Fri, 31 Jan 2014 19:01:27 +0530
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Avoid confusion with the 'options' field
| 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 * |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
64 | purple_protocol_get_account_options(const PurpleProtocol *protocol) |
|
36617
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 | |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
68 | return protocol->account_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 | { |
|
36844
b62140058cd3
Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents:
36731
diff
changeset
|
90 | g_return_if_fail(PURPLE_IS_PROTOCOL(protocol)); |
|
36686
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 |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
101 | account_options_free(PurpleProtocol *protocol) |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
102 | { |
|
36844
b62140058cd3
Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents:
36731
diff
changeset
|
103 | g_return_if_fail(PURPLE_IS_PROTOCOL(protocol)); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
104 | |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
105 | while (protocol->account_options) { |
|
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
106 | PurpleAccountOption *option = protocol->account_options->data; |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
107 | purple_account_option_destroy(option); |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
108 | protocol->account_options = |
|
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
109 | g_list_delete_link(protocol->account_options, |
|
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
110 | protocol->account_options); |
|
36686
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 | { |
|
36844
b62140058cd3
Check for valid PurpleProtocols
Ankit Vani <a@nevitus.org>
parents:
36731
diff
changeset
|
117 | g_return_if_fail(PURPLE_IS_PROTOCOL(protocol)); |
|
36686
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) |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
132 | account_options_free(protocol); |
|
36686
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 |
|
36847
58597c72e6ac
Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents:
36844
diff
changeset
|
147 | purple_protocol_finalize(GObject *object) |
|
36617
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 | |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
173 | user_splits_free(protocol); |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36847
diff
changeset
|
174 | account_options_free(protocol); |
|
36686
9807e4acf281
Added PurpleProtocolOverrideFlags and purple_protocol_override()
Ankit Vani <a@nevitus.org>
parents:
36681
diff
changeset
|
175 | 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
|
176 | |
|
36847
58597c72e6ac
Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents:
36844
diff
changeset
|
177 | PURPLE_DBUS_UNREGISTER_POINTER(protocol); |
|
58597c72e6ac
Moved dispose() code from PurplePluginInfo and PurpleProtocol to finalize()
Ankit Vani <a@nevitus.org>
parents:
36844
diff
changeset
|
178 | |
|
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 | 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
|
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 | |
|
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 | static void |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
183 | 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
|
184 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
185 | 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
|
186 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
187 | 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
|
188 | |
|
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
|
189 | 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
|
190 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
191 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
192 | GType |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
193 | 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
|
194 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
195 | 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
|
196 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
197 | 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
|
198 | 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
|
199 | .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
|
200 | .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
|
201 | .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
|
202 | .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
|
203 | }; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
204 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
205 | 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
|
206 | &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
|
207 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
208 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
209 | return type; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
210 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
211 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
212 | /************************************************************************** |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
213 | * 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
|
214 | **************************************************************************/ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
215 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
216 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
217 | g_return_if_fail(klass != NULL); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
218 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
219 | 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
|
220 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
221 | #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
|
222 | PurpleProtocolClass *klass = PURPLE_PROTOCOL_GET_CLASS(protocol); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
223 | g_return_val_if_fail(klass != NULL, defaultreturn); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
224 | if (klass->funcname) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
225 | 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
|
226 | else \ |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
227 | return defaultreturn; |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
228 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
229 | void |
| 36719 | 230 | 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
|
231 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
232 | 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
|
233 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
234 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
235 | void |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
236 | 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
|
237 | { |
|
36731
38de3f22e864
Renamed close_connection back to close
Ankit Vani <a@nevitus.org>
parents:
36726
diff
changeset
|
238 | DEFINE_PROTOCOL_FUNC(protocol, close, gc); |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
239 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
240 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
241 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
242 | purple_protocol_class_status_types(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
243 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
244 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
245 | 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
|
246 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
247 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
248 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
249 | purple_protocol_class_list_icon(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
250 | PurpleAccount *account, PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
251 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
252 | 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
|
253 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
254 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
255 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
256 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
257 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
258 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
259 | * Protocol Client Interface API |
|
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 DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
262 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
263 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 264 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
265 | client_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
268 | PurpleProtocolClientIface *client_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
269 | PURPLE_PROTOCOL_GET_CLIENT_IFACE(protocol); \ |
| 36726 | 270 | if (client_iface && client_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
271 | return client_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
272 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
273 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
274 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
275 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
276 | 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
|
277 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
278 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
279 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
280 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
281 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
282 | .class_size = sizeof(PurpleProtocolClientIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
285 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
286 | "PurpleProtocolClientIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
287 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
288 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
289 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
290 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
291 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
292 | purple_protocol_client_iface_get_actions(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
293 | PurpleConnection *gc) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
294 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
295 | 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
|
296 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
297 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
298 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
299 | purple_protocol_client_iface_list_emblem(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
300 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
301 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
302 | 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
|
303 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
304 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
305 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
306 | purple_protocol_client_iface_status_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
307 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
308 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
309 | 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
|
310 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
311 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
312 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
313 | purple_protocol_client_iface_tooltip_text(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
314 | PurpleBuddy *buddy, PurpleNotifyUserInfo *user_info, gboolean full) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
315 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
316 | 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
|
317 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
318 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
319 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
320 | purple_protocol_client_iface_blist_node_menu(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
321 | PurpleBlistNode *node) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
322 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
323 | 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
|
324 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
325 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
326 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
327 | purple_protocol_client_iface_buddy_free(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
328 | PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
329 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
330 | 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
|
331 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
332 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
333 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
334 | purple_protocol_client_iface_convo_closed(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
335 | PurpleConnection *gc, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
336 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
337 | DEFINE_PROTOCOL_FUNC(protocol, convo_closed, gc, who); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
340 | const char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
341 | purple_protocol_client_iface_normalize(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
342 | const PurpleAccount *account, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
343 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
344 | 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
|
345 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
346 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
347 | PurpleChat * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
348 | purple_protocol_client_iface_find_blist_chat(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
349 | PurpleAccount *account, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
350 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
351 | 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
|
352 | name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
353 | } |
|
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 | gboolean |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
356 | purple_protocol_client_iface_offline_message(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
357 | const PurpleBuddy *buddy) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
358 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
359 | 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
|
360 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
361 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
362 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
363 | 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
|
364 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
365 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
366 | 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
|
367 | account); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
368 | } |
|
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 | PurpleMood * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
371 | purple_protocol_client_iface_get_moods(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
372 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
373 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
374 | 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
|
375 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
376 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
377 | gssize |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
378 | 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
|
379 | PurpleConversation *conv) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
380 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
381 | 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
|
382 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
383 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
384 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
385 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
386 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
387 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
388 | * Protocol Server Interface API |
|
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 DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
391 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
392 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 393 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
394 | server_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
397 | PurpleProtocolServerIface *server_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
398 | PURPLE_PROTOCOL_GET_SERVER_IFACE(protocol); \ |
| 36726 | 399 | if (server_iface && server_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
400 | return server_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
401 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
402 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
403 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
404 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
405 | purple_protocol_server_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
406 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
407 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
408 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
409 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
410 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
411 | .class_size = sizeof(PurpleProtocolServerIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
414 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
415 | "PurpleProtocolServerIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
416 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
417 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
418 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
419 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
420 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
421 | purple_protocol_server_iface_register_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
422 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
423 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
424 | DEFINE_PROTOCOL_FUNC(protocol, register_user, account); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
427 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
428 | purple_protocol_server_iface_unregister_user(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
429 | PurpleAccount *account, PurpleAccountUnregistrationCb cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
430 | void *user_data) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
431 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
432 | 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
|
433 | } |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
436 | purple_protocol_server_iface_set_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
437 | 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
|
438 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
439 | 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
|
440 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
441 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
442 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
443 | purple_protocol_server_iface_get_info(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
444 | 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
|
445 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
446 | 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
|
447 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
448 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
449 | void |
| 36719 | 450 | purple_protocol_server_iface_set_status(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
451 | 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
|
452 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
453 | 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
|
454 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
455 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
456 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
457 | purple_protocol_server_iface_set_idle(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
458 | 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
|
459 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
460 | 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
|
461 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
462 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
463 | void |
| 36719 | 464 | purple_protocol_server_iface_change_passwd(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
465 | 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
|
466 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
467 | 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
|
468 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
469 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
470 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
471 | purple_protocol_server_iface_add_buddy(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
472 | PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
473 | 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
|
474 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
475 | 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
|
476 | } |
|
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 | void |
| 36719 | 479 | purple_protocol_server_iface_add_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
480 | PurpleConnection *gc, GList *buddies, GList *groups, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
481 | 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
|
482 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
483 | 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
|
484 | } |
|
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 | void |
| 36719 | 487 | purple_protocol_server_iface_remove_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
488 | 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
|
489 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
490 | 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
|
491 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
492 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
493 | void |
| 36719 | 494 | purple_protocol_server_iface_remove_buddies(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
495 | 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
|
496 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
497 | 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
|
498 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
499 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
500 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
501 | purple_protocol_server_iface_keepalive(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
502 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
503 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
504 | 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
|
505 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
506 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
507 | void |
| 36719 | 508 | purple_protocol_server_iface_alias_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
509 | 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
|
510 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
511 | 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
|
512 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
513 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
514 | void |
| 36719 | 515 | purple_protocol_server_iface_group_buddy(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
516 | PurpleConnection *gc, const char *who, const char *old_group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
517 | 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
|
518 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
519 | 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
|
520 | } |
|
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 | void |
| 36719 | 523 | purple_protocol_server_iface_rename_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
524 | PurpleConnection *gc, const char *old_name, PurpleGroup *group, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
525 | 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
|
526 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
527 | 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
|
528 | moved_buddies); |
|
36617
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_set_buddy_icon(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
533 | 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
|
534 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
535 | 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
|
536 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
537 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
538 | void |
| 36719 | 539 | purple_protocol_server_iface_remove_group(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
540 | 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
|
541 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
542 | 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
|
543 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
544 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
545 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
546 | purple_protocol_server_iface_send_raw(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
547 | PurpleConnection *gc, const char *buf, int len) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
548 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
549 | 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
|
550 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
551 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
552 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
553 | purple_protocol_server_iface_set_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
554 | PurpleConnection *gc, const char *alias, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
555 | PurpleSetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
556 | PurpleSetPublicAliasFailureCallback failure_cb) |
|
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(protocol, set_public_alias, gc, alias, success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
559 | failure_cb); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
562 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
563 | purple_protocol_server_iface_get_public_alias(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
564 | PurpleConnection *gc, PurpleGetPublicAliasSuccessCallback success_cb, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
565 | PurpleGetPublicAliasFailureCallback 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, get_public_alias, gc, 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 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
572 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
573 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
574 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
575 | * Protocol IM Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
576 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
577 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
578 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
579 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 580 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
581 | im_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
584 | PurpleProtocolIMIface *im_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
585 | PURPLE_PROTOCOL_GET_IM_IFACE(protocol); \ |
| 36726 | 586 | if (im_iface && im_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
587 | return im_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
588 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
589 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
590 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
591 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
592 | purple_protocol_im_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
593 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
594 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
595 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
596 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
597 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
598 | .class_size = sizeof(PurpleProtocolIMIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
601 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
602 | "PurpleProtocolIMIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
603 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
604 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
605 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
606 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
607 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
608 | purple_protocol_im_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
609 | const char *who, const char *message, PurpleMessageFlags flags) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
610 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
611 | 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
|
612 | flags); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
613 | } |
|
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 | unsigned int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
616 | purple_protocol_im_iface_send_typing(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
617 | PurpleConnection *gc, const char *name, PurpleIMTypingState state) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
618 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
619 | 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
|
620 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
621 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
622 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
623 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
624 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
625 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
626 | * Protocol Chat Interface API |
|
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 DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
629 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
630 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 631 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
632 | chat_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
635 | PurpleProtocolChatIface *chat_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
636 | PURPLE_PROTOCOL_GET_CHAT_IFACE(protocol); \ |
| 36726 | 637 | if (chat_iface && chat_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
638 | return chat_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
639 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
640 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
641 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
642 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
643 | purple_protocol_chat_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
644 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
645 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
646 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
647 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
648 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
649 | .class_size = sizeof(PurpleProtocolChatIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
652 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
653 | "PurpleProtocolChatIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
654 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
655 | return type; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
656 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
657 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
658 | GList * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
659 | purple_protocol_chat_iface_info(PurpleProtocol *protocol, PurpleConnection *gc) |
|
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 | DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol, NULL, info, gc); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
662 | } |
|
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 | GHashTable * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
665 | purple_protocol_chat_iface_info_defaults(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
666 | PurpleConnection *gc, const char *chat_name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
667 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
668 | 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
|
669 | chat_name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
670 | } |
|
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 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
673 | purple_protocol_chat_iface_join(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
674 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
675 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
676 | DEFINE_PROTOCOL_FUNC(protocol, join, gc, components); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
677 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
678 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
679 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
680 | purple_protocol_chat_iface_reject(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
681 | PurpleConnection *gc, GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
682 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
683 | DEFINE_PROTOCOL_FUNC(protocol, reject, gc, 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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
686 | char * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
687 | purple_protocol_chat_iface_get_name(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
688 | GHashTable *components) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
689 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
690 | 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
|
691 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
692 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
693 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
694 | purple_protocol_chat_iface_invite(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
695 | 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
|
696 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
697 | DEFINE_PROTOCOL_FUNC(protocol, invite, gc, id, message, who); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
700 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
701 | purple_protocol_chat_iface_leave(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
702 | int id) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
703 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
704 | DEFINE_PROTOCOL_FUNC(protocol, leave, gc, id); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
707 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
708 | purple_protocol_chat_iface_whisper(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
709 | 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
|
710 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
711 | DEFINE_PROTOCOL_FUNC(protocol, whisper, gc, id, who, message); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
714 | int |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
715 | purple_protocol_chat_iface_send(PurpleProtocol *protocol, PurpleConnection *gc, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
716 | int id, const char *message, PurpleMessageFlags flags) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
717 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
718 | 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
|
719 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
720 | |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
721 | char * |
| 36719 | 722 | 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
|
723 | 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
|
724 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
725 | 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
|
726 | who); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
727 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
728 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
729 | void |
| 36719 | 730 | purple_protocol_chat_iface_set_topic(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
731 | 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
|
732 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
733 | 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
|
734 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
735 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
736 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
737 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
738 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
739 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
740 | * Protocol Privacy Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
741 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
742 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
743 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
744 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 745 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
746 | privacy_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
749 | PurpleProtocolPrivacyIface *privacy_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
750 | PURPLE_PROTOCOL_GET_PRIVACY_IFACE(protocol); \ |
| 36726 | 751 | if (privacy_iface && privacy_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
752 | return privacy_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
753 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
754 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
755 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
756 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
757 | 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
|
758 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
759 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
760 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
761 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
762 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
763 | .class_size = sizeof(PurpleProtocolPrivacyIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
766 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
767 | "PurpleProtocolPrivacyIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
768 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
769 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
770 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
771 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
772 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
773 | purple_protocol_privacy_iface_add_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
774 | 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
|
775 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
776 | 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
|
777 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
778 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
779 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
780 | purple_protocol_privacy_iface_add_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
781 | 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
|
782 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
783 | DEFINE_PROTOCOL_FUNC(protocol, add_deny, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
784 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
785 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
786 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
787 | purple_protocol_privacy_iface_rem_permit(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
788 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
789 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
790 | DEFINE_PROTOCOL_FUNC(protocol, rem_permit, gc, name); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
791 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
792 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
793 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
794 | purple_protocol_privacy_iface_rem_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
795 | PurpleConnection *gc, const char *name) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
796 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
797 | 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
|
798 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
799 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
800 | void |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
801 | purple_protocol_privacy_iface_set_permit_deny(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
802 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
803 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
804 | DEFINE_PROTOCOL_FUNC(protocol, set_permit_deny, gc); |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
807 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
808 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
809 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
810 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
811 | * Protocol Xfer Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
812 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
813 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
814 | PurpleProtocolXferIface *xfer_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
815 | PURPLE_PROTOCOL_GET_XFER_IFACE(protocol); \ |
| 36726 | 816 | if (xfer_iface && xfer_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
817 | xfer_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
820 | PurpleProtocolXferIface *xfer_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
821 | PURPLE_PROTOCOL_GET_XFER_IFACE(protocol); \ |
| 36726 | 822 | if (xfer_iface && xfer_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
823 | return xfer_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
824 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
825 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
826 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
827 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
828 | purple_protocol_xfer_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
829 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
830 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
831 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
832 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
833 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
834 | .class_size = sizeof(PurpleProtocolXferIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
837 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
838 | "PurpleProtocolXferIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
839 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
840 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
841 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
842 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
843 | gboolean |
| 36719 | 844 | purple_protocol_xfer_iface_can_receive(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
845 | 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
|
846 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
847 | 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
|
848 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
849 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
850 | void |
| 36719 | 851 | 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
|
852 | 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
|
853 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
854 | 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
|
855 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
856 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
857 | PurpleXfer * |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
858 | purple_protocol_xfer_iface_new_xfer(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
859 | 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
|
860 | { |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
861 | 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
|
862 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
863 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
864 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
865 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
866 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
867 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
868 | * Protocol Roomlist Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
869 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
870 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
871 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
872 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 873 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
874 | roomlist_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
877 | PurpleProtocolRoomlistIface *roomlist_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
878 | PURPLE_PROTOCOL_GET_ROOMLIST_IFACE(protocol); \ |
| 36726 | 879 | if (roomlist_iface && roomlist_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
880 | return roomlist_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
881 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
882 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
883 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
884 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
885 | 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
|
886 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
887 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
888 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
889 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
890 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
891 | .class_size = sizeof(PurpleProtocolRoomlistIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
894 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
895 | "PurpleProtocolRoomlistIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
896 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
897 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
898 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
899 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
900 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
901 | purple_protocol_roomlist_iface_get_list(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
902 | PurpleConnection *gc) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
903 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
904 | 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
|
905 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
906 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
907 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
908 | purple_protocol_roomlist_iface_cancel(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
909 | PurpleRoomlist *list) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
910 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
911 | DEFINE_PROTOCOL_FUNC(protocol, cancel, list); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
912 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
913 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
914 | void |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
915 | purple_protocol_roomlist_iface_expand_category(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
916 | PurpleRoomlist *list, PurpleRoomlistRoom *category) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
917 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
918 | 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
|
919 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
920 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
921 | char * |
| 36719 | 922 | purple_protocol_roomlist_iface_room_serialize(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
923 | PurpleRoomlistRoom *room) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
924 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
925 | 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
|
926 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
927 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
928 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
929 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
930 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
931 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
932 | * Protocol Attention Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
933 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
934 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
935 | PurpleProtocolAttentionIface *attention_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
936 | PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \ |
| 36726 | 937 | if (attention_iface && attention_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
938 | attention_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
941 | PurpleProtocolAttentionIface *attention_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
942 | PURPLE_PROTOCOL_GET_ATTENTION_IFACE(protocol); \ |
| 36726 | 943 | if (attention_iface && attention_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
944 | return attention_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
945 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
946 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
947 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
948 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
949 | purple_protocol_attention_iface_get_type(void) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
950 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
951 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
952 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
953 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
954 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
955 | .class_size = sizeof(PurpleProtocolAttentionIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
958 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
959 | "PurpleProtocolAttentionIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
960 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
961 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
962 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
963 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
964 | gboolean |
| 36719 | 965 | purple_protocol_attention_iface_send(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
966 | 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
|
967 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
968 | 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
|
969 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
970 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
971 | GList * |
| 36719 | 972 | purple_protocol_attention_iface_get_types(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
973 | PurpleAccount *account) |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
974 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
975 | 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
|
976 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
977 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
978 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
979 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
980 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
981 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
982 | * Protocol Media Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
983 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
984 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
985 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
986 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 987 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
988 | media_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
991 | PurpleProtocolMediaIface *media_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
992 | PURPLE_PROTOCOL_GET_MEDIA_IFACE(protocol); \ |
| 36726 | 993 | if (media_iface && media_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
994 | return media_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
995 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
996 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
997 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
998 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
999 | 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
|
1000 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1001 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1002 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1003 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1004 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1005 | .class_size = sizeof(PurpleProtocolMediaIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1008 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1009 | "PurpleProtocolMediaIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1010 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1011 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1012 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1013 | |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1014 | gboolean |
| 36719 | 1015 | purple_protocol_media_iface_initiate_session(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1016 | 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
|
1017 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1018 | 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
|
1019 | who, type); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1020 | } |
|
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 | PurpleMediaCaps |
| 36719 | 1023 | purple_protocol_media_iface_get_caps(PurpleProtocol *protocol, |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1024 | 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
|
1025 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1026 | 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
|
1027 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1028 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1029 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1030 | #undef DEFINE_PROTOCOL_FUNC |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1031 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1032 | /************************************************************************** |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1033 | * Protocol Factory Interface API |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1034 | **************************************************************************/ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1035 | #define DEFINE_PROTOCOL_FUNC(protocol,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1036 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1037 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 1038 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1039 | factory_iface->funcname(__VA_ARGS__); |
|
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 | #define DEFINE_PROTOCOL_FUNC_WITH_RETURN(protocol,defaultreturn,funcname,...) \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1042 | PurpleProtocolFactoryIface *factory_iface = \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1043 | PURPLE_PROTOCOL_GET_FACTORY_IFACE(protocol); \ |
| 36726 | 1044 | if (factory_iface && factory_iface->funcname) \ |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1045 | return factory_iface->funcname(__VA_ARGS__); \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1046 | else \ |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1047 | return defaultreturn; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1048 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1049 | GType |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1050 | 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
|
1051 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1052 | static GType type = 0; |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1053 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1054 | if (G_UNLIKELY(type == 0)) { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1055 | static const GTypeInfo info = { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1056 | .class_size = sizeof(PurpleProtocolFactoryIface), |
|
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 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1059 | type = g_type_register_static(G_TYPE_INTERFACE, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1060 | "PurpleProtocolFactoryIface", &info, 0); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1061 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1062 | return type; |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1063 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1064 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1065 | PurpleConnection * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1066 | purple_protocol_factory_iface_connection_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1067 | 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
|
1068 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1069 | 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
|
1070 | account, password); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1071 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1072 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1073 | PurpleRoomlist * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1074 | purple_protocol_factory_iface_roomlist_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1075 | PurpleAccount *account) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1076 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1077 | 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
|
1078 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1079 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1080 | PurpleWhiteboard * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1081 | purple_protocol_factory_iface_whiteboard_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1082 | 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
|
1083 | { |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1084 | 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
|
1085 | who, state); |
|
36617
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1086 | } |
|
be16459a68e9
Finished implementation of protocol object and interface stuff in protocol.[ch].
Ankit Vani <a@nevitus.org>
parents:
36560
diff
changeset
|
1087 | |
|
36722
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1088 | PurpleXfer * |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1089 | purple_protocol_factory_iface_xfer_new(PurpleProtocol *protocol, |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1090 | PurpleAccount *account, PurpleXferType type, const char *who) |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1091 | { |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1092 | 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
|
1093 | who); |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1094 | } |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1095 | |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1096 | #undef DEFINE_PROTOCOL_FUNC_WITH_RETURN |
|
49872e1ec30e
Defined the new interface functions
Ankit Vani <a@nevitus.org>
parents:
36719
diff
changeset
|
1097 | #undef DEFINE_PROTOCOL_FUNC |