Mercurial > pidgin.yaz
comparison plugins/win32/transparency/win2ktrans.c @ 5224:5160333a80df
[gaim-migrate @ 5594]
Update for new plugin api
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Sat, 26 Apr 2003 14:55:40 +0000 |
parents | 0b1c01fd68f1 |
children | d635e8fe2fba |
comparison
equal
deleted
inserted
replaced
5223:e2e5bc3ca705 | 5224:5160333a80df |
---|---|
18 * you should have received a copy of the gnu general public license | 18 * you should have received a copy of the gnu general public license |
19 * along with this program; if not, write to the free software | 19 * along with this program; if not, write to the free software |
20 * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa | 20 * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa |
21 * | 21 * |
22 */ | 22 */ |
23 #define GAIM_PLUGINS | |
24 | |
25 #include <gtk/gtk.h> | |
26 #include <gdk/gdkwin32.h> | 23 #include <gdk/gdkwin32.h> |
24 #include <gmodule.h> | |
27 #include "gaim.h" | 25 #include "gaim.h" |
26 #include "gtkplugin.h" | |
28 #include "gtklist.h" | 27 #include "gtklist.h" |
29 #include "win32dep.h" | 28 #include "win32dep.h" |
30 | 29 |
31 /* | 30 /* |
32 * MACROS & DEFINES | 31 * MACROS & DEFINES |
33 */ | 32 */ |
34 #define WINTRANS_VERSION 1 | 33 #define WINTRANS_PLUGIN_ID "win-gaim-trans" |
34 #define WINTRANS_VERSION 1 | |
35 | 35 |
36 /* These defines aren't found in mingw's winuser.h */ | 36 /* These defines aren't found in mingw's winuser.h */ |
37 #ifndef LWA_ALPHA | 37 #ifndef LWA_ALPHA |
38 #define LWA_ALPHA 0x00000002 | 38 #define LWA_ALPHA 0x00000002 |
39 #endif | 39 #endif |
40 | 40 |
41 #ifndef WS_EX_LAYERED | 41 #ifndef WS_EX_LAYERED |
42 #define WS_EX_LAYERED 0x00080000 | 42 #define WS_EX_LAYERED 0x00080000 |
43 #endif | 43 #endif |
44 | 44 |
45 /* Transparency plugin configuration */ | 45 /* Transparency plugin configuration */ |
46 #define OPT_WGAIM_IMTRANS 0x00000001 | 46 #define OPT_WGAIM_IMTRANS 0x00000001 |
47 #define OPT_WGAIM_SHOW_IMTRANS 0x00000002 | 47 #define OPT_WGAIM_SHOW_IMTRANS 0x00000002 |
344 } | 344 } |
345 | 345 |
346 /* | 346 /* |
347 * EXPORTED FUNCTIONS | 347 * EXPORTED FUNCTIONS |
348 */ | 348 */ |
349 | 349 G_MODULE_EXPORT gboolean plugin_load(GaimPlugin *plugin) { |
350 G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) { | 350 gaim_signal_connect(plugin, event_new_conversation, gaim_new_conversation, NULL); |
351 gaim_signal_connect(handle, event_new_conversation, gaim_new_conversation, NULL); | 351 gaim_signal_connect(plugin, event_signon, blist_created, NULL); |
352 gaim_signal_connect(handle, event_signon, blist_created, NULL); | |
353 MySetLayeredWindowAttributes = (void*)wgaim_find_and_loadproc("user32.dll", "SetLayeredWindowAttributes" ); | 352 MySetLayeredWindowAttributes = (void*)wgaim_find_and_loadproc("user32.dll", "SetLayeredWindowAttributes" ); |
354 load_trans_prefs(); | 353 load_trans_prefs(); |
355 | 354 |
356 return NULL; | 355 return TRUE; |
357 } | 356 } |
358 | 357 |
359 G_MODULE_EXPORT void gaim_plugin_remove() { | 358 G_MODULE_EXPORT gboolean plugin_unload(GaimPlugin *plugin) { |
360 debug_printf("Removing win2ktrans.dll plugin\n"); | 359 debug_printf("Removing win2ktrans.dll plugin\n"); |
361 | 360 |
362 /* Remove slider bars */ | 361 /* Remove slider bars */ |
363 if(window_list) { | 362 if(window_list) { |
364 GList *tmp=window_list; | 363 GList *tmp=window_list; |
374 } | 373 } |
375 if(blist) { | 374 if(blist) { |
376 SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); | 375 SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); |
377 set_wintrans_off(blist); | 376 set_wintrans_off(blist); |
378 } | 377 } |
379 } | 378 return TRUE; |
380 | 379 } |
381 struct gaim_plugin_description desc; | 380 |
382 | 381 G_MODULE_EXPORT GtkWidget *get_config_frame(GaimPlugin *plugin) { |
383 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { | |
384 desc.api_version = PLUGIN_API_VERSION; | |
385 desc.name = g_strdup(_("Transparency")); | |
386 desc.version = g_strdup(VERSION); | |
387 desc.description = g_strdup(_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP.")); | |
388 desc.authors = g_strdup("Rob Flynn <rob@marko.net>"); | |
389 desc.url = g_strdup(WEBSITE); | |
390 return &desc; | |
391 } | |
392 | |
393 G_MODULE_EXPORT char *name() { | |
394 return _("Transparency"); | |
395 } | |
396 | |
397 G_MODULE_EXPORT char *description() { | |
398 return _("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."); | |
399 } | |
400 | |
401 G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk() { | |
402 GtkWidget *ret; | 382 GtkWidget *ret; |
403 GtkWidget *imtransbox, *bltransbox; | 383 GtkWidget *imtransbox, *bltransbox; |
404 GtkWidget *hbox; | 384 GtkWidget *hbox; |
405 GtkWidget *label, *slider; | 385 GtkWidget *label, *slider; |
406 GtkWidget *button; | 386 GtkWidget *button; |
488 } | 468 } |
489 | 469 |
490 gtk_widget_show_all(ret); | 470 gtk_widget_show_all(ret); |
491 return ret; | 471 return ret; |
492 } | 472 } |
473 | |
474 static GaimGtkPluginUiInfo ui_info = | |
475 { | |
476 get_config_frame | |
477 }; | |
478 | |
479 static GaimPluginInfo info = | |
480 { | |
481 2, /**< api_version */ | |
482 GAIM_PLUGIN_STANDARD, /**< type */ | |
483 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ | |
484 0, /**< flags */ | |
485 NULL, /**< dependencies */ | |
486 GAIM_PRIORITY_DEFAULT, /**< priority */ | |
487 | |
488 WINTRANS_PLUGIN_ID, /**< id */ | |
489 N_("Transparency"), /**< name */ | |
490 VERSION, /**< version */ | |
491 /** summary */ | |
492 N_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."), | |
493 /** description */ | |
494 N_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."), | |
495 "Herman Bloggs <hermanator12002@yahoo.com>", /**< author */ | |
496 WEBSITE, /**< homepage */ | |
497 | |
498 plugin_load, /**< load */ | |
499 plugin_unload, /**< unload */ | |
500 NULL, /**< destroy */ | |
501 | |
502 &ui_info, /**< ui_info */ | |
503 NULL /**< extra_info */ | |
504 }; | |
505 | |
506 static void | |
507 __init_plugin(GaimPlugin *plugin) | |
508 { | |
509 } | |
510 | |
511 GAIM_INIT_PLUGIN(wintrans, __init_plugin, info); |