annotate src/ticker.c @ 1215:29b708cde8a7

[gaim-migrate @ 1225] :p committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 08 Dec 2000 07:55:14 +0000
parents 889e5026fd98
children 3e6a17ae51e8
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"
469
7ac742be351d [gaim-migrate @ 479]
Rob Flynn <gaim@robflynn.com>
parents: 460
diff changeset
26 #include <string.h>
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
27 #include <stdlib.h>
955
889e5026fd98 [gaim-migrate @ 965]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
28 #include "gaim.h"
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
29
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
30 GtkWidget *tickerwindow = NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
31 GtkWidget *ticker;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
32
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
33 typedef struct {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
34 char buddy[ 128 ];
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
35 GtkWidget *hbox;
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
36 GtkWidget *ebox;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
37 GtkWidget *label;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
38 GtkWidget *pix;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
39 } TickerData;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
40
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
41 static GList *tickerbuds = (GList *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
42 static gboolean userclose = FALSE;
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
43 static GtkWidget *msgw;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
44
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
45 void BuddyTickerDestroyWindow( GtkWidget *window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
46 void BuddyTickerCreateWindow( void );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
47 void BuddyTickerAddUser( char *name, GdkPixmap *pm, GdkBitmap *bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
48 void BuddyTickerRemoveUser( char *name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
49 void BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
50 void BuddyTickerClearList( void );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
51 void BuddyTickerSignOff( void );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
52 GList * BuddyTickerFindUser( char *name );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
53 int BuddyTickerMessageRemove( gpointer data );
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
54 extern void pressed_ticker(char *);
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
55
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
56 // this pref is startup only, so make a shadow here of settings at startup
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
57 // code uses this variable, not display_prefs
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
58
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
59 extern int display_options;
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
60 int ticker_prefs;
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
61
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
62 void
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
63 SetTickerPrefs( void )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
64 {
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
65 ticker_prefs = display_options;
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
66 }
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
67
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
68 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
69 BuddyTickerDestroyWindow( GtkWidget *window )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
70 {
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
71 BuddyTickerClearList();
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
72 gtk_ticker_stop_scroll( GTK_TICKER( ticker ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
73 gtk_widget_destroy( window );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
74 ticker = tickerwindow = (GtkWidget *) NULL;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
75 userclose = TRUE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
76 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
77
955
889e5026fd98 [gaim-migrate @ 965]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 905
diff changeset
78 static char *msg = "Welcome to GAIM " VERSION ", brought to you by Rob Flynn (maintainer), Eric Warmenhoven, Mark Spencer, Jeramey Crawford, Jim Duchek, and Syd Logan";
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
79
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
80 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
81 BuddyTickerCreateWindow()
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
82 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
83 if ( tickerwindow != (GtkWidget *) NULL )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
84 return;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
85 tickerwindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
86 gtk_signal_connect (GTK_OBJECT(tickerwindow), "destroy",
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
87 GTK_SIGNAL_FUNC (BuddyTickerDestroyWindow), "WM destroy");
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
88 gtk_window_set_title (GTK_WINDOW(tickerwindow), "GAIM - Buddy Ticker");
905
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 604
diff changeset
89 gtk_window_set_wmclass (GTK_WINDOW(tickerwindow),
2876c40108cd [gaim-migrate @ 915]
Rob Flynn <gaim@robflynn.com>
parents: 604
diff changeset
90 "ticker", "Gaim");
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
91
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
92 ticker = gtk_ticker_new();
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
93 gtk_ticker_set_spacing( GTK_TICKER( ticker ), 20 );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
94 gtk_widget_set_usize( ticker, 500, -1 );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
95 gtk_container_add( GTK_CONTAINER( tickerwindow ), ticker );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
96 gtk_ticker_set_interval( GTK_TICKER( ticker ), 500 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
97 gtk_ticker_set_scootch( GTK_TICKER( ticker ), 10 );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
98 msgw = gtk_label_new( msg );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
99 gtk_ticker_add( GTK_TICKER( ticker ), msgw );
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
100 gtk_ticker_start_scroll( GTK_TICKER( ticker ) );
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
101
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
102 gtk_timeout_add( 60000, BuddyTickerMessageRemove, (gpointer) NULL );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
103
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
104 gtk_widget_show_all (ticker);
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
105
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
106 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
107
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
108 gint
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
109 ButtonPressCallback( GtkWidget *widget, GdkEvent *event, gpointer callback_data )
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
110 {
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
111 TickerData *p = (TickerData *) callback_data;
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
112
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
113 pressed_ticker( p->buddy );
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
114
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
115 return TRUE;
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
116 }
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
117
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
118 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
119 BuddyTickerAddUser( char *name, GdkPixmap *pm, GdkBitmap *bm )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
120 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
121 TickerData *p;
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
122 GList *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
123
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
124 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
125 return;
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
126
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
127 BuddyTickerCreateWindow();
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
128
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
129 q = (GList *) BuddyTickerFindUser( name );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
130 if ( q != (GList *) NULL )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
131 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
132
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
133 p = (TickerData *) malloc( sizeof( TickerData ) );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
134 p->hbox = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
135 p->label = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
136 p->pix = (GtkWidget *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
137 strcpy( p->buddy, name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
138 tickerbuds = g_list_append( tickerbuds, p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
139
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
140 p->hbox = gtk_hbox_new( FALSE, 0 );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
141 gtk_ticker_add( GTK_TICKER( ticker ), p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
142 gtk_widget_show_all( p->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
143
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
144 BuddyTickerSetPixmap( name, pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
145
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
146 p->ebox = gtk_event_box_new();
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
147
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
148 // click detection
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
149
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
150 gtk_widget_set_events (p->ebox, GDK_BUTTON_PRESS_MASK);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
151 gtk_signal_connect (GTK_OBJECT (p->ebox), "button_press_event",
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
152 GTK_SIGNAL_FUNC(ButtonPressCallback), (gpointer) p);
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
153
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
154 gtk_box_pack_start_defaults( GTK_BOX( p->hbox ), p->ebox );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
155 gtk_widget_show( p->ebox );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
156
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
157 p->label = gtk_label_new( name );
438
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
158 gtk_container_add( GTK_CONTAINER(p->ebox), p->label );
881f5d538f15 [gaim-migrate @ 448]
Syd Logan <slogan>
parents: 436
diff changeset
159
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
160 gtk_widget_show( p->label );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
161
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
162 gtk_widget_show( tickerwindow );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
163 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
164
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
165 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
166 BuddyTickerRemoveUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
167 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
168 GList *p = (GList *) BuddyTickerFindUser( name );
460
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
169 TickerData *data;
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
170
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
171 if ( !p )
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
172 return;
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
173
f4d6dc3a1ada [gaim-migrate @ 470]
Syd Logan <slogan>
parents: 438
diff changeset
174 data = (TickerData *) p->data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
175
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
176 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
177 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
178 if ( data ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
179 gtk_ticker_remove( GTK_TICKER( ticker ), data->hbox );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
180 tickerbuds = g_list_remove( tickerbuds, data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
181 free( data );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
182 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
183 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
184
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
185 void
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
186 BuddyTickerSetPixmap( char *name, GdkPixmap *pm, GdkBitmap *bm )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
187 {
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
188 GList *p;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
189 TickerData *data;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
190
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
191 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
192 return;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
193 p = (GList *) BuddyTickerFindUser( name );
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
194 if ( p )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
195 data = (TickerData *) p->data;
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
196 else
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
197 return;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
198 if ( data->pix == (GtkWidget *) NULL ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
199 data->pix = gtk_pixmap_new( pm, bm );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
200 gtk_box_pack_start_defaults( GTK_BOX( data->hbox ), data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
201 } else {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
202 gtk_widget_hide( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
203 gtk_pixmap_set(GTK_PIXMAP(data->pix), pm, bm);
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
204 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
205 gtk_widget_show( data->pix );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
206 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
207
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
208 GList *
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
209 BuddyTickerFindUser( char *name )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
210 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
211 GList *p = tickerbuds;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
212
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
213 while ( p ) {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
214 TickerData *q = (TickerData *) p->data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
215 if ( !strcmp( name, q->buddy ) )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
216 return( p );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
217 p = p->next;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
218 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
219 return (GList *) NULL;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
220 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
221
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
222 int
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
223 BuddyTickerMessageRemove( gpointer data )
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
224 {
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
225 if ( userclose == TRUE )
604
0b1a132e0f75 [gaim-migrate @ 614]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 469
diff changeset
226 return FALSE;
433
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
227 gtk_ticker_remove( GTK_TICKER( ticker ), msgw );
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
228 return FALSE;
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
229 }
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
230
f82e84386fdf [gaim-migrate @ 443]
Syd Logan <slogan>
parents: 432
diff changeset
231 int
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
232 BuddyTickerLogonTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
233 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
234 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
235 }
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
236
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
237 int
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
238 BuddyTickerLogoutTimeout( gpointer data )
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
239 {
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
240 char *name = (char *) data;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
241
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
242 if ( userclose == TRUE )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
243 return FALSE;
430
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
244 BuddyTickerRemoveUser( name );
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
245
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
246 return FALSE;
0cd2ba801eb4 [gaim-migrate @ 440]
Syd Logan <slogan>
parents:
diff changeset
247 }
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
248
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
249 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
250 BuddyTickerSignoff( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
251 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
252 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
253 TickerData *q;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
254
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
255 while ( p ) {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
256 q = (TickerData *) p->data;
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
257 if ( q )
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
258 BuddyTickerRemoveUser( q->buddy );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
259 p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
260 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
261 userclose = FALSE;
434
634b93c7a473 [gaim-migrate @ 444]
Syd Logan <slogan>
parents: 433
diff changeset
262 gtk_widget_hide( tickerwindow );
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
263 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
264
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
265 void
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
266 BuddyTickerClearList( void )
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
267 {
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
268 GList *p = tickerbuds;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
269
436
7d5f91c1ff20 [gaim-migrate @ 446]
Syd Logan <slogan>
parents: 434
diff changeset
270 while ( p )
432
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
271 p = g_list_remove( p, p->data );
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
272 tickerbuds = (GList *) NULL;
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
273 }
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
274
5741dca6cc8a [gaim-migrate @ 442]
Syd Logan <slogan>
parents: 430
diff changeset
275