Wed, 20 Jun 2018 02:13:44 -0400
prefs: Add binding versions of pref widget functions.
These just bind settings to existing widgets and copy the saved value to
the widget, except for combos which are produced from runtime lists.
Those are populated in a similar way as before.
There are some extra _bind_ words that will probably be dropped once the
other functions are unused.
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1 | /* |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
2 | * purple |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
3 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too numerous |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
6 | * source distribution. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
7 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
11 | * (at your option) any later version. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
12 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
17 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
21 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
22 | */ |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
23 | #include "internal.h" |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
24 | #include "glibcompat.h" |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
25 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
26 | #define PURPLE_BLIST_NODE_GET_PRIVATE(obj) \ |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
27 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_BLIST_NODE, PurpleBlistNodePrivate)) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
28 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
29 | typedef struct _PurpleBlistNodePrivate PurpleBlistNodePrivate; |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
30 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35085
diff
changeset
|
31 | /* Private data of a buddy list node */ |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
32 | struct _PurpleBlistNodePrivate { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35085
diff
changeset
|
33 | GHashTable *settings; /* per-node settings */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35085
diff
changeset
|
34 | gboolean transient; /* node should not be saved with the buddy list */ |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
35 | }; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
36 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
37 | /* Blist node property enums */ |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
38 | enum |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
39 | { |
|
34722
32e636146d3f
Added PurpleCountingNode to blistnodes.[ch]. PurpleContact and PurpleGroup inherit PurpleCountingNode.
Ankit Vani <a@nevitus.org>
parents:
34713
diff
changeset
|
40 | BLNODE_PROP_0, |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
35005
diff
changeset
|
41 | BLNODE_PROP_TRANSIENT, |
|
34722
32e636146d3f
Added PurpleCountingNode to blistnodes.[ch]. PurpleContact and PurpleGroup inherit PurpleCountingNode.
Ankit Vani <a@nevitus.org>
parents:
34713
diff
changeset
|
42 | BLNODE_PROP_LAST |
|
32e636146d3f
Added PurpleCountingNode to blistnodes.[ch]. PurpleContact and PurpleGroup inherit PurpleCountingNode.
Ankit Vani <a@nevitus.org>
parents:
34713
diff
changeset
|
43 | }; |
|
32e636146d3f
Added PurpleCountingNode to blistnodes.[ch]. PurpleContact and PurpleGroup inherit PurpleCountingNode.
Ankit Vani <a@nevitus.org>
parents:
34713
diff
changeset
|
44 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
45 | static GObjectClass *parent_class; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
46 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
47 | static GParamSpec *bn_properties[BLNODE_PROP_LAST]; |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
48 | |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
49 | /**************************************************************************/ |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
50 | /* Buddy list node API */ |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
51 | /**************************************************************************/ |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
52 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
53 | static PurpleBlistNode *get_next_node(PurpleBlistNode *node, gboolean godeep) |
|
34713
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
54 | { |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
55 | if (node == NULL) |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
56 | return NULL; |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
57 | |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
58 | if (godeep && node->child) |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
59 | return node->child; |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
60 | |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
61 | if (node->next) |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
62 | return node->next; |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
63 | |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
64 | return get_next_node(node->parent, FALSE); |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
65 | } |
|
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
66 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
67 | PurpleBlistNode *purple_blist_node_next(PurpleBlistNode *node, gboolean offline) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
68 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
69 | PurpleBlistNode *ret = node; |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
70 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
71 | if (offline) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
72 | return get_next_node(ret, TRUE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
73 | do |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
74 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
75 | ret = get_next_node(ret, TRUE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
76 | } while (ret && PURPLE_IS_BUDDY(ret) && |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
77 | !purple_account_is_connected(purple_buddy_get_account((PurpleBuddy *)ret))); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
78 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
79 | return ret; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
80 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
81 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
82 | PurpleBlistNode *purple_blist_node_get_parent(PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
83 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
84 | return node ? node->parent : NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
85 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
86 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
87 | PurpleBlistNode *purple_blist_node_get_first_child(PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
88 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
89 | return node ? node->child : NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
90 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
91 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
92 | PurpleBlistNode *purple_blist_node_get_sibling_next(PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
93 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
94 | return node? node->next : NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
95 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
96 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
97 | PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
98 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
99 | return node? node->prev : NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
100 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
101 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
102 | void * |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
103 | purple_blist_node_get_ui_data(const PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
104 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34865
diff
changeset
|
105 | g_return_val_if_fail(PURPLE_IS_BLIST_NODE(node), NULL); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
106 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
107 | return node->ui_data; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
108 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
109 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
110 | void |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
111 | purple_blist_node_set_ui_data(PurpleBlistNode *node, void *ui_data) { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34865
diff
changeset
|
112 | g_return_if_fail(PURPLE_IS_BLIST_NODE(node)); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
113 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
114 | node->ui_data = ui_data; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
115 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
116 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
117 | void purple_blist_node_remove_setting(PurpleBlistNode *node, const char *key) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
118 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
119 | PurpleBlistUiOps *ops; |
|
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
120 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
121 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
122 | g_return_if_fail(priv != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
123 | g_return_if_fail(priv->settings != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
124 | g_return_if_fail(key != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
125 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
126 | g_hash_table_remove(priv->settings, key); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
127 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
128 | ops = purple_blist_get_ui_ops(); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
129 | if (ops && ops->save_node) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
130 | ops->save_node(node); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
131 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
132 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
133 | void |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
134 | purple_blist_node_set_transient(PurpleBlistNode *node, gboolean transient) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
135 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
136 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
137 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
138 | g_return_if_fail(priv != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
139 | |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
140 | priv->transient = transient; |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
35005
diff
changeset
|
141 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
142 | g_object_notify_by_pspec(G_OBJECT(node), |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
143 | bn_properties[BLNODE_PROP_TRANSIENT]); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
144 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
145 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
146 | gboolean |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
147 | purple_blist_node_is_transient(PurpleBlistNode *node) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
148 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
149 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
150 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
151 | g_return_val_if_fail(priv != NULL, 0); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
152 | |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
153 | return priv->transient; |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
154 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
155 | |
| 34730 | 156 | GHashTable * |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
157 | purple_blist_node_get_settings(PurpleBlistNode *node) |
| 34730 | 158 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
159 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
| 34730 | 160 | |
| 161 | g_return_val_if_fail(priv != NULL, NULL); | |
| 162 | ||
| 163 | return priv->settings; | |
| 164 | } | |
| 165 | ||
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
166 | gboolean |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
167 | purple_blist_node_has_setting(PurpleBlistNode* node, const char *key) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
168 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
169 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
170 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
171 | g_return_val_if_fail(priv != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
172 | g_return_val_if_fail(priv->settings != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
173 | g_return_val_if_fail(key != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
174 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
175 | /* Boxed type, so it won't ever be NULL, so no need for _extended */ |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
176 | return (g_hash_table_lookup(priv->settings, key) != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
177 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
178 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
179 | void |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
180 | purple_blist_node_set_bool(PurpleBlistNode* node, const char *key, gboolean data) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
181 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
182 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
183 | PurpleBlistUiOps *ops; |
|
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
184 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
185 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
186 | g_return_if_fail(priv != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
187 | g_return_if_fail(priv->settings != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
188 | g_return_if_fail(key != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
189 | |
|
35005
bff56dfca65d
Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
190 | value = purple_value_new(G_TYPE_BOOLEAN); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
191 | g_value_set_boolean(value, data); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
192 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
193 | g_hash_table_replace(priv->settings, g_strdup(key), value); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
194 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
195 | ops = purple_blist_get_ui_ops(); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
196 | if (ops && ops->save_node) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
197 | ops->save_node(node); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
198 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
199 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
200 | gboolean |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
201 | purple_blist_node_get_bool(PurpleBlistNode* node, const char *key) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
202 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
203 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
204 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
205 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
206 | g_return_val_if_fail(priv != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
207 | g_return_val_if_fail(priv->settings != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
208 | g_return_val_if_fail(key != NULL, FALSE); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
209 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
210 | value = g_hash_table_lookup(priv->settings, key); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
211 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
212 | if (value == NULL) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
213 | return FALSE; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
214 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
215 | g_return_val_if_fail(G_VALUE_HOLDS_BOOLEAN(value), FALSE); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
216 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
217 | return g_value_get_boolean(value); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
218 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
219 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
220 | void |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
221 | purple_blist_node_set_int(PurpleBlistNode* node, const char *key, int data) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
222 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
223 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
224 | PurpleBlistUiOps *ops; |
|
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
225 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
226 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
227 | g_return_if_fail(priv != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
228 | g_return_if_fail(priv->settings != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
229 | g_return_if_fail(key != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
230 | |
|
35005
bff56dfca65d
Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
231 | value = purple_value_new(G_TYPE_INT); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
232 | g_value_set_int(value, data); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
233 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
234 | g_hash_table_replace(priv->settings, g_strdup(key), value); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
235 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
236 | ops = purple_blist_get_ui_ops(); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
237 | if (ops && ops->save_node) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
238 | ops->save_node(node); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
239 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
240 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
241 | int |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
242 | purple_blist_node_get_int(PurpleBlistNode* node, const char *key) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
243 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
244 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
245 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
246 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
247 | g_return_val_if_fail(priv != NULL, 0); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
248 | g_return_val_if_fail(priv->settings != NULL, 0); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
249 | g_return_val_if_fail(key != NULL, 0); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
250 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
251 | value = g_hash_table_lookup(priv->settings, key); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
252 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
253 | if (value == NULL) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
254 | return 0; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
255 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
256 | g_return_val_if_fail(G_VALUE_HOLDS_INT(value), 0); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
257 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
258 | return g_value_get_int(value); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
259 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
260 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
261 | void |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
262 | purple_blist_node_set_string(PurpleBlistNode* node, const char *key, const char *data) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
263 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
264 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
265 | PurpleBlistUiOps *ops; |
|
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
266 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
267 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
268 | g_return_if_fail(priv != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
269 | g_return_if_fail(priv->settings != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
270 | g_return_if_fail(key != NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
271 | |
|
35005
bff56dfca65d
Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
272 | value = purple_value_new(G_TYPE_STRING); |
|
34713
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
273 | g_value_set_string(value, data); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
274 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
275 | g_hash_table_replace(priv->settings, g_strdup(key), value); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
276 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
277 | ops = purple_blist_get_ui_ops(); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
278 | if (ops && ops->save_node) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
279 | ops->save_node(node); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
280 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
281 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
282 | const char * |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
283 | purple_blist_node_get_string(PurpleBlistNode* node, const char *key) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
284 | { |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
285 | GValue *value; |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
286 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(node); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
287 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
288 | g_return_val_if_fail(priv != NULL, NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
289 | g_return_val_if_fail(priv->settings != NULL, NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
290 | g_return_val_if_fail(key != NULL, NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
291 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
292 | value = g_hash_table_lookup(priv->settings, key); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
293 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
294 | if (value == NULL) |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
295 | return NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
296 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
297 | g_return_val_if_fail(G_VALUE_HOLDS_STRING(value), NULL); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
298 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
299 | return g_value_get_string(value); |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
300 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
301 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
302 | GList * |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
303 | purple_blist_node_get_extended_menu(PurpleBlistNode *n) |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
304 | { |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
305 | GList *menu = NULL; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
306 | |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
307 | g_return_val_if_fail(n != NULL, NULL); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
308 | |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
309 | purple_signal_emit(purple_blist_get_handle(), "blist-node-extended-menu", |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
310 | n, &menu); |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
311 | return menu; |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
312 | } |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
313 | |
|
34713
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
314 | /************************************************************************** |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
315 | * GObject code for PurpleBlistNode |
|
34713
e4fc06261814
GObjectified PurpleBListNode source
Ankit Vani <a@nevitus.org>
parents:
34712
diff
changeset
|
316 | **************************************************************************/ |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
317 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
318 | /* Set method for GObject properties */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
319 | static void |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
320 | purple_blist_node_set_property(GObject *obj, guint param_id, const GValue *value, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
321 | GParamSpec *pspec) |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
322 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
323 | PurpleBlistNode *node = PURPLE_BLIST_NODE(obj); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
324 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
325 | switch (param_id) { |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
35005
diff
changeset
|
326 | case BLNODE_PROP_TRANSIENT: |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
327 | purple_blist_node_set_transient(node, g_value_get_boolean(value)); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
328 | break; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
329 | default: |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
330 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
331 | break; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
332 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
333 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
334 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
335 | /* Get method for GObject properties */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
336 | static void |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
337 | purple_blist_node_get_property(GObject *obj, guint param_id, GValue *value, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
338 | GParamSpec *pspec) |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
339 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
340 | PurpleBlistNode *node = PURPLE_BLIST_NODE(obj); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
341 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
342 | switch (param_id) { |
|
35010
9c2d352b1d96
Cleaned up properties and added g_object_notify calls for PurpleAccount and PurpleBlistNodes
Ankit Vani <a@nevitus.org>
parents:
35005
diff
changeset
|
343 | case BLNODE_PROP_TRANSIENT: |
|
34865
764a33b41ac7
Renamed blist node's dont_save to transient.
Ankit Vani <a@nevitus.org>
parents:
34864
diff
changeset
|
344 | g_value_set_boolean(value, purple_blist_node_is_transient(node)); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
345 | break; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
346 | default: |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
347 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
348 | break; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
349 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
350 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
351 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
352 | /* GObject initialization function */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
353 | static void |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
354 | purple_blist_node_init(GTypeInstance *instance, gpointer klass) |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
355 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
356 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(instance); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
357 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
358 | priv->settings = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
|
35005
bff56dfca65d
Renamed purple_g_value_* to purple_value_*
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
359 | (GDestroyNotify)purple_value_free); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
360 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
361 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
362 | /* GObject finalize function */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
363 | static void |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
364 | purple_blist_node_finalize(GObject *object) |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
365 | { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
366 | PurpleBlistNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(object); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
367 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
368 | g_hash_table_destroy(priv->settings); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
369 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
370 | parent_class->finalize(object); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
371 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
372 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
373 | /* Class initializer function */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
374 | static void |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
375 | purple_blist_node_class_init(PurpleBlistNodeClass *klass) |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
376 | { |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
377 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
378 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
379 | parent_class = g_type_class_peek_parent(klass); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
380 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
381 | obj_class->finalize = purple_blist_node_finalize; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
382 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
383 | /* Setup properties */ |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
384 | obj_class->get_property = purple_blist_node_get_property; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
385 | obj_class->set_property = purple_blist_node_set_property; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
386 | |
|
35085
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
387 | g_type_class_add_private(klass, sizeof(PurpleBlistNodePrivate)); |
|
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
388 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
389 | bn_properties[BLNODE_PROP_TRANSIENT] = g_param_spec_boolean("transient", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
390 | "Transient", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35010
diff
changeset
|
391 | "Whether node should not be saved with the buddy list.", |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
392 | FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
393 | |
|
35085
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
394 | g_object_class_install_properties(obj_class, BLNODE_PROP_LAST, |
|
abab0adfa0ec
libpurple: use g_object_class_install_properties instead of repeated g_object_class_install_property
Ankit Vani <a@nevitus.org>
parents:
35080
diff
changeset
|
395 | bn_properties); |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
396 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
397 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
398 | GType |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
399 | purple_blist_node_get_type(void) |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
400 | { |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
401 | static GType type = 0; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
402 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
403 | if(type == 0) { |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
404 | static const GTypeInfo info = { |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
405 | sizeof(PurpleBlistNodeClass), |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
406 | NULL, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
407 | NULL, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
408 | (GClassInitFunc)purple_blist_node_class_init, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
409 | NULL, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
410 | NULL, |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
411 | sizeof(PurpleBlistNode), |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
412 | 0, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
413 | (GInstanceInitFunc)purple_blist_node_init, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
414 | NULL, |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
415 | }; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
416 | |
|
34864
0e292d8887de
Renamed PurpleBListNode back to PurpleBlistNode
Ankit Vani <a@nevitus.org>
parents:
34852
diff
changeset
|
417 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleBlistNode", |
|
34712
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
418 | &info, G_TYPE_FLAG_ABSTRACT); |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
419 | } |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
420 | |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
421 | return type; |
|
caeb3904c991
Added GObject code to PurpleBListNode. Changed blist node setting value from PurpleValue to GValue.
Ankit Vani <a@nevitus.org>
parents:
34709
diff
changeset
|
422 | } |
|
34722
32e636146d3f
Added PurpleCountingNode to blistnodes.[ch]. PurpleContact and PurpleGroup inherit PurpleCountingNode.
Ankit Vani <a@nevitus.org>
parents:
34713
diff
changeset
|
423 |