annotate src/gnome_applet_mgr.c @ 396:b1d5c6ab7b0d

[gaim-migrate @ 406] why do i bother committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 12 Jun 2000 13:45:22 +0000
parents 7493af3a4ce2
children 98bbfae58fa2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /**************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 ** GaimGnomeAppletMgr
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 ** Author - Quinticent (John Palmieri: johnp@martianrock.com)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 ** Purpose - Takes over the task of managing the GNOME applet
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 ** code and provides a centralized codebase for
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 ** GNOME integration for Gaim.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 ** gaim
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 ** Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 ** This program is free software; you can redistribute it and/or modify
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 ** it under the terms of the GNU General Public License as published by
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 ** the Free Software Foundation; either version 2 of the License, or
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 ** (at your option) any later version.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 ** This program is distributed in the hope that it will be useful,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23 ** GNU General Public License for more details.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 ** You should have received a copy of the GNU General Public License
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 ** along with this program; if not, write to the Free Software
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 */
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29
349
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
30 #ifdef HAVE_CONFIG_H
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
31 #include "../config.h"
b402a23f35df [gaim-migrate @ 359]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 342
diff changeset
32 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 #ifdef USE_APPLET
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 #include <string.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 #include <gdk_imlib.h>
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 #include "gaim.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 #include "gnome_applet_mgr.h"
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 enum gaim_user_states MRI_user_status;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 gboolean buddy_created = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 gboolean applet_draw_open = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 GtkWidget *applet_popup = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
45 gchar GAIM_GNOME_OFFLINE_ICON[255] = GAIM_GNOME_PENGUIN_OFFLINE;
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
46 gchar GAIM_GNOME_CONNECT_ICON[255] = GAIM_GNOME_PENGUIN_CONNECT;
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
47 gchar GAIM_GNOME_ONLINE_ICON[255] = GAIM_GNOME_PENGUIN_ONLINE;
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
48
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49 GtkWidget *applet;
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
50 GtkWidget *appletframe;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51 GtkWidget *status_label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
53 GtkWidget *icon;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 GdkPixmap *icon_offline_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 GdkPixmap *icon_offline_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 GdkPixmap *icon_online_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 GdkPixmap *icon_online_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 GdkPixmap *icon_connect_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 GdkPixmap *icon_connect_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 GdkPixmap *icon_msg_pending_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 GdkPixmap *icon_msg_pending_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 GdkPixmap *icon_away_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 GdkPixmap *icon_away_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
69 static GtkAllocation get_applet_pos(gboolean);
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
70
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
71 gint sizehint=48;
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
72
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 ** function load_applet_icon
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 ** visibility - private
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 ** input:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 ** name - the name of the file to load
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 ** height, width - the height and width
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 ** that the icon should be
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 ** scaled to.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84 ** output:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85 ** TRUE - success
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86 ** FALSE - failure
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 ** pm - a GdkPixmap structure that the icon is loaded into
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 ** bm - a GdkBitmap structure that the icon's transparancy
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 ** mask is loaded into
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 ** description - loads an icon from
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 ** /usr/share/pixmap/gaim/gnome/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 ** and scales it using imlib
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 gboolean load_applet_icon( const char *name, int height, int width, GdkPixmap **pm, GdkBitmap **bm ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 gboolean result = TRUE;
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
99 char *path;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 GdkImlibImage *im;
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
101
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
102 path = gnome_pixmap_file(name);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
103
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 im=gdk_imlib_load_image( path );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 if ((*pm)!=NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 gdk_imlib_free_pixmap((*pm));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109 if( im!= NULL ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 gdk_imlib_render(im,width,height);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 (*pm) = gdk_imlib_move_image(im);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 (*bm) = gdk_imlib_move_mask(im);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 result = FALSE;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
117 sprintf(debug_buff,_("file not found: %s\n"),path);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 debug_print(debug_buff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
121 free(path);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 return result;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 }
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
124 /***************************************************************
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
125 **
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
126 ** function applet_change_pixel_size
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
127 ** visibility - private
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
128 **
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
129 ** input:
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
130 ** w - applet that called the signal
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
131 ** size - size of panel
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
132 ** data - extra data (in this case NULL)
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
133 **
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
134 ** description - changes the size of the applet when the panel size
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
135 ** changes
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
136 **
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
137 ***************************************************************/
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
138 #ifdef HAVE_PANEL_PIXEL_SIZE
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
139 void applet_change_pixel_size(GtkWidget *w, int size, gpointer data)
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
140 {
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
141 sizehint = size;
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
142 update_pixmaps();
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
143 }
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
144 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 ** function update_applet
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 ** visibility - private
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151 ** input:
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
152 ** ap - if not NULL, was called from update_pixmaps, and
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
153 ** should update them
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 ** description - takes care of swapping status icons and
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 ** updating the status label
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 gboolean update_applet( gpointer *ap ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161 static enum gaim_user_states old_user_status = offline;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
163 if( MRI_user_status != old_user_status || ap){
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 switch( MRI_user_status ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 case offline:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 gtk_pixmap_set( GTK_PIXMAP(icon),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 icon_offline_pm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 icon_offline_bm );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 gtk_label_set( GTK_LABEL(status_label), _MSG_OFFLINE_ );
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
171 applet_set_tooltips(_("Offilne. Click to bring up login box."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 case signing_on:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 gtk_pixmap_set( GTK_PIXMAP(icon),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175 icon_connect_pm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176 icon_connect_bm );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 gtk_label_set( GTK_LABEL(status_label), _MSG_CONNECT_ );
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
178 applet_set_tooltips(_("Attempting to sign on...."));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 case online:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181 gtk_pixmap_set( GTK_PIXMAP(icon),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 icon_online_pm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 icon_online_bm );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185 gtk_label_set( GTK_LABEL(status_label), _MSG_ONLINE_ );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 case unread_message_pending:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 gtk_pixmap_set( GTK_PIXMAP(icon),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190 icon_msg_pending_pm,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191 icon_msg_pending_bm );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 gtk_label_set( GTK_LABEL(status_label), "msg" );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 case away:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 gtk_pixmap_set( GTK_PIXMAP(icon),
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
196 icon_online_pm,
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
197 icon_online_bm );
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
198 gtk_label_set( GTK_LABEL(status_label), _("Away") );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 old_user_status = MRI_user_status;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203 return TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
207 void update_pixmaps() {
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
208 if (display_options & OPT_DISP_DEVIL_PIXMAPS) {
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
209 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_DEVIL_OFFLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
210 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_DEVIL_CONNECT);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
211 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_DEVIL_ONLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
212 } else {
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
213 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_PENGUIN_OFFLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
214 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_PENGUIN_CONNECT);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
215 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_PENGUIN_ONLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
216 }
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
217 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, (sizehint-16), (sizehint-12),
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
218 &icon_offline_pm, &icon_offline_bm );
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
219 load_applet_icon( GAIM_GNOME_CONNECT_ICON, (sizehint-16), (sizehint-12),
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
220 &icon_connect_pm, &icon_connect_bm );
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
221 load_applet_icon( GAIM_GNOME_ONLINE_ICON, (sizehint-16), (sizehint-12),
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
222 &icon_online_pm, &icon_online_bm );
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
223 update_applet((gpointer *)applet);
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
224 gtk_widget_set_usize(appletframe, sizehint, sizehint);
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
225 }
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
226
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 ** function make_buddy
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 ** visibility - private
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 ** description - If buddylist is not created create it
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 ** else show the buddy list
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 void make_buddy(void) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 set_applet_draw_open();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239 if( !buddy_created ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 show_buddy_list();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 buddy_created = TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 gnome_buddy_show();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 }
16
5cdd1f11db02 [gaim-migrate @ 25]
Rob Flynn <gaim@robflynn.com>
parents: 1
diff changeset
245 build_edit_tree();
246
2c5713cd9d8c [gaim-migrate @ 256]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 200
diff changeset
246 build_permit_tree();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 ** function applet_show_login
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 ** visibility - private
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 ** input:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 ** description - I guess it shows the login dialog
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260 ****************************************************************/
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
261 extern GtkWidget *mainwindow;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262 void applet_show_login(AppletWidget *widget, gpointer data) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 show_login();
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
264 if (general_options & OPT_GEN_NEAR_APPLET) {
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
265 GtkAllocation a = get_applet_pos(FALSE);
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
266 gtk_widget_set_uposition(mainwindow, a.x, a.y);
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
267 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
270 void applet_do_signon(AppletWidget *widget, gpointer data) {
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
271 show_login();
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
272 if (general_options & OPT_GEN_REMEMBER_PASS)
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
273 dologin();
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
274 }
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
275
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
276 void insert_applet_away() {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
277 GList *awy = away_messages;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
278 struct away_message *a;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
279 char *awayname;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
280
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
281 applet_widget_register_callback_dir(APPLET_WIDGET(applet),
46
be3417b255db [gaim-migrate @ 55]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 23
diff changeset
282 "away/",
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
283 _("Away"));
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
284 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
285 "away/new",
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
286 _("New Away Message"),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
287 (AppletCallbackFunc)create_away_mess,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
288 NULL);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
289
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
290 while(awy) {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
291 a = (struct away_message *)awy->data;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
292
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 46
diff changeset
293 awayname = g_malloc(sizeof *awayname * (6 + strlen(a->name)));
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
294 awayname[0] = '\0';
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
295 strcat(awayname, "away/");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
296 strcat(awayname, a->name);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
297 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
298 awayname,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
299 a->name,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
300 (AppletCallbackFunc)do_away_message,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
301 a);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
302
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
303 awy = awy->next;
23
e91430c2b276 [gaim-migrate @ 32]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 20
diff changeset
304 free(awayname);
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
305 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
306 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
307
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
308 void remove_applet_away() {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
309 GList *awy = away_messages;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
310 struct away_message *a;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
311 char *awayname;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
312
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
313 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away/new");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
314
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
315 while (awy) {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
316 a = (struct away_message *)awy->data;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
317
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 46
diff changeset
318 awayname = g_malloc(sizeof *awayname * (6 + strlen(a->name)));
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
319 awayname[0] = '\0';
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
320 strcat(awayname, "away/");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
321 strcat(awayname, a->name);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
322 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
323
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
324 awy = awy->next;
23
e91430c2b276 [gaim-migrate @ 32]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 20
diff changeset
325 free(awayname);
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
326 }
46
be3417b255db [gaim-migrate @ 55]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 23
diff changeset
327 applet_widget_unregister_callback_dir(APPLET_WIDGET(applet), "away/");
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
328 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
329 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
330
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 ** function applet_show_about
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334 ** visibility - public
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 ** description - takes care of creating and
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338 ** displaying the about box
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341 void applet_show_about(AppletWidget *widget, gpointer data) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 const gchar *authors[] = {"Mark Spencer <markster@marko.net>",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 "Jim Duchek <jimduchek@ou.edu>",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 "Rob Flynn <rflynn@blueridge.net>",
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
346 "Eric Warmenhoven <warmenhoven@yahoo.com>",
178
5d62a5d50c89 [gaim-migrate @ 188]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
347 "Syd Logan",
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 NULL};
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 GtkWidget *about=gnome_about_new(_("GAIM"),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 _(VERSION),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 _(""),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 authors,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354 "",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 gtk_widget_show(about);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
358
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
360 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 ** function AppletCancelLogin (name should be changed to
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 ** applet_cancel_login)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363 ** visibility - public
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
364 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365 ** description - called when user cancels login
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
368 void AppletCancelLogon(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
369 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signoff");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
370 applet_widget_register_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
371 "signon",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372 _("Signon"),
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
373 applet_do_signon,
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
378 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
379 ** function get_applet_pos
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380 ** visibility - private
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
382 ** output:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
383 ** GtKAllocation - a Gtk struct that holds the
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
384 ** position of the dialog
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
385 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
386 ** description - returns the x,y position the buddy list should
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 ** should be placed based on the position
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 ** of the applet and the orientation
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 ** of the Gnome panel.
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 ****************************************************************/
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
392 GtkAllocation get_applet_pos(gboolean for_blist) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 gint x,y,pad;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394 GtkRequisition buddy_req, applet_req;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 GtkAllocation result;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396 GNOME_Panel_OrientType orient = applet_widget_get_panel_orient( APPLET_WIDGET(applet) );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 pad = 5;
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
398 gdk_window_get_position(gtk_widget_get_parent_window(appletframe), &x, &y);
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
399 if (for_blist)
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
400 buddy_req = gnome_buddy_get_dimentions();
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
401 else
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
402 buddy_req = mainwindow->requisition;
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
403 applet_req = appletframe->requisition;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404 switch( orient ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
405 case ORIENT_UP:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406 result.x=x;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
407 result.y=y-(buddy_req.height+pad);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409 case ORIENT_DOWN:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410 result.x=x;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
411 result.y=y+applet_req.height+pad;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
413 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414 case ORIENT_LEFT:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 result.x=x-(buddy_req.width + pad );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416 result.y=y;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
417 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
418 case ORIENT_RIGHT:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419 result.x=x+applet_req.width+pad;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
420 result.y=y;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 return result;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430 void createOfflinePopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
431 applet_show_login( APPLET_WIDGET(applet), NULL );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 void createSignonPopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436 applet_draw_open = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
439
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440 void createOnlinePopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 GtkAllocation al;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 make_buddy();
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
443 al = get_applet_pos(TRUE);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444 gnome_buddy_set_pos( al.x, al.y );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 void createPendingPopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 applet_draw_open = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 void createAwayPopup(){
83
8a98f129c849 [gaim-migrate @ 93]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
454 createOnlinePopup();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 void closeOfflinePopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 cancel_logon();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460 set_applet_draw_closed();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
462
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 void closeSignonPopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469 void closeOnlinePopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 set_applet_draw_closed();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 applet_destroy_buddy();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
473
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475 void closePendingPopup(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
476 applet_draw_open = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
480 void closeAwayPopup(){
83
8a98f129c849 [gaim-migrate @ 93]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 82
diff changeset
481 closeOnlinePopup();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
483
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
484 void AppletClicked( GtkWidget *sender, GdkEventButton *ev, gpointer data ){
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
485 if (!ev || ev->button != 1 || ev->type != GDK_BUTTON_PRESS)
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
486 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
487
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
488 if( applet_draw_open ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
489 switch( MRI_user_status ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
490 case offline:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491 closeOfflinePopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 case signing_on:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 closeSignonPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 case online:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497 closeOnlinePopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500 case unread_message_pending:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 closePendingPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503 case away:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504 closeAwayPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 set_applet_draw_open();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509 switch( MRI_user_status ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 case offline:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511 createOfflinePopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513 case signing_on:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514 createSignonPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516 case online:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 createOnlinePopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
519 case unread_message_pending:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520 createPendingPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522 case away:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523 createAwayPopup();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
524 break;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 ** Initialize GNOME stuff
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
538 gint init_applet_mgr(int argc, char *argv[]) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 GtkWidget *vbox;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 GtkStyle *label_style;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 GdkFont *label_font = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 applet_widget_init("GAIM",VERSION,argc,argv,NULL,0,NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 /*init imlib for graphics*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547 gdk_imlib_init();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 gtk_widget_push_visual(gdk_imlib_get_visual());
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 gtk_widget_push_colormap(gdk_imlib_get_colormap());
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
550
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 applet=applet_widget_new("gaim_applet");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552 if(!applet) g_error(_("Can't create GAIM applet!"));
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
553 gtk_widget_set_events(applet, gtk_widget_get_events(applet) |
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
554 GDK_BUTTON_PRESS_MASK);
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
555
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
556 appletframe = gtk_frame_new(NULL);
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
557 #ifdef HAVE_PANEL_PIXEL_SIZE
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
558 gtk_widget_set_usize(appletframe, 5, 5);
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
559 #else
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
560 gtk_widget_set_usize(appletframe, 48, 48);
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
561 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563 /*load offline icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
564 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
565 &icon_offline_pm, &icon_offline_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 /*load connecting icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
568 load_applet_icon( GAIM_GNOME_CONNECT_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
569 &icon_connect_pm, &icon_connect_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 /*load online icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
572 load_applet_icon( GAIM_GNOME_ONLINE_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
573 &icon_online_pm, &icon_online_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
574
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 /*icon_away and icon_msg_pennding need to be implemented*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577 icon=gtk_pixmap_new(icon_offline_pm,icon_offline_bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
579 update_applet(NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580 gtk_timeout_add( 1500, (GtkFunction)update_applet, NULL );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 vbox = gtk_vbox_new(FALSE,0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 gtk_box_pack_start(GTK_BOX(vbox), icon, FALSE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
586 status_label = gtk_label_new(_("Offline"));
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
587 /*set this label's font*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 label_style = gtk_widget_get_style( status_label );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
590 label_font = gdk_font_load( _MSG_FONT_ );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
593 if( label_font != NULL ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594 label_style->font = label_font;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595 gtk_widget_set_style( status_label, label_style );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
596 } else {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
597 sprintf(debug_buff, _("Font does not exist") );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598 debug_print(debug_buff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
601 gtk_box_pack_start(GTK_BOX(vbox), status_label, FALSE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
602
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
603 gtk_container_add( GTK_CONTAINER(appletframe), vbox );
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
604 applet_widget_add(APPLET_WIDGET(applet), appletframe);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
605
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
606 gtk_widget_show( status_label );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
607 gtk_widget_show( vbox );
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
608 gtk_widget_show( appletframe );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
609
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610 applet_widget_register_stock_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
611 "about",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 GNOME_STOCK_MENU_ABOUT,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613 _("About..."),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
614 applet_show_about,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
616
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
617 gtk_signal_connect( GTK_OBJECT(applet), "button_press_event", GTK_SIGNAL_FUNC( AppletClicked), NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
619 #ifdef HAVE_PANEL_PIXEL_SIZE
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
620 gtk_signal_connect(GTK_OBJECT(applet), "change_pixel_size",
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
621 GTK_SIGNAL_FUNC(applet_change_pixel_size), NULL);
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
622 #endif
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
623
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 gtk_widget_show(icon);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625 gtk_widget_show(applet);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629 void setUserState( enum gaim_user_states state ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630 MRI_user_status = state;
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
631 update_applet(NULL);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634 enum gaim_user_states getUserState(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 return MRI_user_status;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 void set_applet_draw_open(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639 applet_draw_open = TRUE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 void set_applet_draw_closed(){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 applet_draw_open = FALSE;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
646 void applet_set_tooltips(char *msg) {
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
647 applet_widget_set_tooltip(APPLET_WIDGET(applet), msg);
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
648 }
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
649
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 #endif /*USE_APPLET*/