annotate src/gtkmenutray.c @ 11652:a66ee70c614c

[gaim-migrate @ 13936] Whoops committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 13 Oct 2005 01:48:03 +0000
parents 767e3c0c5062
children c9188d3eb9d3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Gaim is the legal property of its developers, whose names are too numerous
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * to list here. Please refer to the COPYRIGHT file distributed with this
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * source distribution.
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 *
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * under the terms of the GNU General Public License as published by
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * (at your option) any later version.
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 *
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * GNU General Public License for more details.
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 *
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 */
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 #include "gtkmenutray.h"
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 * Enums
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 enum {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 PROP_ZERO = 0,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 PROP_BOX
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 };
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 * Globals
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 static GObjectClass *parent_class = NULL;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 * Internal Stuff
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 * Item Stuff
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 gaim_gtk_menu_tray_select(GtkItem *item) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 /* this may look like nothing, but it's really overriding the
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 * GtkMenuItem's select function so that it doesn't get highlighted like
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * a normal menu item would.
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 */
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 gaim_gtk_menu_tray_deselect(GtkItem *item) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 /* Probably not necessary, but I'd rather be safe than sorry. We're
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 * overridding the select, so it makes sense to override deselect as well.
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 */
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 * Widget Stuff
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 * Object Stuff
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 gaim_gtk_menu_tray_get_property(GObject *obj, guint param_id, GValue *value,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 GParamSpec *pspec)
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 GaimGtkMenuTray *menu_tray = GAIM_GTK_MENU_TRAY(obj);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 switch(param_id) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 case PROP_BOX:
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 g_value_set_object(value, gaim_gtk_menu_tray_get_box(menu_tray));
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 break;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 default:
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 break;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 gaim_gtk_menu_tray_finalize(GObject *obj) {
11599
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
82 #if 0
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
83 /* This _might_ be leaking, but I have a sneaking suspicion that the widget is
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
84 * getting destroyed in GtkContainer's finalize function. But if were are
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
85 * leaking here, be sure to figure out why this causes a crash.
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
86 * -- Gary
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
87 */
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
88 GaimGtkMenuTray *tray = GAIM_GTK_MENU_TRAY(obj);
11599
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
89
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
90 if(GTK_IS_WIDGET(tray->tray))
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
91 gtk_widget_destroy(GTK_WIDGET(tray->tray));
11599
767e3c0c5062 [gaim-migrate @ 13869]
Gary Kramlich <grim@reaperworld.com>
parents: 11558
diff changeset
92 #endif
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 G_OBJECT_CLASS(parent_class)->finalize(obj);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 gaim_gtk_menu_tray_class_init(GaimGtkMenuTrayClass *klass) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 GObjectClass *object_class = G_OBJECT_CLASS(klass);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 GtkItemClass *item_class = GTK_ITEM_CLASS(klass);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 GParamSpec *pspec;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 parent_class = g_type_class_peek_parent(klass);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 object_class->finalize = gaim_gtk_menu_tray_finalize;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 object_class->get_property = gaim_gtk_menu_tray_get_property;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 item_class->select = gaim_gtk_menu_tray_select;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 item_class->deselect = gaim_gtk_menu_tray_deselect;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 pspec = g_param_spec_object("box", "The box",
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 "The box",
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 GTK_TYPE_BOX,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 G_PARAM_READABLE);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 g_object_class_install_property(object_class, PROP_BOX, pspec);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 static void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 gaim_gtk_menu_tray_init(GaimGtkMenuTray *menu_tray) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 gtk_menu_item_set_right_justified(GTK_MENU_ITEM(menu_tray), TRUE);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
122 if(!GTK_IS_WIDGET(menu_tray->tray))
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
123 menu_tray->tray = gtk_hbox_new(FALSE, 0);
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
125 gtk_container_add(GTK_CONTAINER(menu_tray), menu_tray->tray);
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
127 gtk_widget_show(menu_tray->tray);
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 /******************************************************************************
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 * API
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 *****************************************************************************/
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 GType
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 gaim_gtk_menu_tray_get_gtype(void) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 static GType type = 0;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 if(type == 0) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 static const GTypeInfo info = {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 sizeof(GaimGtkMenuTrayClass),
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 NULL,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 NULL,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 (GClassInitFunc)gaim_gtk_menu_tray_class_init,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 NULL,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 NULL,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145 sizeof(GaimGtkMenuTray),
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 0,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 (GInstanceInitFunc)gaim_gtk_menu_tray_init,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 NULL
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
149 };
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
150
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 type = g_type_register_static(GTK_TYPE_MENU_ITEM,
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152 "GaimGtkMenuTray",
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 &info, 0);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 return type;
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 GtkWidget *
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160 gaim_gtk_menu_tray_new() {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 return g_object_new(GAIM_GTK_TYPE_MENU_TRAY, NULL);
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 GtkWidget *
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165 gaim_gtk_menu_tray_get_box(GaimGtkMenuTray *menu_tray) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 g_return_val_if_fail(GAIM_GTK_IS_MENU_TRAY(menu_tray), NULL);
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
167 return menu_tray->tray;
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 gaim_gtk_menu_tray_append(GaimGtkMenuTray *menu_tray, GtkWidget *widget) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 g_return_if_fail(GAIM_GTK_IS_MENU_TRAY(menu_tray));
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 g_return_if_fail(GTK_IS_WIDGET(widget));
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
175 gtk_box_pack_end(GTK_BOX(menu_tray->tray), widget, FALSE, FALSE, 0);
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
176 }
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
177
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
178 void
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
179 gaim_gtk_menu_tray_prepend(GaimGtkMenuTray *menu_tray, GtkWidget *widget) {
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
180 g_return_if_fail(GAIM_GTK_IS_MENU_TRAY(menu_tray));
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
181 g_return_if_fail(GTK_IS_WIDGET(widget));
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
182
11558
19941a47405c [gaim-migrate @ 13820]
Sean Egan <seanegan@gmail.com>
parents: 11553
diff changeset
183 gtk_box_pack_start(GTK_BOX(menu_tray->tray), widget, FALSE, FALSE, 0);
11553
5c8210f7cbe2 [gaim-migrate @ 13813]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
184 }