comparison src/device-impl.h @ 5920:0f2338afbabf cygwin

Minimum necessary to get started: sufficient to compile OK, run -nw, but not with window
author Henry Thompson <ht@markup.co.uk>
date Mon, 21 Apr 2014 11:42:50 +0100
parents 308d34e9f07d
children
comparison
equal deleted inserted replaced
5919:2800105fcc9f 5920:0f2338afbabf
50 #define DEVICE_IMPL_FLAG(d, f) CONMETH_IMPL_FLAG ((d)->devmeths, (f)) 50 #define DEVICE_IMPL_FLAG(d, f) CONMETH_IMPL_FLAG ((d)->devmeths, (f))
51 #define DEVICE_SPECIFIC_FRAME_PROPS(d) \ 51 #define DEVICE_SPECIFIC_FRAME_PROPS(d) \
52 ((d)->devmeths->device_specific_frame_props) 52 ((d)->devmeths->device_specific_frame_props)
53 53
54 /* More public: */ 54 /* More public: */
55 #define DEVICE_TYPE(d) ((d)->devmeths->symbol) 55 #define DEVICE_TYPE_X(d) ((d)->devmeths->symbol)
56 #define XDEVICE_TYPE(d) DEVICE_TYPE (XDEVICE (d)) 56 #define XDEVICE_TYPE(d) DEVICE_TYPE_X (XDEVICE (d))
57 57
58 /******** Accessing / calling a device method *********/ 58 /******** Accessing / calling a device method *********/
59 59
60 #define HAS_DEVMETH_P(d, m) HAS_CONTYPE_METH_P ((d)->devmeths, m) 60 #define HAS_DEVMETH_P(d, m) HAS_CONTYPE_METH_P ((d)->devmeths, m)
61 #define DEVMETH(d, m, args) CONTYPE_METH ((d)->devmeths, m, args) 61 #define DEVMETH(d, m, args) CONTYPE_METH ((d)->devmeths, m, args)
145 }; 145 };
146 146
147 /* Redefine basic properties more efficiently */ 147 /* Redefine basic properties more efficiently */
148 148
149 #undef DEVICE_LIVE_P 149 #undef DEVICE_LIVE_P
150 #define DEVICE_LIVE_P(d) (!EQ (DEVICE_TYPE (d), Qdead)) 150 #define DEVICE_LIVE_P(d) (!EQ (DEVICE_TYPE_X (d), Qdead))
151 #undef DEVICE_CONSOLE 151 #undef DEVICE_CONSOLE
152 #define DEVICE_CONSOLE(d) ((d)->console) 152 #define DEVICE_CONSOLE(d) ((d)->console)
153 #undef DEVICE_FRAME_LIST 153 #undef DEVICE_FRAME_LIST
154 #define DEVICE_FRAME_LIST(d) ((d)->frame_list) 154 #define DEVICE_FRAME_LIST(d) ((d)->frame_list)
155 155
156 #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE (d), Q##type) 156 #define DEVICE_TYPE_P(d, type) EQ (DEVICE_TYPE_X (d), Q##type)
157 157
158 #ifdef ERROR_CHECK_TYPES 158 #ifdef ERROR_CHECK_TYPES
159 DECLARE_INLINE_HEADER ( 159 DECLARE_INLINE_HEADER (
160 struct device * 160 struct device *
161 error_check_device_type (struct device *d, Lisp_Object sym) 161 error_check_device_type (struct device *d, Lisp_Object sym)
162 ) 162 )
163 { 163 {
164 assert (EQ (DEVICE_TYPE (d), sym)); 164 assert (EQ (DEVICE_TYPE_X (d), sym));
165 return d; 165 return d;
166 } 166 }
167 # define DEVICE_TYPE_DATA(d, type) \ 167 # define DEVICE_TYPE_DATA(d, type) \
168 ((struct type##_device *) error_check_device_type (d, Q##type)->device_data) 168 ((struct type##_device *) error_check_device_type (d, Q##type)->device_data)
169 #else 169 #else
229 229
230 /* #### These should be in the device-*.h files but there are 230 /* #### These should be in the device-*.h files but there are
231 too many places where the abstraction is broken. Need to 231 too many places where the abstraction is broken. Need to
232 fix. */ 232 fix. */
233 233
234 #define DEVICE_X_P(dev) CONSOLE_TYPESYM_X_P (DEVICE_TYPE (dev)) 234 #define DEVICE_X_P(dev) CONSOLE_TYPESYM_X_P (DEVICE_TYPE_X (dev))
235 #define CHECK_X_DEVICE(z) CHECK_DEVICE_TYPE (z, x) 235 #define CHECK_X_DEVICE(z) CHECK_DEVICE_TYPE (z, x)
236 #define CONCHECK_X_DEVICE(z) CONCHECK_DEVICE_TYPE (z, x) 236 #define CONCHECK_X_DEVICE(z) CONCHECK_DEVICE_TYPE (z, x)
237 237
238 #define DEVICE_GTK_P(dev) CONSOLE_TYPESYM_GTK_P (DEVICE_TYPE (dev)) 238 #define DEVICE_GTK_P(dev) CONSOLE_TYPESYM_GTK_P (DEVICE_TYPE_X (dev))
239 #define CHECK_GTK_DEVICE(z) CHECK_DEVICE_TYPE (z, gtk) 239 #define CHECK_GTK_DEVICE(z) CHECK_DEVICE_TYPE (z, gtk)
240 #define CONCHECK_GTK_DEVICE(z) CONCHECK_DEVICE_TYPE (z, gtk) 240 #define CONCHECK_GTK_DEVICE(z) CONCHECK_DEVICE_TYPE (z, gtk)
241 241
242 #define DEVICE_MSWINDOWS_P(dev) CONSOLE_TYPESYM_MSWINDOWS_P (DEVICE_TYPE (dev)) 242 #define DEVICE_MSWINDOWS_P(dev) CONSOLE_TYPESYM_MSWINDOWS_P (DEVICE_TYPE_X (dev))
243 #define CHECK_MSWINDOWS_DEVICE(z) CHECK_DEVICE_TYPE (z, mswindows) 243 #define CHECK_MSWINDOWS_DEVICE(z) CHECK_DEVICE_TYPE (z, mswindows)
244 #define CONCHECK_MSWINDOWS_DEVICE(z) CONCHECK_DEVICE_TYPE (z, mswindows) 244 #define CONCHECK_MSWINDOWS_DEVICE(z) CONCHECK_DEVICE_TYPE (z, mswindows)
245 245
246 #define DEVICE_TTY_P(dev) CONSOLE_TYPESYM_TTY_P (DEVICE_TYPE (dev)) 246 #define DEVICE_TTY_P(dev) CONSOLE_TYPESYM_TTY_P (DEVICE_TYPE_X (dev))
247 #define CHECK_TTY_DEVICE(z) CHECK_DEVICE_TYPE (z, tty) 247 #define CHECK_TTY_DEVICE(z) CHECK_DEVICE_TYPE (z, tty)
248 #define CONCHECK_TTY_DEVICE(z) CONCHECK_DEVICE_TYPE (z, tty) 248 #define CONCHECK_TTY_DEVICE(z) CONCHECK_DEVICE_TYPE (z, tty)
249 249
250 #define DEVICE_STREAM_P(dev) CONSOLE_TYPESYM_STREAM_P (DEVICE_TYPE (dev)) 250 #define DEVICE_STREAM_P(dev) CONSOLE_TYPESYM_STREAM_P (DEVICE_TYPE_X (dev))
251 #define CHECK_STREAM_DEVICE(z) CHECK_DEVICE_TYPE (z, stream) 251 #define CHECK_STREAM_DEVICE(z) CHECK_DEVICE_TYPE (z, stream)
252 #define CONCHECK_STREAM_DEVICE(z) CONCHECK_DEVICE_TYPE (z, stream) 252 #define CONCHECK_STREAM_DEVICE(z) CONCHECK_DEVICE_TYPE (z, stream)
253 253
254 #define DEVICE_WIN_P(dev) CONSOLE_TYPESYM_WIN_P (DEVICE_TYPE (dev)) 254 #define DEVICE_WIN_P(dev) CONSOLE_TYPESYM_WIN_P (DEVICE_TYPE_X (dev))
255 255
256 #define DEVICE_REDISPLAY_INFO(d) ((d)->redisplay_info) 256 #define DEVICE_REDISPLAY_INFO(d) ((d)->redisplay_info)
257 257
258 #define DEVICE_NAME(d) ((d)->name) 258 #define DEVICE_NAME(d) ((d)->name)
259 #define DEVICE_CLASS(d) ((d)->device_class) 259 #define DEVICE_CLASS(d) ((d)->device_class)