pidgin/win32/gtkwin32dep.c

Fri, 26 Jan 2024 02:53:42 -0600

author
Elliott Sales de Andrade <quantum.analyst@gmail.com>
date
Fri, 26 Jan 2024 02:53:42 -0600
changeset 42585
0e752027f115
parent 42492
d3f24fe5899b
child 43077
54cb1cfca9ae
permissions
-rw-r--r--

Fix build on Windows

These files were deleted earlier, and nothing from them was used.

Testing Done:
Compiled on Windows.

Reviewed at https://reviews.imfreedom.org/r/2938/

38553
36e30c91cd15 gtkwin32dep: Fix section documentation headings
Mike Ruprecht <cmaiku@gmail.com>
parents: 38433
diff changeset
1 /*
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
2 * Pidgin is the legal property of its developers, whose names are too numerous
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
3 * to list here. Please refer to the COPYRIGHT file distributed with this
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
4 * source distribution.
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
5 *
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
9 * (at your option) any later version.
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
10 *
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
14 * GNU General Public License for more details.
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
15 *
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18633
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
19 *
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
20 */
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
21 #include <io.h>
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
22 #include <stdlib.h>
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
23 #include <stdio.h>
41198
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
24
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
25 /* winsock2.h needs to be include before windows.h or else it throws a warning
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
26 * saying it needs to be included first. We don't use it directly but it's
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
27 * included indirectly.
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
28 */
b5b1bffc48fb Random Windows tweaks
Gary Kramlich <grim@reaperworld.com>
parents: 41087
diff changeset
29 #include <winsock2.h>
40669
48dfed6f4f1f Fix Windows builds and tests
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 40555
diff changeset
30 #include <windows.h>
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
31 #include <winuser.h>
35892
02bf3200b9cb cross-win32: make use of WIN32_LEAN_AND_MEAN define
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 35891
diff changeset
32 #include <shellapi.h>
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
33
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
34 #include <glib.h>
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
35 #include <glib/gstdio.h>
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
36 #include <gtk/gtk.h>
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
37
40360
e21f3bbcc2a5 Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 40001
diff changeset
38 #include <purple.h>
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
39
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
40 #include "resource.h"
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
41
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
42 #include "gtkwin32dep.h"
42067
fcc390443714 Fix the Windows build
Gary Kramlich <grim@reaperworld.com>
parents: 42061
diff changeset
43 #include "pidgindisplaywindow.h"
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
44
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
45 /*
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
46 * GLOBALS
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
47 */
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
48 HINSTANCE exe_hInstance = 0;
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
49 HINSTANCE dll_hInstance = 0;
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
50 HWND messagewin_hwnd;
14762
f494a5f12981 [gaim-migrate @ 17452]
Daniel Atallah <datallah@pidgin.im>
parents: 14636
diff changeset
51
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
52 /*
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
53 * PUBLIC CODE
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
54 */
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
55
16058
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
56 HINSTANCE winpidgin_exe_hinstance(void) {
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
57 return exe_hInstance;
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
58 }
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
59
35605
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
60 void winpidgin_set_exe_hinstance(HINSTANCE hint)
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
61 {
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
62 exe_hInstance = hint;
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
63 }
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
64
16058
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
65 HINSTANCE winpidgin_dll_hinstance(void) {
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
66 return dll_hInstance;
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
67 }
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
68
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
69 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
70 #define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14)
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
71
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
72 static LRESULT CALLBACK message_window_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
73
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
74 if (msg == PIDGIN_WM_FOCUS_REQUEST) {
42061
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
75 GtkWidget *widget = NULL;
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
76
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
77 purple_debug_info("winpidgin", "Got external focus request.");
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
78
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
79 widget = pidgin_display_window_get_default();
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
80 gtk_window_present(GTK_WINDOW(widget));
93ab30300b06 Remove PidginBlist
Gary Kramlich <grim@reaperworld.com>
parents: 41952
diff changeset
81
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
82 return TRUE;
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
83 } else if (msg == PIDGIN_WM_PROTOCOL_HANDLE) {
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
84 char *proto_msg = (char *) lparam;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15697
diff changeset
85 purple_debug_info("winpidgin", "Got protocol handler request: %s\n", proto_msg ? proto_msg : "");
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15697
diff changeset
86 purple_got_protocol_handler_uri(proto_msg);
15678
7434ef155a3a Core support for external protocol URIs. The actual handling of the URIs will be in the prpls and other plugins. This commit only includes the win32 method of actually passing in a URI - the dbus implementation still needs to be written.
Daniel Atallah <datallah@pidgin.im>
parents: 15578
diff changeset
87 return TRUE;
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
88 }
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
89
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
90 return DefWindowProc(hwnd, msg, wparam, lparam);
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
91 }
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
92
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
93 static HWND winpidgin_message_window_init(void) {
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
94 HWND win_hwnd;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
95 WNDCLASSEX wcx;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
96 LPCTSTR wname;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
97
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
98 wname = TEXT("WinpidginMsgWinCls");
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
99
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
100 wcx.cbSize = sizeof(wcx);
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
101 wcx.style = 0;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
102 wcx.lpfnWndProc = message_window_handler;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
103 wcx.cbClsExtra = 0;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
104 wcx.cbWndExtra = 0;
16058
dc1c7b09a058 4bit icons for windows < XP. These are certainly not as pretty as the originals, but look a lot better than scaled down versions.
Daniel Atallah <datallah@pidgin.im>
parents: 15884
diff changeset
105 wcx.hInstance = winpidgin_exe_hinstance();
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
106 wcx.hIcon = NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
107 wcx.hCursor = NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
108 wcx.hbrBackground = NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
109 wcx.lpszMenuName = NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
110 wcx.lpszClassName = wname;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
111 wcx.hIconSm = NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
112
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
113 RegisterClassEx(&wcx);
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
114
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
115 /* Create the window */
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
116 if(!(win_hwnd = CreateWindow(wname, TEXT("WinpidginMsgWin"), 0, 0, 0, 0, 0,
21943
8a938e6ea033 This is a great patch from Lee Roach to make Pidgin on win32 deal with system suspend / resume. It seems to work really well, hopefully this'll make some folks happy. If something doesn't work right, it is probably my fault. Fixes #480.
Daniel Atallah <datallah@pidgin.im>
parents: 21613
diff changeset
117 NULL, NULL, winpidgin_exe_hinstance(), 0))) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15697
diff changeset
118 purple_debug_error("winpidgin",
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
119 "Unable to create message window.\n");
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
120 return NULL;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
121 }
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
122
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
123 return win_hwnd;
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
124 }
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
125
35605
8a0ae6cc73fc Fix win32 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 33960
diff changeset
126 void winpidgin_init(void) {
33960
ce450446c56a Win32: strengthen DLL loading; VV: fix farstream plugins loading on win32
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33898
diff changeset
127 if (purple_debug_is_verbose())
ce450446c56a Win32: strengthen DLL loading; VV: fix farstream plugins loading on win32
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33898
diff changeset
128 purple_debug_misc("winpidgin", "winpidgin_init start\n");
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
129
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
130 messagewin_hwnd = winpidgin_message_window_init();
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
131
33960
ce450446c56a Win32: strengthen DLL loading; VV: fix farstream plugins loading on win32
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33898
diff changeset
132 if (purple_debug_is_verbose())
ce450446c56a Win32: strengthen DLL loading; VV: fix farstream plugins loading on win32
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 33898
diff changeset
133 purple_debug_misc("winpidgin", "winpidgin_init end\n");
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
134 }
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
135
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
136 /* Windows Cleanup */
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
137
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
138 void winpidgin_cleanup(void) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15697
diff changeset
139 purple_debug_info("winpidgin", "winpidgin_cleanup\n");
14319
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
140
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
141 if(messagewin_hwnd)
b9a35c4948dc [gaim-migrate @ 16939]
Daniel Atallah <datallah@pidgin.im>
parents: 14286
diff changeset
142 DestroyWindow(messagewin_hwnd);
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
143
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
144 }
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
145
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
146 /* DLL initializer */
15697
78ddac185d80 winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents: 15678
diff changeset
147 /* suppress gcc "no previous prototype" warning */
78ddac185d80 winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents: 15678
diff changeset
148 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
41952
e128168d9ea5 Fix a compilation error on windows and many warnings
Gary Kramlich <grim@reaperworld.com>
parents: 41904
diff changeset
149 BOOL WINAPI DllMain(HINSTANCE hinstDLL, G_GNUC_UNUSED DWORD fdwReason, G_GNUC_UNUSED LPVOID lpvReserved) {
15574
18d9d1c05994 Win32 de-gaimification of pidgin
Daniel Atallah <datallah@pidgin.im>
parents: 15563
diff changeset
150 dll_hInstance = hinstDLL;
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
151 return TRUE;
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents:
diff changeset
152 }
14636
5306c329992c [gaim-migrate @ 17298]
Daniel Atallah <datallah@pidgin.im>
parents: 14319
diff changeset
153
37565
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
154 typedef HRESULT (WINAPI* DwmIsCompositionEnabledFunction)(BOOL*);
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
155 typedef HRESULT (WINAPI* DwmGetWindowAttributeFunction)(HWND, DWORD, PVOID, DWORD);
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
156 #ifndef DWMWA_EXTENDED_FRAME_BOUNDS
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
157 # define DWMWA_EXTENDED_FRAME_BOUNDS 9
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
158 #endif
fa3c41b69e47 win32: Fix window placement on Windows >= Vista. Fixes #16830
Eion Robb <eion@robbmob.com>
parents: 37507
diff changeset
159
30734
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
160 DWORD winpidgin_get_lastactive() {
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
161 DWORD result = 0;
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
162
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
163 LASTINPUTINFO lii;
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
164 memset(&lii, 0, sizeof(lii));
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
165 lii.cbSize = sizeof(lii);
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
166 if (GetLastInputInfo(&lii))
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
167 result = lii.dwTime;
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
168
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
169 return result;
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
170 }
caafb5a4e95b Kill the win32 idle tracking code that works on old windows versions and move
Daniel Atallah <datallah@pidgin.im>
parents: 30251
diff changeset
171

mercurial