annotate src/w32xfns.c @ 18861:ed1871a409c8

(Finsert_file_contents) [DOS_NT]: Use the coding system to determine buffer_file_type. (Fwrite_region): Only use Qbuffer_file_coding_system before checking file-coding-system-alist if non-nil. (Fwrite_region) [DOS_NT]: Delete conditional code.
author Richard M. Stallman <rms@gnu.org>
date Fri, 18 Jul 1997 22:56:16 +0000
parents 36babc489b0c
children 639881f2750d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4 This file is part of GNU Emacs.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
5
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
9 any later version.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
10
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
14 GNU General Public License for more details.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
15
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13866
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13866
diff changeset
19 Boston, MA 02111-1307, USA. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
20
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
21 #include <signal.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
22 #include <config.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
23 #include <stdio.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
24 #include "lisp.h"
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
25 #include "frame.h"
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
26 #include "blockinput.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
27 #include "w32term.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
28 #include "windowsx.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
29
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
30 #define myalloc(cb) GlobalAllocPtr (GPTR, cb)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
31 #define myfree(lp) GlobalFreePtr (lp)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
32
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
33 CRITICAL_SECTION critsect;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
34 extern HANDLE keyboard_handle;
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
35 HANDLE input_available = NULL;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
36
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
37 void
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
38 init_crit ()
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
39 {
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
40 InitializeCriticalSection (&critsect);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
41
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
42 /* 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
43 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
44 keyboard_handle = input_available = CreateEvent (NULL, TRUE, FALSE, NULL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
45 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
46
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
47 void
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
48 delete_crit ()
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
49 {
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
50 DeleteCriticalSection (&critsect);
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
51
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
52 if (input_available)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
53 {
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
54 CloseHandle (input_available);
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
55 input_available = NULL;
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
56 }
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
57 }
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
58
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
59 void
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
60 select_palette (FRAME_PTR f, HDC hdc)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
61 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
62 if (!NILP (Vw32_enable_palette))
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
63 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
64 SelectPalette (hdc, one_w32_display_info.palette, FALSE);
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
65 else
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
66 f->output_data.w32->old_palette = NULL;
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
67
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
68 if (RealizePalette (hdc))
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
69 {
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
70 Lisp_Object frame, framelist;
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
71 FOR_EACH_FRAME (framelist, frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
72 {
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
73 SET_FRAME_GARBAGED (XFRAME (frame));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
74 }
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
75 }
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
76 }
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
77
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
78 void
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
79 deselect_palette (FRAME_PTR f, HDC hdc)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
80 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
81 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
82 SelectPalette (hdc, f->output_data.w32->old_palette, FALSE);
15153
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
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
85 /* 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
86 all frames if palette's mapping changes. */
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
87 HDC
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
88 get_frame_dc (FRAME_PTR f)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
89 {
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
90 HDC hdc;
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
91
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
92 enter_crit ();
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
93
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
94 hdc = GetDC (f->output_data.w32->window_desc);
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
95 select_palette (f, hdc);
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
96
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
97 return hdc;
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
98 }
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
99
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
100 int
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
101 release_frame_dc (FRAME_PTR f, HDC 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 int ret;
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
104
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
105 deselect_palette (f, hdc);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
106 ret = ReleaseDC (f->output_data.w32->window_desc, hdc);
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
107
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
108 leave_crit ();
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 return ret;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
111 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
112
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
113 typedef struct int_msg
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
114 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
115 W32Msg w32msg;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
116 struct int_msg *lpNext;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
117 } int_msg;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
118
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
119 int_msg *lpHead = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
120 int_msg *lpTail = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
121 int nQueue = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
122
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
123 BOOL
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
124 get_next_msg (lpmsg, bWait)
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
125 W32Msg * lpmsg;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
126 BOOL bWait;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
127 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
128 BOOL bRet = FALSE;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
129
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
130 enter_crit ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
131
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
132 /* The while loop takes care of multiple sets */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
133
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
134 while (!nQueue && bWait)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
135 {
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
136 leave_crit ();
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
137 WaitForSingleObject (input_available, INFINITE);
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
138 enter_crit ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
139 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
140
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
141 if (nQueue)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
142 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
143 bcopy (&(lpHead->w32msg), lpmsg, sizeof (W32Msg));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
144
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
145 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
146 int_msg * lpCur = lpHead;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
147
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
148 lpHead = lpHead->lpNext;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
149
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
150 myfree (lpCur);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
151 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
152
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
153 nQueue--;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
154
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
155 bRet = TRUE;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
156 }
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
157
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
158 if (nQueue == 0)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
159 ResetEvent (input_available);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
160
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
161 leave_crit ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
162
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
163 return (bRet);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
164 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
165
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
166 BOOL
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
167 post_msg (lpmsg)
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
168 W32Msg * lpmsg;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
169 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
170 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
171
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
172 if (!lpNew)
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
173 return (FALSE);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
174
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
175 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
176 lpNew->lpNext = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
177
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
178 enter_crit ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
179
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
180 if (nQueue++)
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
181 {
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
182 lpTail->lpNext = lpNew;
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
183 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
184 else
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
185 {
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
186 lpHead = lpNew;
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
187 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
188
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
189 lpTail = lpNew;
15153
c1494aa589e8 Include frame.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14460
diff changeset
190 SetEvent (input_available);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
191
14352
a05133ebf2bf backout 1,.4
Geoff Voelker <voelker@cs.washington.edu>
parents: 14239
diff changeset
192 leave_crit ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
193
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
194 return (TRUE);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
195 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
196
14460
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
197 BOOL
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
198 prepend_msg (W32Msg *lpmsg)
14460
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
199 {
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
200 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
201
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
202 if (!lpNew)
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
203 return (FALSE);
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
204
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
205 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg));
14460
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
206
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
207 enter_crit ();
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
208
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
209 nQueue++;
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
210 lpNew->lpNext = lpHead;
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
211 lpHead = lpNew;
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
212
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
213 leave_crit ();
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
214
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
215 return (TRUE);
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
216 }
61fc696a0c6a (prepend_msg): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14352
diff changeset
217
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
218 /*
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
219 * XParseGeometry parses strings of the form
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
220 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
221 * width, height, xoffset, and yoffset are unsigned integers.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
222 * Example: "=80x24+300-49"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
223 * The equal sign is optional.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
224 * It returns a bitmask that indicates which of the four values
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
225 * were actually found in the string. For each value found,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
226 * the corresponding argument is updated; for each value
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
227 * not found, the corresponding argument is left unchanged.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
228 */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
229
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
230 static int
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
231 read_integer (string, NextString)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
232 register char *string;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
233 char **NextString;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
234 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
235 register int Result = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
236 int Sign = 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
237
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
238 if (*string == '+')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
239 string++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
240 else if (*string == '-')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
241 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
242 string++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
243 Sign = -1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
244 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
245 for (; (*string >= '0') && (*string <= '9'); string++)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
246 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
247 Result = (Result * 10) + (*string - '0');
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
248 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
249 *NextString = string;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
250 if (Sign >= 0)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
251 return (Result);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
252 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
253 return (-Result);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
254 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
255
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
256 int
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
257 XParseGeometry (string, x, y, width, height)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
258 char *string;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
259 int *x, *y;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
260 unsigned int *width, *height; /* RETURN */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
261 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
262 int mask = NoValue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
263 register char *strind;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
264 unsigned int tempWidth, tempHeight;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
265 int tempX, tempY;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
266 char *nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
267
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
268 if ((string == NULL) || (*string == '\0')) return (mask);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
269 if (*string == '=')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
270 string++; /* ignore possible '=' at beg of geometry spec */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
271
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
272 strind = (char *)string;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
273 if (*strind != '+' && *strind != '-' && *strind != 'x')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
274 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
275 tempWidth = read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
276 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
277 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
278 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
279 mask |= WidthValue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
280 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
281
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
282 if (*strind == 'x' || *strind == 'X')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
283 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
284 strind++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
285 tempHeight = read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
286 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
287 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
288 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
289 mask |= HeightValue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
290 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
291
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
292 if ((*strind == '+') || (*strind == '-'))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
293 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
294 if (*strind == '-')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
295 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
296 strind++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
297 tempX = -read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
298 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
299 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
300 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
301 mask |= XNegative;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
302
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
303 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
304 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
305 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
306 strind++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
307 tempX = read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
308 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
309 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
310 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
311 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
312 mask |= XValue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
313 if ((*strind == '+') || (*strind == '-'))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
314 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
315 if (*strind == '-')
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
316 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
317 strind++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
318 tempY = -read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
319 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
320 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
321 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
322 mask |= YNegative;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
323
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
324 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
325 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
326 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
327 strind++;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
328 tempY = read_integer (strind, &nextCharacter);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
329 if (strind == nextCharacter)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
330 return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
331 strind = nextCharacter;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
332 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
333 mask |= YValue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
334 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
335 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
336
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
337 /* If strind isn't at the end of the string the it's an invalid
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
338 geometry specification. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
339
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
340 if (*strind != '\0') return (0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
341
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
342 if (mask & XValue)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
343 *x = tempX;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
344 if (mask & YValue)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
345 *y = tempY;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
346 if (mask & WidthValue)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
347 *width = tempWidth;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
348 if (mask & HeightValue)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
349 *height = tempHeight;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
350 return (mask);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
351 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
352
13866
808d4570cb4b (have_menus_p): Renamed from using_x_p.
Richard M. Stallman <rms@gnu.org>
parents: 13434
diff changeset
353 /* We can use mouse menus when we wish. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
354 int
13866
808d4570cb4b (have_menus_p): Renamed from using_x_p.
Richard M. Stallman <rms@gnu.org>
parents: 13434
diff changeset
355 have_menus_p (void)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
356 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
357 return 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
358 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
359
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 15153
diff changeset
360 /* x_sync is a no-op on W32. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
361 void
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
362 x_sync (f)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
363 void *f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
364 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
365 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
366