Mercurial > emacs
comparison src/w32xfns.c @ 16588:481b7874a1e9
Change identifiers of the form win32* to w32*.
author | Geoff Voelker <voelker@cs.washington.edu> |
---|---|
date | Tue, 19 Nov 1996 04:59:23 +0000 |
parents | c1494aa589e8 |
children | 36babc489b0c |
comparison
equal
deleted
inserted
replaced
16587:13cda507257c | 16588:481b7874a1e9 |
---|---|
1 /* Functions taken directly from X sources | 1 /* Functions taken directly from X sources for use with the Win32 API. |
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation. | 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation. |
3 | 3 |
4 This file is part of GNU Emacs. | 4 This file is part of GNU Emacs. |
5 | 5 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 6 GNU Emacs is free software; you can redistribute it and/or modify |
57 } | 57 } |
58 | 58 |
59 void | 59 void |
60 select_palette (FRAME_PTR f, HDC hdc) | 60 select_palette (FRAME_PTR f, HDC hdc) |
61 { | 61 { |
62 if (!NILP (Vwin32_enable_palette)) | 62 if (!NILP (Vw32_enable_palette)) |
63 f->output_data.win32->old_palette = | 63 f->output_data.w32->old_palette = |
64 SelectPalette (hdc, one_win32_display_info.palette, FALSE); | 64 SelectPalette (hdc, one_w32_display_info.palette, FALSE); |
65 else | 65 else |
66 f->output_data.win32->old_palette = NULL; | 66 f->output_data.w32->old_palette = NULL; |
67 | 67 |
68 if (RealizePalette (hdc)) | 68 if (RealizePalette (hdc)) |
69 { | 69 { |
70 Lisp_Object frame, framelist; | 70 Lisp_Object frame, framelist; |
71 FOR_EACH_FRAME (framelist, frame) | 71 FOR_EACH_FRAME (framelist, frame) |
76 } | 76 } |
77 | 77 |
78 void | 78 void |
79 deselect_palette (FRAME_PTR f, HDC hdc) | 79 deselect_palette (FRAME_PTR f, HDC hdc) |
80 { | 80 { |
81 if (f->output_data.win32->old_palette) | 81 if (f->output_data.w32->old_palette) |
82 SelectPalette (hdc, f->output_data.win32->old_palette, FALSE); | 82 SelectPalette (hdc, f->output_data.w32->old_palette, FALSE); |
83 } | 83 } |
84 | 84 |
85 /* Get a DC for frame and select palette for drawing; force an update of | 85 /* Get a DC for frame and select palette for drawing; force an update of |
86 all frames if palette's mapping changes. */ | 86 all frames if palette's mapping changes. */ |
87 HDC | 87 HDC |
89 { | 89 { |
90 HDC hdc; | 90 HDC hdc; |
91 | 91 |
92 enter_crit (); | 92 enter_crit (); |
93 | 93 |
94 hdc = GetDC (f->output_data.win32->window_desc); | 94 hdc = GetDC (f->output_data.w32->window_desc); |
95 select_palette (f, hdc); | 95 select_palette (f, hdc); |
96 | 96 |
97 return hdc; | 97 return hdc; |
98 } | 98 } |
99 | 99 |
101 release_frame_dc (FRAME_PTR f, HDC hdc) | 101 release_frame_dc (FRAME_PTR f, HDC hdc) |
102 { | 102 { |
103 int ret; | 103 int ret; |
104 | 104 |
105 deselect_palette (f, hdc); | 105 deselect_palette (f, hdc); |
106 ret = ReleaseDC (f->output_data.win32->window_desc, hdc); | 106 ret = ReleaseDC (f->output_data.w32->window_desc, hdc); |
107 | 107 |
108 leave_crit (); | 108 leave_crit (); |
109 | 109 |
110 return ret; | 110 return ret; |
111 } | 111 } |
112 | 112 |
113 typedef struct int_msg | 113 typedef struct int_msg |
114 { | 114 { |
115 Win32Msg w32msg; | 115 W32Msg w32msg; |
116 struct int_msg *lpNext; | 116 struct int_msg *lpNext; |
117 } int_msg; | 117 } int_msg; |
118 | 118 |
119 int_msg *lpHead = NULL; | 119 int_msg *lpHead = NULL; |
120 int_msg *lpTail = NULL; | 120 int_msg *lpTail = NULL; |
121 int nQueue = 0; | 121 int nQueue = 0; |
122 | 122 |
123 BOOL | 123 BOOL |
124 get_next_msg (lpmsg, bWait) | 124 get_next_msg (lpmsg, bWait) |
125 Win32Msg * lpmsg; | 125 W32Msg * lpmsg; |
126 BOOL bWait; | 126 BOOL bWait; |
127 { | 127 { |
128 BOOL bRet = FALSE; | 128 BOOL bRet = FALSE; |
129 | 129 |
130 enter_crit (); | 130 enter_crit (); |
138 enter_crit (); | 138 enter_crit (); |
139 } | 139 } |
140 | 140 |
141 if (nQueue) | 141 if (nQueue) |
142 { | 142 { |
143 bcopy (&(lpHead->w32msg), lpmsg, sizeof (Win32Msg)); | 143 bcopy (&(lpHead->w32msg), lpmsg, sizeof (W32Msg)); |
144 | 144 |
145 { | 145 { |
146 int_msg * lpCur = lpHead; | 146 int_msg * lpCur = lpHead; |
147 | 147 |
148 lpHead = lpHead->lpNext; | 148 lpHead = lpHead->lpNext; |
163 return (bRet); | 163 return (bRet); |
164 } | 164 } |
165 | 165 |
166 BOOL | 166 BOOL |
167 post_msg (lpmsg) | 167 post_msg (lpmsg) |
168 Win32Msg * lpmsg; | 168 W32Msg * lpmsg; |
169 { | 169 { |
170 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); | 170 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); |
171 | 171 |
172 if (!lpNew) | 172 if (!lpNew) |
173 return (FALSE); | 173 return (FALSE); |
174 | 174 |
175 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg)); | 175 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg)); |
176 lpNew->lpNext = NULL; | 176 lpNew->lpNext = NULL; |
177 | 177 |
178 enter_crit (); | 178 enter_crit (); |
179 | 179 |
180 if (nQueue++) | 180 if (nQueue++) |
193 | 193 |
194 return (TRUE); | 194 return (TRUE); |
195 } | 195 } |
196 | 196 |
197 BOOL | 197 BOOL |
198 prepend_msg (Win32Msg *lpmsg) | 198 prepend_msg (W32Msg *lpmsg) |
199 { | 199 { |
200 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); | 200 int_msg * lpNew = (int_msg *) myalloc (sizeof (int_msg)); |
201 | 201 |
202 if (!lpNew) | 202 if (!lpNew) |
203 return (FALSE); | 203 return (FALSE); |
204 | 204 |
205 bcopy (lpmsg, &(lpNew->w32msg), sizeof (Win32Msg)); | 205 bcopy (lpmsg, &(lpNew->w32msg), sizeof (W32Msg)); |
206 | 206 |
207 enter_crit (); | 207 enter_crit (); |
208 | 208 |
209 nQueue++; | 209 nQueue++; |
210 lpNew->lpNext = lpHead; | 210 lpNew->lpNext = lpHead; |
355 have_menus_p (void) | 355 have_menus_p (void) |
356 { | 356 { |
357 return 1; | 357 return 1; |
358 } | 358 } |
359 | 359 |
360 /* x_sync is a no-op on Win32. */ | 360 /* x_sync is a no-op on W32. */ |
361 void | 361 void |
362 x_sync (f) | 362 x_sync (f) |
363 void *f; | 363 void *f; |
364 { | 364 { |
365 } | 365 } |