comparison plugins/perl/perl.c @ 12988:b457aa723bab

[gaim-migrate @ 15341] Perl plugins can now have more than one plugin action. This isn't exactly the nicest way to have done this, as it requires a "global" plugin_actions hash to work, but I couldn't get the cleaner way to work and this is better than nothing. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sun, 22 Jan 2006 10:29:34 +0000
parents d1e6890ed062
children
comparison
equal deleted inserted replaced
12987:750968cab201 12988:b457aa723bab
374 gps->package, 374 gps->package,
375 SvPV(*key, len)); 375 SvPV(*key, len));
376 info->ui_info = &gtk_ui_info; 376 info->ui_info = &gtk_ui_info;
377 } 377 }
378 378
379 /********************************************************/ 379 if ((key = hv_fetch(plugin_info, "plugin_action_sub",
380 /* */ 380 strlen("plugin_action_sub"), 0))) {
381 /* plugin_action - This is given to the plugin info */ 381 gps->plugin_action_sub = g_strdup_printf("%s::%s",
382 /* as the action GList. There are two */ 382 gps->package,
383 /* parts so the user can set the title */ 383 SvPV(*key, len));
384 /* as it will appear in the plugin */ 384 info->actions = gaim_perl_plugin_actions;
385 /* action menu. The name is extracted */
386 /* and then the callback perl sub's */
387 /* name both of which then are handled */
388 /* by an internal gaim_perl function */
389 /* that sets up the single cb function */
390 /* which is then inserted into 'info'. */
391 /********************************************************/
392 if ((key = hv_fetch(plugin_info, "plugin_action_label",
393 strlen("plugin_action_label"), 0))) {
394 gaim_perl_plugin_action_label = g_strdup(SvPV(*key, len));
395 }
396
397 if ((key = hv_fetch(plugin_info, "plugin_action",
398 strlen("plugin_action"), 0))) {
399 gaim_perl_plugin_action_callback_sub = g_strdup_printf("%s::%s", gps->package, SvPV(*key, len));
400 info->actions = gaim_perl_plugin_action;
401 } 385 }
402 386
403 plugin->info = info; 387 plugin->info = info;
404 info->extra_info = gps; 388 info->extra_info = gps;
405 389