annotate pidgin/gtkdocklet-gtk.c @ 32005:135868ec0aa9

propagate from branch 'im.pidgin.pidgin' (head 8707e10aca1fa6ef13a2a00f24760fb2ed97f641) to branch 'im.pidgin.cpw.masca.p2p' (head 941c9038bb0859c618dd334ada00158485678d24)
author masca@cpw.pidgin.im
date Tue, 04 Jan 2011 04:06:36 +0000
parents cd61b074103a
children c92bc01056ea a8cc50c2279f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
1 /*
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
2 * System tray icon (aka docklet) plugin for Purple
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
3 *
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
4 * Copyright (C) 2007 Anders Hasselqvist
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
5 *
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
8 * published by the Free Software Foundation; either version 2 of the
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
9 * License, or (at your option) any later version.
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
10 *
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, but
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
14 * General Public License for more details.
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
15 *
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
19 * 02111-1307, USA.
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
20 */
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
21
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
22 #include "internal.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
23 #include "pidgin.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
24 #include "debug.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
25 #include "prefs.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
26 #include "pidginstock.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
27 #include "gtkdocklet.h"
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
28
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
29 #define SHORT_EMBED_TIMEOUT 5
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
30 #define LONG_EMBED_TIMEOUT 15
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
31
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
32 /* globals */
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
33 static GtkStatusIcon *docklet = NULL;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
34 static guint embed_timeout = 0;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
35
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
36 /* protos */
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
37 static void docklet_gtk_status_create(gboolean);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
38
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
39 static gboolean
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
40 docklet_gtk_recreate_cb(gpointer data)
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
41 {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
42 docklet_gtk_status_create(TRUE);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
43
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
44 return FALSE;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
45 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
46
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
47 static gboolean
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
48 docklet_gtk_embed_timeout_cb(gpointer data)
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
49 {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
50 /* The docklet was not embedded within the timeout.
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
51 * Remove it as a visibility manager, but leave the plugin
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
52 * loaded so that it can embed automatically if/when a notification
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
53 * area becomes available.
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
54 */
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
55 purple_debug_info("docklet", "failed to embed within timeout\n");
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
56 pidgin_docklet_remove();
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
57
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
58 embed_timeout = 0;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
59 return FALSE;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
60 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
61
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
62 static gboolean
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
63 docklet_gtk_embedded_cb(GtkWidget *widget, gpointer data)
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
64 {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
65 if (embed_timeout) {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
66 purple_timeout_remove(embed_timeout);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
67 embed_timeout = 0;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
68 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
69
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
70 if (gtk_status_icon_is_embedded(docklet)) {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
71 purple_debug_info("docklet", "embedded\n");
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
72
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
73 pidgin_docklet_embedded();
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
74 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", TRUE);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
75 } else {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
76 purple_debug_info("docklet", "detached\n");
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
77
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
78 pidgin_docklet_remove();
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
79 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
80 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
81
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
82 return TRUE;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
83 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
84
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
85 static void
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
86 docklet_gtk_destroyed_cb(GtkWidget *widget, gpointer data)
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
87 {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
88 purple_debug_info("docklet", "destroyed\n");
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
89
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
90 pidgin_docklet_remove();
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
91
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
92 g_object_unref(G_OBJECT(docklet));
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
93 docklet = NULL;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
94
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
95 g_idle_add(docklet_gtk_recreate_cb, NULL);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
96 }
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
97
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
98 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
99 docklet_gtk_status_activated_cb(GtkStatusIcon *status_icon, gpointer user_data)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
100 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
101 pidgin_docklet_clicked(1);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
102 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
103
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
104 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
105 docklet_gtk_status_clicked_cb(GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
106 {
30517
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
107 purple_debug_info("docklet", "The button is %u\n", button);
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
108 #ifdef GDK_WINDOWING_QUARTZ
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
109 /* You can only click left mouse button on MacOSX native GTK. Let that be the menu */
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
110 pidgin_docklet_clicked(3);
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
111 #else
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
112 pidgin_docklet_clicked(button);
26c1c5069c28 GtkStatusIcon only exposes a single button press on a Mac for whatever
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30381
diff changeset
113 #endif
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
114 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
115
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
116 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
117 docklet_gtk_status_update_icon(PurpleStatusPrimitive status, gboolean connecting, gboolean pending)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
118 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
119 const gchar *icon_name = NULL;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
120
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
121 switch (status) {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
122 case PURPLE_STATUS_OFFLINE:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
123 icon_name = PIDGIN_STOCK_TRAY_OFFLINE;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
124 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
125 case PURPLE_STATUS_AWAY:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
126 icon_name = PIDGIN_STOCK_TRAY_AWAY;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
127 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
128 case PURPLE_STATUS_UNAVAILABLE:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
129 icon_name = PIDGIN_STOCK_TRAY_BUSY;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
130 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
131 case PURPLE_STATUS_EXTENDED_AWAY:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
132 icon_name = PIDGIN_STOCK_TRAY_XA;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
133 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
134 case PURPLE_STATUS_INVISIBLE:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
135 icon_name = PIDGIN_STOCK_TRAY_INVISIBLE;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
136 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
137 default:
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
138 icon_name = PIDGIN_STOCK_TRAY_AVAILABLE;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
139 break;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
140 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
141
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
142 if (pending)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
143 icon_name = PIDGIN_STOCK_TRAY_PENDING;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
144 if (connecting)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
145 icon_name = PIDGIN_STOCK_TRAY_CONNECT;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
146
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
147 if (icon_name) {
29717
87e124c52a47 Change lookup of docklet icons to use an 'icon name' instead of a stock
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29627
diff changeset
148 gtk_status_icon_set_from_icon_name(docklet, icon_name);
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
149 }
30372
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
150
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
151 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/blink")) {
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
152 gtk_status_icon_set_blinking(docklet, (pending && !connecting));
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
153 } else if (gtk_status_icon_get_blinking(docklet)) {
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
154 gtk_status_icon_set_blinking(docklet, FALSE);
fb0245b8c177 pidgin: Add charkins's patch for gtkstatusicon blinking. Fixes #11855
Paul Aurich <paul@darkrain42.org>
parents: 29802
diff changeset
155 }
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
156 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
157
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
158 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
159 docklet_gtk_status_set_tooltip(gchar *tooltip)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
160 {
31472
cd61b074103a This conditional is redundant, right?
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31471
diff changeset
161 gtk_status_icon_set_tooltip(docklet, tooltip);
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
162 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
163
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
164 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
165 docklet_gtk_status_position_menu(GtkMenu *menu,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
166 int *x, int *y, gboolean *push_in,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
167 gpointer user_data)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
168 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
169 gtk_status_icon_position_menu(menu, x, y, push_in, docklet);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
170 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
171
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
172 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
173 docklet_gtk_status_destroy(void)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
174 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
175 g_return_if_fail(docklet != NULL);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
176
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
177 pidgin_docklet_remove();
30381
23dbe381eb7a Set the GtkTrayIcon invisible before unref'ing it, or else it will leave
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30372
diff changeset
178
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
179 if (embed_timeout) {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
180 purple_timeout_remove(embed_timeout);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
181 embed_timeout = 0;
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
182 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
183
30381
23dbe381eb7a Set the GtkTrayIcon invisible before unref'ing it, or else it will leave
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30372
diff changeset
184 gtk_status_icon_set_visible(docklet, FALSE);
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
185 g_signal_handlers_disconnect_by_func(G_OBJECT(docklet), G_CALLBACK(docklet_gtk_destroyed_cb), NULL);
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
186 g_object_unref(G_OBJECT(docklet));
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
187 docklet = NULL;
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
188
29762
5a6c66d4de94 Make it slightly clearer which docklet is in use.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29717
diff changeset
189 purple_debug_info("docklet", "GTK+ destroyed\n");
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
190 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
191
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
192 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
193 docklet_gtk_status_create(gboolean recreate)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
194 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
195 if (docklet) {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
196 /* if this is being called when a tray icon exists, it's because
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
197 something messed up. try destroying it before we proceed,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
198 although docklet_refcount may be all hosed. hopefully won't happen. */
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
199 purple_debug_warning("docklet", "trying to create icon but it already exists?\n");
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
200 docklet_gtk_status_destroy();
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
201 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
202
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
203 docklet = gtk_status_icon_new();
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
204 g_return_if_fail(docklet != NULL);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
205
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
206 g_signal_connect(G_OBJECT(docklet), "activate", G_CALLBACK(docklet_gtk_status_activated_cb), NULL);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
207 g_signal_connect(G_OBJECT(docklet), "popup-menu", G_CALLBACK(docklet_gtk_status_clicked_cb), NULL);
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
208 g_signal_connect(G_OBJECT(docklet), "notify::embedded", G_CALLBACK(docklet_gtk_embedded_cb), NULL);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
209 g_signal_connect(G_OBJECT(docklet), "destroy", G_CALLBACK(docklet_gtk_destroyed_cb), NULL);
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
210
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
211 gtk_status_icon_set_visible(docklet, TRUE);
31471
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
212
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
213 /* This is a hack to avoid a race condition between the docklet getting
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
214 * embedded in the notification area and the gtkblist restoring its
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
215 * previous visibility state. If the docklet does not get embedded within
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
216 * the timeout, it will be removed as a visibility manager until it does
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
217 * get embedded. Ideally, we would only call docklet_embedded() when the
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
218 * icon was actually embedded. This only happens when the docklet is first
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
219 * created, not when being recreated.
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
220 *
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
221 * The gtk docklet tracks whether it successfully embedded in a pref and
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
222 * allows for a longer timeout period if it successfully embedded the last
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
223 * time it was run. This should hopefully solve problems with the buddy
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
224 * list not properly starting hidden when Pidgin is started on login.
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
225 */
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
226 if (!recreate) {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
227 pidgin_docklet_embedded();
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
228 if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded")) {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
229 embed_timeout = purple_timeout_add_seconds(LONG_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
230 } else {
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
231 embed_timeout = purple_timeout_add_seconds(SHORT_EMBED_TIMEOUT, docklet_gtk_embed_timeout_cb, NULL);
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
232 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
233 }
7fb5e60fd919 Re-implement the embedding timeout, so that the buddy list doesn't
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 30517
diff changeset
234
29762
5a6c66d4de94 Make it slightly clearer which docklet is in use.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29717
diff changeset
235 purple_debug_info("docklet", "GTK+ created\n");
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
236 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
237
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
238 static void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
239 docklet_gtk_status_create_ui_op(void)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
240 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
241 docklet_gtk_status_create(FALSE);
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
242 }
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
243
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
244 static struct docklet_ui_ops ui_ops =
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
245 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
246 docklet_gtk_status_create_ui_op,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
247 docklet_gtk_status_destroy,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
248 docklet_gtk_status_update_icon,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
249 NULL,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
250 docklet_gtk_status_set_tooltip,
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
251 docklet_gtk_status_position_menu
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
252 };
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
253
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
254 void
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
255 docklet_ui_init(void)
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
256 {
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
257 pidgin_docklet_set_ui_ops(&ui_ops);
29717
87e124c52a47 Change lookup of docklet icons to use an 'icon name' instead of a stock
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29627
diff changeset
258 gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(),
87e124c52a47 Change lookup of docklet icons to use an 'icon name' instead of a stock
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 29627
diff changeset
259 DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "pidgin" G_DIR_SEPARATOR_S "tray");
29627
6652fdb8baf5 Apparently, I only just imagined adding this file.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
diff changeset
260 }