/* xchat-plugin.vapi * * Copyright (C) 2008 Andrea Del Signore * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Author: * Andrea Del Signore */ [CCode (cheader_filename="xchat-plugin.h")] namespace XChat { [CCode (cprefix="XCHAT_EAT_")] public enum EatTypes { NONE = 0, /* pass it on through! */ XCHAT = 1, /* don't let xchat see this event */ PLUGIN = 2, /* don't let other plugins see this event */ ALL = (XChat.EatTypes.XCHAT | XChat.EatTypes.PLUGIN) /* don't let anything see this event */ } [CCode (cprefix="XCHAT_PRI_")] public enum Priorities { HIGHEST = 127, HIGH = 64, NORM = 0, LOW = (-64), LOWEST = (-128) } [CCode (cprefix="XCHAT_FD_")] public enum FdFlags { READ = 1, WRITE = 2, EXCEPTION = 4, NOTSOCKET = 8 } [CCode (cname="xchat_hook")] public class Hook { } [CCode (cname="xchat_context")] public class Context { } [CCode (cname="xchat_plugin")] public class Plugin { [CCode (cname="xchat_hook_command")] public weak Hook hook_command (string name, int pri, [CCode (delegate_target_pos = -1)] command_cb callb, string help_text); [CCode (cname="xchat_hook_print")] public weak Hook hook_print (string name, int pri, print_cb callb); [CCode (cname="xchat_hook_server")] public weak Hook hook_server (string name, int pri, serv_cb callb); [CCode (cname="xchat_hook_fd")] public weak Hook hook_fd (int fd, int flags, fd_cb callb); public weak Hook hook_timer (int timeout, timeout_cb callb); [CCode (cname="xchat_unhook")] public void unhook (weak Hook hook); [CCode (cname = "xchat_cmd_cb"), NoArrayLength()] public delegate int command_cb (string[] word, string[] word_eol); [CCode (cname = "xchat_print_cb"), NoArrayLength()] public delegate int print_cb (string[] word); [CCode (cname = "xchat_serv_cb"), NoArrayLength()] public delegate int serv_cb (string[] word, string[] word_eol); [CCode (cname = "xchat_fd_cb")] public delegate int fd_cb (int fd, int flags); [CCode (cname = "xchat_timeout_cb")] public delegate int timeout_cb (); [CCode (cname = "xchat_command")] public void command (string command); [CCode (cname = "xchat_commandf")] public void commandf (string format, ...); [CCode (cname = "xchat_print")] public void print (string text); [CCode (cname = "xchat_printf")] public void printf (string format, ...); [CCode (cname = "xchat_emit_print")] public int emit_print (string event_name, ...); [CCode (cname = "xchat_send_modes")] public void send_modes (string[] targets, int modes_per_line, char sign, char mode); [CCode (cname = "xchat_context")] public Context find_context (string servname, string channel); [CCode (cname = "xchat_get_context")] public Context get_context (); [CCode (cname = "xchat_get_info")] public weak string get_info (string id); [CCode (cname = "xchat_get_prefs")] public int get_prefs (string name, out string string_data, out int integer_data); [CCode (cname = "xchat_set_context")] public int set_context (Context ctx); [CCode (cname = "xchat_nickcmp")] public int nickcmp (string s1, string s2); [CCode (cname = "xchat_strip")] public weak string strip (string str, int len, int flags); [CCode (cname = "xchat_free")] public void free (void *ptr); } }