Thu, 07 Aug 2025 21:40:13 -0500
Add an avatar-for-display property to Purple.ContactInfo
Testing Done:
Ran the tests under valgrind and called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/4086/
| 11475 | 1 | /* |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
| 11475 | 4 | * |
| 15884 | 5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 11475 | 7 | * source distribution. |
| 8 | * | |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
12 | * any later version. |
| 11475 | 13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
17 | * more details. |
| 11475 | 18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
42584
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
| 11475 | 21 | */ |
| 22 | ||
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
23 | #include "purplewhiteboard.h" |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
24 | |
|
41155
922c9e70900c
Rename protocol.[ch] to purpleprotocol.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
41040
diff
changeset
|
25 | #include "purpleprotocol.h" |
|
41719
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
26 | #include "purpleprotocolwhiteboard.h" |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
27 | #include "purplewhiteboarduiops.h" |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
28 | #include "util.h" |
| 11475 | 29 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
30 | typedef struct { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
31 | int state; |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
32 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
33 | PurpleAccount *account; |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
34 | gchar *id; |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
35 | |
| 35097 | 36 | /* TODO Remove this and use protocol-specific subclasses. */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
37 | void *proto_data; |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
38 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
39 | PurpleWhiteboardOps *protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
40 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
41 | GList *draw_list; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
42 | } PurpleWhiteboardPrivate; |
|
32708
e275f5e7b257
Hide struct PurpleWhiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32285
diff
changeset
|
43 | |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
44 | /* GObject Property enums */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
45 | enum { |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
46 | PROP_0, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
47 | PROP_STATE, |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
48 | PROP_ACCOUNT, |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
49 | PROP_ID, |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
50 | PROP_DRAW_LIST, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
51 | N_PROPERTIES, |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
52 | }; |
|
42584
687260353985
Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41960
diff
changeset
|
53 | static GParamSpec *properties[N_PROPERTIES] = {NULL, }; |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
54 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
55 | G_DEFINE_TYPE_WITH_PRIVATE(PurpleWhiteboard, purple_whiteboard, G_TYPE_OBJECT) |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
56 | |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
57 | /****************************************************************************** |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
58 | * Helpers |
|
11802
b97b3fea95ce
[gaim-migrate @ 14093]
Gary Kramlich <grim@reaperworld.com>
parents:
11506
diff
changeset
|
59 | *****************************************************************************/ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
60 | static void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
61 | purple_whiteboard_set_account(PurpleWhiteboard *whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
62 | PurpleAccount *account) |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
63 | { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
64 | PurpleWhiteboardPrivate *priv = NULL; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
65 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
66 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
67 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
68 | if(g_set_object(&priv->account, account)) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
69 | g_object_notify_by_pspec(G_OBJECT(whiteboard), |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
70 | properties[PROP_ACCOUNT]); |
|
12022
c03fe7e2cd1d
[gaim-migrate @ 14315]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11914
diff
changeset
|
71 | } |
| 11475 | 72 | } |
| 73 | ||
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
74 | static void |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
75 | purple_whiteboard_set_id(PurpleWhiteboard *whiteboard, const gchar *id) { |
|
39782
db027c5e1463
Fix broken `priv != NULL` checks in libpurple.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
76 | PurpleWhiteboardPrivate *priv = NULL; |
|
32285
b5ea2ea68c8c
Add additional accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
32282
diff
changeset
|
77 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
78 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
34936
3c03564af436
Started GObjectification of PurpleWhiteboard
Ankit Vani <a@nevitus.org>
parents:
32708
diff
changeset
|
79 | |
|
42767
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42656
diff
changeset
|
80 | if(g_set_str(&priv->id, id)) { |
|
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42656
diff
changeset
|
81 | g_object_notify_by_pspec(G_OBJECT(whiteboard), properties[PROP_ID]); |
|
8cf1d11b59c1
Use g_set_str everywhere
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42656
diff
changeset
|
82 | } |
|
32282
c3df9b7a5160
Added protocol_data and ui_data accessor functions for Whiteboard.
Andrew Victor <andrew.victor@mxit.com>
parents:
28981
diff
changeset
|
83 | } |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
84 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
85 | /****************************************************************************** |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
86 | * GObject Implementation |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
87 | *****************************************************************************/ |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
88 | static void |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
89 | purple_whiteboard_set_property(GObject *obj, guint param_id, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
90 | const GValue *value, GParamSpec *pspec) |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
91 | { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
92 | PurpleWhiteboard *whiteboard = PURPLE_WHITEBOARD(obj); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
93 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
94 | switch(param_id) { |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
95 | case PROP_STATE: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
96 | purple_whiteboard_set_state(whiteboard, g_value_get_int(value)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
97 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
98 | case PROP_ACCOUNT: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
99 | purple_whiteboard_set_account(whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
100 | g_value_get_object(value)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
101 | break; |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
102 | case PROP_ID: |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
103 | purple_whiteboard_set_id(whiteboard, g_value_get_string(value)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
104 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
105 | case PROP_DRAW_LIST: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
106 | purple_whiteboard_set_draw_list(whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
107 | g_value_get_pointer(value)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
108 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
109 | default: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
110 | 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
|
111 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
112 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
113 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
114 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
115 | static void |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
116 | purple_whiteboard_get_property(GObject *obj, guint param_id, GValue *value, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
117 | GParamSpec *pspec) |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
118 | { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
119 | PurpleWhiteboard *whiteboard = PURPLE_WHITEBOARD(obj); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
120 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
121 | switch (param_id) { |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
122 | case PROP_STATE: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
123 | g_value_set_int(value, purple_whiteboard_get_state(whiteboard)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
124 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
125 | case PROP_ACCOUNT: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
126 | g_value_set_object(value, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
127 | purple_whiteboard_get_account(whiteboard)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
128 | break; |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
129 | case PROP_ID: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
130 | g_value_set_string(value, |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
131 | purple_whiteboard_get_id(whiteboard)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
132 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
133 | case PROP_DRAW_LIST: |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
134 | g_value_set_pointer(value, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
135 | purple_whiteboard_get_draw_list(whiteboard)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
136 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
137 | default: |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
138 | 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
|
139 | break; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
140 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
141 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
142 | |
|
39380
3088866c22f4
libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37119
diff
changeset
|
143 | static void |
|
41960
c8a4853205e3
Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41719
diff
changeset
|
144 | purple_whiteboard_init(G_GNUC_UNUSED PurpleWhiteboard *whiteboard) { |
|
39380
3088866c22f4
libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37119
diff
changeset
|
145 | } |
|
3088866c22f4
libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37119
diff
changeset
|
146 | |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
147 | static void |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
148 | purple_whiteboard_constructed(GObject *object) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
149 | PurpleWhiteboard *whiteboard = PURPLE_WHITEBOARD(object); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
150 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
151 | PurpleProtocol *protocol = NULL; |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
152 | |
|
39380
3088866c22f4
libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37119
diff
changeset
|
153 | G_OBJECT_CLASS(purple_whiteboard_parent_class)->constructed(object); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
154 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
155 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
156 | |
| 36693 | 157 | protocol = purple_connection_get_protocol( |
| 158 | purple_account_get_connection(priv->account)); | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
159 | purple_whiteboard_set_protocol_ops(whiteboard, |
| 36693 | 160 | purple_protocol_get_whiteboard_ops(protocol)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
161 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
162 | /* Start up protocol specifics */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
163 | if(priv->protocol_ops != NULL && priv->protocol_ops->start != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
164 | priv->protocol_ops->start(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
165 | } |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
166 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
167 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
168 | static void |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
169 | purple_whiteboard_finalize(GObject *object) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
170 | PurpleWhiteboard *whiteboard = PURPLE_WHITEBOARD(object); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
171 | PurpleWhiteboardPrivate *priv = NULL; |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
172 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
173 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
174 | |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
175 | /* Do protocol specific session ending procedures */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
176 | if(priv->protocol_ops != NULL && priv->protocol_ops->end != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
177 | priv->protocol_ops->end(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
178 | } |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
179 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
180 | g_clear_object(&priv->account); |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
181 | g_clear_pointer(&priv->id, g_free); |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
182 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
183 | /* TODO: figure out how we need to clean up the drawlist */ |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
184 | |
|
39380
3088866c22f4
libpurple: Port almost self-contained code from g_type_class_add_private()
Mike Ruprecht <cmaiku@gmail.com>
parents:
37119
diff
changeset
|
185 | G_OBJECT_CLASS(purple_whiteboard_parent_class)->finalize(object); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
186 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
187 | |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
188 | static void |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
189 | purple_whiteboard_class_init(PurpleWhiteboardClass *klass) { |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
190 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
191 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
192 | obj_class->get_property = purple_whiteboard_get_property; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
193 | obj_class->set_property = purple_whiteboard_set_property; |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
194 | obj_class->finalize = purple_whiteboard_finalize; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
195 | obj_class->constructed = purple_whiteboard_constructed; |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
196 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
197 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
198 | * PurpleWhiteboard:state: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
199 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
200 | * The state of the whiteboard. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
201 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
202 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
203 | */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
204 | properties[PROP_STATE] = g_param_spec_int( |
|
43071
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
205 | "state", NULL, NULL, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
206 | G_MININT, G_MAXINT, 0, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
207 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
208 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
209 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
210 | * PurpleWhiteboard:account: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
211 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
212 | * The account this whiteboard belongs to. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
213 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
214 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
215 | */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
216 | properties[PROP_ACCOUNT] = g_param_spec_object( |
|
43071
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
217 | "account", NULL, NULL, |
|
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
218 | PURPLE_TYPE_ACCOUNT, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
219 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
220 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
221 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
222 | * PurpleWhiteboard:id: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
223 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
224 | * The unique identifier of the whiteboard. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
225 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
226 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
227 | */ |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
228 | properties[PROP_ID] = g_param_spec_string( |
|
43071
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
229 | "id", NULL, NULL, |
|
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
230 | NULL, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
231 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
232 | |
|
42656
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
233 | /** |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
234 | * PurpleWhiteboard:draw-list: |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
235 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
236 | * The list of draw actions for the whiteboard. |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
237 | * |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
238 | * Since: 3.0 |
|
df9aafbae930
Add a doc-check unit test to libpurple and fix the issues it has found
Gary Kramlich <grim@reaperworld.com>
parents:
42594
diff
changeset
|
239 | */ |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
240 | properties[PROP_DRAW_LIST] = g_param_spec_pointer( |
|
43071
071588186662
Remove nick and blurb from libpurple properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42767
diff
changeset
|
241 | "draw-list", NULL, NULL, |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
242 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
243 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
244 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
245 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
246 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
247 | /****************************************************************************** |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
248 | * API |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
249 | *****************************************************************************/ |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
250 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
251 | purple_whiteboard_set_protocol_ops(PurpleWhiteboard *whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
252 | PurpleWhiteboardOps *ops) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
253 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
254 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
255 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
256 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
257 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
258 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
259 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
260 | priv->protocol_ops = ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
261 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
262 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
263 | PurpleAccount * |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
264 | purple_whiteboard_get_account(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
265 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
266 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
267 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), NULL); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
268 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
269 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
270 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
271 | return priv->account; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
272 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
273 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
274 | const gchar * |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
275 | purple_whiteboard_get_id(PurpleWhiteboard *whiteboard) { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
276 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
277 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
278 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), NULL); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
279 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
280 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
281 | |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
282 | return priv->id; |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
283 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
284 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
285 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
286 | purple_whiteboard_set_state(PurpleWhiteboard *whiteboard, int state) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
287 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
288 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
289 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
290 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
291 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
292 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
293 | priv->state = state; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
294 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
295 | g_object_notify_by_pspec(G_OBJECT(whiteboard), properties[PROP_STATE]); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
296 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
297 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
298 | gint |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
299 | purple_whiteboard_get_state(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
300 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
301 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
302 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), -1); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
303 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
304 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
305 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
306 | return priv->state; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
307 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
308 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
309 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
310 | purple_whiteboard_start(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
311 | purple_whiteboard_ui_ops_create(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
312 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
313 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
314 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
315 | purple_whiteboard_draw_list_destroy(GList *draw_list) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
316 | g_list_free(draw_list); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
317 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
318 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
319 | gboolean |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
320 | purple_whiteboard_get_dimensions(PurpleWhiteboard *whiteboard, gint *width, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
321 | gint *height) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
322 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
323 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
324 | PurpleWhiteboardOps *protocol_ops = NULL; |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
325 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
326 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), FALSE); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
327 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
328 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
329 | protocol_ops = priv->protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
330 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
331 | if(protocol_ops != NULL && protocol_ops->get_dimensions != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
332 | protocol_ops->get_dimensions(whiteboard, width, height); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
333 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
334 | return TRUE; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
335 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
336 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
337 | return FALSE; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
338 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
339 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
340 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
341 | purple_whiteboard_set_dimensions(PurpleWhiteboard *whiteboard, gint width, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
342 | gint height) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
343 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
344 | purple_whiteboard_ui_ops_set_dimensions(whiteboard, width, height); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
345 | } |
|
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
346 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
347 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
348 | purple_whiteboard_send_draw_list(PurpleWhiteboard *whiteboard, GList *list) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
349 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
350 | PurpleWhiteboardOps *protocol_ops = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
351 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
352 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
353 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
354 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
355 | protocol_ops = priv->protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
356 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
357 | if(protocol_ops != NULL && protocol_ops->send_draw_list != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
358 | protocol_ops->send_draw_list(whiteboard, list); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
359 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
360 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
361 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
362 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
363 | purple_whiteboard_draw_point(PurpleWhiteboard *whiteboard, gint x, gint y, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
364 | gint color, gint size) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
365 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
366 | purple_whiteboard_ui_ops_draw_point(whiteboard, x, y, color, size); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
367 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
368 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
369 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
370 | purple_whiteboard_draw_line(PurpleWhiteboard *whiteboard, gint x1, gint y1, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
371 | gint x2, gint y2, gint color, gint size) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
372 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
373 | purple_whiteboard_ui_ops_draw_line(whiteboard, x1, y1, x2, y2, color, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
374 | size); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
375 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
376 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
377 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
378 | purple_whiteboard_clear(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
379 | purple_whiteboard_ui_ops_clear(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
380 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
381 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
382 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
383 | purple_whiteboard_send_clear(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
384 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
385 | PurpleWhiteboardOps *protocol_ops = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
386 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
387 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
388 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
389 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
390 | protocol_ops = priv->protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
391 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
392 | if(protocol_ops != NULL && protocol_ops->clear != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
393 | protocol_ops->clear(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
394 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
395 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
396 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
397 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
398 | purple_whiteboard_send_brush(PurpleWhiteboard *whiteboard, gint size, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
399 | gint color) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
400 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
401 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
402 | PurpleWhiteboardOps *protocol_ops = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
403 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
404 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
405 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
406 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
407 | protocol_ops = priv->protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
408 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
409 | if(protocol_ops != NULL && protocol_ops->set_brush != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
410 | protocol_ops->set_brush(whiteboard, size, color); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
411 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
412 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
413 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
414 | gboolean |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
415 | purple_whiteboard_get_brush(PurpleWhiteboard *whiteboard, gint *size, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
416 | gint *color) |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
417 | { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
418 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
419 | PurpleWhiteboardOps *protocol_ops = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
420 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
421 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), FALSE); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
422 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
423 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
424 | protocol_ops = priv->protocol_ops; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
425 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
426 | if(protocol_ops != NULL && protocol_ops->get_brush != NULL) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
427 | protocol_ops->get_brush(whiteboard, size, color); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
428 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
429 | return TRUE; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
430 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
431 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
432 | return FALSE; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
433 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
434 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
435 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
436 | purple_whiteboard_set_brush(PurpleWhiteboard *whiteboard, gint size, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
437 | gint color) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
438 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
439 | purple_whiteboard_ui_ops_set_brush(whiteboard, size, color); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
440 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
441 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
442 | GList * |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
443 | purple_whiteboard_get_draw_list(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
444 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
445 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
446 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), NULL); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
447 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
448 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
449 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
450 | return priv->draw_list; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
451 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
452 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
453 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
454 | purple_whiteboard_set_draw_list(PurpleWhiteboard *whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
455 | GList* draw_list) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
456 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
457 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
458 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
459 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
460 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
461 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
462 | priv->draw_list = draw_list; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
463 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
464 | g_object_notify_by_pspec(G_OBJECT(whiteboard), properties[PROP_DRAW_LIST]); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
465 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
466 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
467 | void |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
468 | purple_whiteboard_set_protocol_data(PurpleWhiteboard *whiteboard, |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
469 | gpointer proto_data) |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
470 | { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
471 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
472 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
473 | g_return_if_fail(PURPLE_IS_WHITEBOARD(whiteboard)); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
474 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
475 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
476 | priv->proto_data = proto_data; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
477 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
478 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
479 | gpointer |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
480 | purple_whiteboard_get_protocol_data(PurpleWhiteboard *whiteboard) { |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
481 | PurpleWhiteboardPrivate *priv = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
482 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
483 | g_return_val_if_fail(PURPLE_IS_WHITEBOARD(whiteboard), NULL); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
484 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
485 | priv = purple_whiteboard_get_instance_private(whiteboard); |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
486 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
487 | return priv->proto_data; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
488 | } |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
489 | |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
490 | PurpleWhiteboard * |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
491 | purple_whiteboard_new(PurpleAccount *account, const gchar *id, gint state) { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
492 | PurpleWhiteboard *whiteboard = NULL; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
493 | PurpleProtocol *protocol = NULL; |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
494 | |
|
34983
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(PURPLE_IS_ACCOUNT(account), NULL); |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
496 | g_return_val_if_fail(id != NULL, NULL); |
|
34939
e093c956c5e5
Added GObject code to whiteboard.c
Ankit Vani <a@nevitus.org>
parents:
34937
diff
changeset
|
497 | |
|
40804
5496016b3c00
Port libpurple from purple_protocols_ to purple_protocol_manager_
Gary Kramlich <grim@reaperworld.com>
parents:
40745
diff
changeset
|
498 | protocol = purple_account_get_protocol(account); |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
499 | |
|
36844
b62140058cd3
Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents:
36843
diff
changeset
|
500 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
501 | |
|
41719
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
502 | if(PURPLE_IS_PROTOCOL_WHITEBOARD(protocol)) { |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
503 | whiteboard = purple_protocol_whiteboard_create( |
|
affc85fd4f3a
Create PurpleProtocolWhiteboard and remove PurpleProtocolFactory
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
504 | PURPLE_PROTOCOL_WHITEBOARD(protocol), account, id, state); |
|
40339
54813fd13c13
Pull PurpleProtocolFactory out to it's own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40195
diff
changeset
|
505 | } else { |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
506 | whiteboard = g_object_new(PURPLE_TYPE_WHITEBOARD, |
| 36872 | 507 | "account", account, |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
508 | "id", id, |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
509 | "state", state, |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
510 | NULL |
|
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
511 | ); |
|
40339
54813fd13c13
Pull PurpleProtocolFactory out to it's own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40195
diff
changeset
|
512 | } |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
513 | |
|
40595
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
514 | return whiteboard; |
|
d7e28f8a0994
split up whiteboard.[ch] to separate files
Gary Kramlich <grim@reaperworld.com>
parents:
40339
diff
changeset
|
515 | } |
|
36728
313d07370a7b
Use the protocol factory interface functions
Ankit Vani <a@nevitus.org>
parents:
36710
diff
changeset
|
516 | |
|
41040
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
517 | gboolean |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
518 | purple_whiteboard_equal(PurpleWhiteboard *whiteboard1, |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
519 | PurpleWhiteboard *whiteboard2) |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
520 | { |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
521 | PurpleWhiteboardPrivate *priv1 = NULL, *priv2 = NULL; |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
522 | |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
523 | if(whiteboard1 == NULL) { |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
524 | return (whiteboard2 == NULL); |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
525 | } else if(whiteboard2 == NULL) { |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
526 | return FALSE; |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
527 | } |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
528 | |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
529 | priv1 = purple_whiteboard_get_instance_private(whiteboard1); |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
530 | priv2 = purple_whiteboard_get_instance_private(whiteboard2); |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
531 | |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
532 | return purple_strequal(priv1->id, priv2->id); |
|
4be2eda9548a
Create PurpleWhiteboardManager for managing whiteboards
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
533 | } |