annotate gtk/docklet-x11.c @ 14688:37bb5e487347

[gaim-migrate @ 17440] Fix Coverity CID 291 - don't dereference conv before the NULL check committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 07 Oct 2006 17:09:14 +0000
parents 2c1781ea074c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14681
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * System tray icon (aka docklet) plugin for Gaim
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
4 * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org>
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com>
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * Inspired by a similar plugin by:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 * John (J5) Palmieri <johnp@martianrock.com>
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 *
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * modify it under the terms of the GNU General Public License as
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * published by the Free Software Foundation; either version 2 of the
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * License, or (at your option) any later version.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 *
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful, but
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * General Public License for more details.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 *
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * 02111-1307, USA.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
24
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #include "internal.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "gtkgaim.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "debug.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include "gaimstock.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "gaim.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "gtkdialogs.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "eggtrayicon.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "docklet.h"
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36 #define EMBED_TIMEOUT 5000
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 /* globals */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 static EggTrayIcon *docklet = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 static GtkWidget *image = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 static GtkTooltips *tooltips = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 static GdkPixbuf *blank_icon = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 static int embed_timeout = 0;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 /* protos */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
46 static void docklet_x11_create(void);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
48 static gboolean
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 docklet_x11_create_cb()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 docklet_x11_create();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
52
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 return FALSE; /* for when we're called by the glib idle handler */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57 docklet_x11_embedded_cb(GtkWidget *widget, void *data)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "embedded\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 g_source_remove(embed_timeout);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 embed_timeout = 0;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 docklet_embedded();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 docklet_x11_destroyed_cb(GtkWidget *widget, void *data)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 docklet_remove();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 g_object_unref(G_OBJECT(docklet));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 docklet = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 g_idle_add(docklet_x11_create_cb, &handle);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 docklet_x11_clicked_cb(GtkWidget *button, GdkEventButton *event, void *data)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 if (event->type != GDK_BUTTON_PRESS)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 return;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 docklet_clicked(event->button);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 docklet_x11_update_icon(DockletStatus icon)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
91 const gchar *icon_name = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 g_return_if_fail(image != NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 switch (icon) {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 case DOCKLET_STATUS_OFFLINE:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 icon_name = GAIM_STOCK_ICON_OFFLINE;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 case DOCKLET_STATUS_CONNECTING:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 icon_name = GAIM_STOCK_ICON_CONNECT;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 case DOCKLET_STATUS_ONLINE:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 icon_name = GAIM_STOCK_ICON_ONLINE;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 case DOCKLET_STATUS_ONLINE_PENDING:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 icon_name = GAIM_STOCK_ICON_ONLINE_MSG;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 case DOCKLET_STATUS_AWAY:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 icon_name = GAIM_STOCK_ICON_AWAY;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 case DOCKLET_STATUS_AWAY_PENDING:
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 icon_name = GAIM_STOCK_ICON_AWAY_MSG;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 break;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 if(icon_name)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 gtk_image_set_from_stock(GTK_IMAGE(image), icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
119 #if 0
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
120 GdkPixbuf *p;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121 GdkBitmap *mask = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123 p = gtk_widget_render_icon(GTK_WIDGET(image), icon_name, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 if (p && (gdk_pixbuf_get_colorspace(p) == GDK_COLORSPACE_RGB) && (gdk_pixbuf_get_bits_per_sample(p) == 8)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 && (gdk_pixbuf_get_has_alpha(p)) && (gdk_pixbuf_get_n_channels(p) == 4)) {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 int len = gdk_pixbuf_get_width(p) * gdk_pixbuf_get_height(p);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 guchar *data = gdk_pixbuf_get_pixels(p);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129 guchar *bitmap = g_malloc((len / 8) + 1);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 int i;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 for (i = 0; i < len; i++)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 if (data[i*4 + 3] > 55)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 bitmap[i/8] |= 1 << i % 8;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135 else
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 bitmap[i/8] &= ~(1 << i % 8);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 mask = gdk_bitmap_create_from_data(GDK_DRAWABLE(GTK_WIDGET(image)->window), bitmap, gdk_pixbuf_get_width(p), gdk_pixbuf_get_height(p));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 g_free(bitmap);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
141
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 if (mask)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 gdk_window_shape_combine_mask(image->window, mask, 0, 0);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145 g_object_unref(G_OBJECT(p));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 #endif
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 docklet_x11_blank_icon()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 if (!blank_icon) {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 gint width, height;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155 gtk_icon_size_lookup(GTK_ICON_SIZE_LARGE_TOOLBAR, &width, &height);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 blank_icon = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 gdk_pixbuf_fill(blank_icon, 0);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 gtk_image_set_from_pixbuf(GTK_IMAGE(image), blank_icon);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 docklet_x11_set_tooltip(gchar *tooltip)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 if (!tooltips)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 tooltips = gtk_tooltips_new();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 /* image->parent is a GtkEventBox */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 if (tooltip) {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 gtk_tooltips_enable(tooltips);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 gtk_tooltips_set_tip(tooltips, image->parent, tooltip, NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 } else {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174 gtk_tooltips_set_tip(tooltips, image->parent, "", NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 gtk_tooltips_disable(tooltips);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 #if GTK_CHECK_VERSION(2,2,0)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 docklet_x11_position_menu(GtkMenu *menu, int *x, int *y, gboolean *push_in,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 gpointer user_data)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 GtkWidget *widget = GTK_WIDGET(docklet);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 GtkRequisition req;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 gint menu_xpos, menu_ypos;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188 gtk_widget_size_request(GTK_WIDGET(menu), &req);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 gdk_window_get_origin(widget->window, &menu_xpos, &menu_ypos);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 menu_xpos += widget->allocation.x;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 menu_ypos += widget->allocation.y;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
194 if (menu_ypos > gdk_screen_get_height(gtk_widget_get_screen(widget)) / 2)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 menu_ypos -= req.height;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 else
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197 menu_ypos += widget->allocation.height;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 *x = menu_xpos;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 *y = menu_ypos;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 *push_in = TRUE;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 #endif
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 docklet_x11_destroy()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 g_return_if_fail(docklet != NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 docklet_remove();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_x11_destroyed_cb), NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 gtk_widget_destroy(GTK_WIDGET(docklet));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 g_object_unref(G_OBJECT(docklet));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 docklet = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 if (blank_icon)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 g_object_unref(G_OBJECT(blank_icon));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 blank_icon = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 image = NULL;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "destroyed\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 static gboolean
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229 docklet_x11_embed_timeout_cb()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
231 /* The docklet was not embedded within the timeout.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 * Remove it as a visibility manager, but leave the plugin
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 * loaded so that it can embed automatically if/when a notification
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 * area becomes available.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 gaim_debug_info("tray icon", "failed to embed within timeout\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 docklet_remove();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 return FALSE;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 static void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 docklet_x11_create()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245 GtkWidget *box;
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 if (docklet) {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 /* if this is being called when a tray icon exists, it's because
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249 something messed up. try destroying it before we proceed,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 although docklet_refcount may be all hosed. hopefully won't happen. */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
251 gaim_debug(GAIM_DEBUG_WARNING, "tray icon", "trying to create icon but it already exists?\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 docklet_x11_destroy();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 docklet = egg_tray_icon_new("Gaim");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256 box = gtk_event_box_new();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 image = gtk_image_new();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 g_signal_connect(G_OBJECT(docklet), "embedded", G_CALLBACK(docklet_x11_embedded_cb), NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_x11_destroyed_cb), NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 g_signal_connect(G_OBJECT(box), "button-press-event", G_CALLBACK(docklet_x11_clicked_cb), NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 gtk_container_add(GTK_CONTAINER(box), image);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 gtk_container_add(GTK_CONTAINER(docklet), box);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
265
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 if (!gtk_check_version(2,4,0))
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 g_object_set(G_OBJECT(box), "visible-window", FALSE, NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 gtk_widget_show_all(GTK_WIDGET(docklet));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 /* ref the docklet before we bandy it about the place */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 g_object_ref(G_OBJECT(docklet));
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
274 /* This is a hack to avoid a race condition between the docklet getting
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 * embedded in the notification area and the gtkblist restoring its
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
276 * previous visibility state. If the docklet does not get embedded within
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 * the timeout, it will be removed as a visibility manager until it does
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278 * get embedded. Ideally, we would only call docklet_embedded() when the
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
279 * icon was actually embedded.
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
280 */
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 docklet_embedded();
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
282 embed_timeout = g_timeout_add(EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284 gaim_debug(GAIM_DEBUG_INFO, "tray icon", "created\n");
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 }
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287 static struct docklet_ui_ops ui_ops =
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
288 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289 docklet_x11_create,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290 docklet_x11_destroy,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 docklet_x11_update_icon,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 docklet_x11_blank_icon,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293 docklet_x11_set_tooltip,
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 #if GTK_CHECK_VERSION(2,2,0)
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295 docklet_x11_position_menu
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296 #else
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 NULL
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 #endif
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 };
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 void
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 docklet_ui_init()
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 {
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 docklet_set_ui_ops(&ui_ops);
2c1781ea074c [gaim-migrate @ 17433]
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 }