From 1a75c8e1be58a25510642605dcd40c5c65e9c3f3 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Wed, 24 Oct 2012 21:33:02 +0200 Subject: A lot more rebranding --- plugins/plugin20.html | 54 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'plugins/plugin20.html') diff --git a/plugins/plugin20.html b/plugins/plugin20.html index 2c2d106c..e17f3346 100644 --- a/plugins/plugin20.html +++ b/plugins/plugin20.html @@ -101,12 +101,12 @@ margin-right: 32px;

Introduction

-Plugins for XChat are written in C. The interface aims to keep 100% -binary compatability. This means that if you upgrade XChat, you will +Plugins for HexChat are written in C. The interface aims to keep 100% +binary compatability. This means that if you upgrade HexChat, you will not need to recompile your plugins, they'll continue to work. The interface doesn't depend on any structures and offsets, so compiler versions shouldn't have an impact either. The only real requirement of -an XChat plugin, is that it define a "xchat_plugin_init" symbol. This +an HexChat plugin, is that it define a "xchat_plugin_init" symbol. This is your entry point function, see the example below. You should make all your global variables and functions static, so that a symbol is not exported. There is no harm in exporting these symbols, but they @@ -130,7 +130,7 @@ of locale. What does this mean?

Sample plugin

This simple plugin autoOps anyone who joins a channel you're in. It also adds a new command /AUTOOPTOGGLE, which can be used to turn the feature ON -or OFF. Every XChat plugin must define an xchat_plugin_init function, this +or OFF. Every HexChat plugin must define an xchat_plugin_init function, this is the normal entry point. xchat_plugin_deinit is optional.
@@ -142,7 +142,7 @@ is the normal entry point. xchat_plugin_deinit is optional. #define PDESC "Auto Ops anyone that joins" #define PVERSION "0.1" -static xchat_plugin *ph; /* plugin handle */ +static hexchat_plugin *ph; /* plugin handle */ static int enable = 1; static int join_cb(char *word[], void *userdata) @@ -152,7 +152,7 @@ is the normal entry point. xchat_plugin_deinit is optional. xchat_commandf(ph, "OP %s", word[1]); /* word[1] is the nickname, as in the Settings->Advanced->TextEvents window in xchat */ - return XCHAT_EAT_NONE; /* don't eat this event, xchat needs to see it! */ + return XCHAT_EAT_NONE; /* don't eat this event, HexChat needs to see it! */ } static int autooptoggle_cb(char *word[], char *word_eol[], void *userdata) @@ -167,7 +167,7 @@ is the normal entry point. xchat_plugin_deinit is optional. xchat_print(ph, "AutoOping now disabled!\n"); } - return XCHAT_EAT_ALL; /* eat this command so xchat and other plugins can't process it */ + return XCHAT_EAT_ALL; /* eat this command so HexChat and other plugins can't process it */ } void xchat_plugin_get_info(char **name, char **desc, char **version, void **reserved) @@ -186,7 +186,7 @@ is the normal entry point. xchat_plugin_deinit is optional. /* we need to save this for use with any xchat_* functions */ ph = plugin_handle; - /* tell xchat our info */ + /* tell HexChat our info */ *plugin_name = PNAME; *plugin_desc = PDESC; *plugin_version = PVERSION; @@ -358,7 +358,7 @@ Yes, it can be done. All you need is either Simply compile your plugin as a DLL. You should have the following files: @@ -395,16 +395,16 @@ xchat_command(ph, "GUI .....");.

