Mercurial > hg > xemacs-beta
comparison src/objects.c @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 3078fd1074e8 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
135 | 135 |
136 Optional argument DEVICE specifies the device this object applies to | 136 Optional argument DEVICE specifies the device this object applies to |
137 and defaults to the selected device. | 137 and defaults to the selected device. |
138 | 138 |
139 An error is signaled if the color is unknown or cannot be allocated; | 139 An error is signaled if the color is unknown or cannot be allocated; |
140 however, if optional argument NO-ERROR is non-nil, nil is simply | 140 however, if optional argument NOERROR is non-nil, nil is simply |
141 returned in this case. (And if NO-ERROR is other than t, a warning may | 141 returned in this case. (And if NOERROR is other than t, a warning may |
142 be issued.) | 142 be issued.) |
143 | 143 |
144 The returned object is a normal, first-class lisp object. The way you | 144 The returned object is a normal, first-class lisp object. The way you |
145 `deallocate' the color is the way you deallocate any other lisp object: | 145 `deallocate' the color is the way you deallocate any other lisp object: |
146 you drop all pointers to it and allow it to be garbage collected. When | 146 you drop all pointers to it and allow it to be garbage collected. When |
147 these objects are GCed, the underlying window-system data (e.g. X object) | 147 these objects are GCed, the underlying window-system data (e.g. X object) |
148 is deallocated as well. | 148 is deallocated as well. |
149 */ | 149 */ |
150 (name, device, no_error)) | 150 (name, device, noerror)) |
151 { | 151 { |
152 Lisp_Color_Instance *c; | 152 Lisp_Color_Instance *c; |
153 Lisp_Object val; | 153 Lisp_Object val; |
154 int retval; | 154 int retval; |
155 | 155 |
161 c->device = device; | 161 c->device = device; |
162 c->data = 0; | 162 c->data = 0; |
163 | 163 |
164 retval = MAYBE_INT_DEVMETH (XDEVICE (device), initialize_color_instance, | 164 retval = MAYBE_INT_DEVMETH (XDEVICE (device), initialize_color_instance, |
165 (c, name, device, | 165 (c, name, device, |
166 decode_error_behavior_flag (no_error))); | 166 decode_error_behavior_flag (noerror))); |
167 if (!retval) | 167 if (!retval) |
168 return Qnil; | 168 return Qnil; |
169 | 169 |
170 XSETCOLOR_INSTANCE (val, c); | 170 XSETCOLOR_INSTANCE (val, c); |
171 return val; | 171 return val; |
313 The returned object is a normal, first-class lisp object. The way you | 313 The returned object is a normal, first-class lisp object. The way you |
314 `deallocate' the font is the way you deallocate any other lisp object: | 314 `deallocate' the font is the way you deallocate any other lisp object: |
315 you drop all pointers to it and allow it to be garbage collected. When | 315 you drop all pointers to it and allow it to be garbage collected. When |
316 these objects are GCed, the underlying X data is deallocated as well. | 316 these objects are GCed, the underlying X data is deallocated as well. |
317 */ | 317 */ |
318 (name, device, no_error)) | 318 (name, device, noerror)) |
319 { | 319 { |
320 Lisp_Font_Instance *f; | 320 Lisp_Font_Instance *f; |
321 Lisp_Object val; | 321 Lisp_Object val; |
322 int retval = 0; | 322 int retval = 0; |
323 Error_behavior errb = decode_error_behavior_flag (no_error); | 323 Error_behavior errb = decode_error_behavior_flag (noerror); |
324 | 324 |
325 if (ERRB_EQ (errb, ERROR_ME)) | 325 if (ERRB_EQ (errb, ERROR_ME)) |
326 CHECK_STRING (name); | 326 CHECK_STRING (name); |
327 else if (!STRINGP (name)) | 327 else if (!STRINGP (name)) |
328 return Qnil; | 328 return Qnil; |