annotate pidgin/plugins/win32/transparency/win2ktrans.c @ 29259:10ec0fbfc790

NEWSifying
author Paul Aurich <paul@darkrain42.org>
date Fri, 08 Jan 2010 19:01:39 +0000
parents 4aa5400b1b99
children c3cd8f9fe4b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
47 #define blist (purple_get_blist() \
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
48 ? (PIDGIN_BLIST(purple_get_blist()) \
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
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 static BOOL (*MySetLayeredWindowAttributes)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags) = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76
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 * CODE
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81 /* Set window transparency level */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 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
83 gboolean always_on_top) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 if (MySetLayeredWindowAttributes) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 HWND hWnd = GDK_WINDOW_HWND(window->window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 LONG style = GetWindowLong(hWnd, GWL_EXSTYLE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87 if (enabled) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 style |= WS_EX_LAYERED;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 style &= ~WS_EX_LAYERED;
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 SetWindowLong(hWnd, GWL_EXSTYLE, style);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95 if (enabled) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 SetWindowPos(hWnd,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 MySetLayeredWindowAttributes(hWnd, 0, alpha, LWA_ALPHA);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 /* Ask the window and its children to repaint */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 RedrawWindow(hWnd, NULL, NULL,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 /* 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
112 * deal with transparency */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113 static gboolean focus_conv_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
114 if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
115 && 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
116 GtkWidget *window = (GtkWidget *) d;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 if (e->in) { /* Focused */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 set_wintrans(window, 0, FALSE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
119 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
120 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121 set_wintrans(window,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
122 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
123 TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
124 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
125 }
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 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 /* When buddy list window is focused,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 * 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
132 static gboolean focus_blist_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
133 if (purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
134 && 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
135 GtkWidget *window = (GtkWidget *) d;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 if (e->in) { /* Focused */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 set_wintrans(window, 0, FALSE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
138 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
139 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140 set_wintrans(window,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
141 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
142 TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
143 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
144 }
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 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 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
150 int alpha = gtk_range_get_value(GTK_RANGE(w));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
151 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
152
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 /* 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
154 * don't take effect immediately */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
155 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
156 set_wintrans(GTK_WIDGET(data), alpha, TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
157 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
158 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 static GtkWidget *wintrans_slider(GtkWidget *win) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162 GtkWidget *hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 GtkWidget *label, *slider;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 GtkWidget *frame;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
166 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
167
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 frame = gtk_frame_new(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 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
170 gtk_widget_show(frame);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172 hbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 gtk_container_add(GTK_CONTAINER(frame), hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
174
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 label = gtk_label_new(_("Opacity:"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 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
177 gtk_widget_show(hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 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
180 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
181 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
182
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 /* 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
184 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
185 G_CALLBACK(change_alpha), win);
15374
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 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
188
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 /* Set the initial transparency level */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190 set_wintrans(win, imalpha, TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
191 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
192
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 gtk_widget_show_all(hbox);
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 return frame;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 static slider_win* find_slidwin(GtkWidget *win) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 GSList *tmp = window_list;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 while (tmp) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 if (((slider_win*) (tmp->data))->win == win)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 return (slider_win*) tmp->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 tmp = tmp->next;
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 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 /* 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
210 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
211 GtkWidget *window = win->window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 slider_win *slidwin = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 /* Remove window from the window list */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
215 purple_debug_info(WINTRANS_PLUGIN_ID,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 "Conv window destroyed... removing from list\n");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 if ((slidwin = find_slidwin(window))) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 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
220 g_free(slidwin);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 /* Remove the focus cbs */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 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
225 G_CALLBACK(focus_conv_win_cb), window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227
18461
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
228 static void
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
229 conversation_delete_cb(PurpleConversation *conv) {
15502
6fde15c1dcfc pidginconv to pidgin_conv
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
230 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
231 /* 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
232 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
233 cleanup_conv_window(win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 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
237 gboolean enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
238 purple_prefs_set_bool(pref, enabled);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 if (blist) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
240 set_wintrans(blist, purple_prefs_get_int(OPT_WINTRANS_BL_ALPHA),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
241 purple_prefs_get_bool(OPT_WINTRANS_BL_ENABLED),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
242 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
243 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 static void add_slider(GtkWidget *win) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 GList *wl, *wl1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248 GtkWidget *vbox = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
249
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250 /* 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
251 if (!find_slidwin(win)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
252 GtkWidget *slider_box = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
253 slider_win *slidwin = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254 GtkRequisition slidereq;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
255 gint width, height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
256
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 /* Get top vbox */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 for (wl1 = wl = gtk_container_get_children(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259 GTK_CONTAINER(win));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 wl != NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 wl = wl->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 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
263 vbox = GTK_WIDGET(wl->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
264 else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
265 purple_debug_error(WINTRANS_PLUGIN_ID,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
266 "no vbox found\n");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
267 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
268 }
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 g_list_free(wl1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 slider_box = wintrans_slider(win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 /* 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
274 gtk_widget_size_request(slider_box, &slidereq);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275 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
276 gtk_box_pack_start(GTK_BOX(vbox),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 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
278 #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
279 /* 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
280 gtk_window_resize(GTK_WINDOW(win), width,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281 (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
282 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
283 /* 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
284 slidwin = g_new0(slider_win, 1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
285 slidwin->win = win;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
286 slidwin->slider = slider_box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
287 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
288 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
289 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
290
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291 static void remove_sliders() {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
292 if (window_list) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293 GSList *tmp = window_list;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
294 while (tmp) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
295 slider_win *slidwin = (slider_win*) tmp->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
296 if (slidwin != NULL &&
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 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
298 #if 0
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 GtkRequisition slidereq;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 gint width, height;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 /* Figure out how tall the slider was */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302 gtk_widget_size_request(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 slidwin->slider, &slidereq);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 gtk_window_get_size(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
305 GTK_WINDOW(slidwin->win),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 &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
307 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
308 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
309 #if 0
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310 gtk_window_resize(
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 GTK_WINDOW(slidwin->win),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312 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
313 #endif
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 g_free(slidwin);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
316 tmp = tmp->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 g_slist_free(window_list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 window_list = NULL;
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323 /* 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
324 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
325 GList *wins;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
327 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
328 PidginWindow *win = wins->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 GtkWidget *window = win->window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
331 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
332 set_wintrans(window, 0, FALSE, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
333
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 /* Remove the focus cbs */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
335 if (remove_signal)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 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
337 G_CALLBACK(focus_conv_win_cb), window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338 }
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 remove_sliders();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
343 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
344 GtkWidget *win = newwin->window;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 /* check prefs to see if we want trans */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
347 if (purple_prefs_get_bool(OPT_WINTRANS_IM_ENABLED)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
348 set_wintrans(win, purple_prefs_get_int(OPT_WINTRANS_IM_ALPHA),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
349 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
350
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
351 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
352 add_slider(win);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
356 /* 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
357 * 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
358 if (oldwin != NULL && oldwin != newwin) {
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
359 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
360 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
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 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
363 G_CALLBACK(focus_conv_win_cb), win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
364 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
365
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
366 /* 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
367 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
368 cleanup_conv_window(oldwin);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 static void update_convs_wintrans(GtkWidget *toggle_btn, const char *pref) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
373 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
374 GTK_TOGGLE_BUTTON(toggle_btn)));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
376 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
377 GList *wins;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
379 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
380 PidginWindow *win = wins->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 set_conv_window_trans(NULL, win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
384 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
385 remove_sliders();
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388 remove_convs_wintrans(FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390
18461
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
391 static void
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
392 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
393 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
394 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
395
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
396 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
397 && 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
398 && 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
399 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
400 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
401
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
402 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
403
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
404 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
405 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
406
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
407 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
408 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
409 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
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 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
412 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
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 }
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
416
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
417 static void
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
418 new_conversation_cb(PurpleConversation *conv) {
15502
6fde15c1dcfc pidginconv to pidgin_conv
Sean Egan <seanegan@gmail.com>
parents: 15501
diff changeset
419 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
420
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 /* 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
422 * 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
423 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
424 GtkWidget *window = win->window;
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 set_conv_window_trans(NULL, win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
427
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_in_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 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
431 G_CALLBACK(focus_conv_win_cb), window);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
432 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
433 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
434
18461
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
435 static void
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
436 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
437 if (blist) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
438 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
439 set_wintrans(blist,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
440 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
441 TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
442 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
443 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444
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_in_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 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
448 G_CALLBACK(focus_blist_win_cb), blist);
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 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
452 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
453 GList *wins;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454 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
455
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
456 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
457 PidginWindow *win = wins->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458 set_wintrans(win->window, imalpha, TRUE,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
459 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
460 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
461 }
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 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
464 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
465 int alpha = gtk_range_get_value(GTK_RANGE(w));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
466 purple_prefs_set_int(pref, alpha);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
469 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
470 if (blist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
471 change_alpha(w, blist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
472 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
473
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474 static void update_existing_convs() {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 GList *wins;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
477 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
478 PidginWindow *win = wins->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
479 GtkWidget *window = win->window;
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 set_conv_window_trans(NULL, win);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
482
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_in_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 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
486 G_CALLBACK(focus_conv_win_cb), window);
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
490 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 * EXPORTED FUNCTIONS
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
493 static gboolean plugin_load(PurplePlugin *plugin) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
494 MySetLayeredWindowAttributes = (void*) wpurple_find_and_loadproc(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 "user32.dll", "SetLayeredWindowAttributes");
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 if (!MySetLayeredWindowAttributes) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
498 purple_debug_error(WINTRANS_PLUGIN_ID,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 "SetLayeredWindowAttributes API not found (Required W2K+)\n");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
503 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
504 "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
505 PURPLE_CALLBACK(new_conversation_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507 /* Set callback to remove window from the list, if the window is destroyed */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
508 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
509 "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
510 PURPLE_CALLBACK(conversation_delete_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
512 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
513 "conversation-dragging", plugin,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
514 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
515
18461
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
516 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
517 "conversation-updated", plugin,
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
518 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
519
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 update_existing_convs();
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 if (blist)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 blist_created_cb(NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
525 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
526 "gtkblist-created", plugin,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
527 PURPLE_CALLBACK(blist_created_cb), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
529
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 return TRUE;
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
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
533 static gboolean plugin_unload(PurplePlugin *plugin) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
534 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
535
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536 remove_convs_wintrans(TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
537
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 if (blist) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
539 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
540 set_wintrans(blist, 0, FALSE, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
542 /* Remove the focus cbs */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
543 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
544 G_CALLBACK(focus_blist_win_cb), blist);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
545 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
546
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
547 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
548 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
550 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
551 GtkWidget *ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 GtkWidget *imtransbox, *bltransbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553 GtkWidget *hbox;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554 GtkWidget *label, *slider;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 GtkWidget *button;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556 GtkWidget *trans_box;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
557
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
558 ret = gtk_vbox_new(FALSE, 18);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
559 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
560
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
561 /* IM Convo trans options */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
562 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
563 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
564 OPT_WINTRANS_IM_ENABLED, imtransbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
565 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
566 G_CALLBACK(update_convs_wintrans),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 (gpointer) OPT_WINTRANS_IM_ENABLED);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
568
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
569 trans_box = gtk_vbox_new(FALSE, 18);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
570 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
571 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
572 gtk_widget_show(trans_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
574 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
575 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
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(_("_Show slider bar in IM window"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
578 OPT_WINTRANS_IM_SLIDER, 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_SLIDER);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
583 button = pidgin_prefs_checkbox(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 _("Remove IM window transparency on focus"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585 OPT_WINTRANS_IM_ONFOCUS, trans_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586
18461
d2b6ae715eae Fix transparency not being applied when showing a hidden conversation.
Daniel Atallah <daniel.atallah@gmail.com>
parents: 16680
diff changeset
587 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
588 trans_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
589 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
590 G_CALLBACK(update_convs_wintrans),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591 (gpointer) OPT_WINTRANS_IM_ONTOP);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593 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
594
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
595 /* IM transparency slider */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
596 hbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
597
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
598 label = gtk_label_new(_("Opacity:"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
599 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
600
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
601 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
602 gtk_range_set_value(GTK_RANGE(slider),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
603 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
604 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
605
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
606 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
607 G_CALLBACK(alpha_change), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608 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
609 G_CALLBACK(alpha_pref_set_int),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
610 (gpointer) OPT_WINTRANS_IM_ALPHA);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
612 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
613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614 gtk_widget_show_all(hbox);
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 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
617
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 /* Buddy List trans options */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
619 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
620 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
621 OPT_WINTRANS_BL_ENABLED, bltransbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622 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
623 G_CALLBACK(set_blist_trans),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
624 (gpointer) OPT_WINTRANS_BL_ENABLED);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 trans_box = gtk_vbox_new(FALSE, 18);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
627 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
628 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
629 gtk_widget_show(trans_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
630 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
631 G_CALLBACK(pidgin_toggle_sensitive), trans_box);
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
632 button = pidgin_prefs_checkbox(
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 _("Remove Buddy List window transparency on focus"),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634 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
635 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
636 trans_box);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 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
638 G_CALLBACK(set_blist_trans),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639 (gpointer) OPT_WINTRANS_BL_ONTOP);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640 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
641
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
642 /* IM transparency slider */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
643 hbox = gtk_hbox_new(FALSE, 5);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
644
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
645 label = gtk_label_new(_("Opacity:"));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
646 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
647
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648 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
649 gtk_range_set_value(GTK_RANGE(slider),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
650 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
651
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
652 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
653
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
654 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
655 G_CALLBACK(bl_alpha_change), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 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
657 G_CALLBACK(alpha_pref_set_int),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
658 (gpointer) OPT_WINTRANS_BL_ALPHA);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
659
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660 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
661
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662 gtk_widget_show_all(hbox);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
664 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
665
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666 gtk_widget_show_all(ret);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
667 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
668 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
669
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
670 static PidginPluginUiInfo ui_info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
671 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 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
673 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
674
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
675 /* 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
676 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
677 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
678 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
679 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
680 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
681
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
682 static PurplePluginInfo info =
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
684 PURPLE_PLUGIN_MAGIC,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
685 PURPLE_MAJOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
686 PURPLE_MINOR_VERSION,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
687 PURPLE_PLUGIN_STANDARD, /**< type */
15501
d75099d2567e gaim_gtk to pidgin. I hope
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
688 PIDGIN_PLUGIN_TYPE, /**< ui_requirement */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
689 0, /**< flags */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 NULL, /**< dependencies */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
691 PURPLE_PRIORITY_DEFAULT, /**< priority */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692 WINTRANS_PLUGIN_ID, /**< id */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 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
694 DISPLAY_VERSION, /**< version */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
695 /** summary */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
696 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
697 /** description */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698 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
699 "* Note: This plugin requires Win2000 or greater."),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
700 "Herman Bloggs <hermanator12002@yahoo.com>", /**< author */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
701 PURPLE_WEBSITE, /**< homepage */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702 plugin_load, /**< load */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
703 plugin_unload, /**< unload */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704 NULL, /**< destroy */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 &ui_info, /**< ui_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 NULL, /**< extra_info */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707 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
708 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
709
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
710 /* 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
711 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
712 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
713 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
714 NULL
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 };
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
718 init_plugin(PurplePlugin *plugin)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
720 purple_prefs_add_none("/plugins/gtk/win32");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
721 purple_prefs_add_none("/plugins/gtk/win32/wintrans");
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
722 purple_prefs_add_bool(OPT_WINTRANS_IM_ENABLED, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
723 purple_prefs_add_int(OPT_WINTRANS_IM_ALPHA, 255);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
724 purple_prefs_add_bool(OPT_WINTRANS_IM_SLIDER, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
725 purple_prefs_add_bool(OPT_WINTRANS_IM_ONFOCUS, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
726 purple_prefs_add_bool(OPT_WINTRANS_IM_ONTOP, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
727 purple_prefs_add_bool(OPT_WINTRANS_BL_ENABLED, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
728 purple_prefs_add_int(OPT_WINTRANS_BL_ALPHA, 255);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
729 purple_prefs_add_bool(OPT_WINTRANS_BL_ONFOCUS, FALSE);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
730 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
731 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
732
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15502
diff changeset
733 PURPLE_INIT_PLUGIN(wintrans, init_plugin, info)