- - + + - - + + - +
GUI ATTACHSame function as "Attach Window" in the XChat menu (new for 2.6.2).
GUI DETACHSame function as "Detach Tab" in the XChat menu (new for 2.6.2).
GUI ATTACHSame function as "Attach Window" in the HexChat menu (new for 2.6.2).
GUI DETACHSame function as "Detach Tab" in the HexChat menu (new for 2.6.2).
GUI APPLYSimilar to clicking OK in the settings window. Execute this after /SET to activate GUI changes (new for 2.8.0)
GUI COLOR nChange the tab color of the current context, where n is a number from 0 to 3.
GUI FOCUSFocus the current window or tab.
GUI FLASHFlash the taskbar button. It will flash only if the window isn't focused and will stop when it is focused by the user.
GUI HIDEHide the main xchat window completely (this is used by the Systray plugin).
GUI ICONIFYIconify (minimize to taskbar) the current xchat window.
GUI HIDEHide the main HexChat window completely (this is used by the Systray plugin).
GUI ICONIFYIconify (minimize to taskbar) the current HexChat window.
GUI MSGBOX textDisplays a asynchronous message box with your text (new for 2.4.5).
GUI SHOWShow the main xchat window (if currently hidden).
GUI SHOWShow the main HexChat window (if currently hidden).

@@ -439,11 +439,11 @@ Parameters and flags: If you want to change an item's toggle state or enabled flag, just ADD an item with exactly the same name and command and specify the -tX -eX parameters you need. -

It's also possible to add items to XChat's existing menus, for example:
+

It's also possible to add items to HexChat's existing menus, for example:

	MENU ADD "Settings/Sub Menu"
 	MENU -t0 ADD "Settings/Sub Menu/My Setting" myseton mysetoff
 
-However, internal names and layouts of XChat's menu may change in the future, so use at own risk. +However, internal names and layouts of HexChat's menu may change in the future, so use at own risk.

Here is an example of Radio items:
	MENU ADD "Language"
@@ -468,10 +468,10 @@ From 2.8.0, you can also change menus other than the main one (i.e popup menus).
 

-Starting from 2.8.0 you can manipulate XChat's system tray icon using the /TRAY command: +Starting from 2.8.0 you can manipulate HexChat's system tray icon using the /TRAY command:
  Usage: 
- TRAY -f <timeout> <file1> [<file2>] Flash tray between two icons. Leave off file2 to use default xchat icon.
+ TRAY -f <timeout> <file1> [<file2>] Flash tray between two icons. Leave off file2 to use default HexChat icon.
  TRAY -f <filename>                  Set tray to a fixed icon.
  TRAY -i <number>                    Flash tray with an internal icon.
                                      2=Message 5=Highlight 8=Private 11=File
@@ -479,12 +479,12 @@ From 2.8.0, you can also change menus other than the main one (i.e popup menus).
  TRAY -b <title> <text>              Set the tray balloon.
                                      Supported on Windows from 2.8.1 and 2.8.2 on Linux (libnotify required on Linux).
 
-Filenames can be ICO or PNG format. PNG format is supported on Linux/BSD and Windows XP (but requires installation of GDI+ on Windows 2000). Set a timeout of -1 to use XChat's default. +Filenames can be ICO or PNG format. PNG format is supported on Linux/BSD and Windows XP (but requires installation of GDI+ on Windows 2000). Set a timeout of -1 to use HexChat's default.

Handling UTF-8/Unicode strings

-The XChat plugin API specifies that strings passed to and from xchat must be encoded in UTF-8. +The HexChat plugin API specifies that strings passed to and from HexChat must be encoded in UTF-8.

What does this mean for the plugin programmer? You just have to be a little careful when passing strings obtained from IRC to system calls. For example, if you're writing a file-server @@ -512,7 +512,7 @@ static void get_file_name(char *nick, char *fname) char buf[256]; FILE *fp; - /* the fname is in UTF-8, because it came from the xchat API */ + /* the fname is in UTF-8, because it came from the HexChat API */ #ifdef _WIN32

 	wchar_t wide_name[MAX_PATH];
 
