Thu, 06 Feb 2014 17:25:40 +0530
Convert some other doxygen-type comments
| 11475 | 1 | /* |
| 15884 | 2 | * purple |
| 11475 | 3 | * |
| 15884 | 4 | * Purple is the legal property of its developers, whose names are too numerous |
| 11475 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
| 7 | * | |
| 8 | * This program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18265
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11475 | 21 | * |
| 22 | */ | |
| 23 | ||
|
18265
9f26190d7f46
Move the define in internal.h instead.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15884
diff
changeset
|
24 | #include "internal.h" |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
25 | #include "glibcompat.h" |
| 11475 | 26 | #include "whiteboard.h" |
| 27 | #include "prpl.h" | |
| 28 | ||
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
29 | #define PURPLE_WHITEBOARD_GET_PRIVATE(obj) \ |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
30 | (G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_WHITEBOARD, PurpleWhiteboardPrivate)) |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
31 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
32 | typedef struct _PurpleWhiteboardPrivate PurpleWhiteboardPrivate; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
33 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
34 | /* Private data for a whiteboard */ |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
35 | struct _PurpleWhiteboardPrivate |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
36 | { |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
37 | int state; /* State of whiteboard session */ |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
38 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
39 | PurpleAccount *account; /* Account associated with this session */ |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
40 | char *who; /* Name of the remote user */ |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
41 | |
| 35097 | 42 | /* TODO Remove this and use protocol-specific subclasses. */ |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
43 | void *proto_data; /* Protocol specific data */ |
| 35097 | 44 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
45 | PurpleWhiteboardPrplOps *prpl_ops; /* Protocol-plugin operations */ |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
46 | |
|
35470
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
47 | GList *draw_list; /* List of drawing elements/deltas to |
|
8ee08a41f2f3
Convert some other doxygen-type comments
Ankit Vani <a@nevitus.org>
parents:
35102
diff
changeset
|
48 | send */ |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
49 | }; |
|
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
50 | |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
51 | /* GObject Property enums */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
52 | enum |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
53 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
54 | PROP_0, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
55 | PROP_STATE, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
56 | PROP_ACCOUNT, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
57 | PROP_WHO, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
58 | PROP_DRAW_LIST, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
59 | PROP_LAST |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
60 | }; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
61 | |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
62 | /****************************************************************************** |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
63 | * Globals |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
64 | *****************************************************************************/ |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
65 | static GObjectClass *parent_class; |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
66 | static GParamSpec *properties[PROP_LAST]; |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
67 | |
| 15884 | 68 | static PurpleWhiteboardUiOps *whiteboard_ui_ops = NULL; |
| 69 | /* static PurpleWhiteboardPrplOps *whiteboard_prpl_ops = NULL; */ | |
| 11475 | 70 | |
|
35102
ef8014abe867
Rename a camel case var to not be camel case.
Mark Doliner <mark@kingant.net>
parents:
35097
diff
changeset
|
71 | static GList *wb_list = NULL; |
| 11475 | 72 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
73 | /*static gboolean auto_accept = TRUE; */ |
| 11475 | 74 | |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
75 | /****************************************************************************** |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
76 | * API |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
77 | *****************************************************************************/ |
| 15884 | 78 | void purple_whiteboard_set_ui_ops(PurpleWhiteboardUiOps *ops) |
| 11475 | 79 | { |
| 80 | whiteboard_ui_ops = ops; | |
| 81 | } | |
| 82 | ||
| 15884 | 83 | void purple_whiteboard_set_prpl_ops(PurpleWhiteboard *wb, PurpleWhiteboardPrplOps *ops) |
| 11475 | 84 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
85 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
86 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
87 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
88 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
89 | priv->prpl_ops = ops; |
| 11475 | 90 | } |
| 91 | ||
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
92 | PurpleAccount *purple_whiteboard_get_account(const PurpleWhiteboard *wb) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
93 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
94 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
95 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
96 | g_return_val_if_fail(priv != NULL, NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
97 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
98 | return priv->account; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
99 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
100 | |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
101 | const char *purple_whiteboard_get_who(const PurpleWhiteboard *wb) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
102 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
103 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
104 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
105 | g_return_val_if_fail(priv != NULL, NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
106 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
107 | return priv->who; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
108 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
109 | |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
110 | void purple_whiteboard_set_state(PurpleWhiteboard *wb, int state) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
111 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
112 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
113 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
114 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
115 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
116 | priv->state = state; |
|
35013
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
117 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
118 | g_object_notify_by_pspec(G_OBJECT(wb), properties[PROP_STATE]); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
119 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
120 | |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
121 | int purple_whiteboard_get_state(const PurpleWhiteboard *wb) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
122 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
123 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
124 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
125 | g_return_val_if_fail(priv != NULL, -1); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
126 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
127 | return priv->state; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
128 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
129 | |
| 15884 | 130 | void purple_whiteboard_start(PurpleWhiteboard *wb) |
| 11475 | 131 | { |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
132 | /* Create frontend for whiteboard */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
133 | if(whiteboard_ui_ops && whiteboard_ui_ops->create) |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
134 | whiteboard_ui_ops->create(wb); |
| 11475 | 135 | } |
| 136 | ||
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
137 | /* Looks through the list of whiteboard sessions for one that is between |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
138 | * usernames 'me' and 'who'. Returns a pointer to a matching whiteboard |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
139 | * session; if none match, it returns NULL. |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
140 | */ |
| 15884 | 141 | PurpleWhiteboard *purple_whiteboard_get_session(const PurpleAccount *account, const char *who) |
| 11475 | 142 | { |
| 15884 | 143 | PurpleWhiteboard *wb; |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
144 | PurpleWhiteboardPrivate *priv; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
145 | |
|
35102
ef8014abe867
Rename a camel case var to not be camel case.
Mark Doliner <mark@kingant.net>
parents:
35097
diff
changeset
|
146 | GList *l = wb_list; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
147 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
148 | /* Look for a whiteboard session between the local user and the remote user |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
149 | */ |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
150 | while(l != NULL) |
| 11475 | 151 | { |
| 152 | wb = l->data; | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
153 | priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
154 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
155 | if(priv->account == account && purple_strequal(priv->who, who)) |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
156 | return wb; |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
157 | |
|
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
158 | l = l->next; |
| 11475 | 159 | } |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
160 | |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
161 | return NULL; |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
162 | } |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
163 | |
| 15884 | 164 | void purple_whiteboard_draw_list_destroy(GList *draw_list) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
165 | { |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
13419
diff
changeset
|
166 | g_list_free(draw_list); |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
167 | } |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
168 | |
| 15884 | 169 | gboolean purple_whiteboard_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
170 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
171 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
172 | PurpleWhiteboardPrplOps *prpl_ops; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
173 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
174 | g_return_val_if_fail(priv != NULL, FALSE); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
175 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
176 | prpl_ops = priv->prpl_ops; |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
177 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
178 | if (prpl_ops && prpl_ops->get_dimensions) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
179 | { |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
180 | prpl_ops->get_dimensions(wb, width, height); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
181 | return TRUE; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
182 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
183 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
184 | return FALSE; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
185 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
186 | |
| 15884 | 187 | void purple_whiteboard_set_dimensions(PurpleWhiteboard *wb, int width, int height) |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
188 | { |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
189 | if(whiteboard_ui_ops && whiteboard_ui_ops->set_dimensions) |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
190 | whiteboard_ui_ops->set_dimensions(wb, width, height); |
| 11475 | 191 | } |
| 192 | ||
| 15884 | 193 | void purple_whiteboard_send_draw_list(PurpleWhiteboard *wb, GList *list) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
194 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
195 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
196 | PurpleWhiteboardPrplOps *prpl_ops; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
197 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
198 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
199 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
200 | prpl_ops = priv->prpl_ops; |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
201 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
202 | if (prpl_ops && prpl_ops->send_draw_list) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
203 | prpl_ops->send_draw_list(wb, list); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
204 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
205 | |
| 15884 | 206 | void purple_whiteboard_draw_point(PurpleWhiteboard *wb, int x, int y, int color, int size) |
| 11475 | 207 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
208 | if(whiteboard_ui_ops && whiteboard_ui_ops->draw_point) |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
209 | whiteboard_ui_ops->draw_point(wb, x, y, color, size); |
| 11475 | 210 | } |
| 211 | ||
| 15884 | 212 | void purple_whiteboard_draw_line(PurpleWhiteboard *wb, int x1, int y1, int x2, int y2, int color, int size) |
| 11475 | 213 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
214 | if(whiteboard_ui_ops && whiteboard_ui_ops->draw_line) |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
215 | whiteboard_ui_ops->draw_line(wb, x1, y1, x2, y2, color, size); |
| 11475 | 216 | } |
| 217 | ||
| 15884 | 218 | void purple_whiteboard_clear(PurpleWhiteboard *wb) |
| 11475 | 219 | { |
|
11914
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
220 | if(whiteboard_ui_ops && whiteboard_ui_ops->clear) |
|
81ac838f3824
[gaim-migrate @ 14205]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11802
diff
changeset
|
221 | whiteboard_ui_ops->clear(wb); |
| 11475 | 222 | } |
| 223 | ||
| 15884 | 224 | void purple_whiteboard_send_clear(PurpleWhiteboard *wb) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
225 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
226 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
227 | PurpleWhiteboardPrplOps *prpl_ops; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
228 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
229 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
230 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
231 | prpl_ops = priv->prpl_ops; |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
232 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
233 | if (prpl_ops && prpl_ops->clear) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
234 | prpl_ops->clear(wb); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
235 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
236 | |
| 15884 | 237 | void purple_whiteboard_send_brush(PurpleWhiteboard *wb, int size, int color) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
238 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
239 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
240 | PurpleWhiteboardPrplOps *prpl_ops; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
241 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
242 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
243 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
244 | prpl_ops = priv->prpl_ops; |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
245 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
246 | if (prpl_ops && prpl_ops->set_brush) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
247 | prpl_ops->set_brush(wb, size, color); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
248 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
249 | |
| 15884 | 250 | gboolean purple_whiteboard_get_brush(const PurpleWhiteboard *wb, int *size, int *color) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
251 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
252 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
253 | PurpleWhiteboardPrplOps *prpl_ops; |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
254 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
255 | g_return_val_if_fail(priv != NULL, FALSE); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
256 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
257 | prpl_ops = priv->prpl_ops; |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
258 | |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
259 | if (prpl_ops && prpl_ops->get_brush) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
260 | { |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
261 | prpl_ops->get_brush(wb, size, color); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
262 | return TRUE; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
263 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
264 | return FALSE; |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
265 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
266 | |
| 15884 | 267 | void purple_whiteboard_set_brush(PurpleWhiteboard *wb, int size, int color) |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
268 | { |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
269 | if (whiteboard_ui_ops && whiteboard_ui_ops->set_brush) |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
270 | whiteboard_ui_ops->set_brush(wb, size, color); |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
271 | } |
|
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
272 | |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
273 | GList *purple_whiteboard_get_draw_list(const PurpleWhiteboard *wb) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
274 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
275 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
276 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
277 | g_return_val_if_fail(priv != NULL, NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
278 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
279 | return priv->draw_list; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
280 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
281 | |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
282 | void purple_whiteboard_set_draw_list(PurpleWhiteboard *wb, GList* draw_list) |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
283 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
284 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
285 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
286 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
287 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
288 | priv->draw_list = draw_list; |
|
35013
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
289 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
290 | g_object_notify_by_pspec(G_OBJECT(wb), properties[PROP_DRAW_LIST]); |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
291 | } |
|
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
292 | |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
293 | void purple_whiteboard_set_protocol_data(PurpleWhiteboard *wb, gpointer proto_data) |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
294 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
295 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
296 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
297 | g_return_if_fail(priv != NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
298 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
299 | priv->proto_data = proto_data; |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
300 | } |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
301 | |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
302 | gpointer purple_whiteboard_get_protocol_data(const PurpleWhiteboard *wb) |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
303 | { |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
304 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
305 | |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
306 | g_return_val_if_fail(priv != NULL, NULL); |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
307 | |
|
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
308 | return priv->proto_data; |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
309 | } |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
310 | |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
311 | void purple_whiteboard_set_ui_data(PurpleWhiteboard *wb, gpointer ui_data) |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
312 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34939
diff
changeset
|
313 | g_return_if_fail(PURPLE_IS_WHITEBOARD(wb)); |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
314 | |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
315 | wb->ui_data = ui_data; |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
316 | } |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
317 | |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
318 | gpointer purple_whiteboard_get_ui_data(const PurpleWhiteboard *wb) |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
319 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34939
diff
changeset
|
320 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(wb), NULL); |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
321 | |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
322 | return wb->ui_data; |
|
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
323 | } |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
324 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
325 | /****************************************************************************** |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
326 | * GObject code |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
327 | *****************************************************************************/ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
328 | /* Set method for GObject properties */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
329 | static void |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
330 | purple_whiteboard_set_property(GObject *obj, guint param_id, const GValue *value, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
331 | GParamSpec *pspec) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
332 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
333 | PurpleWhiteboard *wb = PURPLE_WHITEBOARD(obj); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
334 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
335 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
336 | switch (param_id) { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
337 | case PROP_STATE: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
338 | purple_whiteboard_set_state(wb, g_value_get_int(value)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
339 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
340 | case PROP_ACCOUNT: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
341 | priv->account = g_value_get_object(value); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
342 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
343 | case PROP_WHO: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
344 | priv->who = g_strdup(g_value_get_string(value)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
345 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
346 | case PROP_DRAW_LIST: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
347 | purple_whiteboard_set_draw_list(wb, g_value_get_pointer(value)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
348 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
349 | default: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
350 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
351 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
352 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
353 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
354 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
355 | /* Get method for GObject properties */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
356 | static void |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
357 | purple_whiteboard_get_property(GObject *obj, guint param_id, GValue *value, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
358 | GParamSpec *pspec) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
359 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
360 | PurpleWhiteboard *wb = PURPLE_WHITEBOARD(obj); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
361 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
362 | switch (param_id) { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
363 | case PROP_STATE: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
364 | g_value_set_int(value, purple_whiteboard_get_state(wb)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
365 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
366 | case PROP_ACCOUNT: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
367 | g_value_set_object(value, purple_whiteboard_get_account(wb)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
368 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
369 | case PROP_WHO: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
370 | g_value_set_string(value, purple_whiteboard_get_who(wb)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
371 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
372 | case PROP_DRAW_LIST: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
373 | g_value_set_pointer(value, purple_whiteboard_get_draw_list(wb)); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
374 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
375 | default: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
376 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
377 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
378 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
379 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
380 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
381 | /* Called when done constructing */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
382 | static void |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
383 | purple_whiteboard_constructed(GObject *object) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
384 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
385 | PurpleWhiteboard *wb = PURPLE_WHITEBOARD(object); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
386 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
387 | PurplePluginProtocolInfo *prpl_info; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
388 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
389 | parent_class->constructed(object); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
390 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
391 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl( |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
392 | purple_account_get_connection(priv->account))); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
393 | purple_whiteboard_set_prpl_ops(wb, prpl_info->whiteboard_prpl_ops); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
394 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
395 | /* Start up protocol specifics */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
396 | if(priv->prpl_ops && priv->prpl_ops->start) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
397 | priv->prpl_ops->start(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
398 | |
|
35102
ef8014abe867
Rename a camel case var to not be camel case.
Mark Doliner <mark@kingant.net>
parents:
35097
diff
changeset
|
399 | wb_list = g_list_append(wb_list, wb); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
400 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
401 | |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
402 | /* GObject finalize function */ |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
403 | static void |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
404 | purple_whiteboard_finalize(GObject *object) |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
405 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
406 | PurpleWhiteboard *wb = PURPLE_WHITEBOARD(object); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
407 | PurpleWhiteboardPrivate *priv = PURPLE_WHITEBOARD_GET_PRIVATE(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
408 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
409 | if(wb->ui_data) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
410 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
411 | /* Destroy frontend */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
412 | if(whiteboard_ui_ops && whiteboard_ui_ops->destroy) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
413 | whiteboard_ui_ops->destroy(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
414 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
415 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
416 | /* Do protocol specific session ending procedures */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
417 | if(priv->prpl_ops && priv->prpl_ops->end) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
418 | priv->prpl_ops->end(wb); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
419 | |
|
35102
ef8014abe867
Rename a camel case var to not be camel case.
Mark Doliner <mark@kingant.net>
parents:
35097
diff
changeset
|
420 | wb_list = g_list_remove(wb_list, wb); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
421 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
422 | g_free(priv->who); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
423 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
424 | parent_class->finalize(object); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
425 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
426 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
427 | /* Class initializer function */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
428 | static void |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
429 | purple_whiteboard_class_init(PurpleWhiteboardClass *klass) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
430 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
431 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
432 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
433 | parent_class = g_type_class_peek_parent(klass); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
434 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
435 | obj_class->finalize = purple_whiteboard_finalize; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
436 | obj_class->constructed = purple_whiteboard_constructed; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
437 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
438 | /* Setup properties */ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
439 | obj_class->get_property = purple_whiteboard_get_property; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
440 | obj_class->set_property = purple_whiteboard_set_property; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
441 | |
|
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
|
442 | g_type_class_add_private(klass, sizeof(PurpleWhiteboardPrivate)); |
|
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
|
443 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
444 | properties[PROP_STATE] = g_param_spec_int("state", "State", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35013
diff
changeset
|
445 | "State of the whiteboard.", |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
446 | G_MININT, G_MAXINT, 0, |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
447 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
448 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
449 | properties[PROP_ACCOUNT] = g_param_spec_object("account", "Account", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35013
diff
changeset
|
450 | "The whiteboard's account.", PURPLE_TYPE_ACCOUNT, |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
451 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
452 | G_PARAM_STATIC_STRINGS); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
453 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
454 | properties[PROP_WHO] = g_param_spec_string("who", "Who", |
|
35058
506740af931c
Unmark property names and blurbs from translatable to non-translatable
Ankit Vani <a@nevitus.org>
parents:
35013
diff
changeset
|
455 | "Who you're drawing with.", NULL, |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
456 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
457 | G_PARAM_STATIC_STRINGS); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
458 | |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
459 | properties[PROP_DRAW_LIST] = g_param_spec_pointer("draw-list", "Draw list", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
460 | "A list of points to draw to the buddy.", |
|
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
461 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
462 | |
|
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
|
463 | g_object_class_install_properties(obj_class, PROP_LAST, properties); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
464 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
465 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
466 | GType |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
467 | purple_whiteboard_get_type(void) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
468 | { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
469 | static GType type = 0; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
470 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
471 | if(type == 0) { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
472 | static const GTypeInfo info = { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
473 | sizeof(PurpleWhiteboardClass), |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
474 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
475 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
476 | (GClassInitFunc)purple_whiteboard_class_init, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
477 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
478 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
479 | sizeof(PurpleWhiteboard), |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
480 | 0, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
481 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
482 | NULL, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
483 | }; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
484 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
485 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleWhiteboard", |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
486 | &info, 0); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
487 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
488 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
489 | return type; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
490 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
491 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
492 | PurpleWhiteboard *purple_whiteboard_new(PurpleAccount *account, const char *who, int state) |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
493 | { |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34939
diff
changeset
|
494 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
|
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34939
diff
changeset
|
495 | g_return_val_if_fail(who != NULL, NULL); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
496 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
497 | return g_object_new(PURPLE_TYPE_WHITEBOARD, |
|
35013
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
498 | "account", account, |
|
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
499 | "who", who, |
|
4718438d053b
Cleaned up properties and added g_object_notify calls for everything else
Ankit Vani <a@nevitus.org>
parents:
34986
diff
changeset
|
500 | "state", state, |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
501 | NULL |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
502 | ); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
503 | } |