Mercurial > hg > xemacs-beta
comparison src/device.h @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | bbff43aa5eb7 |
children | 2f8bb876ab1d |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
22 | 22 |
23 /* Synched up with: Not in FSF. */ | 23 /* Synched up with: Not in FSF. */ |
24 | 24 |
25 /* Written by Chuck Thompson and Ben Wing. */ | 25 /* Written by Chuck Thompson and Ben Wing. */ |
26 | 26 |
27 #ifndef _XEMACS_DEVICE_H_ | 27 #ifndef INCLUDED_device_h_ |
28 #define _XEMACS_DEVICE_H_ | 28 #define INCLUDED_device_h_ |
29 | 29 |
30 #include "console.h" | 30 #include "console.h" |
31 | 31 |
32 /* This should really be in redisplay.h but by putting it here we | 32 /* This should really be in redisplay.h but by putting it here we |
33 won't have to ensure that redisplay.h is always included before | 33 won't have to ensure that redisplay.h is always included before |
166 unsigned int extents_changed :1; | 166 unsigned int extents_changed :1; |
167 unsigned int faces_changed :1; | 167 unsigned int faces_changed :1; |
168 unsigned int frame_changed :1; | 168 unsigned int frame_changed :1; |
169 unsigned int glyphs_changed :1; | 169 unsigned int glyphs_changed :1; |
170 unsigned int subwindows_changed :1; | 170 unsigned int subwindows_changed :1; |
171 unsigned int subwindows_state_changed :1; | |
171 unsigned int icon_changed :1; | 172 unsigned int icon_changed :1; |
172 unsigned int menubar_changed :1; | 173 unsigned int menubar_changed :1; |
173 unsigned int modeline_changed :1; | 174 unsigned int modeline_changed :1; |
174 unsigned int point_changed :1; | 175 unsigned int point_changed :1; |
175 unsigned int size_changed :1; | 176 unsigned int size_changed :1; |
177 unsigned int gutter_changed :1; | |
176 unsigned int toolbar_changed :1; | 178 unsigned int toolbar_changed :1; |
177 unsigned int windows_changed :1; | 179 unsigned int windows_changed :1; |
178 unsigned int windows_structure_changed :1; | 180 unsigned int windows_structure_changed :1; |
179 | 181 |
180 unsigned int locked :1; | 182 unsigned int locked :1; |
217 | 219 |
218 DECLARE_LRECORD (device, struct device); | 220 DECLARE_LRECORD (device, struct device); |
219 #define XDEVICE(x) XRECORD (x, device, struct device) | 221 #define XDEVICE(x) XRECORD (x, device, struct device) |
220 #define XSETDEVICE(x, p) XSETRECORD (x, p, device) | 222 #define XSETDEVICE(x, p) XSETRECORD (x, p, device) |
221 #define DEVICEP(x) RECORDP (x, device) | 223 #define DEVICEP(x) RECORDP (x, device) |
222 #define GC_DEVICEP(x) GC_RECORDP (x, device) | |
223 #define CHECK_DEVICE(x) CHECK_RECORD (x, device) | 224 #define CHECK_DEVICE(x) CHECK_RECORD (x, device) |
224 #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) | 225 #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device) |
225 | 226 |
226 #define CHECK_LIVE_DEVICE(x) do { \ | 227 #define CHECK_LIVE_DEVICE(x) do { \ |
227 CHECK_DEVICE (x); \ | 228 CHECK_DEVICE (x); \ |
244 { | 245 { |
245 assert (EQ (DEVICE_TYPE (d), sym)); | 246 assert (EQ (DEVICE_TYPE (d), sym)); |
246 return d; | 247 return d; |
247 } | 248 } |
248 # define DEVICE_TYPE_DATA(d, type) \ | 249 # define DEVICE_TYPE_DATA(d, type) \ |
249 ((struct type##_device *) (error_check_device_type (d, Q##type))->device_data) | 250 ((struct type##_device *) error_check_device_type (d, Q##type)->device_data) |
250 #else | 251 #else |
251 # define DEVICE_TYPE_DATA(d, type) \ | 252 # define DEVICE_TYPE_DATA(d, type) \ |
252 ((struct type##_device *) (d)->device_data) | 253 ((struct type##_device *) (d)->device_data) |
253 #endif | 254 #endif |
254 | 255 |
265 CONCHECK_DEVICE (x); \ | 266 CONCHECK_DEVICE (x); \ |
266 if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ | 267 if (!(DEVICEP (x) && DEVICE_TYPE_P (XDEVICE (x), \ |
267 type))) \ | 268 type))) \ |
268 x = wrong_type_argument \ | 269 x = wrong_type_argument \ |
269 (type##_console_methods->predicate_symbol, x); \ | 270 (type##_console_methods->predicate_symbol, x); \ |
271 } while (0) | |
272 | |
273 #define DEVICE_DISPLAY_P(dev) \ | |
274 (DEVICE_LIVE_P (dev) && \ | |
275 (MAYBE_INT_DEVMETH (dev, \ | |
276 device_implementation_flags, ()) \ | |
277 & XDEVIMPF_IS_A_PRINTER) ? 0 : 1) | |
278 | |
279 #define CHECK_DISPLAY_DEVICE(dev) \ | |
280 do { \ | |
281 CHECK_DEVICE (dev); \ | |
282 if (!(DEVICEP (dev) \ | |
283 && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ | |
284 dead_wrong_type_argument (Qdisplay, dev); \ | |
285 } while (0) | |
286 | |
287 #define CONCHECK_DISPLAY_DEVICE(dev) \ | |
288 do { \ | |
289 CONCHECK_DEVICE (dev); \ | |
290 if (!(DEVICEP (dev) \ | |
291 && DEVICE_DISPLAY_P (XDEVICE (dev)))) \ | |
292 wrong_type_argument (Qdisplay, dev); \ | |
293 } while (0) | |
294 | |
295 #define DEVICE_PRINTER_P(dev) \ | |
296 (DEVICE_LIVE_P (dev) && !DEVICE_DISPLAY_P (dev)) | |
297 | |
298 #define CHECK_PRINTER_DEVICE(dev) \ | |
299 do { \ | |
300 CHECK_DEVICE (dev); \ | |
301 if (!(DEVICEP (dev) \ | |
302 && DEVICE_PRINTER_P (XDEVICE (dev)))) \ | |
303 dead_wrong_type_argument (Qprinter, dev); \ | |
304 } while (0) | |
305 | |
306 #define CONCHECK_PRINTER_DEVICE(dev) \ | |
307 do { \ | |
308 CONCHECK_DEVICE (dev); \ | |
309 if (!(DEVICEP (dev) \ | |
310 && DEVICE_PRINTER_P (XDEVICE (dev)))) \ | |
311 wrong_type_argument (Qprinter, dev); \ | |
270 } while (0) | 312 } while (0) |
271 | 313 |
272 /* #### These should be in the device-*.h files but there are | 314 /* #### These should be in the device-*.h files but there are |
273 too many places where the abstraction is broken. Need to | 315 too many places where the abstraction is broken. Need to |
274 fix. */ | 316 fix. */ |
345 ((void) (glyphs_changed = (d)->glyphs_changed = 1)) | 387 ((void) (glyphs_changed = (d)->glyphs_changed = 1)) |
346 | 388 |
347 #define MARK_DEVICE_SUBWINDOWS_CHANGED(d) \ | 389 #define MARK_DEVICE_SUBWINDOWS_CHANGED(d) \ |
348 ((void) (subwindows_changed = (d)->subwindows_changed = 1)) | 390 ((void) (subwindows_changed = (d)->subwindows_changed = 1)) |
349 | 391 |
392 #define MARK_DEVICE_SUBWINDOWS_STATE_CHANGED(d) \ | |
393 ((void) (subwindows_state_changed = (d)->subwindows_state_changed = 1)) | |
394 | |
350 #define MARK_DEVICE_TOOLBARS_CHANGED(d) \ | 395 #define MARK_DEVICE_TOOLBARS_CHANGED(d) \ |
351 ((void) (toolbar_changed = (d)->toolbar_changed = 1)) | 396 ((void) (toolbar_changed = (d)->toolbar_changed = 1)) |
397 | |
398 #define MARK_DEVICE_GUTTERS_CHANGED(d) \ | |
399 ((void) (gutter_changed = (d)->gutter_changed = 1)) | |
352 | 400 |
353 #define MARK_DEVICE_SIZE_CHANGED(d) \ | 401 #define MARK_DEVICE_SIZE_CHANGED(d) \ |
354 ((void) (size_changed = (d)->size_changed = 1)) | 402 ((void) (size_changed = (d)->size_changed = 1)) |
355 | 403 |
356 #define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ | 404 #define MARK_DEVICE_FRAMES_FACES_CHANGED(d) do { \ |
357 struct device *mdffc_d = (d); \ | 405 struct device *mdffc_d = (d); \ |
358 Lisp_Object frmcons; \ | 406 Lisp_Object frmcons; \ |
359 DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ | 407 DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ |
360 XFRAME (XCAR (frmcons))->faces_changed = 1; \ | 408 XFRAME (XCAR (frmcons))->faces_changed = 1; \ |
361 MARK_DEVICE_FACES_CHANGED (mdffc_d); \ | 409 MARK_DEVICE_FACES_CHANGED (mdffc_d); \ |
410 } while (0) | |
411 | |
412 #define MARK_DEVICE_FRAMES_GLYPHS_CHANGED(d) do { \ | |
413 struct device *mdffc_d = (d); \ | |
414 Lisp_Object frmcons; \ | |
415 DEVICE_FRAME_LOOP (frmcons, mdffc_d) \ | |
416 XFRAME (XCAR (frmcons))->glyphs_changed = 1; \ | |
417 MARK_DEVICE_GLYPHS_CHANGED (mdffc_d); \ | |
362 } while (0) | 418 } while (0) |
363 | 419 |
364 #define MARK_DEVICE_FRAME_CHANGED(d) \ | 420 #define MARK_DEVICE_FRAME_CHANGED(d) \ |
365 ((void) (frame_changed = (d)->frame_changed = 1)) | 421 ((void) (frame_changed = (d)->frame_changed = 1)) |
366 | 422 |
403 Lisp_Object find_nonminibuffer_frame_not_on_device (Lisp_Object device); | 459 Lisp_Object find_nonminibuffer_frame_not_on_device (Lisp_Object device); |
404 void set_device_selected_frame (struct device *d, Lisp_Object frame); | 460 void set_device_selected_frame (struct device *d, Lisp_Object frame); |
405 Lisp_Object domain_device_type (Lisp_Object domain); | 461 Lisp_Object domain_device_type (Lisp_Object domain); |
406 int window_system_pixelated_geometry (Lisp_Object domain); | 462 int window_system_pixelated_geometry (Lisp_Object domain); |
407 | 463 |
408 #endif /* _XEMACS_DEVICE_H_ */ | 464 #endif /* INCLUDED_device_h_ */ |