comparison src/glyphs-x.c @ 14:9ee227acff29 r19-15b90

Import from CVS: tag r19-15b90
author cvs
date Mon, 13 Aug 2007 08:48:42 +0200
parents 4b173ad71786
children 0293115a14e9
comparison
equal deleted inserted replaced
13:13c6d0aaafe5 14:9ee227acff29
274 Display *display; 274 Display *display;
275 275
276 /* Check non-absolute pathnames with a directory component relative to 276 /* Check non-absolute pathnames with a directory component relative to
277 the search path; that's the way Xt does it. */ 277 the search path; that's the way Xt does it. */
278 /* #### Unix-specific */ 278 /* #### Unix-specific */
279 if (string_byte (XSTRING (name), 0) == '/' || 279 if (XSTRING_BYTE (name, 0) == '/' ||
280 (string_byte (XSTRING (name), 0) == '.' && 280 (XSTRING_BYTE (name, 0) == '.' &&
281 (string_byte (XSTRING (name), 1) == '/' || 281 (XSTRING_BYTE (name, 1) == '/' ||
282 (string_byte (XSTRING (name), 1) == '.' && 282 (XSTRING_BYTE (name, 1) == '.' &&
283 (string_byte (XSTRING (name), 2) == '/'))))) 283 (XSTRING_BYTE (name, 2) == '/')))))
284 { 284 {
285 if (!NILP (Ffile_readable_p (name))) 285 if (!NILP (Ffile_readable_p (name)))
286 return name; 286 return name;
287 else 287 else
288 return Qnil; 288 return Qnil;
298 #ifdef USE_XBMLANGPATH 298 #ifdef USE_XBMLANGPATH
299 { 299 {
300 char *path = egetenv ("XBMLANGPATH"); 300 char *path = egetenv ("XBMLANGPATH");
301 SubstitutionRec subs[1]; 301 SubstitutionRec subs[1];
302 subs[0].match = 'B'; 302 subs[0].match = 'B';
303 subs[0].substitution = (char *) string_data (XSTRING (name)); 303 subs[0].substitution = (char *) XSTRING_DATA (name);
304 /* #### Motif uses a big hairy default if $XBMLANGPATH isn't set. 304 /* #### Motif uses a big hairy default if $XBMLANGPATH isn't set.
305 We don't. If you want it used, set it. */ 305 We don't. If you want it used, set it. */
306 if (path && 306 if (path &&
307 (path = XtResolvePathname (display, "bitmaps", 0, 0, path, 307 (path = XtResolvePathname (display, "bitmaps", 0, 0, path,
308 subs, XtNumber (subs), 0))) 308 subs, XtNumber (subs), 0)))
2295 pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid) 2295 pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
2296 { 2296 {
2297 char **data; 2297 char **data;
2298 int result; 2298 int result;
2299 2299
2300 result = XpmReadFileToData ((char *) string_data (XSTRING (name)), &data); 2300 result = XpmReadFileToData ((char *) XSTRING_DATA (name), &data);
2301 2301
2302 if (result == XpmSuccess) 2302 if (result == XpmSuccess)
2303 { 2303 {
2304 Lisp_Object retval = Qnil; 2304 Lisp_Object retval = Qnil;
2305 struct buffer *old_buffer = current_buffer; 2305 struct buffer *old_buffer = current_buffer;
2539 /* Duplicate the pixel value so that we still have a lock on it if 2539 /* Duplicate the pixel value so that we still have a lock on it if
2540 the pixel we were passed is later freed. */ 2540 the pixel we were passed is later freed. */
2541 if (! XAllocColor (dpy, cmap, &color)) 2541 if (! XAllocColor (dpy, cmap, &color))
2542 abort (); /* it must be allocable since we're just duplicating it */ 2542 abort (); /* it must be allocable since we're just duplicating it */
2543 2543
2544 symbols [i].name = (char *) string_data (XSTRING (XCAR (cons))); 2544 symbols [i].name = (char *) XSTRING_DATA (XCAR (cons));
2545 symbols [i].pixel = color.pixel; 2545 symbols [i].pixel = color.pixel;
2546 symbols [i].value = 0; 2546 symbols [i].value = 0;
2547 free_cons (XCONS (cons)); 2547 free_cons (XCONS (cons));
2548 cons = results; 2548 cons = results;
2549 results = XCDR (results); 2549 results = XCDR (results);
2629 color_symbols = extract_xpm_color_names (&xpmattrs, device, 2629 color_symbols = extract_xpm_color_names (&xpmattrs, device,
2630 color_symbol_alist); 2630 color_symbol_alist);
2631 2631
2632 result = XpmCreatePixmapFromBuffer (dpy, 2632 result = XpmCreatePixmapFromBuffer (dpy,
2633 RootWindowOfScreen (xs), 2633 RootWindowOfScreen (xs),
2634 (char *) string_data (XSTRING (data)), 2634 (char *) XSTRING_DATA (data),
2635 &pixmap, &mask, &xpmattrs); 2635 &pixmap, &mask, &xpmattrs);
2636 2636
2637 if (color_symbols) 2637 if (color_symbols)
2638 { 2638 {
2639 xfree (color_symbols); 2639 xfree (color_symbols);
3251 signal_simple_error ("Not an X device", device); 3251 signal_simple_error ("Not an X device", device);
3252 3252
3253 dpy = DEVICE_X_DISPLAY (XDEVICE (device)); 3253 dpy = DEVICE_X_DISPLAY (XDEVICE (device));
3254 3254
3255 if (!STRINGP (data) || 3255 if (!STRINGP (data) ||
3256 strncmp ("FONT ", (char *) string_data (XSTRING (data)), 5)) 3256 strncmp ("FONT ", (char *) XSTRING_DATA (data), 5))
3257 signal_simple_error ("Invalid font-glyph instantiator", 3257 signal_simple_error ("Invalid font-glyph instantiator",
3258 instantiator); 3258 instantiator);
3259 3259
3260 if (!(dest_mask & IMAGE_POINTER_MASK)) 3260 if (!(dest_mask & IMAGE_POINTER_MASK))
3261 incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK); 3261 incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK);
3267 if (NILP (background)) 3267 if (NILP (background))
3268 background = pointer_bg; 3268 background = pointer_bg;
3269 3269
3270 generate_cursor_fg_bg (device, &foreground, &background, &fg, &bg); 3270 generate_cursor_fg_bg (device, &foreground, &background, &fg, &bg);
3271 3271
3272 count = sscanf ((char *) string_data (XSTRING (data)), 3272 count = sscanf ((char *) XSTRING_DATA (data),
3273 "FONT %s %d %s %d %c", 3273 "FONT %s %d %s %d %c",
3274 source_name, &source_char, 3274 source_name, &source_char,
3275 mask_name, &mask_char, &dummy); 3275 mask_name, &mask_char, &dummy);
3276 /* Allow "%s %d %d" as well... */ 3276 /* Allow "%s %d %d" as well... */
3277 if (count == 3 && (1 == sscanf (mask_name, "%d %c", &mask_char, &dummy))) 3277 if (count == 3 && (1 == sscanf (mask_name, "%d %c", &mask_char, &dummy)))
3600 3600
3601 sw = XSUBWINDOW (subwindow); 3601 sw = XSUBWINDOW (subwindow);
3602 dpy = DisplayOfScreen (LISP_DEVICE_TO_X_SCREEN 3602 dpy = DisplayOfScreen (LISP_DEVICE_TO_X_SCREEN
3603 (FRAME_DEVICE (XFRAME (sw->frame)))); 3603 (FRAME_DEVICE (XFRAME (sw->frame))));
3604 3604
3605 property_atom = XInternAtom (dpy, (char *) string_data (XSTRING (property)), 3605 property_atom = XInternAtom (dpy, (char *) XSTRING_DATA (property),
3606 False); 3606 False);
3607 XChangeProperty (dpy, sw->subwindow, property_atom, XA_STRING, 8, 3607 XChangeProperty (dpy, sw->subwindow, property_atom, XA_STRING, 8,
3608 PropModeReplace, string_data (XSTRING (data)), 3608 PropModeReplace, XSTRING_DATA (data),
3609 string_length (XSTRING (data))); 3609 XSTRING_LENGTH (data));
3610 3610
3611 return (property); 3611 return (property);
3612 } 3612 }
3613 3613
3614 DEFUN ("subwindowp", Fsubwindowp, Ssubwindowp, 1, 1, 0 /* 3614 DEFUN ("subwindowp", Fsubwindowp, Ssubwindowp, 1, 1, 0 /*