Tue, 01 Oct 2013 03:24:42 +0530
Merged soc.2013.gobjectification branch
| 36560 | 1 | /* |
| 2 | * purple | |
| 3 | * | |
| 4 | * Purple is the legal property of its developers, whose names are too numerous | |
| 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 | |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
| 21 | * | |
| 22 | */ | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
23 | #include "dbus-maybe.h" |
| 36560 | 24 | #include "protocol.h" |
| 25 | ||
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
26 | static GObjectClass *parent_class; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
27 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
28 | /************************************************************************** |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
29 | * Protocol Object API |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
30 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
31 | const char * |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
32 | purple_protocol_get_id(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
33 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
34 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
35 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
36 | return protocol->id; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
37 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
38 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
39 | const char * |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
40 | purple_protocol_get_name(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
41 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
42 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
43 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
44 | return protocol->name; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
45 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
46 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
47 | PurpleProtocolOptions |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
48 | purple_protocol_get_options(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
49 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
50 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), 0); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
51 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
52 | return protocol->options; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
53 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
54 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
55 | GList * |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
56 | purple_protocol_get_user_splits(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
57 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
58 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
59 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
60 | return protocol->user_splits; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
61 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
62 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
63 | GList * |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
64 | purple_protocol_get_protocol_options(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
65 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
66 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
67 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
68 | return protocol->protocol_options; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
69 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
70 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
71 | PurpleBuddyIconSpec * |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
72 | purple_protocol_get_icon_spec(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
73 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
74 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
75 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
76 | return protocol->icon_spec; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
77 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
78 | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36624
diff
changeset
|
79 | PurpleWhiteboardOps * |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
80 | purple_protocol_get_whiteboard_ops(const PurpleProtocol *protocol) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
81 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
82 | g_return_val_if_fail(PURPLE_IS_PROTOCOL(protocol), NULL); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
83 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
84 | return protocol->whiteboard_ops; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
85 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
86 | |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
87 | static void |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
88 | user_splits_free(PurpleProtocol *protocol) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
89 | { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
90 | g_return_if_fail(protocol != NULL); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
91 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
92 | while (protocol->user_splits) { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
93 | PurpleAccountUserSplit *split = protocol->user_splits->data; |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
94 | purple_account_user_split_destroy(split); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
95 | protocol->user_splits = g_list_delete_link(protocol->user_splits, |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
96 | protocol->user_splits); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
97 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
98 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
99 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
100 | static void |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
101 | protocol_options_free(PurpleProtocol *protocol) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
102 | { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
103 | g_return_if_fail(protocol != NULL); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
104 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
105 | while (protocol->protocol_options) { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
106 | PurpleAccountOption *option = protocol->protocol_options->data; |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
107 | purple_account_option_destroy(option); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
108 | protocol->protocol_options = |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
109 | g_list_delete_link(protocol->protocol_options, |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
110 | protocol->protocol_options); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
111 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
112 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
113 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
114 | static void |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
115 | icon_spec_free(PurpleProtocol *protocol) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
116 | { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
117 | g_return_if_fail(protocol != NULL); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
118 | |
|
36687
7a83a1a657e3
Removed unused declaration of purple_buddy_icon_spec_free()
Ankit Vani <a@nevitus.org>
parents:
36686
diff
changeset
|
119 | g_free(protocol->icon_spec); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
120 | protocol->icon_spec = NULL; |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
121 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
122 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
123 | void |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
124 | purple_protocol_override(PurpleProtocol *protocol, |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
125 | PurpleProtocolOverrideFlags flags) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
126 | { |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
127 | g_return_if_fail(PURPLE_IS_PROTOCOL(protocol)); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
128 | |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
129 | if (flags & PURPLE_PROTOCOL_OVERRIDE_USER_SPLITS) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
130 | user_splits_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
131 | if (flags & PURPLE_PROTOCOL_OVERRIDE_PROTOCOL_OPTIONS) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
132 | protocol_options_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
133 | if (flags & PURPLE_PROTOCOL_OVERRIDE_ICON_SPEC) |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
134 | icon_spec_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
135 | } |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
136 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
137 | /************************************************************************** |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
138 | * GObject stuff |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
139 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
140 | static void |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
141 | purple_protocol_init(GTypeInstance *instance, gpointer klass) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
142 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
143 | PURPLE_DBUS_REGISTER_POINTER(PURPLE_PROTOCOL(instance), PurpleProtocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
144 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
145 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
146 | static void |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
147 | purple_protocol_dispose(GObject *object) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
148 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
149 | PurpleProtocol *protocol = PURPLE_PROTOCOL(object); |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
150 | GList *accounts, *l; |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
151 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
152 | accounts = purple_accounts_get_all_active(); |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
153 | for (l = accounts; l != NULL; l = l->next) { |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
154 | PurpleAccount *account = PURPLE_ACCOUNT(l->data); |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
155 | if (purple_account_is_disconnected(account)) |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
156 | continue; |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
157 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
158 | if (purple_strequal(protocol->id, |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
159 | purple_account_get_protocol_id(account))) |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
160 | purple_account_disconnect(account); |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
161 | } |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
162 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
163 | g_list_free(accounts); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
164 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
165 | purple_request_close_with_handle(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
166 | purple_notify_close_with_handle(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
167 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
168 | purple_signals_disconnect_by_handle(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
169 | purple_signals_unregister_by_instance(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
170 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
171 | purple_prefs_disconnect_by_handle(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
172 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
173 | PURPLE_DBUS_UNREGISTER_POINTER(protocol); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
174 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
175 | parent_class->dispose(object); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
176 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
177 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
178 | static void |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
179 | purple_protocol_finalize(GObject *object) |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
180 | { |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
181 | PurpleProtocol *protocol = PURPLE_PROTOCOL(object); |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
182 | |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
183 | user_splits_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
184 | protocol_options_free(protocol); |
|
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
185 | icon_spec_free(protocol); |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
186 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
187 | parent_class->finalize(object); |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
188 | } |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
189 | |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
190 | static void |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
191 | purple_protocol_class_init(PurpleProtocolClass *klass) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
192 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
193 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
194 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
195 | parent_class = g_type_class_peek_parent(klass); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
196 | |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
197 | obj_class->dispose = purple_protocol_dispose; |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
198 | obj_class->finalize = purple_protocol_finalize; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
199 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
200 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
201 | GType |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
202 | purple_protocol_get_type(void) |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
203 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
204 | static GType type = 0; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
205 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
206 | if (G_UNLIKELY(type == 0)) { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
207 | static const GTypeInfo info = { |
|
36681
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
208 | .class_size = sizeof(PurpleProtocolClass), |
|
9c38716c8eb7
Moved protocol class members to instance. Protocol definitions now require *_init, *_class_init instead of *_base_init.
Ankit Vani <a@nevitus.org>
parents:
36637
diff
changeset
|
209 | .class_init = (GClassInitFunc)purple_protocol_class_init, |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
210 | .instance_size = sizeof(PurpleProtocol), |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
211 | .instance_init = (GInstanceInitFunc)purple_protocol_init, |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
212 | }; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
213 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
214 | type = g_type_register_static(G_TYPE_OBJECT, "PurpleProtocol", |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
215 | &info, G_TYPE_FLAG_ABSTRACT); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
216 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
217 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
218 | return type; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
219 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
220 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
221 | /************************************************************************** |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
222 | * Protocol Class API |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
223 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
224 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
225 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
226 | g_return_if_fail(klass != NULL); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
227 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
228 | klass->funcname(__VA_ARGS__); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
229 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
230 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
231 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
232 | g_return_val_if_fail(klass != NULL, defaultreturn); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
233 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
234 | return klass->funcname(__VA_ARGS__); \ |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
235 | else \ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
236 | return defaultreturn; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
237 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
238 | void |
| 36719 | 239 | purple_protocol_class_login(PurpleProtocol *protocol, PurpleAccount *account) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
240 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
241 | DEFINE_PROTOCOL_FUNC(protocol, login, account); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
242 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
243 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
244 | void |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
245 | purple_protocol_class_close(PurpleProtocol *protocol, PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
246 | { |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
247 | DEFINE_PROTOCOL_FUNC(protocol, close, gc); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
248 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
249 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
250 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
251 | purple_protocol_class_status_types(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
252 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
253 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
254 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, status_types, account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
255 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
256 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
257 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
258 | purple_protocol_class_list_icon(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
259 | PurpleAccount *account, PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
260 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
261 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, list_icon, account, buddy); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
262 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
263 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
264 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
265 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
266 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
267 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
268 | * Protocol Client Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
269 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
270 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
271 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
272 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 273 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
274 | client_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
275 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
276 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
277 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
278 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 279 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
280 | return client_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
281 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
282 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
283 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
284 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
285 | purple_protocol_client_iface_get_type(void) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
286 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
287 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
288 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
289 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
290 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
291 | .class_size = sizeof(PurpleProtocolClientIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
292 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
293 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
294 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
295 | "PurpleProtocolClientIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
296 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
297 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
298 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
299 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
300 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
301 | purple_protocol_client_iface_get_actions(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
302 | PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
303 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
304 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_actions, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
305 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
306 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
307 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
308 | purple_protocol_client_iface_list_emblem(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
309 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
310 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
311 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, list_emblem, buddy); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
312 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
313 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
314 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
315 | purple_protocol_client_iface_status_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
316 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
317 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
318 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, status_text, buddy); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
319 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
320 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
321 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
322 | purple_protocol_client_iface_tooltip_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
323 | PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
324 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
325 | DEFINE_PROTOCOL_FUNC(protocol, tooltip_text, buddy, user_info, full); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
326 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
327 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
328 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
329 | purple_protocol_client_iface_blist_node_menu(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
330 | PurpleBlistNode *node) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
331 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
332 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, blist_node_menu, node); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
333 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
334 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
335 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
336 | purple_protocol_client_iface_buddy_free(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
337 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
338 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
339 | DEFINE_PROTOCOL_FUNC(protocol, buddy_free, buddy); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
340 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
341 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
342 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
343 | purple_protocol_client_iface_convo_closed(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
344 | PurpleConnection *gc, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
345 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
346 | DEFINE_PROTOCOL_FUNC(protocol, convo_closed, gc, who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
347 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
348 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
349 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
350 | purple_protocol_client_iface_normalize(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
351 | const PurpleAccount *account, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
352 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
353 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, normalize, account, who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
354 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
355 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
356 | PurpleChat * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
357 | purple_protocol_client_iface_find_blist_chat(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
358 | PurpleAccount *account, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
359 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
360 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, find_blist_chat, account, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
361 | name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
362 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
363 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
364 | gboolean |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
365 | purple_protocol_client_iface_offline_message(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
366 | const PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
367 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
368 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, offline_message, buddy); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
369 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
370 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
371 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
372 | purple_protocol_client_iface_get_account_text_table(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
373 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
374 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
375 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_account_text_table, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
376 | account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
377 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
378 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
379 | PurpleMood * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
380 | purple_protocol_client_iface_get_moods(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
381 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
382 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
383 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_moods, account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
384 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
385 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
386 | gssize |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
387 | purple_protocol_client_iface_get_max_message_size(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
388 | PurpleConversation *conv) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
389 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
390 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, get_max_message_size, conv); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
391 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
392 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
393 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
394 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
395 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
396 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
397 | * Protocol Server Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
398 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
399 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
400 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
401 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 402 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
403 | server_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
404 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
405 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
406 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
407 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 408 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
409 | return server_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
410 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
411 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
412 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
413 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
414 | purple_protocol_server_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
415 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
416 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
417 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
418 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
419 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
420 | .class_size = sizeof(PurpleProtocolServerIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
421 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
422 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
423 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
424 | "PurpleProtocolServerIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
425 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
426 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
427 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
428 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
429 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
430 | purple_protocol_server_iface_register_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
431 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
432 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
433 | DEFINE_PROTOCOL_FUNC(protocol, register_user, account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
434 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
435 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
436 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
437 | purple_protocol_server_iface_unregister_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
438 | PurpleAccount *account, PurpleAccountUnregistrationCb cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
439 | void *user_data) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
440 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
441 | DEFINE_PROTOCOL_FUNC(protocol, unregister_user, account, cb, user_data); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
442 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
443 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
444 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
445 | purple_protocol_server_iface_set_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
446 | PurpleConnection *gc, const char *info) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
447 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
448 | DEFINE_PROTOCOL_FUNC(protocol, set_info, gc, info); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
449 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
450 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
451 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
452 | purple_protocol_server_iface_get_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
453 | PurpleConnection *gc, const char *who) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
454 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
455 | DEFINE_PROTOCOL_FUNC(protocol, get_info, gc, who); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
456 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
457 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
458 | void |
| 36719 | 459 | purple_protocol_server_iface_set_status(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
460 | PurpleAccount *account, PurpleStatus *status) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
461 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
462 | DEFINE_PROTOCOL_FUNC(protocol, set_status, account, status); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
463 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
464 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
465 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
466 | purple_protocol_server_iface_set_idle(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
467 | PurpleConnection *gc, int idletime) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
468 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
469 | DEFINE_PROTOCOL_FUNC(protocol, set_idle, gc, idletime); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
470 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
471 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
472 | void |
| 36719 | 473 | purple_protocol_server_iface_change_passwd(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
474 | PurpleConnection *gc, const char *old_pass, const char *new_pass) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
475 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
476 | DEFINE_PROTOCOL_FUNC(protocol, change_passwd, gc, old_pass, new_pass); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
477 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
478 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
479 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
480 | purple_protocol_server_iface_add_buddy(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
481 | PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
482 | const char *message) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
483 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
484 | DEFINE_PROTOCOL_FUNC(protocol, add_buddy, gc, buddy, group, message); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
485 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
486 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
487 | void |
| 36719 | 488 | purple_protocol_server_iface_add_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
489 | PurpleConnection *gc, GList *buddies, GList *groups, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
490 | const char *message) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
491 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
492 | DEFINE_PROTOCOL_FUNC(protocol, add_buddies, gc, buddies, groups, message); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
493 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
494 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
495 | void |
| 36719 | 496 | purple_protocol_server_iface_remove_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
497 | PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
498 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
499 | DEFINE_PROTOCOL_FUNC(protocol, remove_buddy, gc, buddy, group); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
500 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
501 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
502 | void |
| 36719 | 503 | purple_protocol_server_iface_remove_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
504 | PurpleConnection *gc, GList *buddies, GList *groups) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
505 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
506 | DEFINE_PROTOCOL_FUNC(protocol, remove_buddies, gc, buddies, groups); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
507 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
508 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
509 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
510 | purple_protocol_server_iface_keepalive(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
511 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
512 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
513 | DEFINE_PROTOCOL_FUNC(protocol, keepalive, gc); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
514 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
515 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
516 | void |
| 36719 | 517 | purple_protocol_server_iface_alias_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
518 | PurpleConnection *gc, const char *who, const char *alias) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
519 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
520 | DEFINE_PROTOCOL_FUNC(protocol, alias_buddy, gc, who, alias); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
521 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
522 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
523 | void |
| 36719 | 524 | purple_protocol_server_iface_group_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
525 | PurpleConnection *gc, const char *who, const char *old_group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
526 | const char *new_group) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
527 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
528 | DEFINE_PROTOCOL_FUNC(protocol, group_buddy, gc, who, old_group, new_group); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
529 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
530 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
531 | void |
| 36719 | 532 | purple_protocol_server_iface_rename_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
533 | PurpleConnection *gc, const char *old_name, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
534 | GList *moved_buddies) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
535 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
536 | DEFINE_PROTOCOL_FUNC(protocol, rename_group, gc, old_name, group, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
537 | moved_buddies); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
538 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
539 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
540 | void |
| 36719 | 541 | purple_protocol_server_iface_set_buddy_icon(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
542 | PurpleConnection *gc, PurpleStoredImage *img) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
543 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
544 | DEFINE_PROTOCOL_FUNC(protocol, set_buddy_icon, gc, img); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
545 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
546 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
547 | void |
| 36719 | 548 | purple_protocol_server_iface_remove_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
549 | PurpleConnection *gc, PurpleGroup *group) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
550 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
551 | DEFINE_PROTOCOL_FUNC(protocol, remove_group, gc, group); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
552 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
553 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
554 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
555 | purple_protocol_server_iface_send_raw(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
556 | PurpleConnection *gc, const char *buf, int len) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
557 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
558 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send_raw, gc, buf, len); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
559 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
560 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
561 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
562 | purple_protocol_server_iface_set_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
563 | PurpleConnection *gc, const char *alias, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
564 | PurpleSetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
565 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
566 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
567 | DEFINE_PROTOCOL_FUNC(protocol, set_public_alias, gc, alias, success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
568 | failure_cb); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
569 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
570 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
571 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
572 | purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
573 | PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
574 | PurpleGetPublicAliasFailureCallback failure_cb) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
575 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
576 | DEFINE_PROTOCOL_FUNC(protocol, get_public_alias, gc, success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
577 | failure_cb); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
578 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
579 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
580 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
581 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
582 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
583 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
584 | * Protocol IM Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
585 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
586 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
587 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
588 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 589 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
590 | im_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
591 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
592 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
593 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
594 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 595 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
596 | return im_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
597 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
598 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
599 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
600 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
601 | purple_protocol_im_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
602 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
603 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
604 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
605 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
606 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
607 | .class_size = sizeof(PurpleProtocolIMIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
608 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
609 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
610 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
611 | "PurpleProtocolIMIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
612 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
613 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
614 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
615 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
616 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
617 | purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
618 | const char *who, const char *message, PurpleMessageFlags flags) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
619 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
620 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send, gc, who, message, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
621 | flags); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
622 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
623 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
624 | unsigned int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
625 | purple_protocol_im_iface_send_typing(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
626 | PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
627 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
628 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send_typing, gc, name, state); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
629 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
630 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
631 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
632 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
633 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
634 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
635 | * Protocol Chat Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
636 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
637 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
638 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
639 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 640 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
641 | chat_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
642 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
643 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
644 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
645 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 646 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
647 | return chat_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
648 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
649 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
650 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
651 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
652 | purple_protocol_chat_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
653 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
654 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
655 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
656 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
657 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
658 | .class_size = sizeof(PurpleProtocolChatIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
659 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
660 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
661 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
662 | "PurpleProtocolChatIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
663 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
664 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
665 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
666 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
667 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
668 | purple_protocol_chat_iface_info(PurpleProtocol *protocol, PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
669 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
670 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
671 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
672 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
673 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
674 | purple_protocol_chat_iface_info_defaults(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
675 | PurpleConnection *gc, const char *chat_name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
676 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
677 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info_defaults, gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
678 | chat_name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
679 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
680 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
681 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
682 | purple_protocol_chat_iface_join(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
683 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
684 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
685 | DEFINE_PROTOCOL_FUNC(protocol, join, gc, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
686 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
687 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
688 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
689 | purple_protocol_chat_iface_reject(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
690 | PurpleConnection *gc, GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
691 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
692 | DEFINE_PROTOCOL_FUNC(protocol, reject, gc, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
693 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
694 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
695 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
696 | purple_protocol_chat_iface_get_name(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
697 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
698 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
699 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_name, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
700 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
701 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
702 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
703 | purple_protocol_chat_iface_invite(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
704 | PurpleConnection *gc, int id, const char *message, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
705 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
706 | DEFINE_PROTOCOL_FUNC(protocol, invite, gc, id, message, who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
707 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
708 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
709 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
710 | purple_protocol_chat_iface_leave(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
711 | int id) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
712 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
713 | DEFINE_PROTOCOL_FUNC(protocol, leave, gc, id); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
714 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
715 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
716 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
717 | purple_protocol_chat_iface_whisper(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
718 | PurpleConnection *gc, int id, const char *who, const char *message) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
719 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
720 | DEFINE_PROTOCOL_FUNC(protocol, whisper, gc, id, who, message); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
721 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
722 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
723 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
724 | purple_protocol_chat_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
725 | int id, const char *message, PurpleMessageFlags flags) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
726 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
727 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, send, gc, id, message, flags); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
728 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
729 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
730 | char * |
| 36719 | 731 | purple_protocol_chat_iface_get_user_real_name(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
732 | PurpleConnection *gc, int id, const char *who) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
733 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
734 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_user_real_name, gc, id, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
735 | who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
736 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
737 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
738 | void |
| 36719 | 739 | purple_protocol_chat_iface_set_topic(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
740 | PurpleConnection *gc, int id, const char *topic) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
741 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
742 | DEFINE_PROTOCOL_FUNC(protocol, set_topic, gc, id, topic); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
743 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
744 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
745 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
746 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
747 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
748 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
749 | * Protocol Privacy Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
750 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
751 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
752 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
753 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 754 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
755 | privacy_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
756 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
757 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
758 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
759 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 760 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
761 | return privacy_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
762 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
763 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
764 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
765 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
766 | purple_protocol_privacy_iface_get_type(void) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
767 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
768 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
769 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
770 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
771 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
772 | .class_size = sizeof(PurpleProtocolPrivacyIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
773 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
774 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
775 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
776 | "PurpleProtocolPrivacyIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
777 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
778 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
779 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
780 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
781 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
782 | purple_protocol_privacy_iface_add_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
783 | PurpleConnection *gc, const char *name) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
784 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
785 | DEFINE_PROTOCOL_FUNC(protocol, add_permit, gc, name); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
786 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
787 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
788 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
789 | purple_protocol_privacy_iface_add_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
790 | PurpleConnection *gc, const char *name) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
791 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
792 | DEFINE_PROTOCOL_FUNC(protocol, add_deny, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
793 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
794 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
795 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
796 | purple_protocol_privacy_iface_rem_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
797 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
798 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
799 | DEFINE_PROTOCOL_FUNC(protocol, rem_permit, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
800 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
801 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
802 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
803 | purple_protocol_privacy_iface_rem_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
804 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
805 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
806 | DEFINE_PROTOCOL_FUNC(protocol, rem_deny, gc, name); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
807 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
808 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
809 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
810 | purple_protocol_privacy_iface_set_permit_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
811 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
812 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
813 | DEFINE_PROTOCOL_FUNC(protocol, set_permit_deny, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
814 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
815 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
816 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
817 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
818 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
819 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
820 | * Protocol Xfer Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
821 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
822 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
823 | PurpleProtocolXferIface *xfer_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
824 | PURPLE_PROTOCOL_GET_XFER_IFACE(protocol); \ |
| 36726 | 825 | if (xfer_iface && xfer_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
826 | xfer_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
827 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
828 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
829 | PurpleProtocolXferIface *xfer_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
830 | PURPLE_PROTOCOL_GET_XFER_IFACE(protocol); \ |
| 36726 | 831 | if (xfer_iface && xfer_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
832 | return xfer_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
833 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
834 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
835 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
836 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
837 | purple_protocol_xfer_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
838 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
839 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
840 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
841 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
842 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
843 | .class_size = sizeof(PurpleProtocolXferIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
844 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
845 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
846 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
847 | "PurpleProtocolXferIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
848 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
849 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
850 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
851 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
852 | gboolean |
| 36719 | 853 | purple_protocol_xfer_iface_can_receive(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
854 | PurpleConnection *gc, const char *who) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
855 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
856 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, can_receive, gc, who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
857 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
858 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
859 | void |
| 36719 | 860 | purple_protocol_xfer_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
861 | const char *who, const char *filename) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
862 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
863 | DEFINE_PROTOCOL_FUNC(protocol, send, gc, who, filename); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
864 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
865 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
866 | PurpleXfer * |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
867 | purple_protocol_xfer_iface_new_xfer(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
868 | PurpleConnection *gc, const char *who) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
869 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
870 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, new_xfer, gc, who); |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
871 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
872 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
873 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
874 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
875 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
876 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
877 | * Protocol Roomlist Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
878 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
879 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
880 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
881 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 882 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
883 | roomlist_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
884 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
885 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
886 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
887 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 888 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
889 | return roomlist_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
890 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
891 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
892 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
893 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
894 | purple_protocol_roomlist_iface_get_type(void) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
895 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
896 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
897 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
898 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
899 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
900 | .class_size = sizeof(PurpleProtocolRoomlistIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
901 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
902 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
903 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
904 | "PurpleProtocolRoomlistIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
905 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
906 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
907 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
908 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
909 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
910 | purple_protocol_roomlist_iface_get_list(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
911 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
912 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
913 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_list, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
914 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
915 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
916 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
917 | purple_protocol_roomlist_iface_cancel(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
918 | PurpleRoomlist *list) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
919 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
920 | DEFINE_PROTOCOL_FUNC(protocol, cancel, list); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
921 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
922 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
923 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
924 | purple_protocol_roomlist_iface_expand_category(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
925 | PurpleRoomlist *list, PurpleRoomlistRoom *category) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
926 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
927 | DEFINE_PROTOCOL_FUNC(protocol, expand_category, list, category); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
928 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
929 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
930 | char * |
| 36719 | 931 | purple_protocol_roomlist_iface_room_serialize(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
932 | PurpleRoomlistRoom *room) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
933 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
934 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, room_serialize, room); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
935 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
936 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
937 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
938 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
939 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
940 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
941 | * Protocol Attention Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
942 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
943 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
944 | PurpleProtocolAttentionIface *attention_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
945 | PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \ |
| 36726 | 946 | if (attention_iface && attention_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
947 | attention_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
948 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
949 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
950 | PurpleProtocolAttentionIface *attention_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
951 | PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \ |
| 36726 | 952 | if (attention_iface && attention_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
953 | return attention_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
954 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
955 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
956 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
957 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
958 | purple_protocol_attention_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
959 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
960 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
961 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
962 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
963 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
964 | .class_size = sizeof(PurpleProtocolAttentionIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
965 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
966 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
967 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
968 | "PurpleProtocolAttentionIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
969 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
970 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
971 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
972 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
973 | gboolean |
| 36719 | 974 | purple_protocol_attention_iface_send(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
975 | PurpleConnection *gc, const char *username, guint type) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
976 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
977 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, send, gc, username, type); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
978 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
979 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
980 | GList * |
| 36719 | 981 | purple_protocol_attention_iface_get_types(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
982 | PurpleAccount *account) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
983 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
984 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, get_types, account); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
985 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
986 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
987 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
988 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
989 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
990 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
991 | * Protocol Media Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
992 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
993 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
994 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
995 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 996 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
997 | media_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
998 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
999 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1000 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1001 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 1002 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1003 | return media_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1004 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1005 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1006 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1007 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1008 | purple_protocol_media_iface_get_type(void) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1009 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1010 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1011 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1012 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1013 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1014 | .class_size = sizeof(PurpleProtocolMediaIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1015 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1016 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1017 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1018 | "PurpleProtocolMediaIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1019 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1020 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1021 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1022 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1023 | gboolean |
| 36719 | 1024 | purple_protocol_media_iface_initiate_session(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1025 | PurpleAccount *account, const char *who, PurpleMediaSessionType type) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1026 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1027 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, FALSE, initiate_session, account, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1028 | who, type); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1029 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1030 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1031 | PurpleMediaCaps |
| 36719 | 1032 | purple_protocol_media_iface_get_caps(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1033 | PurpleAccount *account, const char *who) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1034 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1035 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, 0, get_caps, account, who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1036 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1037 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1038 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1039 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1040 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1041 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1042 | * Protocol Factory Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1043 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1044 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1045 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1046 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 1047 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1048 | factory_iface->funcname(__VA_ARGS__); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1049 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1050 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1051 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1052 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 1053 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1054 | return factory_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1055 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1056 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1057 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1058 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1059 | purple_protocol_factory_iface_get_type(void) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1060 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1061 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1062 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1063 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1064 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1065 | .class_size = sizeof(PurpleProtocolFactoryIface), |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1066 | }; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1067 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1068 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1069 | "PurpleProtocolFactoryIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1070 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1071 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1072 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1073 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1074 | PurpleConnection * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1075 | purple_protocol_factory_iface_connection_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1076 | PurpleAccount *account, const char *password) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1077 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1078 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, connection_new, protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1079 | account, password); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1080 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1081 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1082 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1083 | purple_protocol_factory_iface_roomlist_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1084 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1085 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1086 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, roomlist_new, account); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1087 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1088 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1089 | PurpleWhiteboard * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1090 | purple_protocol_factory_iface_whiteboard_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1091 | PurpleAccount *account, const char *who, int state) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1092 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1093 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, whiteboard_new, account, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1094 | who, state); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1095 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1096 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1097 | PurpleXfer * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1098 | purple_protocol_factory_iface_xfer_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1099 | PurpleAccount *account, PurpleXferType type, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1100 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1101 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, xfer_new, account, type, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1102 | who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1103 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1104 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1105 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1106 | #undef DEFINE_PROTOCOL_FUNC |