annotate src/ticker.c @ 433:f82e84386fdf

[gaim-migrate @ 443] Something for our egos. committer: Tailor Script <tailor@pidgin.im>
author Syd Logan <slogan>
date Sun, 25 Jun 2000 00:57:30 +0000
parents 5741dca6cc8a
children 634b93c7a473
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
1 /* GTK - The GIMP Toolkit
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
3 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
4 * This library is free software; you can redistribute it and/or
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
5 * modify it under the terms of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
6 * License as published by the Free Software Foundation; either
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
7 * version 2 of the License, or (at your option) any later version.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
8 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
9 * This library is distributed in the hope that it will be useful,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
12 * Library General Public License for more details.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
13 *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
14 * You should have received a copy of the GNU Library General Public
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
15 * License along with this library; if not, write to the
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
17 * Boston, MA 02111-1307, USA.
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
18 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
19
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
20 /*
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
21 * ticker.c -- Syd Logan, Summer 2000
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
22 */
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
23
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
24 #include <gtk/gtk.h>
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
25 #include "gtkticker.h"
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
26
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
27 GtkWidget *tickerwindow = NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
28 GtkWidget *ticker;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
29
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
30 typedef struct {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
31 char buddy[ 128 ];
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
32 GtkWidget *hbox;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
33 GtkWidget *label;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
34 GtkWidget *pix;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
35 } TickerData;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
36
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
37 static GList *tickerbuds = (GList *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
38 static gboolean userclose = FALSE;
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
39 static GtkWidget *msgw;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
40
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
41 void BuddyTickerDestroyWindow( GtkWidget *window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
42 void BuddyTickerCreateWindow( void );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
43 void BuddyTickerAddUser( char *name, GdkPixmap *pm, GdkBitmap *bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
44 void BuddyTickerRemoveUser( char *name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
45 void BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
46 void BuddyTickerClearList( void );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
47 void BuddyTickerSignOff( void );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
48 GList * BuddyTickerFindUser( char *name );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
49 int BuddyTickerMessageRemove( gpointer data );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
50
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
51 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
52 BuddyTickerDestroyWindow( GtkWidget *window )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
53 {
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
54 BuddyTickerClearList();
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
55 gtk_ticker_stop_scroll( GTK_TICKER( ticker ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
56 gtk_widget_destroy( window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
57 ticker = tickerwindow = (GtkWidget *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
58 userclose = TRUE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
59 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
60
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
61 static char *msg = "Welcome to GAIM 0.9.20, brought to you by Rob Flynn (maintainer), Eric Warmenhoven, Mark Spencer, Jeramey Crawford, Jim Duchek, and Syd Logan";
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
62
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
63 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
64 BuddyTickerCreateWindow()
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
65 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
66 if ( tickerwindow != (GtkWidget *) NULL )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
67 return;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
68 tickerwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
69 gtk_signal_connect (GTK_OBJECT(tickerwindow), "destroy",
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
70 GTK_SIGNAL_FUNC (BuddyTickerDestroyWindow), "WM destroy");
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
71 gtk_window_set_title (GTK_WINDOW(tickerwindow), "GAIM - Buddy Ticker");
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
72
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
73 ticker = gtk_ticker_new();
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
74 gtk_ticker_set_spacing( GTK_TICKER( ticker ), 20 );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
75 gtk_widget_set_usize( ticker, 500, -1 );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
76 gtk_container_add( GTK_CONTAINER( tickerwindow ), ticker );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
77 gtk_ticker_set_interval( GTK_TICKER( ticker ), 500 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
78 gtk_ticker_set_scootch( GTK_TICKER( ticker ), 10 );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
79 msgw = gtk_label_new( msg );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
80 gtk_ticker_add( GTK_TICKER( ticker ), msgw );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
81 gtk_ticker_start_scroll( GTK_TICKER( ticker ) );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
82
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
83 gtk_timeout_add( 60000, BuddyTickerMessageRemove, (gpointer) NULL );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
84
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
85 gtk_widget_show_all (ticker);
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
86
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
87 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
88
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
89 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
90 BuddyTickerAddUser( char *name, GdkPixmap *pm, GdkBitmap *bm )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
91 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
92 GtkWidget *hbox, *label, *pmap;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
93 TickerData *p;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
94 GList *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
95
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
96 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
97 return;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
98 q = (GList *) BuddyTickerFindUser( name );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
99 if ( q != (GList *) NULL )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
100 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
101
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
102 BuddyTickerCreateWindow();
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
103 p = (TickerData *) malloc( sizeof( TickerData ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
104 p->hbox = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
105 p->label = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
106 p->pix = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
107 strcpy( p->buddy, name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
108 tickerbuds = g_list_append( tickerbuds, p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
109
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
110 p->hbox = gtk_hbox_new( FALSE, 0 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
111 gtk_ticker_add( GTK_TICKER( ticker ), p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
112 gtk_widget_show_all( p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
113
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
114 BuddyTickerSetPixmap( name, pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
115
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
116 p->label = gtk_label_new( name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
117 gtk_box_pack_start_defaults( GTK_BOX( p->hbox ), p->label );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
118 gtk_widget_show( p->label );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
119
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
120 gtk_widget_show( tickerwindow );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
121 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
122
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
123 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
124 BuddyTickerRemoveUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
125 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
126 GList *p = (GList *) BuddyTickerFindUser( name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
127 TickerData *data = (TickerData *) p->data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
128
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
129 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
130 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
131 if ( data ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
132 gtk_ticker_remove( GTK_TICKER( ticker ), data->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
133 tickerbuds = g_list_remove( tickerbuds, data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
134 free( data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
135 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
136 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
137
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
138 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
139 BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
140 {
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
141 GList *p;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
142 TickerData *data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
143
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
144 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
145 return;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
146 p = (GList *) BuddyTickerFindUser( name );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
147 data = (TickerData *) p->data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
148 if ( data->pix == (GtkWidget *) NULL ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
149 data->pix = gtk_pixmap_new( pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
150 gtk_box_pack_start_defaults( GTK_BOX( data->hbox ), data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
151 } else {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
152 gtk_widget_hide( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
153 gtk_pixmap_set(GTK_PIXMAP(data->pix), pm, bm);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
154 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
155 gtk_widget_show( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
156 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
157
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
158 GList *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
159 BuddyTickerFindUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
160 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
161 GList *p = tickerbuds;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
162
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
163 while ( p ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
164 TickerData *q = (TickerData *) p->data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
165 if ( !strcmp( name, q->buddy ) )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
166 return( p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
167 p = p->next;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
168 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
169 return (GList *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
170 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
171
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
172 int
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
173 BuddyTickerMessageRemove( gpointer data )
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
174 {
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
175 if ( userclose == TRUE )
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
176 return;
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
177 gtk_ticker_remove( GTK_TICKER( ticker ), msgw );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
178 return FALSE;
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
179 }
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
180
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
181 int
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
182 BuddyTickerLogonTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
183 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
184 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
185 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
186
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
187 int
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
188 BuddyTickerLogoutTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
189 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
190 char *name = (char *) data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
191
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
192 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
193 return FALSE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
194 BuddyTickerRemoveUser( name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
195
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
196 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
197 }
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
198
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
199 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
200 BuddyTickerSignoff( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
201 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
202 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
203 TickerData *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
204
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
205 while ( p ) {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
206 q = (TickerData *) p->data;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
207 BuddyTickerRemoveUser( q->buddy );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
208 p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
209 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
210 userclose = FALSE;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
211 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
212
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
213 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
214 BuddyTickerClearList( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
215 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
216 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
217 TickerData *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
218
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
219 while ( p ) {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
220 q = (TickerData *) p->data;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
221 p = g_list_remove( p, p->data );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
222 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
223 tickerbuds = (GList *) NULL;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
224 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
225
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
226