@@ -601,7 +601,7 @@ xchat_hook_command(ph, "ONOTICE", XCHAT_PRI_NORM, onotice_cb,
 
ph: Plugin handle (as given to xchat_plugin_init).
fd: The file descriptor or socket.
flags: One or more of XCHAT_FD_READ, XCHAT_FD_WRITE, XCHAT_FD_EXCEPTION, XCHAT_FD_NOTSOCKET. Use bitwise OR to combine them. -XCHAT_FD_NOTSOCKET tells xchat that the provided fd is not a socket, but a "MSVCRT.DLL" pipe. +XCHAT_FD_NOTSOCKET tells HexChat that the provided fd is not a socket, but a "MSVCRT.DLL" pipe.
callb: Callback function. This will be called when the socket is available for reading/writing or exception (depending on your chosen flags)
userdata: Pointer passed to the callback function.
Returns: Pointer to the hook. Can be passed to xchat_unhook. @@ -644,7 +644,7 @@ tab-window is focused by the window manager. static int youpart_cb(char *word[], void *userdata) { xchat_printf(ph, "You have left channel %s\n", word[3]); - return XCHAT_EAT_XCHAT; /* dont let xchat do its normal printing */ + return XCHAT_EAT_XCHAT; /* dont let HexChat do its normal printing */ } xchat_hook_print(ph, "You Part", XCHAT_PRI_NORM, youpart_cb, NULL); @@ -673,7 +673,7 @@ hook every line that comes from the IRC server, you may use the special name of static int kick_cb(char *word[], char *word_eol[], void *userdata) { xchat_printf(ph, "%s was kicked from %s (reason=%s)\n", word[4], word[3], word_eol[5]); - return XCHAT_EAT_NONE; /* don't eat this event, let other plugins and xchat see it too */ + return XCHAT_EAT_NONE; /* don't eat this event, let other plugins and HexChat see it too */ } xchat_hook_server(ph, "KICK", XCHAT_PRI_NORM, kick_cb, NULL); @@ -737,7 +737,7 @@ removed, so you don't need to call this within your xchat_plugin_deinit() functi

 xchat_command() 

Prototype: void xchat_command(xchat_plugin *ph, const char *command);
-
Description: Executes a command as if it were typed in xchat's input box. +
Description: Executes a command as if it were typed in HexChat's input box.

Arguments:
ph: Plugin handle (as given to xchat_plugin_init). @@ -748,7 +748,7 @@ removed, so you don't need to call this within your xchat_plugin_deinit() functi

 xchat_commandf() 

Prototype: void xchat_commandf(xchat_plugin *ph, const char *format, ...);
-
Description: Executes a command as if it were typed in xchat's input box and provides string formating like printf. +
Description: Executes a command as if it were typed in HexChat's input box and provides string formating like printf.

Arguments:
ph: Plugin handle (as given to xchat_plugin_init). @@ -877,7 +877,7 @@ Changed in 2.6.1. If servname is NULL, it finds the channel (or query) by the gi win_ptrnative window pointer. Unix: (GtkWindow *) Win32: HWND (since 2.6.0). win_statuswindow status: "active", "hidden" or "normal" (since 2.0.9). xchatdirxchat config directory, e.g.: /home/user/.xchat2 This string is encoded in UTF-8, which means you _should_ convert it to "locale" encoding before using functions like open() or OpenFile(). For best Unicode support on Linux, convert this string using g_filename_from_utf8 and on Windows convert this string to UTF-16LE (wide) and use OpenFileW() etc. - xchatdirfsxchat config directory, e.g.: /home/user/.xchat2 (since 2.0.9).This string is encoded in local file system encoding, making it ideal for direct use with functions like open() or OpenFile(). For real Unicode support on Windows, it's best not to use xchatdirfs, but xchatdir instead. + xchatdirfsxchat config directory, e.g.: /home/user/.xchat2 (since 2.0.9).This string is encoded in local file system encoding, making it ideal for direct use with functions like open() or OpenFile(). For real Unicode support on Windows, it's best not to use HexChatdirfs, but HexChatdir instead.
-- cgit 1.4.1