Mercurial > pidgin.yaz
annotate gtk/win32/gtkwin32dep.c @ 15149:b5a8193edb62
[gaim-migrate @ 17934]
I forgot to add section breaks in the appropriate places in oscar in [17929]
committer: Tailor Script <tailor@pidgin.im>
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Sun, 10 Dec 2006 03:44:35 +0000 |
parents | 650dee386bf6 |
children | 2bcb8684bfb5 |
rev | line source |
---|---|
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
1 /* |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
2 * gaim |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
3 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
4 * File: gtkwin32dep.c |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
5 * Date: June, 2002 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
6 * Description: Windows dependant code for Gaim |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
7 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
8 * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
9 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
10 * This program is free software; you can redistribute it and/or modify |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
11 * it under the terms of the GNU General Public License as published by |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
12 * the Free Software Foundation; either version 2 of the License, or |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
13 * (at your option) any later version. |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
14 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
15 * This program is distributed in the hope that it will be useful, |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
18 * GNU General Public License for more details. |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
19 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
20 * You should have received a copy of the GNU General Public License |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
21 * along with this program; if not, write to the Free Software |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
23 * |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
24 */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
25 #define _WIN32_IE 0x500 |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
26 #ifndef WINVER |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
27 #define WINVER 0x0500 /* W2K */ |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
28 #endif |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
29 #include <windows.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
30 #include <io.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
31 #include <stdlib.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
32 #include <stdio.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
33 #include <winuser.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
34 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
35 #include <glib.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
36 #include <glib/gstdio.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
37 #include <gtk/gtk.h> |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
38 #include <gdk/gdkwin32.h> |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
39 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
40 #include "debug.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
41 #include "notify.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
42 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
43 #include "resource.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
44 #include "idletrack.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
45 #include "zlib.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
46 #include "untar.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
47 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
48 #include <libintl.h> |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
49 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
50 #include "gtkwin32dep.h" |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
51 #include "win32dep.h" |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
52 #include "gtkconv.h" |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
53 #include "wspell.h" |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
54 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
55 /* |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
56 * GLOBALS |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
57 */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
58 HINSTANCE gaimexe_hInstance = 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
59 HINSTANCE gtkgaimdll_hInstance = 0; |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
60 HWND messagewin_hwnd; |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
61 static int gtkwin32_handle; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
62 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
63 typedef BOOL (CALLBACK* LPFNFLASHWINDOWEX)(PFLASHWINFO); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
64 static LPFNFLASHWINDOWEX MyFlashWindowEx = NULL; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
65 |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
66 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
67 /* |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
68 * PUBLIC CODE |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
69 */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
70 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
71 HINSTANCE gtkwgaim_hinstance(void) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
72 return gaimexe_hInstance; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
73 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
74 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
75 int gtkwgaim_gz_decompress(const char* in, const char* out) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
76 gzFile fin; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
77 FILE *fout; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
78 char buf[1024]; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
79 int ret; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
80 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
81 if((fin = gzopen(in, "rb"))) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
82 if(!(fout = g_fopen(out, "wb"))) { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
83 gaim_debug_error("gtkwgaim_gz_decompress", "Error opening file: %s\n", out); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
84 gzclose(fin); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
85 return 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
86 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
87 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
88 else { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
89 gaim_debug_error("gtkwgaim_gz_decompress", "gzopen failed to open: %s\n", in); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
90 return 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
91 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
92 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
93 while((ret = gzread(fin, buf, 1024))) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
94 if(fwrite(buf, 1, ret, fout) < ret) { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
95 gaim_debug_error("wgaim_gz_decompress", "Error writing %d bytes to file\n", ret); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
96 gzclose(fin); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
97 fclose(fout); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
98 return 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
99 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
100 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
101 fclose(fout); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
102 gzclose(fin); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
103 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
104 if(ret < 0) { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
105 gaim_debug_error("gtkwgaim_gz_decompress", "gzread failed while reading: %s\n", in); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
106 return 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
107 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
108 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
109 return 1; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
110 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
111 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
112 int gtkwgaim_gz_untar(const char* filename, const char* destdir) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
113 char tmpfile[_MAX_PATH]; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
114 char template[]="wgaimXXXXXX"; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
115 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
116 sprintf(tmpfile, "%s%s%s", g_get_tmp_dir(), G_DIR_SEPARATOR_S, _mktemp(template)); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
117 if(gtkwgaim_gz_decompress(filename, tmpfile)) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
118 int ret; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
119 if(untar(tmpfile, destdir, UNTAR_FORCE | UNTAR_QUIET)) |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
120 ret = 1; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
121 else { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
122 gaim_debug_error("gtkwgaim_gz_untar", "Failure untaring %s\n", tmpfile); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
123 ret = 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
124 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
125 g_unlink(tmpfile); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
126 return ret; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
127 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
128 else { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
129 gaim_debug_error("gtkwgaim_gz_untar", "Failed to gz decompress %s\n", filename); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
130 return 0; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
131 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
132 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
133 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
134 void gtkwgaim_notify_uri(const char *uri) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
135 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
136 /* We'll allow whatever URI schemes are supported by the |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
137 * default http browser. |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
138 */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
139 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
140 if (G_WIN32_HAVE_WIDECHAR_API()) { |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
141 SHELLEXECUTEINFOW wsinfo; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
142 wchar_t *w_uri; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
143 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
144 w_uri = g_utf8_to_utf16(uri, -1, NULL, NULL, NULL); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
145 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
146 memset(&wsinfo, 0, sizeof(wsinfo)); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
147 wsinfo.cbSize = sizeof(wsinfo); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
148 wsinfo.fMask = SEE_MASK_CLASSNAME; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
149 wsinfo.lpVerb = L"open"; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
150 wsinfo.lpFile = w_uri; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
151 wsinfo.nShow = SW_SHOWNORMAL; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
152 wsinfo.lpClass = L"http"; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
153 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
154 if(!ShellExecuteExW(&wsinfo)) |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
155 gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
156 uri, (int) wsinfo.hInstApp); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
157 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
158 g_free(w_uri); |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
159 } else { |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
160 SHELLEXECUTEINFOA sinfo; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
161 gchar *locale_uri; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
162 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
163 locale_uri = g_locale_from_utf8(uri, -1, NULL, NULL, NULL); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
164 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
165 memset(&sinfo, 0, sizeof(sinfo)); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
166 sinfo.cbSize = sizeof(sinfo); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
167 sinfo.fMask = SEE_MASK_CLASSNAME; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
168 sinfo.lpVerb = "open"; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
169 sinfo.lpFile = locale_uri; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
170 sinfo.nShow = SW_SHOWNORMAL; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
171 sinfo.lpClass = "http"; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
172 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
173 if(!ShellExecuteExA(&sinfo)) |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
174 gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
175 uri, (int) sinfo.hInstApp); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
176 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
177 g_free(locale_uri); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
178 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
179 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
180 |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
181 #define WM_FOCUS_REQUEST (WM_APP + 13) |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
182 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
183 static LRESULT CALLBACK message_window_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
184 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
185 if (msg == WM_FOCUS_REQUEST) { |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
186 gaim_debug_info("gtkwgaim", "Got external Buddy List focus request."); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
187 gaim_blist_set_visible(TRUE); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
188 return TRUE; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
189 } |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
190 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
191 return DefWindowProc(hwnd, msg, wparam, lparam); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
192 } |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
193 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
194 static HWND wgaim_message_window_init(void) { |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
195 HWND win_hwnd; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
196 WNDCLASSEX wcx; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
197 LPCTSTR wname; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
198 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
199 wname = TEXT("WingaimMsgWinCls"); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
200 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
201 wcx.cbSize = sizeof(wcx); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
202 wcx.style = 0; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
203 wcx.lpfnWndProc = message_window_handler; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
204 wcx.cbClsExtra = 0; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
205 wcx.cbWndExtra = 0; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
206 wcx.hInstance = gtkwgaim_hinstance(); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
207 wcx.hIcon = NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
208 wcx.hCursor = NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
209 wcx.hbrBackground = NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
210 wcx.lpszMenuName = NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
211 wcx.lpszClassName = wname; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
212 wcx.hIconSm = NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
213 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
214 RegisterClassEx(&wcx); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
215 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
216 /* Create the window */ |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
217 if(!(win_hwnd = CreateWindow(wname, TEXT("WingaimMsgWin"), 0, 0, 0, 0, 0, |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
218 NULL, NULL, gtkwgaim_hinstance(), 0))) { |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
219 gaim_debug_error("gtkwgaim", |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
220 "Unable to create message window.\n"); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
221 return NULL; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
222 } |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
223 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
224 return win_hwnd; |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
225 } |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
226 |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
227 void |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
228 gtkwgaim_conv_blink(GaimConversation *conv, GaimMessageFlags flags) { |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
229 GaimGtkWindow *win; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
230 GtkWidget *window; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
231 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
232 /* Don't flash for our own messages or system messages */ |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
233 if(flags & GAIM_MESSAGE_SEND || flags & GAIM_MESSAGE_SYSTEM) |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
234 return; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
235 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
236 if(conv == NULL) { |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
237 gaim_debug_info("gtkwgaim", "No conversation found to blink.\n"); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
238 return; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
239 } |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
240 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
241 win = gaim_gtkconv_get_window(GAIM_GTK_CONVERSATION(conv)); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
242 if(win == NULL) { |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
243 gaim_debug_info("gtkwgaim", "No conversation windows found to blink.\n"); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
244 return; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
245 } |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
246 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
247 window = win->window; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
248 |
14795
d1614d9ce7ab
[gaim-migrate @ 17560]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14700
diff
changeset
|
249 /* Don't flash if we have the window focused */ |
d1614d9ce7ab
[gaim-migrate @ 17560]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14700
diff
changeset
|
250 if(GetForegroundWindow() == GDK_WINDOW_HWND(window->window)) |
d1614d9ce7ab
[gaim-migrate @ 17560]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14700
diff
changeset
|
251 return; |
d1614d9ce7ab
[gaim-migrate @ 17560]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14700
diff
changeset
|
252 |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
253 if(MyFlashWindowEx) { |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
254 FLASHWINFO info; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
255 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
256 memset(&info, 0, sizeof(FLASHWINFO)); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
257 info.cbSize = sizeof(FLASHWINFO); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
258 info.hwnd = GDK_WINDOW_HWND(window->window); |
14795
d1614d9ce7ab
[gaim-migrate @ 17560]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14700
diff
changeset
|
259 info.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG; |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
260 info.dwTimeout = 0; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
261 MyFlashWindowEx(&info); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
262 } |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
263 } |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
264 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
265 static gboolean |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
266 gtkwgaim_conv_im_blink(GaimAccount *account, const char *who, char **message, |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
267 GaimConversation *conv, GaimMessageFlags flags, void *data) |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
268 { |
14805
984657c2584d
[gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14795
diff
changeset
|
269 if (gaim_prefs_get_bool("/gaim/gtk/win32/blink_im")) |
984657c2584d
[gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14795
diff
changeset
|
270 gtkwgaim_conv_blink(conv, flags); |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
271 return FALSE; |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
272 } |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
273 |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
274 void gtkwgaim_init(HINSTANCE hint) { |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
275 |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
276 gaim_debug_info("gtkwgaim", "gtkwgaim_init start\n"); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
277 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
278 gaimexe_hInstance = hint; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
279 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
280 /* IdleTracker Initialization */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
281 if(!wgaim_set_idlehooks()) |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
282 gaim_debug_error("gtkwgaim", "Failed to initialize idle tracker\n"); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
283 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
284 wgaim_gtkspell_init(); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
285 gaim_debug_info("gtkwgaim", "GTK+ :%u.%u.%u\n", |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
286 gtk_major_version, gtk_minor_version, gtk_micro_version); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
287 |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
288 messagewin_hwnd = wgaim_message_window_init(); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
289 |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
290 MyFlashWindowEx = (LPFNFLASHWINDOWEX) wgaim_find_and_loadproc("user32.dll", "FlashWindowEx"); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
291 |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
292 gaim_debug_info("gtkwgaim", "gtkwgaim_init end\n"); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
293 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
294 |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
295 void gtkwgaim_post_init(void) { |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
296 |
14805
984657c2584d
[gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14795
diff
changeset
|
297 gaim_prefs_add_none("/gaim/gtk/win32"); |
984657c2584d
[gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14795
diff
changeset
|
298 gaim_prefs_add_bool("/gaim/gtk/win32/blink_im", TRUE); |
984657c2584d
[gaim-migrate @ 17570]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14795
diff
changeset
|
299 |
14700
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
300 gaim_signal_connect(gaim_gtk_conversations_get_handle(), |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
301 "displaying-im-msg", >kwin32_handle, GAIM_CALLBACK(gtkwgaim_conv_im_blink), |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
302 NULL); |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
303 |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
304 } |
7fb8a8583c73
[gaim-migrate @ 17452]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14574
diff
changeset
|
305 |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
306 /* Windows Cleanup */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
307 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
308 void gtkwgaim_cleanup(void) { |
14257
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
309 gaim_debug_info("gtkwgaim", "gtkwgaim_cleanup\n"); |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
310 |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
311 if(messagewin_hwnd) |
14933d9055a0
[gaim-migrate @ 16939]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14224
diff
changeset
|
312 DestroyWindow(messagewin_hwnd); |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
313 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
314 /* Idle tracker cleanup */ |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
315 wgaim_remove_idlehooks(); |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
316 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
317 } |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
318 |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
319 /* DLL initializer */ |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
320 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { |
14224
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
321 gtkgaimdll_hInstance = hinstDLL; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
322 return TRUE; |
ab8a105eff62
[gaim-migrate @ 16905]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
323 } |
14574
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
324 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
325 typedef HMONITOR WINAPI gaim_MonitorFromWindow(HWND, DWORD); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
326 typedef BOOL WINAPI gaim_GetMonitorInfo(HMONITOR, LPMONITORINFO); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
327 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
328 static gboolean |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
329 get_WorkingAreaRectForWindow(HWND hwnd, RECT *workingAreaRc) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
330 static gaim_MonitorFromWindow *the_MonitorFromWindow; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
331 static gaim_GetMonitorInfo *the_GetMonitorInfo; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
332 static gboolean initialized = FALSE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
333 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
334 HMONITOR monitor; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
335 MONITORINFO info; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
336 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
337 if(!initialized) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
338 the_MonitorFromWindow = (gaim_MonitorFromWindow*) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
339 wgaim_find_and_loadproc("user32", "MonitorFromWindow"); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
340 the_GetMonitorInfo = (gaim_GetMonitorInfo*) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
341 wgaim_find_and_loadproc("user32", "GetMonitorInfoA"); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
342 initialized = TRUE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
343 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
344 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
345 if(!the_MonitorFromWindow) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
346 return FALSE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
347 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
348 if(!the_GetMonitorInfo) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
349 return FALSE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
350 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
351 monitor = the_MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
352 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
353 info.cbSize = sizeof(info); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
354 if(!the_GetMonitorInfo(monitor, &info)) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
355 return FALSE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
356 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
357 CopyRect(workingAreaRc, &(info.rcWork)); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
358 return TRUE; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
359 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
360 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
361 void gtkwgaim_ensure_onscreen(GtkWidget *win) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
362 RECT windowRect, workingAreaRect, intersectionRect; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
363 HWND hwnd = GDK_WINDOW_HWND(win->window); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
364 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
365 g_return_if_fail(hwnd != NULL); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
366 GetWindowRect(hwnd, &windowRect); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
367 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
368 gaim_debug_info("win32placement", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
369 "Window RECT: L:%ld R:%ld T:%ld B:%ld\n", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
370 windowRect.left, windowRect.right, |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
371 windowRect.top, windowRect.bottom); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
372 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
373 if(!get_WorkingAreaRectForWindow(hwnd, &workingAreaRect)) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
374 gaim_debug_info("win32placement", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
375 "Couldn't get multimonitor working area\n"); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
376 if(!SystemParametersInfo(SPI_GETWORKAREA, 0, &workingAreaRect, FALSE)) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
377 /* I don't think this will ever happen */ |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
378 workingAreaRect.left = 0; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
379 workingAreaRect.top = 0; |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
380 workingAreaRect.bottom = GetSystemMetrics(SM_CYSCREEN); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
381 workingAreaRect.right = GetSystemMetrics(SM_CXSCREEN); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
382 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
383 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
384 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
385 gaim_debug_info("win32placement", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
386 "Working Area RECT: L:%ld R:%ld T:%ld B:%ld\n", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
387 workingAreaRect.left, workingAreaRect.right, |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
388 workingAreaRect.top, workingAreaRect.bottom); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
389 |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
390 /** If the conversation window doesn't intersect perfectly with the working area, |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
391 * move it to the top left corner of the working area */ |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
392 if(!(IntersectRect(&intersectionRect, &windowRect, &workingAreaRect) |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
393 && EqualRect(&intersectionRect, &windowRect))) { |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
394 gaim_debug_info("win32placement", |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
395 "conversation window out of working area, relocating\n"); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
396 MoveWindow(hwnd, workingAreaRect.left, workingAreaRect.top, |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
397 (windowRect.right - windowRect.left), |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
398 (windowRect.bottom - windowRect.top), TRUE); |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
399 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
400 } |
333989477bcd
[gaim-migrate @ 17298]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
14257
diff
changeset
|
401 |