Mercurial > pidgin
annotate finch/libgnt/gntmenuitemcheck.c @ 29920:a4662fd44a7e
gg: Fix 05793e8aa in a way that is upstream-able
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Thu, 13 May 2010 02:58:31 +0000 |
parents | 88d889b54df4 |
children |
rev | line source |
---|---|
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
1 /** |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
2 * GNT - The GLib Ncurses Toolkit |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
3 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
4 * GNT is the legal property of its developers, whose names are too numerous |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
6 * source distribution. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
7 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
8 * This library is free software; you can redistribute it and/or modify |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
11 * (at your option) any later version. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
12 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
16 * GNU General Public License for more details. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
17 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17928
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
17928
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
21 */ |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15928
diff
changeset
|
22 |
28836
88d889b54df4
Fix building finch & libgnt using older gcc or non-gcc compilers that do
Stu Tomlinson <stu@nosnilmot.com>
parents:
19681
diff
changeset
|
23 #include "gntinternal.h" |
15817 | 24 #include "gntmenuitemcheck.h" |
25 | |
26 static GntMenuItemClass *parent_class = NULL; | |
27 | |
28 static void | |
29 gnt_menuitem_check_class_init(GntMenuItemCheckClass *klass) | |
30 { | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
31 parent_class = GNT_MENU_ITEM_CLASS(klass); |
15817 | 32 |
33 GNTDEBUG; | |
34 } | |
35 | |
36 static void | |
37 gnt_menuitem_check_init(GTypeInstance *instance, gpointer class) | |
38 { | |
39 GNTDEBUG; | |
40 } | |
41 | |
42 /****************************************************************************** | |
43 * GntMenuItemCheck API | |
44 *****************************************************************************/ | |
45 GType | |
46 gnt_menuitem_check_get_gtype(void) | |
47 { | |
48 static GType type = 0; | |
49 | |
50 if(type == 0) | |
51 { | |
52 static const GTypeInfo info = { | |
53 sizeof(GntMenuItemCheckClass), | |
54 NULL, /* base_init */ | |
55 NULL, /* base_finalize */ | |
56 (GClassInitFunc)gnt_menuitem_check_class_init, | |
57 NULL, /* class_finalize */ | |
58 NULL, /* class_data */ | |
59 sizeof(GntMenuItemCheck), | |
60 0, /* n_preallocs */ | |
61 gnt_menuitem_check_init, /* instance_init */ | |
62 NULL /* value_table */ | |
63 }; | |
64 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
65 type = g_type_register_static(GNT_TYPE_MENU_ITEM, |
15817 | 66 "GntMenuItemCheck", |
67 &info, 0); | |
68 } | |
69 | |
70 return type; | |
71 } | |
72 | |
73 GntMenuItem *gnt_menuitem_check_new(const char *text) | |
74 { | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
75 GntMenuItem *item = g_object_new(GNT_TYPE_MENU_ITEM_CHECK, NULL); |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
76 GntMenuItem *menuitem = GNT_MENU_ITEM(item); |
15817 | 77 |
78 menuitem->text = g_strdup(text); | |
79 return item; | |
80 } | |
81 | |
82 gboolean gnt_menuitem_check_get_checked(GntMenuItemCheck *item) | |
83 { | |
84 return item->checked; | |
85 } | |
86 | |
87 void gnt_menuitem_check_set_checked(GntMenuItemCheck *item, gboolean set) | |
88 { | |
89 item->checked = set; | |
90 } | |
91 |