Mon, 09 Jul 2007 02:01:25 +0000
Fix transparency not being applied when showing a hidden conversation.
| 14286 | 1 | /* |
| 15884 | 2 | * purple - Transparency plugin |
| 14286 | 3 | * |
| 4 | * copyright (c) 1998-2002, rob flynn <rob@marko.net> | |
| 5 | * copyright (c) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> | |
| 6 | * copyright (c) 2005, Daniel Atallah <daniel_atallah@yahoo.com> | |
| 7 | * | |
| 8 | * this program is free software; you can redistribute it and/or modify | |
| 9 | * it under the terms of the gnu general public license as published by | |
| 10 | * the free software foundation; either version 2 of the license, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * this program is distributed in the hope that it will be useful, | |
| 14 | * but without any warranty; without even the implied warranty of | |
| 15 | * merchantability or fitness for a particular purpose. see the | |
| 16 | * gnu general public license for more details. | |
| 17 | * | |
| 18 | * you should have received a copy of the gnu general public license | |
| 19 | * along with this program; if not, write to the free software | |
| 20 | * foundation, inc., 59 temple place, suite 330, boston, ma 02111-1307 usa | |
| 21 | * | |
| 22 | */ | |
| 23 | #ifndef _WIN32_WINNT | |
| 24 | #define _WIN32_WINNT 0x0500 | |
| 25 | #endif | |
| 26 | #include <gdk/gdkwin32.h> | |
| 27 | #include "internal.h" | |
| 28 | ||
| 29 | #include "core.h" | |
| 30 | #include "prefs.h" | |
| 31 | #include "debug.h" | |
| 32 | ||
| 33 | #include "gtkconv.h" | |
| 34 | #include "gtkplugin.h" | |
| 35 | #include "gtkprefs.h" | |
| 36 | #include "gtkblist.h" | |
| 37 | #include "gtkutils.h" | |
| 38 | #include "signals.h" | |
| 39 | #include "version.h" | |
| 40 | ||
| 41 | /* | |
| 42 | * MACROS & DEFINES | |
| 43 | */ | |
| 44 | #define WINTRANS_PLUGIN_ID "gtk-win-trans" | |
| 45 | ||
| 15884 | 46 | #define blist (purple_get_blist() \ |
| 47 | ? (PIDGIN_BLIST(purple_get_blist()) \ | |
| 48 | ? ((PIDGIN_BLIST(purple_get_blist()))->window) \ | |
| 14286 | 49 | : NULL) \ |
| 50 | : NULL) | |
| 51 | ||
| 52 | /* | |
| 53 | * DATA STRUCTS | |
| 54 | */ | |
| 55 | typedef struct { | |
| 56 | GtkWidget *win; | |
| 57 | GtkWidget *slider; | |
| 58 | } slider_win; | |
| 59 | ||
| 60 | /* | |
| 61 | * LOCALS | |
| 62 | */ | |
| 63 | static const char *OPT_WINTRANS_IM_ENABLED= "/plugins/gtk/win32/wintrans/im_enabled"; | |
| 64 | static const char *OPT_WINTRANS_IM_ALPHA = "/plugins/gtk/win32/wintrans/im_alpha"; | |
| 65 | static const char *OPT_WINTRANS_IM_SLIDER = "/plugins/gtk/win32/wintrans/im_slider"; | |
| 66 | static const char *OPT_WINTRANS_IM_ONFOCUS= "/plugins/gtk/win32/wintrans/im_solid_onfocus"; | |
| 67 | static const char *OPT_WINTRANS_IM_ONTOP = "/plugins/gtk/win32/wintrans/im_always_on_top"; | |
| 68 | static const char *OPT_WINTRANS_BL_ENABLED= "/plugins/gtk/win32/wintrans/bl_enabled"; | |
| 69 | static const char *OPT_WINTRANS_BL_ALPHA = "/plugins/gtk/win32/wintrans/bl_alpha"; | |
| 70 | static const char *OPT_WINTRANS_BL_ONFOCUS= "/plugins/gtk/win32/wintrans/bl_solid_onfocus"; | |
| 71 | static const char *OPT_WINTRANS_BL_ONTOP = "/plugins/gtk/win32/wintrans/bl_always_on_top"; | |
| 72 | static GSList *window_list = NULL; | |
| 73 | ||
| 74 | static BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags) = NULL; | |
| 75 | ||
| 76 | /* | |
| 77 | * CODE | |
| 78 | */ | |
| 79 | ||
| 80 | /* Set window transparency level */ | |
| 81 | static void set_wintrans(GtkWidget *window, int alpha, gboolean enabled, | |
| 82 | gboolean always_on_top) { | |
| 83 | if (MySetLayeredWindowAttributes) { | |
| 84 | HWND hWnd = GDK_WINDOW_HWND(window->window); | |
| 85 | LONG style = GetWindowLong(hWnd, GWL_EXSTYLE); | |
| 86 | if (enabled) { | |
| 87 | style |= WS_EX_LAYERED; | |
| 88 | } else { | |
| 89 | style &= ~WS_EX_LAYERED; | |
| 90 | } | |
| 91 | SetWindowLong(hWnd, GWL_EXSTYLE, style); | |
| 92 | ||
| 93 | ||
| 94 | if (enabled) { | |
| 95 | SetWindowPos(hWnd, | |
| 96 | always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, | |
| 97 | 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
| 98 | MySetLayeredWindowAttributes(hWnd, 0, alpha, LWA_ALPHA); | |
| 99 | } else { | |
| 100 | /* Ask the window and its children to repaint */ | |
| 101 | SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, | |
| 102 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
| 103 | ||
| 104 | RedrawWindow(hWnd, NULL, NULL, | |
| 105 | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); | |
| 106 | } | |
| 107 | } | |
| 108 | } | |
| 109 | ||
| 110 | /* When a conv window is focused, if we're only transparent when unfocused, | |
| 111 | * deal with transparency */ | |
| 112 | static gboolean focus_conv_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) { | |
| 15884 | 113 | if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED) |
| 114 | && purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS)) { | |
| 14286 | 115 | GtkWidget *window = (GtkWidget *) d; |
| 116 | if (e->in) { /* Focused */ | |
| 117 | set_wintrans(window, 0, FALSE, | |
| 15884 | 118 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); |
| 14286 | 119 | } else { |
| 120 | set_wintrans(window, | |
| 15884 | 121 | purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA), |
| 14286 | 122 | TRUE, |
| 15884 | 123 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); |
| 14286 | 124 | } |
| 125 | } | |
| 126 | return FALSE; | |
| 127 | } | |
| 128 | ||
| 129 | /* When buddy list window is focused, | |
| 130 | * if we're only transparent when unfocused, deal with transparency */ | |
| 131 | static gboolean focus_blist_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) { | |
| 15884 | 132 | if (purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED) |
| 133 | && purple_prefs_get_bool(OPT_WINTRANS_BL_ONFOCUS)) { | |
| 14286 | 134 | GtkWidget *window = (GtkWidget *) d; |
| 135 | if (e->in) { /* Focused */ | |
| 136 | set_wintrans(window, 0, FALSE, | |
| 15884 | 137 | purple_prefs_get_bool(OPT_WINTRANS_BL_ONTOP)); |
| 14286 | 138 | } else { |
| 139 | set_wintrans(window, | |
| 15884 | 140 | purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA), |
| 14286 | 141 | TRUE, |
| 15884 | 142 | purple_prefs_get_bool(OPT_WINTRANS_BL_ONTOP)); |
| 14286 | 143 | } |
| 144 | } | |
| 145 | return FALSE; | |
| 146 | } | |
| 147 | ||
| 148 | static void change_alpha(GtkWidget *w, gpointer data) { | |
| 149 | int alpha = gtk_range_get_value(GTK_RANGE(w)); | |
| 15884 | 150 | purple_prefs_set_int(OPT_WINTRANS_IM_ALPHA, alpha); |
| 14286 | 151 | |
| 152 | /* If we're in no-transparency on focus mode, | |
| 153 | * don't take effect immediately */ | |
| 15884 | 154 | if (!purple_prefs_get_bool(OPT_WINTRANS_IM_ONFOCUS)) |
| 14286 | 155 | set_wintrans(GTK_WIDGET(data), alpha, TRUE, |
| 15884 | 156 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); |
| 14286 | 157 | } |
| 158 | ||
| 159 | ||
| 160 | static GtkWidget *wintrans_slider(GtkWidget *win) { | |
| 161 | GtkWidget *hbox; | |
| 162 | GtkWidget *label, *slider; | |
| 163 | GtkWidget *frame; | |
| 164 | ||
| 15884 | 165 | int imalpha = purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA); |
| 14286 | 166 | |
| 167 | frame = gtk_frame_new(NULL); | |
| 168 | gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_NONE); | |
| 169 | gtk_widget_show(frame); | |
| 170 | ||
| 171 | hbox = gtk_hbox_new(FALSE, 5); | |
| 172 | gtk_container_add(GTK_CONTAINER(frame), hbox); | |
| 173 | ||
| 174 | label = gtk_label_new(_("Opacity:")); | |
| 175 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
| 176 | gtk_widget_show(hbox); | |
| 177 | ||
| 178 | slider = gtk_hscale_new_with_range(50, 255, 1); | |
| 179 | gtk_range_set_value(GTK_RANGE(slider), imalpha); | |
| 180 | gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); | |
| 181 | ||
| 182 | /* On slider val change, update window's transparency level */ | |
| 183 | g_signal_connect(GTK_OBJECT(slider), "value-changed", | |
| 184 | GTK_SIGNAL_FUNC(change_alpha), win); | |
| 185 | ||
| 186 | gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); | |
| 187 | ||
| 188 | /* Set the initial transparency level */ | |
| 189 | set_wintrans(win, imalpha, TRUE, | |
| 15884 | 190 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); |
| 14286 | 191 | |
| 192 | gtk_widget_show_all(hbox); | |
| 193 | ||
| 194 | return frame; | |
| 195 | } | |
| 196 | ||
| 197 | static slider_win* find_slidwin(GtkWidget *win) { | |
| 198 | GSList *tmp = window_list; | |
| 199 | ||
| 200 | while (tmp) { | |
| 201 | if (((slider_win*) (tmp->data))->win == win) | |
| 202 | return (slider_win*) tmp->data; | |
| 203 | tmp = tmp->next; | |
| 204 | } | |
| 205 | return NULL; | |
| 206 | } | |
| 207 | ||
| 208 | /* Clean up transparency stuff for the conv window */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
209 | static void cleanup_conv_window(PidginWindow *win) { |
| 14286 | 210 | GtkWidget *window = win->window; |
| 211 | slider_win *slidwin = NULL; | |
| 212 | ||
| 213 | /* Remove window from the window list */ | |
| 15884 | 214 | purple_debug_info(WINTRANS_PLUGIN_ID, |
| 14286 | 215 | "Conv window destroyed... removing from list\n"); |
| 216 | ||
| 217 | if ((slidwin = find_slidwin(window))) { | |
| 218 | window_list = g_slist_remove(window_list, slidwin); | |
| 219 | g_free(slidwin); | |
| 220 | } | |
| 221 | ||
| 222 | /* Remove the focus cbs */ | |
| 223 | g_signal_handlers_disconnect_by_func(G_OBJECT(window), | |
| 224 | G_CALLBACK(focus_conv_win_cb), window); | |
| 225 | } | |
| 226 | ||
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
227 | static void |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
228 | conversation_delete_cb(PurpleConversation *conv) { |
| 15563 | 229 | PidginWindow *win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv)); |
| 14286 | 230 | /* If it is the last conversation in the window, cleanup */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
231 | if (pidgin_conv_window_get_gtkconv_count(win) == 1) |
| 14286 | 232 | cleanup_conv_window(win); |
| 233 | } | |
| 234 | ||
| 235 | static void set_blist_trans(GtkWidget *w, const char *pref) { | |
| 236 | gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); | |
| 15884 | 237 | purple_prefs_set_bool(pref, enabled); |
| 14286 | 238 | if (blist) { |
| 15884 | 239 | set_wintrans(blist, purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA), |
| 240 | purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED), | |
| 241 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); | |
| 14286 | 242 | } |
| 243 | } | |
| 244 | ||
| 245 | static void add_slider(GtkWidget *win) { | |
| 246 | GList *wl, *wl1; | |
| 247 | GtkWidget *vbox = NULL; | |
| 248 | ||
| 249 | /* Look up this window to see if it already has a slider */ | |
| 250 | if (!find_slidwin(win)) { | |
| 251 | GtkWidget *slider_box = NULL; | |
| 252 | slider_win *slidwin = NULL; | |
| 253 | GtkRequisition slidereq; | |
| 254 | gint width, height; | |
| 255 | ||
| 256 | /* Get top vbox */ | |
| 257 | for (wl1 = wl = gtk_container_get_children( | |
| 258 | GTK_CONTAINER(win)); | |
| 259 | wl != NULL; | |
| 260 | wl = wl->next) { | |
| 261 | if (GTK_IS_VBOX(GTK_OBJECT(wl->data))) | |
| 262 | vbox = GTK_WIDGET(wl->data); | |
| 263 | else { | |
| 15884 | 264 | purple_debug_error(WINTRANS_PLUGIN_ID, |
| 14286 | 265 | "no vbox found\n"); |
| 266 | return; | |
| 267 | } | |
| 268 | } | |
| 269 | g_list_free(wl1); | |
| 270 | ||
| 271 | slider_box = wintrans_slider(win); | |
| 272 | /* Figure out how tall the slider wants to be */ | |
| 273 | gtk_widget_size_request(slider_box, &slidereq); | |
| 274 | gtk_window_get_size(GTK_WINDOW(win), &width, &height); | |
| 275 | gtk_box_pack_start(GTK_BOX(vbox), | |
| 276 | slider_box, FALSE, FALSE, 0); | |
| 277 | /* Make window taller so we don't slowly collapse its message area */ | |
| 278 | gtk_window_resize(GTK_WINDOW(win), width, | |
| 279 | (height + slidereq.height)); | |
| 280 | /* Add window to list, to track that it has a slider */ | |
| 281 | slidwin = g_new0(slider_win, 1); | |
| 282 | slidwin->win = win; | |
| 283 | slidwin->slider = slider_box; | |
| 284 | window_list = g_slist_append(window_list, slidwin); | |
| 285 | } | |
| 286 | } | |
| 287 | ||
| 288 | static void remove_sliders() { | |
| 289 | if (window_list) { | |
| 290 | GSList *tmp = window_list; | |
| 291 | while (tmp) { | |
| 292 | slider_win *slidwin = (slider_win*) tmp->data; | |
| 293 | if (slidwin != NULL && | |
| 294 | GTK_IS_WINDOW(slidwin->win)) { | |
| 295 | GtkRequisition slidereq; | |
| 296 | gint width, height; | |
| 297 | /* Figure out how tall the slider was */ | |
| 298 | gtk_widget_size_request( | |
| 299 | slidwin->slider, &slidereq); | |
| 300 | gtk_window_get_size( | |
| 301 | GTK_WINDOW(slidwin->win), | |
| 302 | &width, &height); | |
| 303 | ||
| 304 | gtk_widget_destroy(slidwin->slider); | |
| 305 | ||
| 306 | gtk_window_resize( | |
| 307 | GTK_WINDOW(slidwin->win), | |
| 308 | width, (height - slidereq.height)); | |
| 309 | } | |
| 310 | g_free(slidwin); | |
| 311 | tmp = tmp->next; | |
| 312 | } | |
| 313 | g_slist_free(window_list); | |
| 314 | window_list = NULL; | |
| 315 | } | |
| 316 | } | |
| 317 | ||
| 318 | /* Remove all transparency related aspects from conversation windows */ | |
| 319 | static void remove_convs_wintrans(gboolean remove_signal) { | |
| 320 | GList *wins; | |
| 321 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
322 | for (wins = pidgin_conv_windows_get_list(); wins; wins = wins->next) { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
323 | PidginWindow *win = wins->data; |
| 14286 | 324 | GtkWidget *window = win->window; |
| 325 | ||
| 15884 | 326 | if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) |
| 14286 | 327 | set_wintrans(window, 0, FALSE, FALSE); |
| 328 | ||
| 329 | /* Remove the focus cbs */ | |
| 330 | if (remove_signal) | |
| 331 | g_signal_handlers_disconnect_by_func(G_OBJECT(window), | |
| 332 | G_CALLBACK(focus_conv_win_cb), window); | |
| 333 | } | |
| 334 | ||
| 335 | remove_sliders(); | |
| 336 | } | |
| 337 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
338 | static void set_conv_window_trans(PidginWindow *oldwin, PidginWindow *newwin) { |
| 14286 | 339 | GtkWidget *win = newwin->window; |
| 340 | ||
| 341 | /* check prefs to see if we want trans */ | |
| 15884 | 342 | if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) { |
| 343 | set_wintrans(win, purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA), | |
| 344 | TRUE, purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); | |
| 14286 | 345 | |
| 15884 | 346 | if (purple_prefs_get_bool(OPT_WINTRANS_IM_SLIDER)) { |
| 14286 | 347 | add_slider(win); |
| 348 | } | |
| 349 | } | |
| 350 | ||
| 351 | /* If we're moving from one window to another, | |
| 352 | * add the focus listeners to the new window if not already there */ | |
| 353 | if (oldwin != NULL && oldwin != newwin) { | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
354 | if (pidgin_conv_window_get_gtkconv_count(newwin) == 0) { |
| 14286 | 355 | g_signal_connect(G_OBJECT(win), "focus_in_event", |
| 356 | G_CALLBACK(focus_conv_win_cb), win); | |
| 357 | g_signal_connect(G_OBJECT(win), "focus_out_event", | |
| 358 | G_CALLBACK(focus_conv_win_cb), win); | |
| 359 | } | |
| 360 | ||
| 361 | /* If we've moved the last conversation, cleanup the window */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
362 | if (pidgin_conv_window_get_gtkconv_count(oldwin) == 1) |
| 14286 | 363 | cleanup_conv_window(oldwin); |
| 364 | } | |
| 365 | } | |
| 366 | ||
| 367 | static void update_convs_wintrans(GtkWidget *toggle_btn, const char *pref) { | |
| 15884 | 368 | purple_prefs_set_bool(pref, gtk_toggle_button_get_active( |
| 14286 | 369 | GTK_TOGGLE_BUTTON(toggle_btn))); |
| 370 | ||
| 15884 | 371 | if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) { |
| 14286 | 372 | GList *wins; |
| 373 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
374 | for (wins = pidgin_conv_windows_get_list(); wins; wins = wins->next) { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
375 | PidginWindow *win = wins->data; |
| 14286 | 376 | set_conv_window_trans(NULL, win); |
| 377 | } | |
| 378 | ||
| 15884 | 379 | if (!purple_prefs_get_bool(OPT_WINTRANS_IM_SLIDER)) |
| 14286 | 380 | remove_sliders(); |
| 381 | } | |
| 382 | else | |
| 383 | remove_convs_wintrans(FALSE); | |
| 384 | } | |
| 385 | ||
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
386 | static void |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
387 | conv_updated_cb(PurpleConversation *conv, PurpleConvUpdateType type) { |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
388 | PidginConversation *pconv = PIDGIN_CONVERSATION(conv); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
389 | PidginWindow *win = pidgin_conv_get_window(pconv); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
390 | |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
391 | if (type == PURPLE_CONV_UPDATE_UNSEEN && !pidgin_conv_is_hidden(pconv) |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
392 | && pconv->unseen_state == PIDGIN_UNSEEN_NONE |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
393 | && pidgin_conv_window_get_gtkconv_count(win) == 1) { |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
394 | GtkWidget *window = win->window; |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
395 | |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
396 | set_conv_window_trans(NULL, win); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
397 | |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
398 | if (g_signal_handler_find(G_OBJECT(window), G_SIGNAL_MATCH_FUNC, |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
399 | 0, 0, NULL, G_CALLBACK(focus_conv_win_cb), NULL) == 0) { |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
400 | g_signal_connect(G_OBJECT(window), "focus_in_event", |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
401 | G_CALLBACK(focus_conv_win_cb), window); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
402 | g_signal_connect(G_OBJECT(window), "focus_out_event", |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
403 | G_CALLBACK(focus_conv_win_cb), window); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
404 | } |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
405 | } |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
406 | } |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
407 | |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
408 | static void |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
409 | new_conversation_cb(PurpleConversation *conv) { |
| 15563 | 410 | PidginWindow *win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv)); |
| 14286 | 411 | |
| 412 | /* If it is the first conversation in the window, | |
| 413 | * add the sliders, and set transparency */ | |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
414 | if (!pidgin_conv_is_hidden(PIDGIN_CONVERSATION(conv)) && pidgin_conv_window_get_gtkconv_count(win) == 1) { |
| 14286 | 415 | GtkWidget *window = win->window; |
| 416 | ||
| 417 | set_conv_window_trans(NULL, win); | |
| 418 | ||
| 419 | g_signal_connect(G_OBJECT(window), "focus_in_event", | |
| 420 | G_CALLBACK(focus_conv_win_cb), window); | |
| 421 | g_signal_connect(G_OBJECT(window), "focus_out_event", | |
| 422 | G_CALLBACK(focus_conv_win_cb), window); | |
| 423 | } | |
| 424 | } | |
| 425 | ||
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
426 | static void |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
427 | blist_created_cb(PurpleBuddyList *purple_blist, gpointer data) { |
| 14286 | 428 | if (blist) { |
| 15884 | 429 | if (purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED)) { |
| 14286 | 430 | set_wintrans(blist, |
| 15884 | 431 | purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA), |
| 14286 | 432 | TRUE, |
| 15884 | 433 | purple_prefs_get_bool(OPT_WINTRANS_BL_ONTOP)); |
| 14286 | 434 | } |
| 435 | ||
| 436 | g_signal_connect(G_OBJECT(blist), "focus_in_event", | |
| 437 | G_CALLBACK(focus_blist_win_cb), blist); | |
| 438 | g_signal_connect(G_OBJECT(blist), "focus_out_event", | |
| 439 | G_CALLBACK(focus_blist_win_cb), blist); | |
| 440 | } | |
| 441 | } | |
| 442 | ||
| 443 | static void alpha_change(GtkWidget *w, gpointer data) { | |
| 444 | GList *wins; | |
| 445 | int imalpha = gtk_range_get_value(GTK_RANGE(w)); | |
| 446 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
447 | for (wins = pidgin_conv_windows_get_list(); wins; wins = wins->next) { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
448 | PidginWindow *win = wins->data; |
| 14286 | 449 | set_wintrans(win->window, imalpha, TRUE, |
| 15884 | 450 | purple_prefs_get_bool(OPT_WINTRANS_IM_ONTOP)); |
| 14286 | 451 | } |
| 452 | } | |
| 453 | ||
| 454 | static void alpha_pref_set_int (GtkWidget *w, GdkEventFocus *e, const char *pref) | |
| 455 | { | |
| 456 | int alpha = gtk_range_get_value(GTK_RANGE(w)); | |
| 15884 | 457 | purple_prefs_set_int(pref, alpha); |
| 14286 | 458 | } |
| 459 | ||
| 460 | static void bl_alpha_change(GtkWidget *w, gpointer data) { | |
| 461 | if (blist) | |
| 462 | change_alpha(w, blist); | |
| 463 | } | |
| 464 | ||
| 465 | static void update_existing_convs() { | |
| 466 | GList *wins; | |
| 467 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
468 | for (wins = pidgin_conv_windows_get_list(); wins; wins = wins->next) { |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
469 | PidginWindow *win = wins->data; |
| 14286 | 470 | GtkWidget *window = win->window; |
| 471 | ||
| 472 | set_conv_window_trans(NULL, win); | |
| 473 | ||
| 474 | g_signal_connect(G_OBJECT(window), "focus_in_event", | |
| 475 | G_CALLBACK(focus_conv_win_cb), window); | |
| 476 | g_signal_connect(G_OBJECT(window), "focus_out_event", | |
| 477 | G_CALLBACK(focus_conv_win_cb), window); | |
| 478 | } | |
| 479 | } | |
| 480 | ||
| 481 | /* | |
| 482 | * EXPORTED FUNCTIONS | |
| 483 | */ | |
| 15884 | 484 | static gboolean plugin_load(PurplePlugin *plugin) { |
| 485 | MySetLayeredWindowAttributes = (void*) wpurple_find_and_loadproc( | |
| 14286 | 486 | "user32.dll", "SetLayeredWindowAttributes"); |
| 487 | ||
| 488 | if (!MySetLayeredWindowAttributes) { | |
| 15884 | 489 | purple_debug_error(WINTRANS_PLUGIN_ID, |
| 14286 | 490 | "SetLayeredWindowAttributes API not found (Required W2K+)\n"); |
| 491 | return FALSE; | |
| 492 | } | |
| 493 | ||
| 15884 | 494 | purple_signal_connect(purple_conversations_get_handle(), |
| 14286 | 495 | "conversation-created", plugin, |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
496 | PURPLE_CALLBACK(new_conversation_cb), NULL); |
| 14286 | 497 | |
| 498 | /* Set callback to remove window from the list, if the window is destroyed */ | |
| 15884 | 499 | purple_signal_connect(purple_conversations_get_handle(), |
| 14286 | 500 | "deleting-conversation", plugin, |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
501 | PURPLE_CALLBACK(conversation_delete_cb), NULL); |
| 14286 | 502 | |
| 15884 | 503 | purple_signal_connect(pidgin_conversations_get_handle(), |
| 14286 | 504 | "conversation-dragging", plugin, |
| 15884 | 505 | PURPLE_CALLBACK(set_conv_window_trans), NULL); |
| 14286 | 506 | |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
507 | purple_signal_connect(purple_conversations_get_handle(), |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
508 | "conversation-updated", plugin, |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
509 | PURPLE_CALLBACK(conv_updated_cb), NULL); |
|
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
510 | |
| 14286 | 511 | update_existing_convs(); |
| 512 | ||
| 513 | if (blist) | |
| 514 | blist_created_cb(NULL, NULL); | |
| 515 | else | |
| 15884 | 516 | purple_signal_connect(pidgin_blist_get_handle(), |
| 14286 | 517 | "gtkblist-created", plugin, |
| 15884 | 518 | PURPLE_CALLBACK(blist_created_cb), NULL); |
| 14286 | 519 | |
| 520 | ||
| 521 | return TRUE; | |
| 522 | } | |
| 523 | ||
| 15884 | 524 | static gboolean plugin_unload(PurplePlugin *plugin) { |
| 525 | purple_debug_info(WINTRANS_PLUGIN_ID, "Unloading win2ktrans plugin\n"); | |
| 14286 | 526 | |
| 527 | remove_convs_wintrans(TRUE); | |
| 528 | ||
| 529 | if (blist) { | |
| 15884 | 530 | if (purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED)) |
| 14286 | 531 | set_wintrans(blist, 0, FALSE, FALSE); |
| 532 | ||
| 533 | /* Remove the focus cbs */ | |
| 534 | g_signal_handlers_disconnect_by_func(G_OBJECT(blist), | |
| 535 | G_CALLBACK(focus_blist_win_cb), blist); | |
| 536 | } | |
| 537 | ||
| 538 | return TRUE; | |
| 539 | } | |
| 540 | ||
| 15884 | 541 | static GtkWidget *get_config_frame(PurplePlugin *plugin) { |
| 14286 | 542 | GtkWidget *ret; |
| 543 | GtkWidget *imtransbox, *bltransbox; | |
| 544 | GtkWidget *hbox; | |
| 545 | GtkWidget *label, *slider; | |
| 546 | GtkWidget *button; | |
| 547 | GtkWidget *trans_box; | |
| 548 | ||
| 549 | ret = gtk_vbox_new(FALSE, 18); | |
| 550 | gtk_container_set_border_width(GTK_CONTAINER (ret), 12); | |
| 551 | ||
| 552 | /* IM Convo trans options */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
553 | imtransbox = pidgin_make_frame(ret, _("IM Conversation Windows")); |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
554 | button = pidgin_prefs_checkbox(_("_IM window transparency"), |
| 14286 | 555 | OPT_WINTRANS_IM_ENABLED, imtransbox); |
| 556 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
| 557 | GTK_SIGNAL_FUNC(update_convs_wintrans), | |
| 558 | (gpointer) OPT_WINTRANS_IM_ENABLED); | |
| 559 | ||
| 560 | trans_box = gtk_vbox_new(FALSE, 18); | |
| 15884 | 561 | if (!purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) |
| 14286 | 562 | gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
| 563 | gtk_widget_show(trans_box); | |
| 564 | ||
| 565 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
566 | GTK_SIGNAL_FUNC(pidgin_toggle_sensitive), trans_box); |
| 14286 | 567 | |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
568 | button = pidgin_prefs_checkbox(_("_Show slider bar in IM window"), |
| 14286 | 569 | OPT_WINTRANS_IM_SLIDER, trans_box); |
| 570 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
| 571 | GTK_SIGNAL_FUNC(update_convs_wintrans), | |
| 572 | (gpointer) OPT_WINTRANS_IM_SLIDER); | |
| 573 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
574 | button = pidgin_prefs_checkbox( |
| 14286 | 575 | _("Remove IM window transparency on focus"), |
| 576 | OPT_WINTRANS_IM_ONFOCUS, trans_box); | |
| 577 | ||
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
578 | button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_IM_ONTOP, |
| 14286 | 579 | trans_box); |
| 580 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
| 581 | GTK_SIGNAL_FUNC(update_convs_wintrans), | |
| 582 | (gpointer) OPT_WINTRANS_IM_ONTOP); | |
| 583 | ||
| 584 | gtk_box_pack_start(GTK_BOX(imtransbox), trans_box, FALSE, FALSE, 5); | |
| 585 | ||
| 586 | /* IM transparency slider */ | |
| 587 | hbox = gtk_hbox_new(FALSE, 5); | |
| 588 | ||
| 589 | label = gtk_label_new(_("Opacity:")); | |
| 590 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
| 591 | ||
| 592 | slider = gtk_hscale_new_with_range(50, 255, 1); | |
| 593 | gtk_range_set_value(GTK_RANGE(slider), | |
| 15884 | 594 | purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA)); |
| 14286 | 595 | gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); |
| 596 | ||
| 597 | g_signal_connect(GTK_OBJECT(slider), "value-changed", | |
| 598 | GTK_SIGNAL_FUNC(alpha_change), NULL); | |
| 599 | g_signal_connect(GTK_OBJECT(slider), "focus-out-event", | |
| 600 | GTK_SIGNAL_FUNC(alpha_pref_set_int), | |
| 601 | (gpointer) OPT_WINTRANS_IM_ALPHA); | |
| 602 | ||
| 603 | gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); | |
| 604 | ||
| 605 | gtk_widget_show_all(hbox); | |
| 606 | ||
| 607 | gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5); | |
| 608 | ||
| 609 | /* Buddy List trans options */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
610 | bltransbox = pidgin_make_frame (ret, _("Buddy List Window")); |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
611 | button = pidgin_prefs_checkbox(_("_Buddy List window transparency"), |
| 14286 | 612 | OPT_WINTRANS_BL_ENABLED, bltransbox); |
| 613 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
| 614 | GTK_SIGNAL_FUNC(set_blist_trans), | |
| 615 | (gpointer) OPT_WINTRANS_BL_ENABLED); | |
| 616 | ||
| 617 | trans_box = gtk_vbox_new(FALSE, 18); | |
| 15884 | 618 | if (!purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED)) |
| 14286 | 619 | gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE); |
| 620 | gtk_widget_show(trans_box); | |
| 621 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
622 | GTK_SIGNAL_FUNC(pidgin_toggle_sensitive), trans_box); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
623 | button = pidgin_prefs_checkbox( |
| 14286 | 624 | _("Remove Buddy List window transparency on focus"), |
| 625 | OPT_WINTRANS_BL_ONFOCUS, trans_box); | |
|
18669
872d7d81d212
Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <datallah@pidgin.im>
parents:
16751
diff
changeset
|
626 | button = pidgin_prefs_checkbox(_("Always on top"), OPT_WINTRANS_BL_ONTOP, |
| 14286 | 627 | trans_box); |
| 628 | g_signal_connect(GTK_OBJECT(button), "clicked", | |
| 629 | GTK_SIGNAL_FUNC(set_blist_trans), | |
| 630 | (gpointer) OPT_WINTRANS_BL_ONTOP); | |
| 631 | gtk_box_pack_start(GTK_BOX(bltransbox), trans_box, FALSE, FALSE, 5); | |
| 632 | ||
| 633 | /* IM transparency slider */ | |
| 634 | hbox = gtk_hbox_new(FALSE, 5); | |
| 635 | ||
| 636 | label = gtk_label_new(_("Opacity:")); | |
| 637 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); | |
| 638 | ||
| 639 | slider = gtk_hscale_new_with_range(50, 255, 1); | |
| 640 | gtk_range_set_value(GTK_RANGE(slider), | |
| 15884 | 641 | purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA)); |
| 14286 | 642 | |
| 643 | gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1); | |
| 644 | ||
| 645 | g_signal_connect(GTK_OBJECT(slider), "value-changed", | |
| 646 | GTK_SIGNAL_FUNC(bl_alpha_change), NULL); | |
| 647 | g_signal_connect(GTK_OBJECT(slider), "focus-out-event", | |
| 648 | GTK_SIGNAL_FUNC(alpha_pref_set_int), | |
| 649 | (gpointer) OPT_WINTRANS_BL_ALPHA); | |
| 650 | ||
| 651 | gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5); | |
| 652 | ||
| 653 | gtk_widget_show_all(hbox); | |
| 654 | ||
| 655 | gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5); | |
| 656 | ||
| 657 | gtk_widget_show_all(ret); | |
| 658 | return ret; | |
| 659 | } | |
| 660 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
661 | static PidginPluginUiInfo ui_info = |
| 14286 | 662 | { |
| 663 | get_config_frame, | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
664 | 0, /* page_num (Reserved) */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
665 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
666 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
667 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
668 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
669 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
670 | NULL |
| 14286 | 671 | }; |
| 672 | ||
| 15884 | 673 | static PurplePluginInfo info = |
| 14286 | 674 | { |
| 15884 | 675 | PURPLE_PLUGIN_MAGIC, |
| 676 | PURPLE_MAJOR_VERSION, | |
| 677 | PURPLE_MINOR_VERSION, | |
| 678 | PURPLE_PLUGIN_STANDARD, /**< type */ | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
679 | PIDGIN_PLUGIN_TYPE, /**< ui_requirement */ |
| 14286 | 680 | 0, /**< flags */ |
| 681 | NULL, /**< dependencies */ | |
| 15884 | 682 | PURPLE_PRIORITY_DEFAULT, /**< priority */ |
| 14286 | 683 | WINTRANS_PLUGIN_ID, /**< id */ |
| 684 | N_("Transparency"), /**< name */ | |
| 685 | VERSION, /**< version */ | |
| 686 | /** summary */ | |
| 687 | N_("Variable Transparency for the buddy list and conversations."), | |
| 688 | /** description */ | |
| 689 | N_("This plugin enables variable alpha transparency on conversation windows and the buddy list.\n\n" | |
| 690 | "* Note: This plugin requires Win2000 or greater."), | |
| 691 | "Herman Bloggs <hermanator12002@yahoo.com>", /**< author */ | |
| 15884 | 692 | PURPLE_WEBSITE, /**< homepage */ |
| 14286 | 693 | plugin_load, /**< load */ |
| 694 | plugin_unload, /**< unload */ | |
| 695 | NULL, /**< destroy */ | |
| 696 | &ui_info, /**< ui_info */ | |
| 697 | NULL, /**< extra_info */ | |
| 698 | NULL, /**< prefs_info */ | |
|
16751
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
699 | NULL, /**< actions */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
700 | |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
701 | /* padding */ |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
702 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
703 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
704 | NULL, |
|
8e552dc2ef9f
20:06 < SimGuy> grim: add padding to the two win32 plugins while you're at it :P
Gary Kramlich <grim@reaperworld.com>
parents:
15884
diff
changeset
|
705 | NULL |
| 14286 | 706 | }; |
| 707 | ||
| 708 | static void | |
| 15884 | 709 | init_plugin(PurplePlugin *plugin) |
| 14286 | 710 | { |
| 15884 | 711 | purple_prefs_add_none("/plugins/gtk/win32"); |
| 712 | purple_prefs_add_none("/plugins/gtk/win32/wintrans"); | |
| 713 | purple_prefs_add_bool(OPT_WINTRANS_IM_ENABLED, FALSE); | |
| 714 | purple_prefs_add_int(OPT_WINTRANS_IM_ALPHA, 255); | |
| 715 | purple_prefs_add_bool(OPT_WINTRANS_IM_SLIDER, FALSE); | |
| 716 | purple_prefs_add_bool(OPT_WINTRANS_IM_ONFOCUS, FALSE); | |
| 717 | purple_prefs_add_bool(OPT_WINTRANS_IM_ONTOP, FALSE); | |
| 718 | purple_prefs_add_bool(OPT_WINTRANS_BL_ENABLED, FALSE); | |
| 719 | purple_prefs_add_int(OPT_WINTRANS_BL_ALPHA, 255); | |
| 720 | purple_prefs_add_bool(OPT_WINTRANS_BL_ONFOCUS, FALSE); | |
| 721 | purple_prefs_add_bool(OPT_WINTRANS_BL_ONTOP, FALSE); | |
| 14286 | 722 | } |
| 723 | ||
| 15884 | 724 | PURPLE_INIT_PLUGIN(wintrans, init_plugin, info) |