annotate src/gnome_applet_mgr.c @ 1155:f4d4a14752ee

[gaim-migrate @ 1165] Heres the rest of the BP crap. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 28 Nov 2000 10:20:23 +0000
parents bc718030af96
children 2d12541cedb1
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
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
41 gboolean applet_buddy_show = FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 GtkWidget *applet_popup = NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43
776
626975d79bff [gaim-migrate @ 786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
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;
776
626975d79bff [gaim-migrate @ 786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
48 */
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
49
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50 GtkWidget *applet;
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
51 GtkWidget *appletframe;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52 GtkWidget *status_label;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
53
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 GtkWidget *icon;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 GdkPixmap *icon_offline_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 GdkPixmap *icon_offline_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 GdkPixmap *icon_online_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59 GdkPixmap *icon_online_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 GdkPixmap *icon_connect_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 GdkPixmap *icon_connect_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 GdkPixmap *icon_msg_pending_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 GdkPixmap *icon_msg_pending_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 GdkPixmap *icon_away_pm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 GdkPixmap *icon_away_bm=NULL;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
70 static GtkAllocation get_applet_pos(gboolean);
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
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
73 static gboolean load_applet_icon(const char *name, int height, int width,
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
74 GdkPixmap **pm, GdkBitmap **bm)
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
75 {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 gboolean result = TRUE;
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
77 char *path;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 GdkImlibImage *im;
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
79
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
80 path = gnome_pixmap_file(name);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
81
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 im=gdk_imlib_load_image( path );
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 if ((*pm)!=NULL)
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85 gdk_imlib_free_pixmap((*pm));
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 if( im!= NULL ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 gdk_imlib_render(im,width,height);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 (*pm) = gdk_imlib_move_image(im);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 (*bm) = gdk_imlib_move_mask(im);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 } else {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 result = FALSE;
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
95 sprintf(debug_buff,_("file not found: %s\n"),path);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 debug_print(debug_buff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
99 free(path);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 return result;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 }
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
102
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
103 #ifdef HAVE_PANEL_PIXEL_SIZE
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
104 static void applet_change_pixel_size(GtkWidget *w, int size, gpointer data)
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
105 {
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
106 sizehint = size;
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
107 update_pixmaps();
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
108 }
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
109 #endif
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110
1116
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
111 static gboolean update_applet(){
1104
46c10fa4e557 [gaim-migrate @ 1114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1031
diff changeset
112 char buf[BUF_LONG];
46c10fa4e557 [gaim-migrate @ 1114]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1031
diff changeset
113 GSList *c = connections;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114
1116
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
115 switch( MRI_user_status ){
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
116 case offline:
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
117 gtk_pixmap_set( GTK_PIXMAP(icon),
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
118 icon_offline_pm,
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
119 icon_offline_bm );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
120 gtk_label_set( GTK_LABEL(status_label), _MSG_OFFLINE_ );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
121 applet_set_tooltips(_("Offilne. Click to bring up login box."));
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
122 break;
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
123 case signing_on:
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
124 gtk_pixmap_set( GTK_PIXMAP(icon),
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
125 icon_connect_pm,
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
126 icon_connect_bm );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
127 gtk_label_set( GTK_LABEL(status_label), _MSG_CONNECT_ );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
128 applet_set_tooltips(_("Attempting to sign on...."));
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
129 break;
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
130 case online:
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
131 gtk_pixmap_set( GTK_PIXMAP(icon),
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
132 icon_online_pm,
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
133 icon_online_bm );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
134 gtk_label_set( GTK_LABEL(status_label), _MSG_ONLINE_ );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
135 g_snprintf(buf, sizeof buf, "Online: ");
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
136 while (c) {
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
137 strcat(buf, ((struct gaim_connection *)c->data)->username);
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
138 c = g_slist_next(c);
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
139 if (c) strcat(buf, ", ");
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
140 }
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
141 applet_set_tooltips(buf);
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
142 break;
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
143 case away:
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
144 gtk_pixmap_set( GTK_PIXMAP(icon),
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
145 icon_online_pm,
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
146 icon_online_bm );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
147 gtk_label_set( GTK_LABEL(status_label), _("Away") );
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
148 break;
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
149 }
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
151 return TRUE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
154 void update_pixmaps() {
776
626975d79bff [gaim-migrate @ 786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
155 /*
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
156 if (display_options & OPT_DISP_DEVIL_PIXMAPS) {
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
157 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_DEVIL_OFFLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
158 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_DEVIL_CONNECT);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
159 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_DEVIL_ONLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
160 } else {
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
161 sprintf(GAIM_GNOME_OFFLINE_ICON, "%s", GAIM_GNOME_PENGUIN_OFFLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
162 sprintf(GAIM_GNOME_CONNECT_ICON, "%s", GAIM_GNOME_PENGUIN_CONNECT);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
163 sprintf(GAIM_GNOME_ONLINE_ICON, "%s", GAIM_GNOME_PENGUIN_ONLINE);
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
164 }
776
626975d79bff [gaim-migrate @ 786]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 746
diff changeset
165 */
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
166 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
167 &icon_offline_pm, &icon_offline_bm );
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
168 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
169 &icon_connect_pm, &icon_connect_bm );
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
170 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
171 &icon_online_pm, &icon_online_bm );
1116
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
172 update_applet();
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
173 gtk_widget_set_usize(appletframe, sizehint, sizehint);
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
174 }
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
175
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
177 extern GtkWidget *mainwindow;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178 void applet_show_login(AppletWidget *widget, gpointer data) {
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 show_login();
340
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
180 if (general_options & OPT_GEN_NEAR_APPLET) {
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
181 GtkAllocation a = get_applet_pos(FALSE);
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
182 gtk_widget_set_uposition(mainwindow, a.x, a.y);
0d9cfc3579a5 [gaim-migrate @ 350]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 338
diff changeset
183 }
1
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
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
186 void applet_do_signon(AppletWidget *widget, gpointer data) {
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
187 applet_show_login(NULL, 0);
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
188 }
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
189
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
190 void insert_applet_away() {
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 776
diff changeset
191 GSList *awy = away_messages;
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
192 struct away_message *a;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
193 char *awayname;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
194
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
195 applet_widget_register_callback_dir(APPLET_WIDGET(applet),
46
be3417b255db [gaim-migrate @ 55]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 23
diff changeset
196 "away/",
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
197 _("Away"));
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
198 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
199 "away/new",
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
200 _("New Away Message"),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
201 (AppletCallbackFunc)create_away_mess,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
202 NULL);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
203
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
204 while(awy) {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
205 a = (struct away_message *)awy->data;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
206
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 46
diff changeset
207 awayname = g_malloc(sizeof *awayname * (6 + strlen(a->name)));
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
208 awayname[0] = '\0';
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
209 strcat(awayname, "away/");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
210 strcat(awayname, a->name);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
211 applet_widget_register_callback(APPLET_WIDGET(applet),
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
212 awayname,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
213 a->name,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
214 (AppletCallbackFunc)do_away_message,
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
215 a);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
216
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 776
diff changeset
217 awy = g_slist_next(awy);
23
e91430c2b276 [gaim-migrate @ 32]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 20
diff changeset
218 free(awayname);
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
219 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
220 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
221
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
222 void remove_applet_away() {
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 776
diff changeset
223 GSList *awy = away_messages;
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
224 struct away_message *a;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
225 char *awayname;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
226
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
227 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away/new");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
228
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
229 while (awy) {
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
230 a = (struct away_message *)awy->data;
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
231
79
bfdc427b936d [gaim-migrate @ 89]
Rob Flynn <gaim@robflynn.com>
parents: 46
diff changeset
232 awayname = g_malloc(sizeof *awayname * (6 + strlen(a->name)));
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
233 awayname[0] = '\0';
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
234 strcat(awayname, "away/");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
235 strcat(awayname, a->name);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
236 applet_widget_unregister_callback(APPLET_WIDGET(applet), awayname);
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
237
940
9fca1293f871 [gaim-migrate @ 950]
Rob Flynn <gaim@robflynn.com>
parents: 776
diff changeset
238 awy = g_slist_next(awy);
23
e91430c2b276 [gaim-migrate @ 32]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 20
diff changeset
239 free(awayname);
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
240 }
46
be3417b255db [gaim-migrate @ 55]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 23
diff changeset
241 applet_widget_unregister_callback_dir(APPLET_WIDGET(applet), "away/");
18
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
242 applet_widget_unregister_callback(APPLET_WIDGET(applet), "away");
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
243 }
99d91a6c2fbf [gaim-migrate @ 27]
Rob Flynn <gaim@robflynn.com>
parents: 16
diff changeset
244
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
245 static void applet_show_about(AppletWidget *widget, gpointer data) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 const gchar *authors[] = {"Mark Spencer <markster@marko.net>",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 "Jim Duchek <jimduchek@ou.edu>",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 "Rob Flynn <rflynn@blueridge.net>",
82
05077cb276d4 [gaim-migrate @ 92]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 79
diff changeset
250 "Eric Warmenhoven <warmenhoven@yahoo.com>",
178
5d62a5d50c89 [gaim-migrate @ 188]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 107
diff changeset
251 "Syd Logan",
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 NULL};
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 GtkWidget *about=gnome_about_new(_("GAIM"),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 _(VERSION),
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 authors,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258 "",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260 gtk_widget_show(about);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
263 static GtkAllocation get_applet_pos(gboolean for_blist) {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
264 gint x,y,pad;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
265 GtkRequisition buddy_req, applet_req;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
266 GtkAllocation result;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
267 GNOME_Panel_OrientType orient = applet_widget_get_panel_orient( APPLET_WIDGET(applet) );
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
268 pad = 5;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
269
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
270 gdk_window_get_position(gtk_widget_get_parent_window(appletframe), &x, &y);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
271 if (for_blist) {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
272 if (general_options & OPT_GEN_SAVED_WINDOWS) {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
273 buddy_req.width = blist_pos.width;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
274 buddy_req.height = blist_pos.height;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
275 } else {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
276 buddy_req = blist->requisition;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
277 }
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
278 } else {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
279 buddy_req = mainwindow->requisition;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
280 }
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
281 applet_req = appletframe->requisition;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
282
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
283 /* FIXME : we need to be smarter here */
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
284 switch( orient ){
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
285 case ORIENT_UP:
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
286 result.x=x;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
287 result.y=y-(buddy_req.height+pad);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
288 break;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
289 case ORIENT_DOWN:
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
290 result.x=x;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
291 result.y=y+applet_req.height+pad;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
292 break;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
293 case ORIENT_LEFT:
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
294 result.x=x-(buddy_req.width + pad );
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
295 result.y=y;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
296 break;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
297 case ORIENT_RIGHT:
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
298 result.x=x+applet_req.width+pad;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
299 result.y=y;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
300 break;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
301 }
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
302 return result;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 void createOnlinePopup(){
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
306 GtkAllocation al;
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
307 if (blist) gtk_widget_show(blist);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
308 al = get_applet_pos(TRUE);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
309 if (general_options & OPT_GEN_NEAR_APPLET)
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
310 gtk_widget_set_uposition ( blist, al.x, al.y );
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
311 else if (general_options & OPT_GEN_SAVED_WINDOWS)
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
312 gtk_widget_set_uposition(blist, blist_pos.x - blist_pos.xoff, blist_pos.y - blist_pos.yoff);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
315 void AppletClicked( GtkWidget *sender, GdkEventButton *ev, gpointer data ){
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
316 if (!ev || ev->button != 1 || ev->type != GDK_BUTTON_PRESS)
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
317 return;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
319 if(applet_buddy_show) {
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
320 applet_buddy_show = FALSE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 switch( MRI_user_status ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 case offline:
941
0c3bdd59f983 [gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
323 if (mainwindow)
0c3bdd59f983 [gaim-migrate @ 951]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 940
diff changeset
324 gtk_widget_hide(mainwindow);
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
325 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326 case online:
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 case away:
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
328 applet_destroy_buddy(0, 0, 0);
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
329 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 } else {
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
332 applet_buddy_show = TRUE;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 switch( MRI_user_status ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334 case offline:
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
335 applet_show_login( APPLET_WIDGET(applet), NULL );
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
336 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 case online:
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
338 case away:
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 createOnlinePopup();
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
340 break;
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341 }
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 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346 /***************************************************************
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347 **
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 ** Initialize GNOME stuff
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 ****************************************************************/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
352 gint init_applet_mgr(int argc, char *argv[]) {
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 GtkWidget *vbox;
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 GtkStyle *label_style;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 GdkFont *label_font = NULL;
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 applet_widget_init("GAIM",VERSION,argc,argv,NULL,0,NULL);
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 /*init imlib for graphics*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 gdk_imlib_init();
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 gtk_widget_push_visual(gdk_imlib_get_visual());
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363 gtk_widget_push_colormap(gdk_imlib_get_colormap());
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
364
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365 applet=applet_widget_new("gaim_applet");
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 if(!applet) g_error(_("Can't create GAIM applet!"));
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
367 gtk_widget_set_events(applet, gtk_widget_get_events(applet) |
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
368 GDK_BUTTON_PRESS_MASK);
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
369
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
370 appletframe = gtk_frame_new(NULL);
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
371 #ifdef HAVE_PANEL_PIXEL_SIZE
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
372 gtk_widget_set_usize(appletframe, 5, 5);
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
373 #else
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
374 gtk_widget_set_usize(appletframe, 48, 48);
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
375 #endif
1
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 /*load offline icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
378 load_applet_icon( GAIM_GNOME_OFFLINE_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
379 &icon_offline_pm, &icon_offline_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 /*load connecting icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
382 load_applet_icon( GAIM_GNOME_CONNECT_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
383 &icon_connect_pm, &icon_connect_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
384
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
385 /*load online icon*/
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
386 load_applet_icon( GAIM_GNOME_ONLINE_ICON, 32, 32,
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
387 &icon_online_pm, &icon_online_bm );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389 /*icon_away and icon_msg_pennding need to be implemented*/
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 icon=gtk_pixmap_new(icon_offline_pm,icon_offline_bm);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 vbox = gtk_vbox_new(FALSE,0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 gtk_box_pack_start(GTK_BOX(vbox), icon, FALSE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
397 status_label = gtk_label_new(_("Offline"));
1123
bc718030af96 [gaim-migrate @ 1133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1116
diff changeset
398
bc718030af96 [gaim-migrate @ 1133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1116
diff changeset
399 update_applet();
bc718030af96 [gaim-migrate @ 1133]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1116
diff changeset
400
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
401 /*set this label's font*/
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 label_style = gtk_widget_get_style( status_label );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404 label_font = gdk_font_load( _MSG_FONT_ );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
405
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
407 if( label_font != NULL ){
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 label_style->font = label_font;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409 gtk_widget_set_style( status_label, label_style );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410 } else {
350
fd3cc0a28d5d [gaim-migrate @ 360]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 349
diff changeset
411 sprintf(debug_buff, _("Font does not exist") );
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412 debug_print(debug_buff);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
413 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 gtk_box_pack_start(GTK_BOX(vbox), status_label, FALSE, TRUE, 0);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
417 gtk_container_add( GTK_CONTAINER(appletframe), vbox );
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
418 applet_widget_add(APPLET_WIDGET(applet), appletframe);
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
420 gtk_widget_show( status_label );
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421 gtk_widget_show( vbox );
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
422 gtk_widget_show( appletframe );
1
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 applet_widget_register_stock_callback(APPLET_WIDGET(applet),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 "about",
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 GNOME_STOCK_MENU_ABOUT,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427 _("About..."),
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 applet_show_about,
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429 NULL);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430
338
9d258a0aa560 [gaim-migrate @ 348]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 246
diff changeset
431 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
432
425
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
433 gtk_signal_connect( GTK_OBJECT(applet), "destroy", GTK_SIGNAL_FUNC( do_quit), NULL);
ae7c762775cd [gaim-migrate @ 435]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 411
diff changeset
434
374
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
435 #ifdef HAVE_PANEL_PIXEL_SIZE
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
436 gtk_signal_connect(GTK_OBJECT(applet), "change_pixel_size",
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
437 GTK_SIGNAL_FUNC(applet_change_pixel_size), NULL);
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
438 #endif
7493af3a4ce2 [gaim-migrate @ 384]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 350
diff changeset
439
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440 gtk_widget_show(icon);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 gtk_widget_show(applet);
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 return 0;
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444
746
5a908dd5cfc4 [gaim-migrate @ 756]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 425
diff changeset
445 void set_user_state( enum gaim_user_states state ){
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 MRI_user_status = state;
1116
35476475f794 [gaim-migrate @ 1126]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 1104
diff changeset
447 update_applet();
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448 }
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449
342
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
450 void applet_set_tooltips(char *msg) {
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
451 applet_widget_set_tooltip(APPLET_WIDGET(applet), msg);
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
452 }
f4fba304b236 [gaim-migrate @ 352]
Eric Warmenhoven <eric@warmenhoven.org>
parents: 340
diff changeset
453
1
2846a03bda67 [gaim-migrate @ 10]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 #endif /*USE_APPLET*/