Mercurial > pidgin.yaz
annotate plugins/notify.c @ 5677:0adfd56b46b5
[gaim-migrate @ 6095]
The conversation API now has glib parameter checks, which should let us
know if we're passing invalid stuff to them.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 02 Jun 2003 22:13:42 +0000 |
parents | dae79aefac8d |
children | 7d385de2f9cd |
rev | line source |
---|---|
3392 | 1 /* Rewritten by Etan Reisner <deryni@eden.rutgers.edu> |
3374 | 2 * |
3 * Added config dialog | |
4 * Added control over notification method | |
5 * Added control over when to release notification | |
4035 | 6 * |
7 * Added option to get notification for chats also | |
8 * Cleaned up code | |
9 * Added option to notify on click as it's own option | |
10 * rather then as what happens when on focus isn't clicked | |
11 * Added apply button to change the denotification methods for | |
12 * open conversation windows | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
13 * Fixed apply to conversations, count now keeps count across applies |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
14 * Fixed(?) memory leak, and in the process fixed some stupidities |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
15 * Hit enter when done editing the title string entry box to save it |
3392 | 16 * |
17 * Thanks to Carles Pina i Estany <carles@pinux.info> | |
18 * for count of new messages option | |
19 */ | |
20 | |
4202
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4165
diff
changeset
|
21 #include "config.h" |
59751fe608c5
[gaim-migrate @ 4438]
Christian Hammond <chipx86@chipx86.com>
parents:
4165
diff
changeset
|
22 |
191 | 23 #include "gaim.h" |
3428 | 24 #include <string.h> |
25 #include <ctype.h> | |
26 #include <stdlib.h> | |
191 | 27 #include <gtk/gtk.h> |
3385 | 28 #include <X11/Xlib.h> |
3374 | 29 #include <X11/Xutil.h> |
3392 | 30 #include <X11/Xatom.h> |
3374 | 31 #include <gdk/gdkx.h> |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
32 #include "gtkplugin.h" |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
33 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
34 #define NOTIFY_PLUGIN_ID "gtk-notify" |
3374 | 35 |
3710 | 36 guint type = 1; |
5021 | 37 #define TYPE_IM 0x00000001 |
38 #define TYPE_CHAT 0x00000002 | |
3710 | 39 |
3392 | 40 guint choice = 1; |
41 #define NOTIFY_FOCUS 0x00000001 | |
42 #define NOTIFY_TYPE 0x00000002 | |
5021 | 43 #define NOTIFY_IN_FOCUS 0x00000004 |
44 #define NOTIFY_CLICK 0x00000008 | |
3374 | 45 |
3392 | 46 guint method = 1; |
47 #define METHOD_STRING 0x00000001 | |
48 #define METHOD_QUOTE 0x00000002 | |
49 #define METHOD_URGENT 0x00000004 | |
50 #define METHOD_COUNT 0x00000008 | |
191 | 51 |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
52 static GaimPlugin *my_plugin = NULL; |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
53 |
191 | 54 void *handle; |
3565 | 55 GtkWidget *Entry; |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
56 gchar *title_string; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
57 int Number = 0; |
191 | 58 |
3374 | 59 /* predefine some functions, less warnings */ |
60 void options(GtkWidget *widget, gpointer data); | |
4047 | 61 /* this returns an int so that typing events don't get stopped here */ |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
62 int un_star(GtkWidget *widget, gpointer data); |
3428 | 63 int counter (char *buf, int *length); |
4035 | 64 /*string functions */ |
65 void string_add(GtkWidget *widget); | |
66 gboolean string_remove(GtkWidget *widget); | |
67 /* count functions */ | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
68 void count_add(GtkWidget *widget, int number); |
4035 | 69 gboolean count_remove(GtkWidget *widget); |
70 /* quote functions */ | |
71 void quote_add(GtkWidget *widget); | |
72 gboolean quote_remove(GtkWidget *widget); | |
73 /* urgent functions */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
74 void urgent_add(GaimConversation *c); |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
75 gboolean urgent_remove(GaimConversation *c); |
3710 | 76 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
77 int notify(GaimConversation *cnv) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
78 GaimGtkWindow *gtkwin; |
3710 | 79 Window focus_return; |
4035 | 80 int revert_to_return; |
191 | 81 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
82 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(cnv)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
83 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
84 XGetInputFocus(GDK_WINDOW_XDISPLAY(gtkwin->window->window), &focus_return, &revert_to_return); |
3374 | 85 |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
86 if ((choice & NOTIFY_IN_FOCUS) || |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
87 focus_return != GDK_WINDOW_XWINDOW(gtkwin->window->window)) { |
4035 | 88 if (method & METHOD_STRING) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
89 string_add(gtkwin->window); |
4035 | 90 if (method & METHOD_COUNT) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
91 count_add(gtkwin->window, 0); |
4035 | 92 if (method & METHOD_QUOTE) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
93 quote_add(gtkwin->window); |
4035 | 94 if (method & METHOD_URGENT) |
95 urgent_add(cnv); | |
3374 | 96 } |
97 return 0; | |
98 } | |
99 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
100 guint unnotify(GaimConversation *c, gboolean clean) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
101 GaimGtkWindow *gtkwin; |
4035 | 102 guint option = 0; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
103 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
104 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5021 | 105 |
4043 | 106 /* The top level ifs check whether we are either cleaning all methods, |
107 * or whether we have that method is currently selected. | |
108 * If we do then they are cleaned | |
109 * | |
110 * The second level ifs check if we removed something, | |
111 * and if that method is currently selected. | |
112 * If we did and it is then set option so that it can be re-added */ | |
4035 | 113 if (clean || (method & METHOD_QUOTE)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
114 if (quote_remove(gtkwin->window) && (method & METHOD_QUOTE)) |
4035 | 115 option ^= METHOD_QUOTE; |
5021 | 116 |
4035 | 117 if (clean || (method & METHOD_COUNT)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
118 if (count_remove(gtkwin->window) && (method & METHOD_COUNT)) |
4035 | 119 option ^= METHOD_COUNT; |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
120 |
4035 | 121 if (clean || (method & METHOD_STRING)) |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
122 if (string_remove(gtkwin->window) && (method & METHOD_STRING)) |
4035 | 123 option ^= METHOD_STRING; |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
124 |
4035 | 125 if (clean || (method & METHOD_URGENT)) |
4043 | 126 if (urgent_remove(c) && (method & METHOD_URGENT)) |
4035 | 127 option ^= METHOD_URGENT; |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
128 |
4035 | 129 return option; |
3374 | 130 } |
131 | |
3710 | 132 void chat_recv_im(struct gaim_connection *gc, int id, char **who, char **text) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
133 GaimConversation *c = gaim_find_chat(gc, id); |
3710 | 134 |
135 if (c && (type & TYPE_CHAT)) | |
136 notify(c); | |
137 return; | |
138 } | |
139 | |
140 void chat_sent_im(struct gaim_connection *gc, int id, char **text) { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
141 GaimConversation *c = gaim_find_chat(gc, id); |
3710 | 142 |
143 if (c && (type & TYPE_CHAT)) | |
4035 | 144 unnotify(c, FALSE); |
3710 | 145 return; |
146 } | |
147 | |
148 int im_recv_im(struct gaim_connection *gc, char **who, char **what, void *m) { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
149 GaimConversation *c = gaim_find_conversation(*who); |
3710 | 150 |
151 if (c && (type & TYPE_IM)) | |
152 notify(c); | |
153 return 0; | |
154 } | |
155 | |
156 int im_sent_im(struct gaim_connection *gc, char *who, char **what, void *m) { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
157 GaimConversation *c = gaim_find_conversation(who); |
3374 | 158 |
3710 | 159 if (c && (type & TYPE_IM)) |
4035 | 160 unnotify(c, FALSE); |
3710 | 161 return 0; |
162 } | |
3392 | 163 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
164 int attach_signals(GaimConversation *c) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
165 GaimGtkConversation *gtkconv; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
166 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
167 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
168 gtkconv = GAIM_GTK_CONVERSATION(c); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
169 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
170 |
3392 | 171 if (choice & NOTIFY_FOCUS) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
172 g_signal_connect(G_OBJECT(gtkwin->window), "focus-in-event", G_CALLBACK(un_star), NULL); |
3374 | 173 } |
3710 | 174 |
175 if (choice & NOTIFY_CLICK) { | |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
176 g_signal_connect(G_OBJECT(gtkwin->window), "button_press_event", G_CALLBACK(un_star), NULL); |
4035 | 177 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
178 g_signal_connect_swapped(G_OBJECT(gtkconv->imhtml), "button_press_event", G_CALLBACK(un_star), G_OBJECT(gtkwin->window)); |
4035 | 179 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
180 g_signal_connect_swapped(G_OBJECT(gtkconv->entry), "button_press_event", G_CALLBACK(un_star), G_OBJECT(gtkwin->window)); |
3374 | 181 } |
182 | |
3392 | 183 if (choice & NOTIFY_TYPE) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
184 g_signal_connect_swapped(G_OBJECT(gtkconv->entry), "key-press-event", G_CALLBACK(un_star), G_OBJECT(gtkwin->window)); |
191 | 185 } |
4035 | 186 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
187 g_object_set_data(G_OBJECT(gtkwin->window), "user_data", c); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
188 g_object_set_data(G_OBJECT(gtkwin->window), "notify_data", GUINT_TO_POINTER(choice)); |
3428 | 189 return 0; |
191 | 190 } |
191 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
192 void detach_signals(GaimConversation *c) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
193 GaimGtkConversation *gtkconv; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
194 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
195 guint options; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
196 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
197 gtkconv = GAIM_GTK_CONVERSATION(c); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
198 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
199 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
200 options = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(gtkwin->window), "notify_data")); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
201 |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
202 if (options & NOTIFY_FOCUS) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
203 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkwin->window), un_star, NULL); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
204 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
205 if (options & NOTIFY_CLICK) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
206 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkwin->window), un_star, NULL); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
207 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->imhtml), un_star, gtkwin->window); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
208 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry), un_star, gtkwin->window); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
209 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
210 |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
211 if (options & NOTIFY_TYPE) { |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
212 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkconv->entry), un_star, gtkwin->window); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
213 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
214 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
215 |
3710 | 216 void new_conv(char *who) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
217 GaimConversation *c = gaim_find_conversation(who); |
3710 | 218 |
4035 | 219 if (c && (type & TYPE_IM)) |
3710 | 220 attach_signals(c); |
221 } | |
222 | |
223 void chat_join(struct gaim_connection *gc, int id, char *room) { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
224 GaimConversation *c = gaim_find_chat(gc, id); |
3710 | 225 |
4043 | 226 if (c && (type & TYPE_CHAT)) |
3710 | 227 attach_signals(c); |
228 } | |
229 | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
230 int un_star(GtkWidget *widget, gpointer data) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
231 GaimConversation *c = g_object_get_data(G_OBJECT(widget), "user_data"); |
3374 | 232 |
233 if (method & METHOD_QUOTE) | |
234 quote_remove(widget); | |
3392 | 235 if (method & METHOD_COUNT) |
236 count_remove(widget); | |
3374 | 237 if (method & METHOD_STRING) |
238 string_remove(widget); | |
4043 | 239 if (c && method & METHOD_URGENT) |
3374 | 240 urgent_remove(c); |
4047 | 241 return 0; |
3374 | 242 } |
243 | |
5021 | 244 /* This function returns the number in [ ]'s or 0 |
245 and sets *length to the number of digits in that number */ | |
3392 | 246 int counter (char *buf, int *length) { |
247 char temp[256]; | |
5021 | 248 int i = 0; |
249 int j = 0; | |
3392 | 250 *length = 0; |
251 | |
5021 | 252 /* Don't assume buf[0]=='[' */ |
253 while( buf[i++] != '[' && i<sizeof(buf)); | |
254 | |
3392 | 255 while (isdigit(buf[i]) && i<sizeof(buf)) { |
5021 | 256 temp[j++] = buf[i++]; |
3392 | 257 (*length)++; |
258 } | |
5021 | 259 temp[j] = '\0'; |
4035 | 260 |
3392 | 261 if (buf[i] != ']') { |
262 *length = 0; | |
263 return (0); | |
264 } | |
265 | |
266 return (atoi(temp)); | |
267 } | |
268 | |
4035 | 269 void string_add(GtkWidget *widget) { |
270 char buf[256]; | |
271 GtkWindow *win = GTK_WINDOW(widget); | |
272 | |
273 strncpy(buf, win->title, sizeof(buf)); | |
274 if (!strstr(buf, title_string)) { | |
275 g_snprintf(buf, sizeof(buf), "%s%s", title_string, win->title); | |
276 gtk_window_set_title(win, buf); | |
277 } | |
278 } | |
279 | |
280 gboolean string_remove(GtkWidget *widget) { | |
191 | 281 char buf[256]; |
3374 | 282 GtkWindow *win = GTK_WINDOW(widget); |
283 | |
3392 | 284 strncpy(buf, win->title, sizeof(buf)); |
3374 | 285 if (strstr(buf, title_string)) { |
286 g_snprintf(buf, sizeof(buf), "%s", &win->title[strlen(title_string)]); | |
287 gtk_window_set_title(win, buf); | |
4035 | 288 return TRUE; |
3374 | 289 } |
4035 | 290 return FALSE; |
3374 | 291 } |
292 | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
293 void count_add(GtkWidget *widget, int number) { |
4035 | 294 char buf[256]; |
295 int c, length; | |
296 GtkWindow *win = GTK_WINDOW(widget); | |
297 | |
298 strncpy(buf, win->title, sizeof(buf)); | |
299 c = counter(buf, &length); | |
5021 | 300 |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
301 if (number) { |
5021 | 302 /* This might cause problems in the future. |
303 I'm pretty sure if count_add is called after quote_add | |
304 and number!=0, then this will have problems dealing with | |
305 the quotation marks. */ | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
306 g_snprintf(buf, sizeof(buf), "[%d] %s", number, win->title); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
307 } else if (!c) { |
4035 | 308 g_snprintf(buf, sizeof(buf), "[1] %s", win->title); |
5021 | 309 } else if (buf[0] == '[' || buf[1] == '[' ) { |
310 /* This has to be so complicated in order to account for METHOD_QUOTE */ | |
311 g_snprintf(buf, sizeof(buf), "[%d] %s", c+1, &win->title[ ((method & METHOD_QUOTE) ? 4 : 3)+length ]); | |
312 if( buf[ strlen(buf)-1 ] == '"' ) | |
313 buf[ strlen(buf)-1 ] = '\0'; | |
4035 | 314 } |
315 gtk_window_set_title(win, buf); | |
316 } | |
317 | |
318 gboolean count_remove(GtkWidget *widget) { | |
3392 | 319 char buf[256]; |
320 GtkWindow *win = GTK_WINDOW(widget); | |
321 int length; | |
322 | |
323 strncpy(buf, win->title, sizeof(buf)); | |
4793 | 324 if (buf[0] == '[') { |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
325 Number = counter(buf, &length); |
3392 | 326 g_snprintf(buf, sizeof(buf), "%s", &win->title[3+length]); |
327 gtk_window_set_title(win, buf); | |
4035 | 328 return TRUE; |
3392 | 329 } |
4035 | 330 return FALSE; |
3392 | 331 } |
332 | |
4035 | 333 void quote_add(GtkWidget *widget) { |
334 char buf[256]; | |
335 GtkWindow *win = GTK_WINDOW(widget); | |
336 | |
337 strncpy(buf, win->title, sizeof(buf)); | |
4793 | 338 if (buf[0] != '\"') { |
4035 | 339 g_snprintf(buf, sizeof(buf), "\"%s\"", win->title); |
340 gtk_window_set_title(win, buf); | |
341 } | |
342 } | |
343 | |
344 gboolean quote_remove(GtkWidget *widget) { | |
3374 | 345 char buf[256]; |
346 GtkWindow *win = GTK_WINDOW(widget); | |
191 | 347 |
3392 | 348 strncpy(buf, win->title, sizeof(buf)); |
4793 | 349 if (buf[0] == '\"') { |
3374 | 350 g_snprintf(buf, strlen(buf) - 1, "%s", &win->title[1]); |
191 | 351 gtk_window_set_title(win, buf); |
4035 | 352 return TRUE; |
191 | 353 } |
4035 | 354 return FALSE; |
3374 | 355 } |
356 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
357 void urgent_add(GaimConversation *c) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
358 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
359 XWMHints *hints; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
360 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
361 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
362 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
363 hints = XGetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window)); |
4035 | 364 hints->flags |= XUrgencyHint; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
365 XSetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window), hints); |
4218 | 366 XFree(hints); |
4035 | 367 } |
368 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
369 gboolean urgent_remove(GaimConversation *c) { |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
370 GaimGtkConversation *gtkconv; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
371 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
372 gtkconv = GAIM_GTK_CONVERSATION(c); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
373 |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
374 if ((gaim_conversation_get_type(c) == GAIM_CONV_CHAT && |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
375 (chat_options & OPT_CHAT_ONE_WINDOW)) || |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
376 (gaim_conversation_get_type(c) != GAIM_CONV_CHAT && |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
377 (im_options & OPT_IM_ONE_WINDOW))) { |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
378 if (gaim_conversation_get_type(c) == GAIM_CONV_CHAT) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
379 GaimConversation *c = (GaimConversation *)gaim_get_chats()->data; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
380 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
381 GdkWindow *win; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
382 XWMHints *hints; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
383 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
384 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
385 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
386 win = gtkwin->window->window; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
387 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
388 hints = XGetWMHints(GDK_WINDOW_XDISPLAY(win), GDK_WINDOW_XWINDOW(win)); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
389 if (hints->flags & XUrgencyHint) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
390 hints->flags &= ~XUrgencyHint; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
391 XSetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window), hints); |
4218 | 392 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
393 return TRUE; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
394 } |
4218 | 395 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
396 return FALSE; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
397 } else { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
398 GaimConversation *c; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
399 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
400 GdkWindow *win; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
401 XWMHints *hints; |
3374 | 402 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
403 c = (GaimConversation *)gaim_get_ims()->data; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
404 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
405 win = gtkwin->window->window; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
406 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
407 hints = XGetWMHints(GDK_WINDOW_XDISPLAY(win), GDK_WINDOW_XWINDOW(win)); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
408 if (hints->flags & XUrgencyHint) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
409 hints->flags &= ~XUrgencyHint; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
410 XSetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window), hints); |
4218 | 411 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
412 return TRUE; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
413 } |
4218 | 414 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
415 return FALSE; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
416 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
417 } else { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
418 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
419 XWMHints *hints; |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
420 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
421 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
422 hints = XGetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
423 |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
424 if (hints->flags & XUrgencyHint) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
425 hints->flags &= ~XUrgencyHint; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
426 XSetWMHints(GDK_WINDOW_XDISPLAY(gtkwin->window->window), GDK_WINDOW_XWINDOW(gtkwin->window->window), hints); |
4218 | 427 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
428 return TRUE; |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
429 } |
4218 | 430 XFree(hints); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
431 return FALSE; |
4035 | 432 } |
3374 | 433 } |
434 | |
435 void save_notify_prefs() { | |
3392 | 436 gchar buf[1000]; |
3374 | 437 FILE *fp; |
438 | |
439 snprintf(buf, 1000, "%s/.gaim/.notify", getenv("HOME")); | |
440 if (!(fp = fopen(buf, "w"))) { | |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
441 gaim_notify_error(my_plugin, NULL, |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
442 _("Unable to write to config file"), |
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
443 _("Notify plugin")); |
3374 | 444 return; |
445 } | |
446 | |
3710 | 447 fprintf(fp, "%d=TYPE\n", type); |
3392 | 448 fprintf(fp, "%d=CHOICE\n", choice); |
449 fprintf(fp, "%d=METHOD\n", method); | |
450 fprintf(fp, "%s=STRING\n", title_string); | |
3374 | 451 fclose(fp); |
452 } | |
453 | |
454 void load_notify_prefs() { | |
455 gchar buf[1000]; | |
456 gchar **parsed; | |
457 FILE *fp; | |
458 | |
459 g_snprintf(buf, sizeof(buf), "%s/.gaim/.notify", getenv("HOME")); | |
460 if (!(fp = fopen(buf, "r"))) | |
461 return; | |
462 | |
463 while (fgets(buf, 1000, fp) != NULL) { | |
464 parsed = g_strsplit(g_strchomp(buf), "=", 2); | |
465 if (parsed[0] && parsed[1]) { | |
3710 | 466 if (!strcmp(parsed[1], "TYPE")) |
467 type = atoi(parsed[0]); | |
3392 | 468 if (!strcmp(parsed[1], "CHOICE")) |
469 choice = atoi(parsed[0]); | |
470 if (!strcmp(parsed[1], "METHOD")) | |
471 method = atoi(parsed[0]); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
472 if (!strcmp(parsed[1], "STRING")) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
473 if (title_string != NULL) |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
474 g_free(title_string); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
475 title_string = g_strdup(parsed[0]); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
476 } |
3374 | 477 } |
3392 | 478 g_strfreev(parsed); |
3374 | 479 } |
480 fclose(fp); | |
481 return; | |
482 } | |
483 | |
484 void options(GtkWidget *widget, gpointer data) { | |
4035 | 485 gint option = GPOINTER_TO_INT(data); |
3374 | 486 |
487 if (option == 0) | |
3392 | 488 choice ^= NOTIFY_FOCUS; |
3374 | 489 else if (option == 1) |
3710 | 490 choice ^= NOTIFY_CLICK; |
491 else if (option == 2) | |
3392 | 492 choice ^= NOTIFY_TYPE; |
3710 | 493 else if (option == 3) { |
3374 | 494 method ^= METHOD_STRING; |
495 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) | |
496 gtk_widget_set_sensitive(Entry, TRUE); | |
497 else | |
498 gtk_widget_set_sensitive(Entry, FALSE); | |
499 } | |
3710 | 500 else if (option == 4) |
3374 | 501 method ^= METHOD_QUOTE; |
3710 | 502 else if (option == 5) |
3374 | 503 method ^= METHOD_URGENT; |
3710 | 504 else if (option == 6) |
3392 | 505 choice ^= NOTIFY_IN_FOCUS; |
3710 | 506 else if (option == 7) |
3392 | 507 method ^= METHOD_COUNT; |
3710 | 508 else if (option == 8) |
509 type ^= TYPE_IM; | |
510 else if (option == 9) | |
511 type ^= TYPE_CHAT; | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
512 else if (option == 10) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
513 /* I made an option for this as at least a way to have it save correctly |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
514 * I'd much rather there were better ways, and I don't want to save this |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
515 * no matter which pref is changed, that's too much of a hack */ |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
516 if (title_string != NULL) { |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
517 g_free(title_string); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
518 title_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(Entry))); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
519 } |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
520 } |
3710 | 521 |
522 save_notify_prefs(); | |
3374 | 523 } |
524 | |
4035 | 525 void apply_options(GtkWidget *widget, gpointer data) { |
4376
2c985a9e994c
[gaim-migrate @ 4642]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
526 GList *cnv = gaim_get_conversations(); |
4035 | 527 |
528 while (cnv) { | |
529 guint notification; | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
530 GaimConversation *c = (GaimConversation *) cnv->data; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
531 GaimGtkConversation *gtkconv; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
532 GaimGtkWindow *gtkwin; |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
533 guint options = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(c->window), "notify_data")); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
534 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
535 gtkconv = GAIM_GTK_CONVERSATION(c); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
536 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(c)); |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
537 |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
538 if (options & NOTIFY_FOCUS) |
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
539 g_signal_handlers_disconnect_by_func(G_OBJECT(gtkwin->window), un_star, NULL); |
4035 | 540 |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
541 /* remove old notification signals */ |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
542 detach_signals(c); |
4035 | 543 |
544 /* clean off all notification markings */ | |
545 notification = unnotify(c, TRUE); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
546 |
4035 | 547 /* re-add appropriate notification methods cleaned above */ |
4043 | 548 if (notification & METHOD_STRING) /* re-add string */ |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
549 string_add(gtkwin->window); |
4035 | 550 if (notification & METHOD_QUOTE) /* re-add quote */ |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
551 quote_add(gtkwin->window); |
4035 | 552 if (notification & METHOD_COUNT) /* re-add count */ |
4359
5fb47ec9bfe4
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
4218
diff
changeset
|
553 count_add(gtkwin->window, Number); |
4035 | 554 if (notification & METHOD_URGENT) /* re-add urgent */ |
555 urgent_add(c); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
556 |
4035 | 557 /* attach new unnotification signals */ |
558 attach_signals(c); | |
559 | |
560 cnv = cnv->next; | |
561 } | |
562 } | |
563 | |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
564 static GtkWidget * |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
565 get_config_frame(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
566 { |
3565 | 567 GtkWidget *ret; |
568 GtkWidget *vbox, *hbox; | |
4035 | 569 GtkWidget *toggle, *button; |
3565 | 570 ret = gtk_vbox_new(FALSE, 18); |
571 gtk_container_set_border_width (GTK_CONTAINER (ret), 12); | |
3392 | 572 |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
573 vbox = gaim_gtk_make_frame(ret, _("Notify For")); |
3710 | 574 toggle = gtk_check_button_new_with_mnemonic(_("_IM windows")); |
575 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
576 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), type & TYPE_IM); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
577 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(8)); |
3710 | 578 |
579 toggle = gtk_check_button_new_with_mnemonic(_("_Chat windows")); | |
580 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
581 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), type & TYPE_CHAT); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
582 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(9)); |
3710 | 583 |
584 /*--------------*/ | |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
585 vbox = gaim_gtk_make_frame(ret, _("Notification Methods")); |
3565 | 586 hbox = gtk_hbox_new(FALSE, 18); |
587 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); | |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
588 toggle = gtk_check_button_new_with_mnemonic(_("Prepend _string into window title (hit enter to save):")); |
3565 | 589 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_STRING); |
4035 | 590 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(3)); |
3565 | 591 gtk_box_pack_start(GTK_BOX(hbox), toggle, FALSE, FALSE, 0); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
592 Entry = gtk_entry_new(); |
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
593 gtk_entry_set_max_length(GTK_ENTRY(Entry), 10); |
3565 | 594 gtk_widget_set_sensitive(GTK_WIDGET(Entry), method & METHOD_STRING); |
595 gtk_box_pack_start(GTK_BOX(hbox), Entry, FALSE, FALSE, 0); | |
3392 | 596 gtk_entry_set_text(GTK_ENTRY(Entry), title_string); |
4203
ec6d0c5e5c23
[gaim-migrate @ 4439]
Christian Hammond <chipx86@chipx86.com>
parents:
4202
diff
changeset
|
597 g_signal_connect(G_OBJECT(Entry), "activate", G_CALLBACK(options), GINT_TO_POINTER(10)); |
3374 | 598 |
3710 | 599 toggle = gtk_check_button_new_with_mnemonic(_("_Quote window title")); |
3565 | 600 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
601 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_QUOTE); | |
4035 | 602 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(4)); |
3374 | 603 |
3565 | 604 toggle = gtk_check_button_new_with_mnemonic(_("Set Window Manager \"_URGENT\" Hint")); |
605 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
606 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_URGENT); | |
4035 | 607 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(5)); |
608 | |
3710 | 609 toggle = gtk_check_button_new_with_mnemonic(_("Insert c_ount of new messages into window title")); |
3565 | 610 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), method & METHOD_COUNT); |
611 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
4035 | 612 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(7)); |
3710 | 613 |
614 toggle = gtk_check_button_new_with_mnemonic(_("_Notify even if conversation is in focus")); | |
615 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_IN_FOCUS); | |
616 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
4035 | 617 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(6)); |
3392 | 618 |
3565 | 619 /*--------------*/ |
5530
2c4c975620f0
[gaim-migrate @ 5930]
Christian Hammond <chipx86@chipx86.com>
parents:
5436
diff
changeset
|
620 vbox = gaim_gtk_make_frame(ret, _("Notification Removal")); |
3710 | 621 toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window gains _focus")); |
3565 | 622 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); |
623 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_FOCUS); | |
4035 | 624 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(0)); |
3374 | 625 |
3710 | 626 toggle = gtk_check_button_new_with_mnemonic(_("Remove when conversation window _receives click")); |
627 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
628 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_CLICK); | |
4035 | 629 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(1)); |
3710 | 630 |
3565 | 631 toggle = gtk_check_button_new_with_mnemonic(_("Remove when _typing in conversation window")); |
632 gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); | |
633 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), choice & NOTIFY_TYPE); | |
4035 | 634 g_signal_connect(G_OBJECT(toggle), "toggled", G_CALLBACK(options), GINT_TO_POINTER(2)); |
635 | |
636 button = gtk_button_new_with_mnemonic(_("Appl_y")); | |
637 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 5); | |
638 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(apply_options), NULL); | |
3565 | 639 |
640 gtk_widget_show_all(ret); | |
641 return ret; | |
3374 | 642 } |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
643 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
644 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
645 plugin_load(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
646 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
647 title_string = g_strdup("(*) "); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
648 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
649 load_notify_prefs(); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
650 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
651 gaim_signal_connect(plugin, event_im_recv, im_recv_im, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
652 gaim_signal_connect(plugin, event_chat_recv, chat_recv_im, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
653 gaim_signal_connect(plugin, event_im_send, im_sent_im, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
654 gaim_signal_connect(plugin, event_chat_send, chat_sent_im, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
655 gaim_signal_connect(plugin, event_new_conversation, new_conv, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
656 gaim_signal_connect(plugin, event_chat_join, chat_join, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
657 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
658 return TRUE; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
659 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
660 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
661 static gboolean |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
662 plugin_unload(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
663 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
664 GList *c = gaim_get_conversations(); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
665 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
666 while (c) { |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
667 GaimConversation *cnv = (GaimConversation *)c->data; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5530
diff
changeset
|
668 GaimGtkWindow *gtkwin; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
669 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
670 gtkwin = GAIM_GTK_WINDOW(gaim_conversation_get_window(cnv)); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
671 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
672 detach_signals(cnv); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
673 un_star(gtkwin->window, NULL); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
674 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
675 c = c->next; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
676 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
677 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
678 /* this might be a hack I'm not sure, I don't think so but... */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
679 g_free(title_string); |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
680 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
681 return TRUE; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
682 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
683 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
684 static GaimGtkPluginUiInfo ui_info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
685 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
686 get_config_frame |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
687 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
688 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
689 static GaimPluginInfo info = |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
690 { |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
691 2, /**< api_version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
692 GAIM_PLUGIN_STANDARD, /**< type */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
693 GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
694 0, /**< flags */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
695 NULL, /**< dependencies */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
696 GAIM_PRIORITY_DEFAULT, /**< priority */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
697 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
698 NOTIFY_PLUGIN_ID, /**< id */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
699 N_("Message Notification"), /**< name */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
700 VERSION, /**< version */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
701 /** summary */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
702 N_("Provides a variety of ways of notifying you of unread messages."), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
703 /** description */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
704 N_("Provides a variety of ways of notifying you of unread messages."), |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
705 "Etan Reisner <deryni@eden.rutgers.edu>", /**< author */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
706 WEBSITE, /**< homepage */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
707 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
708 plugin_load, /**< load */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
709 plugin_unload, /**< unload */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
710 NULL, /**< destroy */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
711 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
712 &ui_info, /**< ui_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
713 NULL /**< extra_info */ |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
714 }; |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
715 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
716 static void |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
717 __init_plugin(GaimPlugin *plugin) |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
718 { |
5436
ad445074d239
[gaim-migrate @ 5818]
Christian Hammond <chipx86@chipx86.com>
parents:
5205
diff
changeset
|
719 my_plugin = plugin; |
5205
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
720 } |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
721 |
fefad67de2c7
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5021
diff
changeset
|
722 GAIM_INIT_PLUGIN(notify, __init_plugin, info); |