Mercurial > pidgin
comparison plugins/ticker/ticker.c @ 3630:9682c0e022c6
[gaim-migrate @ 3753]
Yeah this will probably break a lot of shit knowing my luck. But hey, I really don't care what people thnk.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Fri, 11 Oct 2002 03:14:01 +0000 |
parents | cd938f18f3f8 |
children | 195049ac6bf3 |
comparison
equal
deleted
inserted
replaced
3629:afc5bb164c5a | 3630:9682c0e022c6 |
---|---|
29 #include <string.h> | 29 #include <string.h> |
30 #include <stdlib.h> | 30 #include <stdlib.h> |
31 #include "gaim.h" | 31 #include "gaim.h" |
32 #include "prpl.h" | 32 #include "prpl.h" |
33 #include "pixmaps/no_icon.xpm" | 33 #include "pixmaps/no_icon.xpm" |
34 #ifdef _WIN32 | |
35 #include "win32dep.h" | |
36 #endif | |
34 | 37 |
35 static GtkWidget *tickerwindow = NULL; | 38 static GtkWidget *tickerwindow = NULL; |
36 static GtkWidget *ticker; | 39 static GtkWidget *ticker; |
37 static GModule *handle; | 40 static GModule *handle; |
38 | 41 |
46 } TickerData; | 49 } TickerData; |
47 | 50 |
48 GList *tickerbuds = (GList *) NULL; | 51 GList *tickerbuds = (GList *) NULL; |
49 gboolean userclose = FALSE; | 52 gboolean userclose = FALSE; |
50 GtkWidget *msgw; | 53 GtkWidget *msgw; |
54 | |
55 /* for win32 compatability */ | |
56 G_MODULE_IMPORT GSList *connections; | |
57 G_MODULE_IMPORT GtkWidget *blist; | |
51 | 58 |
52 void BuddyTickerDestroyWindow( GtkWidget *window ); | 59 void BuddyTickerDestroyWindow( GtkWidget *window ); |
53 void BuddyTickerCreateWindow( void ); | 60 void BuddyTickerCreateWindow( void ); |
54 void BuddyTickerAddUser( char *name, char *alias, GdkPixmap *pm, GdkBitmap *bm ); | 61 void BuddyTickerAddUser( char *name, char *alias, GdkPixmap *pm, GdkBitmap *bm ); |
55 void BuddyTickerRemoveUser( char *name ); | 62 void BuddyTickerRemoveUser( char *name ); |
370 if (bm) | 377 if (bm) |
371 gdk_bitmap_unref(bm); | 378 gdk_bitmap_unref(bm); |
372 } | 379 } |
373 | 380 |
374 void signoff_cb(struct gaim_connection *gc) { | 381 void signoff_cb(struct gaim_connection *gc) { |
375 if (!connections->next) { | 382 if (connections && !connections->next) { |
376 gtk_widget_destroy(tickerwindow); | 383 gtk_widget_destroy(tickerwindow); |
377 tickerwindow = NULL; | 384 tickerwindow = NULL; |
378 ticker = NULL; | 385 ticker = NULL; |
379 } | 386 } |
380 } | 387 } |
399 gdk_pixmap_unref(pm); | 406 gdk_pixmap_unref(pm); |
400 if (bm) | 407 if (bm) |
401 gdk_bitmap_unref(bm); | 408 gdk_bitmap_unref(bm); |
402 } | 409 } |
403 | 410 |
404 char *gaim_plugin_init(GModule *h) { | 411 /* |
412 * EXPORTED FUNCTIONS | |
413 */ | |
414 | |
415 G_MODULE_EXPORT char *name() { | |
416 return "Buddy Ticker"; | |
417 } | |
418 | |
419 G_MODULE_EXPORT char *description() { | |
420 return "Scrolls online buddies from your buddy list."; | |
421 } | |
422 | |
423 G_MODULE_EXPORT char *gaim_plugin_init(GModule *h) { | |
405 handle = h; | 424 handle = h; |
406 | 425 |
407 gaim_signal_connect(h, event_buddy_signon, signon_cb, NULL); | 426 gaim_signal_connect(h, event_buddy_signon, signon_cb, NULL); |
408 gaim_signal_connect(h, event_signoff, signoff_cb, NULL); | 427 gaim_signal_connect(h, event_signoff, signoff_cb, NULL); |
409 gaim_signal_connect(h, event_buddy_signoff, buddy_signoff_cb, NULL); | 428 gaim_signal_connect(h, event_buddy_signoff, buddy_signoff_cb, NULL); |
412 if (connections) | 431 if (connections) |
413 BuddyTickerShow(); | 432 BuddyTickerShow(); |
414 return NULL; | 433 return NULL; |
415 } | 434 } |
416 | 435 |
417 void gaim_plugin_remove() { | 436 G_MODULE_EXPORT void gaim_plugin_remove() { |
418 gtk_widget_destroy(tickerwindow); | 437 BuddyTickerDestroyWindow(tickerwindow); |
419 } | 438 } |
420 struct gaim_plugin_description desc; | 439 struct gaim_plugin_description desc; |
421 struct gaim_plugin_description *gaim_plugin_desc() { | 440 G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() { |
422 desc.api_version = PLUGIN_API_VERSION; | 441 desc.api_version = PLUGIN_API_VERSION; |
423 desc.name = g_strdup("Ticker"); | 442 desc.name = g_strdup("Ticker"); |
424 desc.version = g_strdup(VERSION); | 443 desc.version = g_strdup(VERSION); |
425 desc.description = g_strdup("A horizontal scrolling version of the buddy list."); | 444 desc.description = g_strdup("A horizontal scrolling version of the buddy list."); |
426 desc.authors = g_strdup("Syd Logan"); | 445 desc.authors = g_strdup("Syd Logan"); |