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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
19
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
20 #include <signal.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
21 #include <config.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
22 #include <stdio.h>
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
23 #include "lisp.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
24 #include "blockinput.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
25 #include "w32term.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
26 #include "windowsx.h"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
27
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
28 #define myalloc(cb) GlobalAllocPtr (GPTR, cb)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
29 #define myfree(lp) GlobalFreePtr (lp)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
30
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
31 CRITICAL_SECTION critsect;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
32 extern HANDLE keyboard_handle;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
33 HANDLE hEvent = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
34
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
35 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
36 init_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
37 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
38 InitializeCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
39 keyboard_handle = hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
40 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
41
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
43 enter_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
44 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
45 EnterCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
46 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
47
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
48 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
49 leave_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
50 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
51 LeaveCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
52 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
53
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
54 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
55 delete_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
56 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
57 DeleteCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
58 if (hEvent)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
59 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
60 CloseHandle (hEvent);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
61 hEvent = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
62 }
|
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 typedef struct int_msg
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
66 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
67 Win32Msg w32msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
68 struct int_msg *lpNext;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
69 } int_msg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
70
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
71 int_msg *lpHead = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
72 int_msg *lpTail = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
73 int nQueue = 0;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
74
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
75 BOOL
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
76 get_next_msg (lpmsg, bWait)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
77 Win32Msg * lpmsg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
78 BOOL bWait;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
79 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
80 BOOL bRet = FALSE;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
81
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
82 enter_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
83
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
84 /* The while loop takes care of multiple sets */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
85
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
86 while (!nQueue && bWait)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
87 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
88 leave_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
89 WaitForSingleObject (hEvent, INFINITE);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
90 enter_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
91 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
92
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
93 if (nQueue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
94 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
95 bcopy (&(lpHead->w32msg), lpmsg, sizeof (Win32Msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
96
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
97 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
98 int_msg * lpCur = lpHead;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
99
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
100 lpHead = lpHead->lpNext;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
101
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
102 myfree (lpCur);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
103 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
104
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
105 nQueue--;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
106
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
107 bRet = TRUE;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
108 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
109
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
110 leave_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
111
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
112 return (bRet);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
113 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
114
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
115 BOOL
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
116 post_msg (lpmsg)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
117 Win32Msg * lpmsg;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
118 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
119 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
120
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
121 if (!lpNew) return (FALSE);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
122
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
123 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg));
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
124 lpNew->lpNext = NULL;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
125
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
126 enter_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
127
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
128 if (nQueue++)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
129 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
130 lpTail->lpNext = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
131 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
132 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
133 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
134 lpHead = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
135 SetEvent (hEvent);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
136 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
137
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
138 lpTail = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
139
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
140 leave_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
141
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
142 return (TRUE);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
143 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
144
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
145 /*
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
146 * XParseGeometry parses strings of the form
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
147 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
148 * width, height, xoffset, and yoffset are unsigned integers.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
149 * Example: "=80x24+300-49"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
150 * The equal sign is optional.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
151 * It returns a bitmask that indicates which of the four values
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
152 * were actually found in the string. For each value found,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
153 * the corresponding argument is updated; for each value
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
154 * not found, the corresponding argument is left unchanged.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
155 */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
156
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
157 static int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
158 read_integer (string, NextString)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
159 register char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
160 char **NextString;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
161 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
162 register int Result = 0;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
163 int Sign = 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
164
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
165 if (*string == '+')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
166 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
167 else if (*string == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
168 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
169 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
170 Sign = -1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
171 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
172 for (; (*string >= '0') && (*string <= '9'); string++)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
173 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
174 Result = (Result * 10) + (*string - '0');
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
175 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
176 *NextString = string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
177 if (Sign >= 0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
178 return (Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
179 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
180 return (-Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
181 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
182
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
183 int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
184 XParseGeometry (string, x, y, width, height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
185 char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
186 int *x, *y;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
187 unsigned int *width, *height; /* RETURN */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
188 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
189 int mask = NoValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
190 register char *strind;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
191 unsigned int tempWidth, tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
192 int tempX, tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
193 char *nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
194
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
195 if ((string == NULL) || (*string == '\0')) return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
196 if (*string == '=')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
197 string++; /* ignore possible '=' at beg of geometry spec */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
198
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
199 strind = (char *)string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
200 if (*strind != '+' && *strind != '-' && *strind != 'x')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
201 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
202 tempWidth = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
203 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
204 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
205 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
206 mask |= WidthValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
207 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
208
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
209 if (*strind == 'x' || *strind == 'X')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
210 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
211 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
212 tempHeight = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
213 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
214 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
215 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
216 mask |= HeightValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
217 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
218
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
219 if ((*strind == '+') || (*strind == '-'))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
220 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
221 if (*strind == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
222 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
223 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
224 tempX = -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 |= XNegative;
|
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 else
|
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 tempX = 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 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
239 mask |= XValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
240 if ((*strind == '+') || (*strind == '-'))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
241 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
242 if (*strind == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
243 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
244 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
245 tempY = -read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
246 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
247 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
248 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
249 mask |= YNegative;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
250
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
251 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
252 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
253 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
254 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
255 tempY = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
256 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
257 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
258 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
259 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
260 mask |= YValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
261 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
262 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
263
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
264 /* If strind isn't at the end of the string the it's an invalid
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
265 geometry specification. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
266
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
267 if (*strind != '\0') return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
268
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
269 if (mask & XValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
270 *x = tempX;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
271 if (mask & YValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
272 *y = tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
273 if (mask & WidthValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
274 *width = tempWidth;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
275 if (mask & HeightValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
276 *height = tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
277 return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
278 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
279
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
280 /* The semantics of the use of using_x_p is really using_a_window_system. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
281 int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
282 using_x_p (void)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
283 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
284 return 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
285 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
286
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
287 /* x_sync is a no-op on Win32. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
288 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
289 x_sync (f)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
290 void *f;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
291 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
292 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
293
|