| 105 static GdkAtom _PurpleUnseenCount = GDK_NONE; |
105 static GdkAtom _PurpleUnseenCount = GDK_NONE; |
| 106 #endif |
106 #endif |
| 107 |
107 |
| 108 /* notification set/unset */ |
108 /* notification set/unset */ |
| 109 static int notify(PurpleConversation *conv, gboolean increment); |
109 static int notify(PurpleConversation *conv, gboolean increment); |
| 110 static void notify_win(PidginWindow *purplewin, PurpleConversation *conv); |
110 static void notify_win(PidginConvWindow *purplewin, PurpleConversation *conv); |
| 111 static void unnotify(PurpleConversation *conv, gboolean reset); |
111 static void unnotify(PurpleConversation *conv, gboolean reset); |
| 112 static int unnotify_cb(GtkWidget *widget, gpointer data, |
112 static int unnotify_cb(GtkWidget *widget, gpointer data, |
| 113 PurpleConversation *conv); |
113 PurpleConversation *conv); |
| 114 |
114 |
| 115 /* gtk widget callbacks for prefs panel */ |
115 /* gtk widget callbacks for prefs panel */ |
| 120 gpointer data); |
120 gpointer data); |
| 121 static void apply_method(void); |
121 static void apply_method(void); |
| 122 static void apply_notify(void); |
122 static void apply_notify(void); |
| 123 |
123 |
| 124 /* string function */ |
124 /* string function */ |
| 125 static void handle_string(PidginWindow *purplewin); |
125 static void handle_string(PidginConvWindow *purplewin); |
| 126 |
126 |
| 127 /* count_title function */ |
127 /* count_title function */ |
| 128 static void handle_count_title(PidginWindow *purplewin); |
128 static void handle_count_title(PidginConvWindow *purplewin); |
| 129 |
129 |
| 130 /* count_xprop function */ |
130 /* count_xprop function */ |
| 131 static void handle_count_xprop(PidginWindow *purplewin); |
131 static void handle_count_xprop(PidginConvWindow *purplewin); |
| 132 |
132 |
| 133 /* urgent function */ |
133 /* urgent function */ |
| 134 static void handle_urgent(PidginWindow *purplewin, gboolean set); |
134 static void handle_urgent(PidginConvWindow *purplewin, gboolean set); |
| 135 |
135 |
| 136 /* raise function */ |
136 /* raise function */ |
| 137 static void handle_raise(PidginWindow *purplewin); |
137 static void handle_raise(PidginConvWindow *purplewin); |
| 138 |
138 |
| 139 /* present function */ |
139 /* present function */ |
| 140 static void handle_present(PurpleConversation *conv); |
140 static void handle_present(PurpleConversation *conv); |
| 141 |
141 |
| 142 /****************************************/ |
142 /****************************************/ |
| 143 /* Begin doing stuff below this line... */ |
143 /* Begin doing stuff below this line... */ |
| 144 /****************************************/ |
144 /****************************************/ |
| 145 static guint |
145 static guint |
| 146 count_messages(PidginWindow *purplewin) |
146 count_messages(PidginConvWindow *purplewin) |
| 147 { |
147 { |
| 148 guint count = 0; |
148 guint count = 0; |
| 149 GList *convs = NULL, *l; |
149 GList *convs = NULL, *l; |
| 150 |
150 |
| 151 for (convs = purplewin->gtkconvs; convs != NULL; convs = convs->next) { |
151 for (convs = purplewin->gtkconvs; convs != NULL; convs = convs->next) { |
| 161 static int |
161 static int |
| 162 notify(PurpleConversation *conv, gboolean increment) |
162 notify(PurpleConversation *conv, gboolean increment) |
| 163 { |
163 { |
| 164 gint count; |
164 gint count; |
| 165 gboolean has_focus; |
165 gboolean has_focus; |
| 166 PidginWindow *purplewin = NULL; |
166 PidginConvWindow *purplewin = NULL; |
| 167 |
167 |
| 168 if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) |
168 if (conv == NULL || PIDGIN_CONVERSATION(conv) == NULL) |
| 169 return 0; |
169 return 0; |
| 170 |
170 |
| 171 /* We want to remove the notifications, but not reset the counter */ |
171 /* We want to remove the notifications, but not reset the counter */ |
| 219 |
219 |
| 220 static void |
220 static void |
| 221 unnotify(PurpleConversation *conv, gboolean reset) |
221 unnotify(PurpleConversation *conv, gboolean reset) |
| 222 { |
222 { |
| 223 PurpleConversation *active_conv = NULL; |
223 PurpleConversation *active_conv = NULL; |
| 224 PidginWindow *purplewin = NULL; |
224 PidginConvWindow *purplewin = NULL; |
| 225 |
225 |
| 226 g_return_if_fail(conv != NULL); |
226 g_return_if_fail(conv != NULL); |
| 227 if (PIDGIN_CONVERSATION(conv) == NULL) |
227 if (PIDGIN_CONVERSATION(conv) == NULL) |
| 228 return; |
228 return; |
| 229 |
229 |
| 385 |
385 |
| 386 static void |
386 static void |
| 387 conv_switched(PurpleConversation *conv) |
387 conv_switched(PurpleConversation *conv) |
| 388 { |
388 { |
| 389 #if 0 |
389 #if 0 |
| 390 PidginWindow *purplewin = purple_conversation_get_window(new_conv); |
390 PidginConvWindow *purplewin = purple_conversation_get_window(new_conv); |
| 391 #endif |
391 #endif |
| 392 |
392 |
| 393 /* |
393 /* |
| 394 * If the conversation was switched, then make sure we re-notify |
394 * If the conversation was switched, then make sure we re-notify |
| 395 * because Purple will have overwritten our custom window title. |
395 * because Purple will have overwritten our custom window title. |
| 436 } |
436 } |
| 437 |
437 |
| 438 #if 0 |
438 #if 0 |
| 439 static void |
439 static void |
| 440 conversation_dragging(PurpleConversation *active_conv, |
440 conversation_dragging(PurpleConversation *active_conv, |
| 441 PidginWindow *old_purplewin, |
441 PidginConvWindow *old_purplewin, |
| 442 PidginWindow *new_purplewin) |
442 PidginConvWindow *new_purplewin) |
| 443 { |
443 { |
| 444 if (old_purplewin != new_purplewin) { |
444 if (old_purplewin != new_purplewin) { |
| 445 if (old_purplewin == NULL) { |
445 if (old_purplewin == NULL) { |
| 446 /* |
446 /* |
| 447 purple_conversation_autoset_title(active_conv); |
447 purple_conversation_autoset_title(active_conv); |
| 543 GDK_PROP_MODE_REPLACE, (guchar *) &count, 1); |
543 GDK_PROP_MODE_REPLACE, (guchar *) &count, 1); |
| 544 #endif |
544 #endif |
| 545 } |
545 } |
| 546 |
546 |
| 547 static void |
547 static void |
| 548 handle_urgent(PidginWindow *purplewin, gboolean set) |
548 handle_urgent(PidginConvWindow *purplewin, gboolean set) |
| 549 { |
549 { |
| 550 g_return_if_fail(purplewin != NULL); |
550 g_return_if_fail(purplewin != NULL); |
| 551 g_return_if_fail(purplewin->window != NULL); |
551 g_return_if_fail(purplewin->window != NULL); |
| 552 |
552 |
| 553 pidgin_set_urgent(GTK_WINDOW(purplewin->window), set); |
553 pidgin_set_urgent(GTK_WINDOW(purplewin->window), set); |
| 554 } |
554 } |
| 555 |
555 |
| 556 static void |
556 static void |
| 557 handle_raise(PidginWindow *purplewin) |
557 handle_raise(PidginConvWindow *purplewin) |
| 558 { |
558 { |
| 559 pidgin_conv_window_raise(purplewin); |
559 pidgin_conv_window_raise(purplewin); |
| 560 } |
560 } |
| 561 |
561 |
| 562 static void |
562 static void |