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