Mercurial > hg > xemacs-beta
comparison src/device.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | 6240c7796c7a |
children | bbff43aa5eb7 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
35 #include "events.h" | 35 #include "events.h" |
36 #include "faces.h" | 36 #include "faces.h" |
37 #include "frame.h" | 37 #include "frame.h" |
38 #include "keymap.h" | 38 #include "keymap.h" |
39 #include "redisplay.h" | 39 #include "redisplay.h" |
40 #include "scrollbar.h" | |
41 #include "specifier.h" | 40 #include "specifier.h" |
42 #include "sysdep.h" | 41 #include "sysdep.h" |
43 #include "window.h" | 42 #include "window.h" |
43 | |
44 #ifdef HAVE_SCROLLBARS | |
45 #include "scrollbar.h" | |
46 #endif | |
44 | 47 |
45 #include "syssignal.h" | 48 #include "syssignal.h" |
46 | 49 |
47 /* Vdefault_device is the firstly-created non-stream device that's still | 50 /* Vdefault_device is the firstly-created non-stream device that's still |
48 around. We don't really use it anywhere currently, but it might | 51 around. We don't really use it anywhere currently, but it might |
80 static Lisp_Object | 83 static Lisp_Object |
81 mark_device (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 84 mark_device (Lisp_Object obj, void (*markobj) (Lisp_Object)) |
82 { | 85 { |
83 struct device *d = XDEVICE (obj); | 86 struct device *d = XDEVICE (obj); |
84 | 87 |
85 ((markobj) (d->name)); | 88 markobj (d->name); |
86 ((markobj) (d->connection)); | 89 markobj (d->connection); |
87 ((markobj) (d->canon_connection)); | 90 markobj (d->canon_connection); |
88 ((markobj) (d->console)); | 91 markobj (d->console); |
89 ((markobj) (d->_selected_frame)); | 92 markobj (d->selected_frame); |
90 ((markobj) (d->frame_with_focus_real)); | 93 markobj (d->frame_with_focus_real); |
91 ((markobj) (d->frame_with_focus_for_hooks)); | 94 markobj (d->frame_with_focus_for_hooks); |
92 ((markobj) (d->frame_that_ought_to_have_focus)); | 95 markobj (d->frame_that_ought_to_have_focus); |
93 ((markobj) (d->device_class)); | 96 markobj (d->device_class); |
94 ((markobj) (d->user_defined_tags)); | 97 markobj (d->user_defined_tags); |
95 ((markobj) (d->pixel_to_glyph_cache.obj1)); | 98 markobj (d->pixel_to_glyph_cache.obj1); |
96 ((markobj) (d->pixel_to_glyph_cache.obj2)); | 99 markobj (d->pixel_to_glyph_cache.obj2); |
97 | 100 |
98 ((markobj) (d->color_instance_cache)); | 101 markobj (d->color_instance_cache); |
99 ((markobj) (d->font_instance_cache)); | 102 markobj (d->font_instance_cache); |
100 #ifdef MULE | 103 #ifdef MULE |
101 ((markobj) (d->charset_font_cache)); | 104 markobj (d->charset_font_cache); |
102 #endif | 105 #endif |
103 ((markobj) (d->image_instance_cache)); | 106 markobj (d->image_instance_cache); |
104 | 107 |
105 if (d->devmeths) | 108 if (d->devmeths) |
106 { | 109 { |
107 ((markobj) (d->devmeths->symbol)); | 110 markobj (d->devmeths->symbol); |
108 MAYBE_DEVMETH (d, mark_device, (d, markobj)); | 111 MAYBE_DEVMETH (d, mark_device, (d, markobj)); |
109 } | 112 } |
110 | 113 |
111 return (d->frame_list); | 114 return (d->frame_list); |
112 } | 115 } |
175 d->name = Qnil; | 178 d->name = Qnil; |
176 d->console = console; | 179 d->console = console; |
177 d->connection = Qnil; | 180 d->connection = Qnil; |
178 d->canon_connection = Qnil; | 181 d->canon_connection = Qnil; |
179 d->frame_list = Qnil; | 182 d->frame_list = Qnil; |
180 d->_selected_frame = Qnil; | 183 d->selected_frame = Qnil; |
181 d->frame_with_focus_real = Qnil; | 184 d->frame_with_focus_real = Qnil; |
182 d->frame_with_focus_for_hooks = Qnil; | 185 d->frame_with_focus_for_hooks = Qnil; |
183 d->frame_that_ought_to_have_focus = Qnil; | 186 d->frame_that_ought_to_have_focus = Qnil; |
184 d->device_class = Qnil; | 187 d->device_class = Qnil; |
185 d->user_defined_tags = Qnil; | 188 d->user_defined_tags = Qnil; |
187 d->pixel_to_glyph_cache.obj2 = Qnil; | 190 d->pixel_to_glyph_cache.obj2 = Qnil; |
188 | 191 |
189 d->infd = d->outfd = -1; | 192 d->infd = d->outfd = -1; |
190 | 193 |
191 /* #### is 20 reasonable? */ | 194 /* #### is 20 reasonable? */ |
192 d->color_instance_cache = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK, | 195 d->color_instance_cache = |
193 HASHTABLE_EQUAL); | 196 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); |
194 d->font_instance_cache = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK, | 197 d->font_instance_cache = |
195 HASHTABLE_EQUAL); | 198 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); |
196 #ifdef MULE | 199 #ifdef MULE |
197 /* Note that the following table is bi-level. */ | 200 /* Note that the following table is bi-level. */ |
198 d->charset_font_cache = make_lisp_hashtable (20, HASHTABLE_NONWEAK, | 201 d->charset_font_cache = |
199 HASHTABLE_EQ); | 202 make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); |
200 #endif | 203 #endif |
201 /* | 204 /* |
202 Note that the image instance cache is actually bi-level. | 205 Note that the image instance cache is actually bi-level. |
203 See device.h. We use a low number here because most of the | 206 See device.h. We use a low number here because most of the |
204 time there aren't very many diferent masks that will be used. | 207 time there aren't very many different masks that will be used. |
205 */ | 208 */ |
206 d->image_instance_cache = make_lisp_hashtable (5, HASHTABLE_NONWEAK, | 209 d->image_instance_cache = |
207 HASHTABLE_EQ); | 210 make_lisp_hash_table (5, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); |
208 | 211 |
209 UNGCPRO; | 212 UNGCPRO; |
210 return d; | 213 return d; |
211 } | 214 } |
212 | 215 |
214 decode_device (Lisp_Object device) | 217 decode_device (Lisp_Object device) |
215 { | 218 { |
216 if (NILP (device)) | 219 if (NILP (device)) |
217 device = Fselected_device (Qnil); | 220 device = Fselected_device (Qnil); |
218 /* quietly accept frames for the device arg */ | 221 /* quietly accept frames for the device arg */ |
219 if (FRAMEP (device)) | 222 else if (FRAMEP (device)) |
220 device = FRAME_DEVICE (decode_frame (device)); | 223 device = FRAME_DEVICE (decode_frame (device)); |
221 CHECK_LIVE_DEVICE (device); | 224 CHECK_LIVE_DEVICE (device); |
222 return XDEVICE (device); | 225 return XDEVICE (device); |
223 } | 226 } |
224 | 227 |
285 void | 288 void |
286 set_device_selected_frame (struct device *d, Lisp_Object frame) | 289 set_device_selected_frame (struct device *d, Lisp_Object frame) |
287 { | 290 { |
288 if (!NILP (frame) && !FRAME_MINIBUF_ONLY_P (XFRAME (frame))) | 291 if (!NILP (frame) && !FRAME_MINIBUF_ONLY_P (XFRAME (frame))) |
289 set_console_last_nonminibuf_frame (XCONSOLE (DEVICE_CONSOLE (d)), frame); | 292 set_console_last_nonminibuf_frame (XCONSOLE (DEVICE_CONSOLE (d)), frame); |
290 d->_selected_frame = frame; | 293 d->selected_frame = frame; |
291 } | 294 } |
292 | 295 |
293 DEFUN ("set-device-selected-frame", Fset_device_selected_frame, 2, 2, 0, /* | 296 DEFUN ("set-device-selected-frame", Fset_device_selected_frame, 2, 2, 0, /* |
294 Set the selected frame of device object DEVICE to FRAME. | 297 Set the selected frame of device object DEVICE to FRAME. |
295 If DEVICE is nil, the selected device is used. | 298 If DEVICE is nil, the selected device is used. |
912 DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /* | 915 DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /* |
913 Get a metric for DEVICE as provided by the system. | 916 Get a metric for DEVICE as provided by the system. |
914 | 917 |
915 METRIC must be a symbol specifying requested metric. Note that the metrics | 918 METRIC must be a symbol specifying requested metric. Note that the metrics |
916 returned are these provided by the system internally, not read from resources, | 919 returned are these provided by the system internally, not read from resources, |
917 so obtained from the most internal level. | 920 so obtained from the most internal level. |
918 | 921 |
919 If a metric is not provided by the system, then DEFAULT is returned. | 922 If a metric is not provided by the system, then DEFAULT is returned. |
920 | 923 |
921 When DEVICE is nil, selected device is assumed | 924 When DEVICE is nil, selected device is assumed |
922 | 925 |
923 Metrics, by group, are: | 926 Metrics, by group, are: |
924 | 927 |
925 COLORS. Colors are returned as valid color instantiators. No other assumption | 928 COLORS. Colors are returned as valid color instantiators. No other assumption |
926 on the returned valie should be made (i.e. it can be a string on one system but | 929 on the returned value should be made (i.e. it can be a string on one system but |
927 a color instance on another). For colors, returned value is a cons of | 930 a color instance on another). For colors, returned value is a cons of |
928 foreground and background colors. Note that if the system provides only one | 931 foreground and background colors. Note that if the system provides only one |
929 color of the pair, the second one may be nil. | 932 color of the pair, the second one may be nil. |
930 | 933 |
931 color-default Standard window text foreground and background. | 934 color-default Standard window text foreground and background. |
932 color-select Selection highligh text and backgroun colors. | 935 color-select Selection highlight text and background colors. |
933 color-balloon Ballon popup text and background colors. | 936 color-balloon Balloon popup text and background colors. |
934 color-3d-face 3-D object (button, modeline) text and surface colors. | 937 color-3d-face 3-D object (button, modeline) text and surface colors. |
935 color-3d-light Fore and back colors for 3-D edges facing light source. | 938 color-3d-light Fore and back colors for 3-D edges facing light source. |
936 color-3d-dark Fore and back colors for 3-D edges facing away from | 939 color-3d-dark Fore and back colors for 3-D edges facing away from |
937 light source. | 940 light source. |
938 color-menu Text and background for menus | 941 color-menu Text and background for menus |
952 font-menubar Menubar font | 955 font-menubar Menubar font |
953 font-dialog Dialog boxes font | 956 font-dialog Dialog boxes font |
954 | 957 |
955 GEOMETRY. These metrics are returned as conses of (X . Y). As with colors, | 958 GEOMETRY. These metrics are returned as conses of (X . Y). As with colors, |
956 either car or cdr of the cons may be nil if the system does not provide one | 959 either car or cdr of the cons may be nil if the system does not provide one |
957 of corresponding dimensions. | 960 of the corresponding dimensions. |
958 | 961 |
959 size-cursor Mouse cursor size. | 962 size-cursor Mouse cursor size. |
960 size-scrollbar Scrollbars (WIDTH . HEIGHT) | 963 size-scrollbar Scrollbars (WIDTH . HEIGHT) |
961 size-menu Menubar height, as (nil . HEIGHT) | 964 size-menu Menubar height, as (nil . HEIGHT) |
962 size-toolbar Toolbar width and height. | 965 size-toolbar Toolbar width and height. |
969 above if window manager has decorations which | 972 above if window manager has decorations which |
970 effectively shrink the area remaining for application | 973 effectively shrink the area remaining for application |
971 windows. | 974 windows. |
972 size-device-mm Device screen size in millimeters. | 975 size-device-mm Device screen size in millimeters. |
973 device-dpi Device resolution, in dots per inch. | 976 device-dpi Device resolution, in dots per inch. |
974 num-bit-planes Integer, number of deivce bit planes. | 977 num-bit-planes Integer, number of device bit planes. |
975 num-color-cells Integer, number of device color cells. | 978 num-color-cells Integer, number of device color cells. |
976 | 979 |
977 FEATURES. This group reports various device features. If a feature is | 980 FEATURES. This group reports various device features. If a feature is |
978 present, integer 1 (one) is returned, if it is not present, then integer | 981 present, integer 1 (one) is returned, if it is not present, then integer |
979 0 (zero) is returned. If the system is unaware of the feature, then | 982 0 (zero) is returned. If the system is unaware of the feature, then |
980 DEFAULT is returned. | 983 DEFAULT is returned. |
981 | 984 |
982 mouse-buttons Integer, number of mouse buttons, or zero if no mouse. | 985 mouse-buttons Integer, number of mouse buttons, or zero if no mouse. |
983 swap-buttons Non-zero if left and right mouse buttons are swapped. | 986 swap-buttons Non-zero if left and right mouse buttons are swapped. |
984 show-sounds User preference for visual over audible bell. | 987 show-sounds User preference for visual over audible bell. |
985 slow-device Device is slow, avoid animation. | 988 slow-device Device is slow, avoid animation. |
986 security Non-zero if user environment is secure. | 989 security Non-zero if user environment is secure. |