13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
1 /* Functions taken directly from X sources
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
3
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
4 This file is part of GNU Emacs.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
5
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
7 it under the terms of the GNU General Public License as published by
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
8 the Free Software Foundation; either version 2, or (at your option)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
9 any later version.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
10
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
14 GNU General Public License for more details.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
15
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
16 You should have received a copy of the GNU General Public License
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
17 along with GNU Emacs; see the file COPYING. If not, write to
|
14186
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
20
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
21 #include <signal.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
22 #include <config.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
23 #include <stdio.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
24 #include "lisp.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
25 #include "blockinput.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
26 #include "w32term.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
27 #include "windowsx.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
28
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
29 #define myalloc(cb) GlobalAllocPtr (GPTR, cb)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
30 #define myfree(lp) GlobalFreePtr (lp)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
31
|
14352
|
32 CRITICAL_SECTION critsect;
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
33 extern HANDLE keyboard_handle;
|
14352
|
34 HANDLE hEvent = NULL;
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
35
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
36 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
37 init_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
38 {
|
14352
|
39 InitializeCriticalSection (&critsect);
|
|
40 keyboard_handle = hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
|
|
41 }
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42
|
14352
|
43 void
|
|
44 enter_crit ()
|
|
45 {
|
|
46 EnterCriticalSection (&critsect);
|
|
47 }
|
|
48
|
|
49 void
|
|
50 leave_crit ()
|
|
51 {
|
|
52 LeaveCriticalSection (&critsect);
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
53 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
54
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
55 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
56 delete_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
57 {
|
14352
|
58 DeleteCriticalSection (&critsect);
|
|
59 if (hEvent)
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
60 {
|
14352
|
61 CloseHandle (hEvent);
|
|
62 hEvent = NULL;
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
63 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
64 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
65
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
66 typedef struct int_msg
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
67 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
68 Win32Msg w32msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
69 struct int_msg *lpNext;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
70 } int_msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
71
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
72 int_msg *lpHead = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
73 int_msg *lpTail = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
74 int nQueue = 0;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
75
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
76 BOOL
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
77 get_next_msg (lpmsg, bWait)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
78 Win32Msg * lpmsg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
79 BOOL bWait;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
80 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
81 BOOL bRet = FALSE;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
82
|
14352
|
83 enter_crit ();
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
84
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
85 /* The while loop takes care of multiple sets */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
86
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
87 while (!nQueue && bWait)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
88 {
|
14352
|
89 leave_crit ();
|
|
90 WaitForSingleObject (hEvent, INFINITE);
|
|
91 enter_crit ();
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
92 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
93
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
94 if (nQueue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
95 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
96 bcopy (&(lpHead->w32msg), lpmsg, sizeof (Win32Msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
97
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
98 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
99 int_msg * lpCur = lpHead;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
100
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
101 lpHead = lpHead->lpNext;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
102
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
103 myfree (lpCur);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
104 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
105
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
106 nQueue--;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
107
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
108 bRet = TRUE;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
109 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
110
|
14352
|
111 leave_crit ();
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
112
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
113 return (bRet);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
114 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
115
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
116 BOOL
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
117 post_msg (lpmsg)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
118 Win32Msg * lpmsg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
119 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
120 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
121
|
14352
|
122 if (!lpNew) return (FALSE);
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
123
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
124 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
125 lpNew->lpNext = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
126
|
14352
|
127 enter_crit ();
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
128
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
129 if (nQueue++)
|
14352
|
130 {
|
|
131 lpTail->lpNext = lpNew;
|
|
132 }
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
133 else
|
14352
|
134 {
|
|
135 lpHead = lpNew;
|
|
136 SetEvent (hEvent);
|
|
137 }
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
138
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
139 lpTail = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
140
|
14352
|
141 leave_crit ();
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
142
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
143 return (TRUE);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
144 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
145
|
14460
|
146 BOOL
|
|
147 prepend_msg (Win32Msg *lpmsg)
|
|
148 {
|
|
149 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
|
|
150
|
|
151 if (!lpNew)
|
|
152 return (FALSE);
|
|
153
|
|
154 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg));
|
|
155
|
|
156 enter_crit ();
|
|
157
|
|
158 nQueue++;
|
|
159 lpNew->lpNext = lpHead;
|
|
160 lpHead = lpNew;
|
|
161
|
|
162 leave_crit ();
|
|
163
|
|
164 return (TRUE);
|
|
165 }
|
|
166
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
167 /*
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
168 * XParseGeometry parses strings of the form
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
169 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
170 * width, height, xoffset, and yoffset are unsigned integers.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
171 * Example: "=80x24+300-49"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
172 * The equal sign is optional.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
173 * It returns a bitmask that indicates which of the four values
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
174 * were actually found in the string. For each value found,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
175 * the corresponding argument is updated; for each value
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
176 * not found, the corresponding argument is left unchanged.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
177 */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
178
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
179 static int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
180 read_integer (string, NextString)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
181 register char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
182 char **NextString;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
183 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
184 register int Result = 0;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
185 int Sign = 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
186
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
187 if (*string == '+')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
188 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
189 else if (*string == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
190 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
191 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
192 Sign = -1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
193 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
194 for (; (*string >= '0') && (*string <= '9'); string++)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
195 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
196 Result = (Result * 10) + (*string - '0');
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
197 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
198 *NextString = string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
199 if (Sign >= 0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
200 return (Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
201 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
202 return (-Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
203 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
204
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
205 int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
206 XParseGeometry (string, x, y, width, height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
207 char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
208 int *x, *y;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
209 unsigned int *width, *height; /* RETURN */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
210 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
211 int mask = NoValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
212 register char *strind;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
213 unsigned int tempWidth, tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
214 int tempX, tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
215 char *nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
216
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
217 if ((string == NULL) || (*string == '\0')) return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
218 if (*string == '=')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
219 string++; /* ignore possible '=' at beg of geometry spec */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
220
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
221 strind = (char *)string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
222 if (*strind != '+' && *strind != '-' && *strind != 'x')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
223 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
224 tempWidth = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
225 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
226 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
227 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
228 mask |= WidthValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
229 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
230
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
231 if (*strind == 'x' || *strind == 'X')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
232 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
233 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
234 tempHeight = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
235 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
236 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
237 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
238 mask |= HeightValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
239 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
240
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
241 if ((*strind == '+') || (*strind == '-'))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
242 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
243 if (*strind == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
244 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
245 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
246 tempX = -read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
247 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
248 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
249 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
250 mask |= XNegative;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
251
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
252 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
253 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
254 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
255 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
256 tempX = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
257 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
258 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
259 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
260 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
261 mask |= XValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
262 if ((*strind == '+') || (*strind == '-'))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
263 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
264 if (*strind == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
265 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
266 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
267 tempY = -read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
268 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
269 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
270 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
271 mask |= YNegative;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
272
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
273 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
274 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
275 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
276 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
277 tempY = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
278 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
279 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
280 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
281 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
282 mask |= YValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
283 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
284 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
285
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
286 /* If strind isn't at the end of the string the it's an invalid
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
287 geometry specification. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
288
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
289 if (*strind != '\0') return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
290
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
291 if (mask & XValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
292 *x = tempX;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
293 if (mask & YValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
294 *y = tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
295 if (mask & WidthValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
296 *width = tempWidth;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
297 if (mask & HeightValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
298 *height = tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
299 return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
300 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
301
|
13866
|
302 /* We can use mouse menus when we wish. */
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
303 int
|
13866
|
304 have_menus_p (void)
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
305 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
306 return 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
307 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
308
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
309 /* x_sync is a no-op on Win32. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
310 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
311 x_sync (f)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
312 void *f;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
313 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
314 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
315
|