comparison src/ticker.c @ 1750:d2eca7a46cfd

[gaim-migrate @ 1760] someday maybe she'll come back to me and i'll say WHY DON'T YOU GO FUCK YOURSELF committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 25 Apr 2001 19:15:50 +0000
parents 3e6a17ae51e8
children 24aed1c31342
comparison
equal deleted inserted replaced
1749:5bfc58c20e82 1750:d2eca7a46cfd
24 #include <gtk/gtk.h> 24 #include <gtk/gtk.h>
25 #include "gtkticker.h" 25 #include "gtkticker.h"
26 #include <string.h> 26 #include <string.h>
27 #include <stdlib.h> 27 #include <stdlib.h>
28 #include "gaim.h" 28 #include "gaim.h"
29 #include "prpl.h"
30 #include "pixmaps/no_icon.xpm"
29 31
30 GtkWidget *tickerwindow = NULL; 32 GtkWidget *tickerwindow = NULL;
31 GtkWidget *ticker; 33 GtkWidget *ticker;
32 34
33 typedef struct { 35 typedef struct {
50 void BuddyTickerClearList( void ); 52 void BuddyTickerClearList( void );
51 void BuddyTickerSignOff( void ); 53 void BuddyTickerSignOff( void );
52 GList * BuddyTickerFindUser( char *name ); 54 GList * BuddyTickerFindUser( char *name );
53 int BuddyTickerMessageRemove( gpointer data ); 55 int BuddyTickerMessageRemove( gpointer data );
54 extern void pressed_ticker(char *); 56 extern void pressed_ticker(char *);
55 57 void BuddyTickerShow();
56 // this pref is startup only, so make a shadow here of settings at startup
57 // code uses this variable, not display_prefs
58 58
59 extern int display_options; 59 extern int display_options;
60 int ticker_prefs;
61
62 void
63 SetTickerPrefs( void )
64 {
65 ticker_prefs = display_options;
66 }
67 60
68 void 61 void
69 BuddyTickerDestroyWindow( GtkWidget *window ) 62 BuddyTickerDestroyWindow( GtkWidget *window )
70 { 63 {
71 BuddyTickerClearList(); 64 BuddyTickerClearList();
183 } 176 }
184 177
185 void 178 void
186 BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm ) 179 BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm )
187 { 180 {
188 GList *p; 181 GList *p;
189 TickerData *data; 182 TickerData *data;
190 183
191 if ( userclose == TRUE ) 184 if ( userclose == TRUE )
192 return; 185 return;
193 p = (GList *) BuddyTickerFindUser( name ); 186 p = (GList *) BuddyTickerFindUser( name );
273 while ( p ) 266 while ( p )
274 p = g_list_remove( p, p->data ); 267 p = g_list_remove( p, p->data );
275 tickerbuds = (GList *) NULL; 268 tickerbuds = (GList *) NULL;
276 } 269 }
277 270
278 271 void BuddyTickerShow()
272 {
273 GdkPixmap *pm;
274 GdkBitmap *bm;
275 struct gaim_connection *gc;
276 struct group *g;
277 struct buddy *b;
278 GSList *gcons, *grps, *buds;
279 char **xpm;
280
281 if( !(display_options & OPT_DISP_SHOW_BUDDYTICKER) ) {
282 BuddyTickerSignoff();
283 display_options &= ~OPT_DISP_SHOW_BUDDYTICKER;
284 return;
285 }
286
287 for( gcons = connections; gcons; gcons = gcons->next ) {
288 gc = (struct gaim_connection *)gcons->data;
289 for( grps = gc->groups; grps; grps = grps->next ) {
290 g = (struct group *)grps->data;
291 for( buds = g->members; buds; buds = buds->next ) {
292 b = (struct buddy *)buds->data;
293 if( b->present ) {
294 xpm = NULL;
295 if (gc->prpl->list_icon)
296 xpm = (*gc->prpl->list_icon)(b->uc);
297 if (xpm == NULL)
298 xpm = (char **)no_icon_xpm;
299 pm = gdk_pixmap_create_from_xpm_d(blist->window, &bm, NULL, xpm);
300 BuddyTickerAddUser( b->name, pm, bm );
301 }
302 }
303 }
304 }
305 }