Mercurial > emacs
annotate src/w32xfns.c @ 111002:62243368de05
shr.el (shr-insert): Remove space inserted before or after a breakable character or at the beginning or the end of a line.
shr.el (shr-find-fill-point): Do kinsoku; find the second best point or give it up if there's no breakable point.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Fri, 15 Oct 2010 08:10:56 +0000 |
parents | b8fde5ef9e14 |
children | 417b1e4d63cd |
rev | line source |
---|---|
16884
36babc489b0c
Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
1 /* Functions taken directly from X sources for use with the Microsoft W32 API. |
75227
e90d04cd455a
Update copyright for years from Emacs 21 to present (mainly adding
Glenn Morris <rgm@gnu.org>
parents:
68651
diff
changeset
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1999, 2001, 2002, 2003, |
106815 | 3 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
13434 | 4 |
5 This file is part of GNU Emacs. | |
6 | |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
7 GNU Emacs is free software: you can redistribute it and/or modify |
13434 | 8 it under the terms of the GNU General Public License as published by |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
10 (at your option) any later version. |
13434 | 11 |
12 GNU Emacs is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
13434 | 19 |
26088
b7aa6ac26872
Add support for large files, 64-bit Solaris, system locale codings.
Paul Eggert <eggert@twinsun.com>
parents:
24917
diff
changeset
|
20 #include <config.h> |
13434 | 21 #include <signal.h> |
22 #include <stdio.h> | |
105669
68dd71358159
* alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
23 #include <setjmp.h> |
13434 | 24 #include "lisp.h" |
31117
f390b90e3495
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
26088
diff
changeset
|
25 #include "keyboard.h" |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
26 #include "frame.h" |
23509
afcb561b535d
Include charset.h and fontset.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22077
diff
changeset
|
27 #include "charset.h" |
afcb561b535d
Include charset.h and fontset.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22077
diff
changeset
|
28 #include "fontset.h" |
13434 | 29 #include "blockinput.h" |
30 #include "w32term.h" | |
31 #include "windowsx.h" | |
32 | |
33 #define myalloc(cb) GlobalAllocPtr (GPTR, cb) | |
34 #define myfree(lp) GlobalFreePtr (lp) | |
35 | |
14352 | 36 CRITICAL_SECTION critsect; |
13434 | 37 extern HANDLE keyboard_handle; |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
38 HANDLE input_available = NULL; |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
39 HANDLE interrupt_handle = NULL; |
13434 | 40 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
41 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
42 init_crit (void) |
13434 | 43 { |
14352 | 44 InitializeCriticalSection (&critsect); |
13434 | 45 |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
46 /* For safety, input_available should only be reset by get_next_msg |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
47 when the input queue is empty, so make it a manual reset event. */ |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
48 keyboard_handle = input_available = CreateEvent (NULL, TRUE, FALSE, NULL); |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
49 |
96361
a99299e4d2de
American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents:
94963
diff
changeset
|
50 /* interrupt_handle is signaled when quit (C-g) is detected, so that |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
51 blocking system calls can be interrupted. We make it a manual |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
52 reset event, so that if we should ever have multiple threads |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
53 performing system calls, they will all be interrupted (I'm guessing |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
54 that would the right response). Note that we use PulseEvent to |
96361
a99299e4d2de
American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents:
94963
diff
changeset
|
55 signal this event, so that it never remains signaled. */ |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
56 interrupt_handle = CreateEvent (NULL, TRUE, FALSE, NULL); |
13434 | 57 } |
58 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
59 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
60 delete_crit (void) |
13434 | 61 { |
14352 | 62 DeleteCriticalSection (&critsect); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
63 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
64 if (input_available) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
65 { |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
66 CloseHandle (input_available); |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
67 input_available = NULL; |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
68 } |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
69 if (interrupt_handle) |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
70 { |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
71 CloseHandle (interrupt_handle); |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
72 interrupt_handle = NULL; |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
73 } |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
74 } |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
75 |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
76 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
77 signal_quit (void) |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
78 { |
96361
a99299e4d2de
American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents:
94963
diff
changeset
|
79 /* Make sure this event never remains signaled; if the main thread |
22077
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
80 isn't in a blocking call, then this should do nothing. */ |
ae5e3b23c7e2
(interrupt_handle): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19715
diff
changeset
|
81 PulseEvent (interrupt_handle); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
82 } |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
83 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
84 void |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
85 select_palette (FRAME_PTR f, HDC hdc) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
86 { |
34783
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
87 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); |
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
88 |
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
89 if (!display_info->has_palette) |
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
90 return; |
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
91 |
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
92 if (display_info->palette == 0) |
35943
7a9bc23b91e7
(select_palette): Do nothing if palette hasn't yet
Andrew Innes <andrewi@gnu.org>
parents:
34999
diff
changeset
|
93 return; |
34783
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
94 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
95 if (!NILP (Vw32_enable_palette)) |
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
96 f->output_data.w32->old_palette = |
34783
9c0d7d896682
(select_palette): Avoid calling SelectPalette if
Andrew Innes <andrewi@gnu.org>
parents:
34094
diff
changeset
|
97 SelectPalette (hdc, display_info->palette, FALSE); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
98 else |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
99 f->output_data.w32->old_palette = NULL; |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
100 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
101 if (RealizePalette (hdc)) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
102 { |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
103 Lisp_Object frame, framelist; |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
104 FOR_EACH_FRAME (framelist, frame) |
13434 | 105 { |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
106 SET_FRAME_GARBAGED (XFRAME (frame)); |
13434 | 107 } |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
108 } |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
109 } |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
110 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
111 void |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
112 deselect_palette (FRAME_PTR f, HDC hdc) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
113 { |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
114 if (f->output_data.w32->old_palette) |
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
115 SelectPalette (hdc, f->output_data.w32->old_palette, FALSE); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
116 } |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
117 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
118 /* Get a DC for frame and select palette for drawing; force an update of |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
119 all frames if palette's mapping changes. */ |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
120 HDC |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
121 get_frame_dc (FRAME_PTR f) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
122 { |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
123 HDC hdc; |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
124 |
34999
549bbda5364a
(get_frame_dc): Abort if called on a non-w32 frame.
Andrew Innes <andrewi@gnu.org>
parents:
34783
diff
changeset
|
125 if (f->output_method != output_w32) |
549bbda5364a
(get_frame_dc): Abort if called on a non-w32 frame.
Andrew Innes <andrewi@gnu.org>
parents:
34783
diff
changeset
|
126 abort (); |
549bbda5364a
(get_frame_dc): Abort if called on a non-w32 frame.
Andrew Innes <andrewi@gnu.org>
parents:
34783
diff
changeset
|
127 |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
128 enter_crit (); |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
129 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
130 hdc = GetDC (f->output_data.w32->window_desc); |
34094
59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
Jason Rumney <jasonr@gnu.org>
parents:
31117
diff
changeset
|
131 |
59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
Jason Rumney <jasonr@gnu.org>
parents:
31117
diff
changeset
|
132 /* If this gets called during startup before the frame is valid, |
59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
Jason Rumney <jasonr@gnu.org>
parents:
31117
diff
changeset
|
133 there is a chance of corrupting random data or crashing. */ |
59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
Jason Rumney <jasonr@gnu.org>
parents:
31117
diff
changeset
|
134 if (hdc) |
59adbaee3092
(get_frame_dc): Avoid changing the palette on an invalid frame.
Jason Rumney <jasonr@gnu.org>
parents:
31117
diff
changeset
|
135 select_palette (f, hdc); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
136 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
137 return hdc; |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
138 } |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
139 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
140 int |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
141 release_frame_dc (FRAME_PTR f, HDC hdc) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
142 { |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
143 int ret; |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
144 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
145 deselect_palette (f, hdc); |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
146 ret = ReleaseDC (f->output_data.w32->window_desc, hdc); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
147 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
148 leave_crit (); |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
149 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
150 return ret; |
13434 | 151 } |
152 | |
153 typedef struct int_msg | |
154 { | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
155 W32Msg w32msg; |
13434 | 156 struct int_msg *lpNext; |
157 } int_msg; | |
158 | |
159 int_msg *lpHead = NULL; | |
160 int_msg *lpTail = NULL; | |
161 int nQueue = 0; | |
162 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
163 BOOL |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
164 get_next_msg (W32Msg * lpmsg, BOOL bWait) |
13434 | 165 { |
166 BOOL bRet = FALSE; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
167 |
14352 | 168 enter_crit (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
169 |
13434 | 170 /* The while loop takes care of multiple sets */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
171 |
13434 | 172 while (!nQueue && bWait) |
173 { | |
14352 | 174 leave_crit (); |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
175 WaitForSingleObject (input_available, INFINITE); |
14352 | 176 enter_crit (); |
13434 | 177 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
178 |
13434 | 179 if (nQueue) |
180 { | |
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109160
diff
changeset
|
181 memcpy (lpmsg, &lpHead->w32msg, sizeof (W32Msg)); |
13434 | 182 |
183 { | |
184 int_msg * lpCur = lpHead; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
185 |
13434 | 186 lpHead = lpHead->lpNext; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
187 |
13434 | 188 myfree (lpCur); |
189 } | |
190 | |
191 nQueue--; | |
91031
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
192 /* Consolidate WM_PAINT messages to optimise redrawing. */ |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
193 if (lpmsg->msg.message == WM_PAINT && nQueue) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
194 { |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
195 int_msg * lpCur = lpHead; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
196 int_msg * lpPrev = NULL; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
197 int_msg * lpNext = NULL; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
198 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
199 while (lpCur && nQueue) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
200 { |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
201 lpNext = lpCur->lpNext; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
202 if (lpCur->w32msg.msg.message == WM_PAINT) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
203 { |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
204 /* Remove this message from the queue. */ |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
205 if (lpPrev) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
206 lpPrev->lpNext = lpNext; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
207 else |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
208 lpHead = lpNext; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
209 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
210 if (lpCur == lpTail) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
211 lpTail = lpPrev; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
212 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
213 /* Adjust clip rectangle to cover both. */ |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
214 if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect), |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
215 &(lpCur->w32msg.rect))) |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
216 { |
110994
734b2470f93c
src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
217 SetRectEmpty (&(lpmsg->rect)); |
91031
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
218 } |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
219 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
220 myfree (lpCur); |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
221 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
222 nQueue--; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
223 |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
224 lpCur = lpNext; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
225 } |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
226 else |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
227 { |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
228 lpPrev = lpCur; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
229 lpCur = lpNext; |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
230 } |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
231 } |
524f82fbf3ef
(get_next_msg): Consolidate WM_PAINT messages.
Jason Rumney <jasonr@gnu.org>
parents:
90996
diff
changeset
|
232 } |
13434 | 233 |
234 bRet = TRUE; | |
235 } | |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
236 |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
237 if (nQueue == 0) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
238 ResetEvent (input_available); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
239 |
14352 | 240 leave_crit (); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
241 |
13434 | 242 return (bRet); |
243 } | |
244 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
245 BOOL |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
246 post_msg (W32Msg * lpmsg) |
13434 | 247 { |
248 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); | |
249 | |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
250 if (!lpNew) |
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
251 return (FALSE); |
13434 | 252 |
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109160
diff
changeset
|
253 memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg)); |
13434 | 254 lpNew->lpNext = NULL; |
255 | |
14352 | 256 enter_crit (); |
13434 | 257 |
258 if (nQueue++) | |
14352 | 259 { |
260 lpTail->lpNext = lpNew; | |
261 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
262 else |
14352 | 263 { |
264 lpHead = lpNew; | |
265 } | |
13434 | 266 |
267 lpTail = lpNew; | |
15153
c1494aa589e8
Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14460
diff
changeset
|
268 SetEvent (input_available); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
269 |
14352 | 270 leave_crit (); |
13434 | 271 |
272 return (TRUE); | |
273 } | |
274 | |
14460
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
275 BOOL |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
276 prepend_msg (W32Msg *lpmsg) |
14460
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
277 { |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
278 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
279 |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
280 if (!lpNew) |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
281 return (FALSE); |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
282 |
109165
750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents:
109160
diff
changeset
|
283 memcpy (&lpNew->w32msg, lpmsg, sizeof (W32Msg)); |
14460
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
284 |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
285 enter_crit (); |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
286 |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
287 nQueue++; |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
288 lpNew->lpNext = lpHead; |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
289 lpHead = lpNew; |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
290 |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
291 leave_crit (); |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
292 |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
293 return (TRUE); |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
294 } |
61fc696a0c6a
(prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents:
14352
diff
changeset
|
295 |
24917
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
296 /* Process all messages in the current thread's queue. */ |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
297 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
298 drain_message_queue (void) |
24917
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
299 { |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
300 MSG msg; |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
301 while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
302 { |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
303 TranslateMessage (&msg); |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
304 DispatchMessage (&msg); |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
305 } |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
306 } |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
307 |
600578f35004
(drain_message_queue): New function.
Andrew Innes <andrewi@gnu.org>
parents:
23509
diff
changeset
|
308 |
13434 | 309 /* |
310 * XParseGeometry parses strings of the form | |
311 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where | |
312 * width, height, xoffset, and yoffset are unsigned integers. | |
313 * Example: "=80x24+300-49" | |
314 * The equal sign is optional. | |
315 * It returns a bitmask that indicates which of the four values | |
316 * were actually found in the string. For each value found, | |
317 * the corresponding argument is updated; for each value | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
318 * not found, the corresponding argument is left unchanged. |
13434 | 319 */ |
320 | |
321 static int | |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
322 read_integer (register char *string, char **NextString) |
13434 | 323 { |
324 register int Result = 0; | |
325 int Sign = 1; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
326 |
13434 | 327 if (*string == '+') |
328 string++; | |
329 else if (*string == '-') | |
330 { | |
331 string++; | |
332 Sign = -1; | |
333 } | |
334 for (; (*string >= '0') && (*string <= '9'); string++) | |
335 { | |
336 Result = (Result * 10) + (*string - '0'); | |
337 } | |
338 *NextString = string; | |
339 if (Sign >= 0) | |
340 return (Result); | |
341 else | |
342 return (-Result); | |
343 } | |
344 | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
345 int |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
346 XParseGeometry (char *string, |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
347 int *x, int *y, |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
348 unsigned int *width, unsigned int *height) |
13434 | 349 { |
350 int mask = NoValue; | |
351 register char *strind; | |
352 unsigned int tempWidth, tempHeight; | |
353 int tempX, tempY; | |
354 char *nextCharacter; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
355 |
13434 | 356 if ((string == NULL) || (*string == '\0')) return (mask); |
357 if (*string == '=') | |
358 string++; /* ignore possible '=' at beg of geometry spec */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
359 |
13434 | 360 strind = (char *)string; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
361 if (*strind != '+' && *strind != '-' && *strind != 'x') |
13434 | 362 { |
363 tempWidth = read_integer (strind, &nextCharacter); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
364 if (strind == nextCharacter) |
13434 | 365 return (0); |
366 strind = nextCharacter; | |
367 mask |= WidthValue; | |
368 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
369 |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
370 if (*strind == 'x' || *strind == 'X') |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
371 { |
13434 | 372 strind++; |
373 tempHeight = read_integer (strind, &nextCharacter); | |
374 if (strind == nextCharacter) | |
375 return (0); | |
376 strind = nextCharacter; | |
377 mask |= HeightValue; | |
378 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
379 |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
380 if ((*strind == '+') || (*strind == '-')) |
13434 | 381 { |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
382 if (*strind == '-') |
13434 | 383 { |
384 strind++; | |
385 tempX = -read_integer (strind, &nextCharacter); | |
386 if (strind == nextCharacter) | |
387 return (0); | |
388 strind = nextCharacter; | |
389 mask |= XNegative; | |
390 | |
391 } | |
392 else | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
393 { |
13434 | 394 strind++; |
395 tempX = read_integer (strind, &nextCharacter); | |
396 if (strind == nextCharacter) | |
397 return (0); | |
398 strind = nextCharacter; | |
399 } | |
400 mask |= XValue; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
401 if ((*strind == '+') || (*strind == '-')) |
13434 | 402 { |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
403 if (*strind == '-') |
13434 | 404 { |
405 strind++; | |
406 tempY = -read_integer (strind, &nextCharacter); | |
407 if (strind == nextCharacter) | |
408 return (0); | |
409 strind = nextCharacter; | |
410 mask |= YNegative; | |
411 } | |
412 else | |
413 { | |
414 strind++; | |
415 tempY = read_integer (strind, &nextCharacter); | |
416 if (strind == nextCharacter) | |
417 return (0); | |
418 strind = nextCharacter; | |
419 } | |
420 mask |= YValue; | |
421 } | |
422 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
423 |
110994
734b2470f93c
src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
424 /* If strind isn't at the end of the string then it's an invalid |
13434 | 425 geometry specification. */ |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
426 |
13434 | 427 if (*strind != '\0') return (0); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
35943
diff
changeset
|
428 |
13434 | 429 if (mask & XValue) |
430 *x = tempX; | |
431 if (mask & YValue) | |
432 *y = tempY; | |
433 if (mask & WidthValue) | |
434 *width = tempWidth; | |
435 if (mask & HeightValue) | |
436 *height = tempHeight; | |
437 return (mask); | |
438 } | |
439 | |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
15153
diff
changeset
|
440 /* x_sync is a no-op on W32. */ |
13434 | 441 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
442 x_sync (void *f) |
13434 | 443 { |
444 } | |
52401 | 445 |
446 /* arch-tag: 4fab3695-4ad3-4cc6-a2b1-fd2c67dc46be | |
447 (do not change this comment) */ |