annotate src/notify.c @ 12154:24bde295d755

[gaim-migrate @ 14455] Migrate the old idle reporting preference in a way to cause least confusion committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 19 Nov 2005 13:52:03 +0000
parents 216988c717da
children 64254fbabc7b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file notify.c Notification API
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 * @ingroup core
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 *
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 * gaim
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
6 *
8046
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
7 * Gaim is the legal property of its developers, whose names are too numerous
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
fa6395637e2c [gaim-migrate @ 8730]
Sean Egan <seanegan@gmail.com>
parents: 7035
diff changeset
9 * source distribution.
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
10 *
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * (at your option) any later version.
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 *
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 * GNU General Public License for more details.
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 *
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 */
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #include "notify.h"
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 static GaimNotifyUiOps *notify_ui_ops = NULL;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28 static GList *handles = NULL;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30 typedef struct
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 GaimNotifyType type;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 void *handle;
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
34 void *ui_handle;
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
35
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 } GaimNotifyInfo;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 void *
6356
ee0044f3e377 [gaim-migrate @ 6855]
Christian Hammond <chipx86@chipx86.com>
parents: 6106
diff changeset
39 gaim_notify_message(void *handle, GaimNotifyMsgType type,
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 const char *title, const char *primary,
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 const char *secondary, GCallback cb, void *user_data)
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
42 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43 GaimNotifyUiOps *ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 g_return_val_if_fail(primary != NULL, NULL);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
47 ops = gaim_notify_get_ui_ops();
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
48
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
49 if (ops != NULL && ops->notify_message != NULL) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
50 GaimNotifyInfo *info;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
51
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
52 info = g_new0(GaimNotifyInfo, 1);
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
53 info->type = GAIM_NOTIFY_MESSAGE;
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
54 info->handle = handle;
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
55 info->ui_handle = ops->notify_message(type, title, primary,
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
56 secondary, cb, user_data);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
57
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
58 handles = g_list_append(handles, info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
59
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
60 return info->ui_handle;
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
61 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 return NULL;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 void *
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 gaim_notify_email(void *handle, const char *subject, const char *from,
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 const char *to, const char *url, GCallback cb,
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 void *user_data)
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 GaimNotifyUiOps *ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
73 ops = gaim_notify_get_ui_ops();
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 if (ops != NULL && ops->notify_email != NULL) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 GaimNotifyInfo *info;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
78 info = g_new0(GaimNotifyInfo, 1);
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
79 info->type = GAIM_NOTIFY_EMAIL;
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
80 info->handle = handle;
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
81 info->ui_handle = ops->notify_email(subject, from, to, url, cb,
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
82 user_data);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 handles = g_list_append(handles, info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
86 return info->ui_handle;
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 return NULL;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 void *
5522
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
93 gaim_notify_emails(void *handle, size_t count, gboolean detailed,
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
94 const char **subjects, const char **froms,
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
95 const char **tos, const char **urls,
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 GCallback cb, void *user_data)
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 GaimNotifyUiOps *ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 g_return_val_if_fail(count != 0, NULL);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
101
5522
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
102 if (count == 1) {
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
103 return gaim_notify_email(handle,
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
104 (subjects == NULL ? NULL : *subjects),
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
105 (froms == NULL ? NULL : *froms),
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
106 (tos == NULL ? NULL : *tos),
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
107 (urls == NULL ? NULL : *urls),
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
108 cb, user_data);
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
109 }
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
110
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
111 ops = gaim_notify_get_ui_ops();
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
112
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
113 if (ops != NULL && ops->notify_emails != NULL) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
114 GaimNotifyInfo *info;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
115
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
116 info = g_new0(GaimNotifyInfo, 1);
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
117 info->type = GAIM_NOTIFY_EMAILS;
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
118 info->handle = handle;
5522
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
119 info->ui_handle = ops->notify_emails(count, detailed, subjects,
a3e6a5ef49b5 [gaim-migrate @ 5922]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
120 froms, tos, urls, cb, user_data);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
121
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
122 handles = g_list_append(handles, info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
123
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
124 return info->ui_handle;
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
125 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
126
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
127 return NULL;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
128 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
129
6381
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
130 void *
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
131 gaim_notify_formatted(void *handle, const char *title, const char *primary,
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
132 const char *secondary, const char *text,
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
133 GCallback cb, void *user_data)
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
134 {
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
135 GaimNotifyUiOps *ops;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
136
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
137 g_return_val_if_fail(primary != NULL, NULL);
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
138
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
139 ops = gaim_notify_get_ui_ops();
6381
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
140
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
141 if (ops != NULL && ops->notify_formatted != NULL) {
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
142 GaimNotifyInfo *info;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
143
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
144 info = g_new0(GaimNotifyInfo, 1);
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
145 info->type = GAIM_NOTIFY_FORMATTED;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
146 info->handle = handle;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
147 info->ui_handle = ops->notify_formatted(title, primary, secondary,
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
148 text, cb, user_data);
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
149
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
150 handles = g_list_append(handles, info);
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
151
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
152 return info->ui_handle;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
153 }
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
154
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
155 return NULL;
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
156 }
e006685f75aa [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6356
diff changeset
157
10439
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
158 void *
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
159 gaim_notify_searchresults(GaimConnection *gc, const char *title,
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
160 const char *primary, const char *secondary,
11359
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
161 GaimNotifySearchResults *results, GCallback cb, void *user_data)
10439
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
162 {
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
163 GaimNotifyUiOps *ops;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
164
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
165 ops = gaim_notify_get_ui_ops();
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
166
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
167 if (ops != NULL && ops->notify_searchresults != NULL) {
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
168 GaimNotifyInfo *info;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
169
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
170 info = g_new0(GaimNotifyInfo, 1);
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
171 info->type = GAIM_NOTIFY_SEARCHRESULTS;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
172 info->handle = gc;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
173 info->ui_handle = ops->notify_searchresults(gc, title, primary,
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
174 secondary, results,
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
175 cb, user_data);
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
176
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
177 handles = g_list_append(handles, info);
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
178
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
179 return info->ui_handle;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
180 }
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
181
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
182 return NULL;
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
183 }
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
184
11359
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
185 void
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
186 gaim_notify_searchresults_free(GaimNotifySearchResults *results)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
187 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
188 GList *l, *m;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
189
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
190 g_return_if_fail(results != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
191
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
192 for (l = results->buttons; l != NULL; l = l->next) {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
193 GaimNotifySearchButton *button = l->data;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
194
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
195 results->buttons = g_list_remove(results->buttons, button);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
196 g_free(button);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
197 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
198 g_list_free(results->buttons);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
199
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
200 for (l = results->rows; l != NULL; l = l->next) {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
201 GList *row = l->data;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
202
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
203 for (m = row; m != NULL; m = m->next) {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
204 gchar *str = m->data;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
205
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
206 m = g_list_remove(m, str);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
207 g_free(str);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
208 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
209
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
210 results->rows = g_list_remove(results->rows, row);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
211 g_list_free(row);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
212 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
213 g_list_free(results->rows);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
214
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
215 for (l = results->columns; l != NULL; l = l->next) {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
216 GaimNotifySearchColumn *column = l->data;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
217
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
218 results->columns = g_list_remove(results->columns, column);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
219 g_free(column->title);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
220 g_free(column);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
221 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
222 g_list_free(results->columns);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
223 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
224
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
225 void
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
226 gaim_notify_searchresults_new_rows(GaimConnection *gc,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
227 GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
228 void *data, void *user_data)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
229 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
230 GaimNotifyUiOps *ops;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
231
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
232 ops = gaim_notify_get_ui_ops();
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
233
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
234 if (ops != NULL && ops->notify_searchresults != NULL) {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
235 ops->notify_searchresults_new_rows(gc, results, data, user_data);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
236 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
237 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
238
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
239 void
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
240 gaim_notify_searchresults_button_add(GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
241 GaimNotifySearchButtonType type,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
242 GaimNotifySearchResultsCallback cb)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
243 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
244 GaimNotifySearchButton *button;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
245
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
246 g_return_if_fail(results != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
247 g_return_if_fail(cb != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
248
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
249 button = g_new0(GaimNotifySearchButton, 1);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
250 button->callback = cb;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
251 button->type = type;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
252
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
253 results->buttons = g_list_append(results->buttons, button);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
254 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
255
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
256 GaimNotifySearchResults *
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
257 gaim_notify_searchresults_new()
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
258 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
259 GaimNotifySearchResults *rs = g_new0(GaimNotifySearchResults, 1);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
260
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
261 return rs;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
262 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
263
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
264 void
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
265 gaim_notify_searchresults_column_add(GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
266 GaimNotifySearchColumn *column)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
267 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
268 g_return_if_fail(results != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
269 g_return_if_fail(column != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
270
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
271 results->columns = g_list_append(results->columns, column);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
272 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
273
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
274 void gaim_notify_searchresults_row_add(GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
275 GList *row)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
276 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
277 g_return_if_fail(results != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
278 g_return_if_fail(row != NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
279
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
280 results->rows = g_list_append(results->rows, row);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
281 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
282
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
283 GaimNotifySearchColumn *
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
284 gaim_notify_searchresults_column_new(const char *title)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
285 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
286 GaimNotifySearchColumn *sc;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
287
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
288 g_return_val_if_fail(title != NULL, NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
289
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
290 sc = g_new0(GaimNotifySearchColumn, 1);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
291 sc->title = g_strdup(title);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
292
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
293 return sc;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
294 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
295
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
296 int
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
297 gaim_notify_searchresults_get_columns_count(GaimNotifySearchResults *results)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
298 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
299 g_return_val_if_fail(results != NULL, -1);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
300
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
301 return g_list_length(results->columns);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
302 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
303
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
304 int
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
305 gaim_notify_searchresults_get_rows_count(GaimNotifySearchResults *results)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
306 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
307 g_return_val_if_fail(results != NULL, -1);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
308
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
309 return g_list_length(results->rows);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
310 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
311
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
312 char *
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
313 gaim_notify_searchresults_column_get_title(GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
314 unsigned int column_id)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
315 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
316 g_return_val_if_fail(results != NULL, NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
317
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
318 return ((GaimNotifySearchColumn *)g_list_nth_data(results->columns, column_id))->title;
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
319 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
320
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
321 GList *
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
322 gaim_notify_searchresults_row_get(GaimNotifySearchResults *results,
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
323 unsigned int row_id)
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
324 {
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
325 g_return_val_if_fail(results != NULL, NULL);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
326
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
327 return g_list_nth_data(results->rows, row_id);
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
328 }
9480e0d0f563 [gaim-migrate @ 13581]
Bartoz Oler <bartosz@pidgin.im>
parents: 10439
diff changeset
329
10439
911530134bf8 [gaim-migrate @ 11697]
Mark Doliner <mark@kingant.net>
parents: 10240
diff changeset
330 void *
11531
bf763a1b2454 [gaim-migrate @ 13780]
Luke Schierer <lschiere@pidgin.im>
parents: 11359
diff changeset
331 gaim_notify_userinfo(GaimConnection *gc, const char *who,
9797
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
332 const char *text, GCallback cb, void *user_data)
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
333 {
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
334 GaimNotifyUiOps *ops;
11531
bf763a1b2454 [gaim-migrate @ 13780]
Luke Schierer <lschiere@pidgin.im>
parents: 11359
diff changeset
335
11533
c9b815aeddc1 [gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents: 11531
diff changeset
336 g_return_val_if_fail(who != NULL, NULL);
9797
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
337
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
338 ops = gaim_notify_get_ui_ops();
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
339
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
340 if (ops != NULL && ops->notify_userinfo != NULL) {
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
341 GaimNotifyInfo *info;
12129
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
342 char *infotext = g_strdup(text);
9797
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
343
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
344 info = g_new0(GaimNotifyInfo, 1);
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
345 info->type = GAIM_NOTIFY_USERINFO;
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
346 info->handle = gc;
12129
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
347
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
348 gaim_signal_emit(gaim_notify_get_handle(), "displaying-userinfo",
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
349 gaim_connection_get_account(gc), who, &infotext);
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
350
11533
c9b815aeddc1 [gaim-migrate @ 13782]
Richard Laager <rlaager@wiktel.com>
parents: 11531
diff changeset
351 info->ui_handle = ops->notify_userinfo(gc, who,
12129
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
352 infotext, cb, user_data);
9797
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
353
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
354 handles = g_list_append(handles, info);
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
355
12129
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
356 g_free(infotext);
9797
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
357 return info->ui_handle;
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
358 }
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
359
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
360 return NULL;
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
361 }
62eb9fe24692 [gaim-migrate @ 10665]
Luke Schierer <lschiere@pidgin.im>
parents: 8046
diff changeset
362
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
363 void *
10240
95ca0db2d01d [gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10209
diff changeset
364 gaim_notify_uri(void *handle, const char *uri)
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
365 {
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
366 GaimNotifyUiOps *ops;
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
367
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
368 g_return_val_if_fail(uri != NULL, NULL);
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
369
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
370 ops = gaim_notify_get_ui_ops();
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
371
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
372 if (ops != NULL && ops->notify_uri != NULL) {
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
373 GaimNotifyInfo *info;
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
374
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
375 info = g_new0(GaimNotifyInfo, 1);
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
376 info->type = GAIM_NOTIFY_URI;
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
377 info->handle = handle;
10240
95ca0db2d01d [gaim-migrate @ 11377]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 10209
diff changeset
378 info->ui_handle = ops->notify_uri(uri);
6465
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
379
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
380 handles = g_list_append(handles, info);
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
381
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
382 return info->ui_handle;
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
383 }
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
384
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
385 return NULL;
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
386 }
fb64cc87bc96 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
387
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
388 void
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
389 gaim_notify_close(GaimNotifyType type, void *ui_handle)
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
390 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
391 GList *l;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
392 GaimNotifyUiOps *ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
393
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
394 g_return_if_fail(ui_handle != NULL);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
395
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
396 ops = gaim_notify_get_ui_ops();
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
397
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
398 for (l = handles; l != NULL; l = l->next) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
399 GaimNotifyInfo *info = l->data;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
400
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
401 if (info->ui_handle == ui_handle) {
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
402 handles = g_list_remove(handles, info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
403
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
404 if (ops != NULL && ops->close_notify != NULL)
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
405 ops->close_notify(info->type, ui_handle);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
406
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
407 g_free(info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
408
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
409 break;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
410 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
411 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
412 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
413
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
414 void
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
415 gaim_notify_close_with_handle(void *handle)
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
416 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
417 GList *l, *l_next;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
418 GaimNotifyUiOps *ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
419
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
420 g_return_if_fail(handle != NULL);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
421
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
422 ops = gaim_notify_get_ui_ops();
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
423
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
424 for (l = handles; l != NULL; l = l_next) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
425 GaimNotifyInfo *info = l->data;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
426
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
427 l_next = l->next;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
428
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
429 if (info->handle == handle) {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
430 handles = g_list_remove(handles, info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
431
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
432 if (ops != NULL && ops->close_notify != NULL)
5476
9bcd8cd625ae [gaim-migrate @ 5872]
Christian Hammond <chipx86@chipx86.com>
parents: 5437
diff changeset
433 ops->close_notify(info->type, info->ui_handle);
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
434
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
435 g_free(info);
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
436 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
437 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
438 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
439
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
440 void
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
441 gaim_notify_set_ui_ops(GaimNotifyUiOps *ops)
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
442 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
443 notify_ui_ops = ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
444 }
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
445
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
446 GaimNotifyUiOps *
7035
feb3d21a7794 [gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents: 6465
diff changeset
447 gaim_notify_get_ui_ops(void)
5437
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
448 {
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
449 return notify_ui_ops;
0031a613a87d [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
450 }
12129
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
451
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
452 void *
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
453 gaim_notify_get_handle(void)
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
454 {
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
455 static int handle;
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
456
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
457 return &handle;
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
458 }
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
459
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
460 void
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
461 gaim_notify_init(void)
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
462 {
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
463 gpointer handle = gaim_notify_get_handle();
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
464
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
465 gaim_signal_register(handle, "displaying-userinfo",
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
466 gaim_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
467 gaim_value_new(GAIM_TYPE_SUBTYPE,
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
468 GAIM_SUBTYPE_ACCOUNT),
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
469 gaim_value_new(GAIM_TYPE_STRING),
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
470 gaim_value_new_outgoing(GAIM_TYPE_STRING));
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
471 }
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
472
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
473 void
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
474 gaim_notify_uninit(void)
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
475 {
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
476 gaim_signals_unregister_by_instance(gaim_notify_get_handle());
216988c717da [gaim-migrate @ 14429]
Richard Laager <rlaager@wiktel.com>
parents: 11533
diff changeset
477 }