From 012d78b2f642b91099b581937a15b6afab0049d0 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Tue, 30 Oct 2012 10:38:45 +0100 Subject: [PATCH] Plugin doc fixes --- share/doc/plugins.md | 100 +++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 57 deletions(-) diff --git a/share/doc/plugins.md b/share/doc/plugins.md index 0645ff46..a46c4177 100644 --- a/share/doc/plugins.md +++ b/share/doc/plugins.md @@ -205,8 +205,7 @@ needed for a long time after calling _hexchat\_list\_str_. The types of lists an offTime when user went offline.time_t seenTime when user the user was last verified still online.time_t -The entire "notify" list was added in xchat 2.0.8. Fields are -only valid for the context when hexchat_list_get() was called +Fields are only valid for the context when hexchat_list_get() was called (i.e. you get information about the user ON THAT ONE SERVER ONLY). You may cycle through the "channels" list to find notify information for every server. @@ -254,7 +253,7 @@ Example: All you need is Visual Studio setup as explained in [Building](http://www.hexchat.org/developers/building). Your best bet is to use an existing plugin (such as the currently unused SASL plugin) in the HexChat solution as a starting point. You should have the following files: - * [hexchat-plugin.h](https://github.com/hexchat/hexchat/blob/master/plugins/hexchat-plugin.h) - main plugin header + * [hexchat-plugin.h](https://github.com/hexchat/hexchat/blob/master/src/common/hexchat-plugin.h) - main plugin header * plugin.c - Your plugin, you need to write this one :) * plugin.def - A simple text file containing the following: @@ -277,20 +276,16 @@ in the sample plugin above. A simple way to perform basic GUI functions is to use the _/GUI_ command. You can execute this command through the input box, or by calling _hexchat\_command (ph, "GUI .....");_. -
- - - - - - - - - - - -
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 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 HexChat window (if currently hidden).
-
+ * **GUI ATTACH:** Same function as "Attach Window" in the HexChat menu. + * **GUI DETACH:** Same function as "Detach Tab" in the HexChat menu. + * **GUI APPLY:** Similar to clicking OK in the settings window. Execute this after /SET to activate GUI changes. + * **GUI COLOR _n_:** Change the tab color of the current context, where n is a number from 0 to 3. + * **GUI FOCUS:** Focus the current window or tab. + * **GUI FLASH:** Flash the taskbar button. It will flash only if the window isn't focused and will stop when it is focused by the user. + * **GUI HIDE:** Hide the main HexChat window completely. + * **GUI ICONIFY:** Iconify (minimize to taskbar) the current HexChat window. + * **GUI MSGBOX _text_:** Displays a asynchronous message box with your text. + * **GUI SHOW:** Show the main HexChat window (if currently hidden). You can add your own items to the menu bar. The menu command has this syntax:
@@ -311,17 +306,13 @@ In the example above, it would be recommended to execute _MENU DEL FServe_ insid
 
 Parameters and flags:
 
-
- - - - - - - - -
-eXSet enable flag to X. -e0 for disable, -e1 for enable. This lets you create a disabled (shaded) item.
-iFILEUse an icon filename FILE (new for 2.8.0). Not supported for toggles or radio items.
-k<mod>,<key>Specify a keyboard shortcut. "mod" is the modifier which is a bitwise OR of: 1-SHIFT 4-CTRL 8-ALT in decimal. "key" is the key value in decimal, e.g. -k5,101 would specify SHIFT-CTRL-E.
-mSpecify that this label should be treated as Pango Markup language. Since forward slash ("/") is already used in menu paths, you should replace closing tags with an ASCII 003 instead e.g.: hexchat_command(ph, "MENU -m ADD \"<b>Bold Menu<\003b>\""); (new for 2.6.6).
-pXSpecify a menu item's position number. e.g. -p5 will cause the item to be inserted in the 5th place. New for 2.8.0: If the position is a negative number, it will be used as an offset from the bottom/right-most item.
-rX,groupSpecify a radio menu item, with initial state X and a group name (new for 2.8.0). The group name should be the exact label of another menu item (without the path) that this item will be grouped with. For radio items, only a select command will be executed (no unselect command).
-tXSpecify a toggle menu item with an initial state. -t0 for an "unticked" item and -t1 for a "ticked" item.
-
+ * **-eX:** Set enable flag to X. -e0 for disable, -e1 for enable. This lets you create a disabled (shaded) item. + * **-iFILE:** Use an icon filename FILE. Not supported for toggles or radio items. + * **-k<mod>,<key>:** Specify a keyboard shortcut. "mod" is the modifier which is a bitwise OR of: 1-SHIFT 4- CTRL 8-ALT in decimal. "key" is the key value in decimal, e.g. -k5,101 would specify SHIFT-CTRL-E. + * **-m:** Specify that this label should be treated as Pango Markup language. Since forward slash ("/") is already used in menu paths, you should replace closing tags with an ASCII 003 instead e.g.: hexchat_command (ph, "MENU -m ADD \"<b>Bold Menu<\003b>\""); + * **-pX:** Specify a menu item's position number. e.g. -p5 will cause the item to be inserted in the 5th place. If the position is a negative number, it will be used as an offset from the bottom/right-most item. + * **-rX,group:** Specify a radio menu item, with initial state X and a group name. The group name should be the exact label of another menu item (without the path) that this item will be grouped with. For radio items, only a select command will be executed (no unselect command). + * **-tX:** Specify a toggle menu item with an initial state. -t0 for an "unticked" item and -t1 for a "ticked" item. 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. @@ -407,7 +398,7 @@ ctcp_cb (char *word[], char *word_eol[], void *userdata) get_file_name (nick, word[2]); } - return HEXCHAT_EAT_hexchat; + return HEXCHAT_EAT_HEXCHAT; } static void @@ -479,7 +470,7 @@ Commands hooked that begin with a period ('.') will be hidden in _/HELP_ and _/H * **ph:** Plugin handle (as given to _hexchat\_plugin\_init ()_). * **name:** Name of the command (without the forward slash). - * **pri:** Priority of this command. Use _hexchat\_PRI\_NORM_. + * **pri:** Priority of this command. Use _HEXCHAT\_PRI\_NORM_. * **callb:** Callback function. This will be called when the user executes the given command name. * **help\_text:** String of text to display when the user executes _/HELP_ for this command. May be NULL if you're lazy. * **userdata:** Pointer passed to the callback function. @@ -516,7 +507,7 @@ hexchat_hook_command (ph, "ONOTICE", HEXCHAT_PRI_NORM, onotice_cb, "Usage: ONOTI * **ph:** Plugin handle (as given to _hexchat\_plugin\_init ()_). * **fd:** The file descriptor or socket. - * **flags:** One or more of _hexchat\_FD\_READ_, _hexchat\_FD\_WRITE_, _hexchat\_FD\_EXCEPTION_, _hexchat\_FD\_NOTSOCKET_. Use bitwise OR to combine them. _hexchat\_FD\_NOTSOCKET_ tells HexChat that the provided _fd__ is not a socket, but an "MSVCRT.DLL" pipe. + * **flags:** One or more of _HEXCHAT\_FD\_READ_, _HEXCHAT\_FD\_WRITE_, _HEXCHAT\_FD\_EXCEPTION_, _HEXCHAT\_FD\_NOTSOCKET_. Use bitwise OR to combine them. _HEXCHAT\_FD\_NOTSOCKET_ tells HexChat that the provided _fd__ is not a socket, but an "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. @@ -569,7 +560,7 @@ static int youpart_cb (char *word[], void *userdata) { hexchat_printf (ph, "You have left channel %s\n", word[3]); - return HEXCHAT_EAT_hexchat; /* dont let HexChat do its normal printing */ + return HEXCHAT_EAT_HEXCHAT; /* dont let HexChat do its normal printing */ } hexchat_hook_print (ph, "You Part", HEXCHAT_PRI_NORM, youpart_cb, NULL); @@ -814,30 +805,25 @@ Changed in 2.6.1. If _servname_ is NULL, it finds the channel (or query) by the * **ph:** Plugin handle (as given to _hexchat\_plugin\_init ()_). * **id:** ID of the information you want. Currently supported IDs are (case sensitive): - -
- - - - - - - - - - - - - - - - - - - - -
awayaway reason or NULL if you are not away.
channelcurrent channel name.
charsetcharacter-set used in the current context (since 2.4.2).
event_text <name>text event format string for name (since 2.8.2).
gtkwin_ptr(GtkWindow *) (since 2.8.9).
hostreal hostname of the server you connected to.
inputboxthe input-box contents, what the user has typed (since 2.4.1).
libdirfslibrary directory. e.g. /usr/lib/hexchat. The same directory used for auto-loading plugins (since 2.4.0).This string isn't necessarily UTF-8, but local file system encoding.
modeschannel modes, if known, or NULL (since 2.8.1).
networkcurrent network name or NULL.
nickyour current nick name.
nickservnickserv password for this network or NULL (since 2.4.3).
servercurrent server name (what the server claims to be). NULL if you are not connected.
topiccurrent channel topic.
versionHexChat version number.
win_ptrnative window pointer. Unix: (GtkWindow *) Win32: HWND (since 2.6.0).
win_statuswindow status: "active", "hidden" or "normal" (since 2.0.9).
hexchatdirHexChat config directory, e.g.: /home/user/.config/hexchat 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.
hexchatdirfsHexChat config directory, e.g.: /home/user/.config/hexchat.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.
-
+ * **away:** away reason or NULL if you are not away. + * **channel:** current channel name. + * **charset:** character-set used in the current context. + * **event\_text <name>:** text event format string for _name_. + * **gtkwin\_ptr:** (GtkWindow \*). + * **hexchatdir:** HexChat config directory, e.g.: /home/user/.config/hexchat. 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. + * **hexchatdirfs:** HexChat config directory, e.g.: /home/user/.config/hexchat. 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. + * **host:** real hostname of the server you connected to. + * **inputbox:** the input-box contents, what the user has typed. + * **libdirfs:** library directory. e.g. /usr/lib/hexchat. The same directory used for auto-loading plugins. This string isn't necessarily UTF-8, but local file system encoding. + * **modes:** channel modes, if known, or NULL. + * **network:** current network name or NULL. + * **nick:** your current nick name. + * **nickserv:** nickserv password for this network or NULL. + * **server:** current server name (what the server claims to be). NULL if you are not connected. + * **topic:** current channel topic. + * **version:** HexChat version number. + * **win\_ptr:** native window pointer. Unix: (GtkWindow *) Win32: HWND. + * **win\_status:** window status: "active", "hidden" or "normal". **Returns:** A string of the requested information, or NULL. This string must not be freed and must be copied if needed after the call to _hexchat\_get\_info ()_. @@ -1076,7 +1062,7 @@ saveint_cb (char *word[], char *word_eol[], void *user_data) hexchat_printf (ph, "Invalid input!\n"); } - return HEXCHAT_EAT_hexchat; + return HEXCHAT_EAT_HEXCHAT; }