comparison src/core.h @ 5205:fefad67de2c7

[gaim-migrate @ 5573] I had a damn good commit message, but it was eaten. Let's try it again. Announcing, Gaim Plugin API version 2.0, or GPAPIV2.0 for short. There are lots'a cool thingies here. Okay now, this isn't as cool as the previous message, but: 1) There's now a single entry function for all plugin types. It returns a detailed information structure on the plugin. This removes a lot of the ugliness from old plugins. Oh yeah, libicq wasn't converted to this, so if you use it, well, you shouldn't have used it anyway, but now you can't! bwahahaha. Use AIM/ICQ. 2) There are now 3 types of plugins: Standard, Loader, and Protocol plugins. Standard plugins are, well, standard, compiled plugins. Loader plugins load other plugins. For example, the perl support is now a loader plugin. It loads perl scripts. In the future, we'll have Ruby and Python loader plugins. Protocol plugins are, well, protocol plugins... yeah... 3) Plugins have unique IDs, so they can be referred to or automatically updated from a plugin database in the future. Neat, huh? 4) Plugins will have dependency support in the future, and can be hidden, so if you have, say, a logging core plugin, it won't have to show up, but then you load the GTK+ logging plugin and it'll auto-load the core plugin. Core/UI split plugins! 5) There will eventually be custom plugin signals and RPC of some sort, for the core/ui split plugins. So, okay, back up .gaimrc. I'd like to thank my parents for their support, javabsp for helping convert a bunch of protocol plugins, and Etan for helping convert a bunch of standard plugins. Have fun. If you have any problems, please let me know, but you probably won't have anything major happen. You will have to convert your plugins, though, and I'm not guaranteeing that all perl scripts will still work. I'll end up changing the perl script API eventually, so I know they won't down the road. Don't worry, though. It'll be mass cool. faceprint wants me to just commit the damn code already. So, here we go!!! .. .. I need a massage. From a young, cute girl. Are there any young, cute girls in the audience? IM me plz k thx. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 25 Apr 2003 06:47:33 +0000
parents 381da05cb5ed
children 0241d6b6702d
comparison
equal deleted inserted replaced
5204:44de70702205 5205:fefad67de2c7
51 51
52 #include "multi.h" 52 #include "multi.h"
53 #include "conversation.h" 53 #include "conversation.h"
54 #include "ft.h" 54 #include "ft.h"
55 #include "privacy.h" 55 #include "privacy.h"
56 #include "plugin.h"
57 #include "event.h"
56 58
57 /* Really user states are controlled by the PRPLs now. We just use this for event_away */ 59 /* Really user states are controlled by the PRPLs now. We just use this for event_away */
58 #define UC_UNAVAILABLE 1 60 #define UC_UNAVAILABLE 1
59 61
60 /* This is far too long to be practical, but MSN users are probably used to long aliases */ 62 /* This is far too long to be practical, but MSN users are probably used to long aliases */
82 GSList *permit; 84 GSList *permit;
83 GSList *deny; 85 GSList *deny;
84 int permdeny; 86 int permdeny;
85 }; 87 };
86 88
87 enum gaim_event {
88 event_signon = 0,
89 event_signoff,
90 event_away,
91 event_back,
92 event_im_recv,
93 event_im_send,
94 event_buddy_signon,
95 event_buddy_signoff,
96 event_buddy_away,
97 event_buddy_back,
98 event_buddy_idle,
99 event_buddy_unidle,
100 event_blist_update,
101 event_chat_invited,
102 event_chat_join,
103 event_chat_leave,
104 event_chat_buddy_join,
105 event_chat_buddy_leave,
106 event_chat_recv,
107 event_chat_send,
108 event_warned,
109 event_error,
110 event_quit,
111 event_new_conversation,
112 event_set_info,
113 event_draw_menu,
114 event_im_displayed_sent,
115 event_im_displayed_rcvd,
116 event_chat_send_invite,
117 event_got_typing,
118 event_del_conversation,
119 event_connecting,
120 /* any others? it's easy to add... */
121 };
122
123 struct UI { 89 struct UI {
124 GIOChannel *channel; 90 GIOChannel *channel;
125 guint inpa; 91 guint inpa;
126 }; 92 };
127 93
128 #define USE_PLUGINS GAIM_PLUGINS || USE_PERL
129 #define PLUGIN_API_VERSION 1
130 enum gaim_plugin_type {
131 perl_script,
132 plugin
133 };
134
135 struct gaim_plugin_description {
136 int api_version;
137 gchar *name;
138 gchar *version;
139 gchar *description;
140 gchar *authors;
141 gchar *url;
142 gchar *iconfile;
143 };
144
145 struct gaim_plugin {
146 enum gaim_plugin_type type;
147 void *handle;
148 gchar path[128];
149 struct gaim_plugin_description desc;
150 gchar error[128];
151 void *iter;
152 };
153
154 #ifdef GAIM_PLUGINS
155 struct gaim_callback {
156 GModule *handle;
157 enum gaim_event event;
158 void *function;
159 void *data;
160 };
161 #endif
162
163 /* Globals in core.c */ 94 /* Globals in core.c */
164 extern GSList *uis; 95 extern GSList *uis;
165 extern int gaim_session; 96 extern int gaim_session;
166
167 /* Globals in plugins.c */
168 extern GList *plugins;
169 extern GList *probed_plugins;
170 extern GList *callbacks;
171 97
172 /* Functions in core.c */ 98 /* Functions in core.c */
173 extern gint UI_write(struct UI *, guchar *, int); 99 extern gint UI_write(struct UI *, guchar *, int);
174 extern void UI_build_write(struct UI *, guchar, guchar, ...); 100 extern void UI_build_write(struct UI *, guchar, guchar, ...);
175 extern void UI_broadcast(guchar *data, int); 101 extern void UI_broadcast(guchar *data, int);
182 /* Functions in gaimrc.c */ 108 /* Functions in gaimrc.c */
183 extern void load_prefs(); 109 extern void load_prefs();
184 extern void load_pounces(); 110 extern void load_pounces();
185 extern void save_prefs(); 111 extern void save_prefs();
186 112
187 /* Functions in perl.c */
188 #ifdef USE_PERL
189 extern void perl_end();
190 extern int perl_event(enum gaim_event, void *, void *, void *, void *, void *);
191 extern int perl_load_file(char *);
192 extern void perl_unload_file(struct gaim_plugin *);
193 extern void unload_perl_scripts();
194 extern void list_perl_scripts();
195 extern struct gaim_plugin *probe_perl(char *);
196 #endif
197
198 /* Functions in plugins.c */
199 #ifdef GAIM_PLUGINS
200 extern struct gaim_plugin *load_plugin(const char *);
201 extern void unload_plugin(struct gaim_plugin *);
202 extern struct gaim_plugin *reload_plugin(struct gaim_plugin *);
203 extern void gaim_signal_connect(GModule *, enum gaim_event, void *, void *);
204 extern void gaim_signal_disconnect(GModule *, enum gaim_event, void *);
205 extern void gaim_plugin_unload(GModule *);
206 extern void remove_all_plugins();
207 #endif
208 extern void gaim_probe_plugins();
209 extern int plugin_event(enum gaim_event, ...);
210 extern char *event_name(enum gaim_event);
211
212 /* Functions in server.c */ 113 /* Functions in server.c */
213 extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int); 114 extern void serv_got_update(struct gaim_connection *, char *, int, int, time_t, time_t, int);
214 extern void serv_got_im(struct gaim_connection *, const char *, const char *, guint32, time_t, gint); 115 extern void serv_got_im(struct gaim_connection *, const char *, const char *, guint32, time_t, gint);
215 extern void serv_got_typing(struct gaim_connection *, char *, int, int); 116 extern void serv_got_typing(struct gaim_connection *, char *, int, int);
216 extern void serv_got_typing_stopped(struct gaim_connection *, char *); 117 extern void serv_got_typing_stopped(struct gaim_connection *, char *);