comparison plugins/gestures/gestures.c @ 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 ae7760945ef2
children 2c4c975620f0
comparison
equal deleted inserted replaced
5204:44de70702205 5205:fefad67de2c7
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 * 02111-1307, USA. 19 * 02111-1307, USA.
20 */ 20 */
21 #include "config.h" 21 #include "config.h"
22 22
23 #ifndef GAIM_PLUGINS
24 #define GAIM_PLUGINS
25 #endif
26
27 #include "gaim.h" 23 #include "gaim.h"
28 #include "gstroke.h" 24 #include "gstroke.h"
29 25 #include "gtkconv.h"
30 static GModule *handle = NULL; 26 #include "gtkplugin.h"
31 struct gaim_plugin_description desc; 27
28 #define GESTURES_PLUGIN_ID "gtk-gestures"
32 29
33 static void 30 static void
34 stroke_close(GtkWidget *widget, void *data) 31 stroke_close(GtkWidget *widget, void *data)
35 { 32 {
36 struct gaim_conversation *conv; 33 struct gaim_conversation *conv;
151 toggle_draw_cb(GtkToggleButton *toggle, gpointer data) 148 toggle_draw_cb(GtkToggleButton *toggle, gpointer data)
152 { 149 {
153 gstroke_set_draw_strokes(!gstroke_draw_strokes()); 150 gstroke_set_draw_strokes(!gstroke_draw_strokes());
154 } 151 }
155 152
156 char * 153 static gboolean
157 gaim_plugin_init(GModule *h) 154 plugin_load(GaimPlugin *plugin)
158 { 155 {
159 struct gaim_conversation *conv; 156 struct gaim_conversation *conv;
160 GList *l; 157 GList *l;
161
162 handle = h;
163 158
164 for (l = gaim_get_conversations(); l != NULL; l = l->next) { 159 for (l = gaim_get_conversations(); l != NULL; l = l->next) {
165 conv = (struct gaim_conversation *)l->data; 160 conv = (struct gaim_conversation *)l->data;
166 161
167 if (!GAIM_IS_GTK_CONVERSATION(conv)) 162 if (!GAIM_IS_GTK_CONVERSATION(conv))
168 continue; 163 continue;
169 164
170 attach_signals(conv); 165 attach_signals(conv);
171 } 166 }
172 167
173 gaim_signal_connect(handle, event_new_conversation, new_conv_cb, NULL); 168 gaim_signal_connect(plugin, event_new_conversation, new_conv_cb, NULL);
174 169
175 return NULL; 170 return TRUE;
176 } 171 }
177 172
178 void 173 static gboolean
179 gaim_plugin_remove(void) 174 plugin_unload(GaimPlugin *plugin)
180 { 175 {
181 struct gaim_conversation *conv; 176 struct gaim_conversation *conv;
182 struct gaim_gtk_conversation *gtkconv; 177 struct gaim_gtk_conversation *gtkconv;
183 GList *l; 178 GList *l;
184 179
190 185
191 gtkconv = GAIM_GTK_CONVERSATION(conv); 186 gtkconv = GAIM_GTK_CONVERSATION(conv);
192 187
193 gstroke_cleanup(gtkconv->imhtml); 188 gstroke_cleanup(gtkconv->imhtml);
194 } 189 }
195 } 190
196 191 return TRUE;
197 GtkWidget * 192 }
198 gaim_plugin_config_gtk(void) 193
194 static GtkWidget *
195 get_config_frame(GaimPlugin *plugin)
199 { 196 {
200 GtkWidget *ret; 197 GtkWidget *ret;
201 GtkWidget *vbox; 198 GtkWidget *vbox;
202 GtkWidget *toggle; 199 GtkWidget *toggle;
203 #if 0 200 #if 0
244 gtk_widget_show_all(ret); 241 gtk_widget_show_all(ret);
245 242
246 return ret; 243 return ret;
247 } 244 }
248 245
249 struct gaim_plugin_description * 246 static GaimGtkPluginUiInfo ui_info =
250 gaim_plugin_desc() 247 {
251 { 248 get_config_frame
252 desc.api_version = PLUGIN_API_VERSION; 249 };
253 desc.name = g_strdup(_("Mouse Gestures")); 250
254 desc.version = g_strdup(VERSION); 251 static GaimPluginInfo info =
255 desc.description = g_strdup( 252 {
256 _("Allows support for mouse gestures in conversation windows.\n" 253 2, /**< api_version */
257 "Drag the middle mouse button to perform certain actions:\n\n" 254 GAIM_PLUGIN_STANDARD, /**< type */
258 "Drag down and then to the right to close a conversation.\n" 255 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */
259 "Drag up and then to the left to switch to the previous " 256 0, /**< flags */
260 "conversation.\n" 257 NULL, /**< dependencies */
261 "Drag up and then to the right to switch to the next " 258 GAIM_PRIORITY_DEFAULT, /**< priority */
262 "conversation.")); 259
263 desc.authors = g_strdup("Christian Hammond &lt;chipx86@gnupdate.org&gt;"); 260 GESTURES_PLUGIN_ID, /**< id */
264 desc.url = g_strdup(WEBSITE); 261 N_("Mouse Gestures"), /**< name */
265 262 VERSION, /**< version */
266 return &desc; 263 /** summary */
267 } 264 N_("Provides support for mouse gestures"),
268 265 /** description */
269 char * 266 N_("Allows support for mouse gestures in conversation windows.\n"
270 name(void) 267 "Drag the middle mouse button to perform certain actions:\n\n"
271 { 268 "Drag down and then to the right to close a conversation.\n"
272 return _("Mouse Gestures"); 269 "Drag up and then to the left to switch to the previous "
273 } 270 "conversation.\n"
274 271 "Drag up and then to the right to switch to the next "
275 char * 272 "conversation."),
276 description(void) 273 "Christian Hammond <chipx86@gnupdate.org>", /**< author */
277 { 274 WEBSITE, /**< homepage */
278 return _("Allows support for mouse gestures in conversation windows.\n" 275
279 "Drag the middle mouse button to perform certain actions:\n\n" 276 plugin_load, /**< load */
280 "Drag down and then to the right to close a conversation.\n" 277 plugin_unload, /**< unload */
281 "Drag up and then to the left to switch to the previous " 278 NULL, /**< destroy */
282 "conversation.\n" 279
283 "Drag up and then to the right to switch to the next " 280 &ui_info, /**< ui_info */
284 "conversation."); 281 NULL /**< extra_info */
285 } 282 };
283
284 static void
285 __init_plugin(GaimPlugin *plugin)
286 {
287 }
288
289 GAIM_INIT_PLUGIN(gestures, __init_plugin, info);