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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
32 CRITICAL_SECTION critsect;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
33 extern HANDLE keyboard_handle;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
34 HANDLE hEvent = NULL;
|
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 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
39 InitializeCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
40 keyboard_handle = hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
41 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
42
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
43 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
44 enter_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
45 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
46 EnterCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
47 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
48
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
49 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
50 leave_crit ()
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
51 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
52 LeaveCriticalSection (&critsect);
|
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 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
58 DeleteCriticalSection (&critsect);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
59 if (hEvent)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
60 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
61 CloseHandle (hEvent);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
62 hEvent = NULL;
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
83 enter_crit ();
|
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 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
89 leave_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
90 WaitForSingleObject (hEvent, INFINITE);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
91 enter_crit ();
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
111 leave_crit ();
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
122 if (!lpNew) return (FALSE);
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
127 enter_crit ();
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
128
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
129 if (nQueue++)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
130 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
131 lpTail->lpNext = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
132 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
133 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
134 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
135 lpHead = lpNew;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
136 SetEvent (hEvent);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
137 }
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
141 leave_crit ();
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
146 /*
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
147 * XParseGeometry parses strings of the form
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
148 * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
149 * width, height, xoffset, and yoffset are unsigned integers.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
150 * Example: "=80x24+300-49"
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
151 * The equal sign is optional.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
152 * It returns a bitmask that indicates which of the four values
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
153 * were actually found in the string. For each value found,
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
154 * the corresponding argument is updated; for each value
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
155 * not found, the corresponding argument is left unchanged.
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
156 */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
157
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
158 static int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
159 read_integer (string, NextString)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
160 register char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
161 char **NextString;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
162 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
163 register int Result = 0;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
164 int Sign = 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
165
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
166 if (*string == '+')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
167 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
168 else if (*string == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
169 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
170 string++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
171 Sign = -1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
172 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
173 for (; (*string >= '0') && (*string <= '9'); string++)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
174 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
175 Result = (Result * 10) + (*string - '0');
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
176 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
177 *NextString = string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
178 if (Sign >= 0)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
179 return (Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
180 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
181 return (-Result);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
182 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
183
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
184 int
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
185 XParseGeometry (string, x, y, width, height)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
186 char *string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
187 int *x, *y;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
188 unsigned int *width, *height; /* RETURN */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
189 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
190 int mask = NoValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
191 register char *strind;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
192 unsigned int tempWidth, tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
193 int tempX, tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
194 char *nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
195
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
196 if ((string == NULL) || (*string == '\0')) return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
197 if (*string == '=')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
198 string++; /* ignore possible '=' at beg of geometry spec */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
199
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
200 strind = (char *)string;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
201 if (*strind != '+' && *strind != '-' && *strind != 'x')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
202 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
203 tempWidth = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
204 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
205 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
206 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
207 mask |= WidthValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
208 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
209
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
210 if (*strind == 'x' || *strind == 'X')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
211 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
212 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
213 tempHeight = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
214 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
215 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
216 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
217 mask |= HeightValue;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
218 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
219
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
220 if ((*strind == '+') || (*strind == '-'))
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
221 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
222 if (*strind == '-')
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
223 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
224 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
225 tempX = -read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
226 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
227 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
228 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
229 mask |= XNegative;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
230
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
231 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
232 else
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
233 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
234 strind++;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
235 tempX = read_integer (strind, &nextCharacter);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
236 if (strind == nextCharacter)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
237 return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
238 strind = nextCharacter;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
239 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
240 mask |= XValue;
|
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 tempY = -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 |= YNegative;
|
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 tempY = 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 |= YValue;
|
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
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
265 /* If strind isn't at the end of the string the it's an invalid
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
266 geometry specification. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
267
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
268 if (*strind != '\0') return (0);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
269
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
270 if (mask & XValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
271 *x = tempX;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
272 if (mask & YValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
273 *y = tempY;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
274 if (mask & WidthValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
275 *width = tempWidth;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
276 if (mask & HeightValue)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
277 *height = tempHeight;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
278 return (mask);
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
279 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
280
|
13866
|
281 /* We can use mouse menus when we wish. */
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
282 int
|
13866
|
283 have_menus_p (void)
|
13434
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
284 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
285 return 1;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
286 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
287
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
288 /* x_sync is a no-op on Win32. */
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
289 void
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
290 x_sync (f)
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
291 void *f;
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
292 {
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
293 }
|
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff
changeset
|
294
|