Mercurial > hg > xemacs-beta
comparison src/objects-x.c @ 4916:a6c778975d7d
split USE_XFT into HAVE_XFT/USE_XFT
-------------------- ChangeLog entries follow: --------------------
ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* configure:
* configure.ac (TAB):
USE_XFT* -> HAVE_XFT*.
lwlib/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* lwlib-colors.c:
* lwlib-colors.h:
* lwlib-fonts.c:
* lwlib-fonts.h:
* xlwmenu.c:
* xlwmenu.c (xlwMenuResources):
* xlwmenu.c (x_xft_text_width):
* xlwmenu.c (label_button_draw):
* xlwmenu.c (push_button_size):
* xlwmenu.c (push_button_draw):
* xlwmenu.c (make_drawing_gcs):
* xlwmenu.c (extract_font_extents):
* xlwmenu.c (default_font_of_font_list):
* xlwmenu.c (XlwMenuInitialize):
* xlwmenu.c (XlwMenuDestroy):
* xlwmenu.c (XlwMenuSetValues):
* xlwmenuP.h:
* xlwmenuP.h (_XlwMenu_part):
* xlwtabs.c:
* xlwtabs.c (TabsInit):
* xlwtabs.c (TabsDestroy):
* xlwtabs.c (TabsSetValues):
* xlwtabs.c (DrawTab):
* xlwtabs.c (TabWidth):
* xlwtabs.c (TabsAllocFgGC):
* xlwtabs.c (TabsAllocGreyGC):
* xlwtabsP.h:
USE_XFT* -> HAVE_XFT*.
src/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* Makefile.in.in:
* compiler.h:
* config.h.in:
* console-x-impl.h:
* console-x-impl.h (struct x_frame):
* console-x-impl.h (FRAME_X_TOTALLY_VISIBLE_P):
* console-x.h:
* console-xlike-inc.h:
* emacs.c (main_1):
* faces.c (complex_vars_of_faces):
* font-mgr.h:
* frame-x.c (x_delete_frame):
* frame-x.c (x_update_frame_external_traits):
* glyphs-x.c (update_widget_face):
* inline.c:
* objects-x-impl.h:
* objects-x-impl.h (struct x_color_instance_data):
* objects-x-impl.h (struct x_font_instance_data):
* objects-x.c:
* objects-x.c (x_initialize_color_instance):
* objects-x.c (x_initialize_font_instance):
* objects-x.c (x_print_font_instance):
* objects-x.c (x_finalize_font_instance):
* objects-x.c (x_font_instance_truename):
* objects-x.c (vars_of_objects_x):
* objects-x.h:
USE_XFT* -> HAVE_XFT*. But in objects-xlike-inc.c and
redisplay-xlike-inc.c, continue to use USE_XFT, and define
it appropriately in console-xlike-inc.h when both HAVE_XFT
and THIS_IS_X -- even if HAVE_XFT, we don't want to enable
XFT code when included in a *-gtk.c file.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 22:00:29 -0600 |
parents | a23ac8f90a49 |
children | cbe181529c34 |
comparison
equal
deleted
inserted
replaced
4909:87175eb65ff4 | 4916:a6c778975d7d |
---|---|
37 | 37 |
38 #include "console-x-impl.h" | 38 #include "console-x-impl.h" |
39 #include "objects-x-impl.h" | 39 #include "objects-x-impl.h" |
40 #include "elhash.h" | 40 #include "elhash.h" |
41 | 41 |
42 #ifdef USE_XFT | 42 #ifdef HAVE_XFT |
43 #include "font-mgr.h" | 43 #include "font-mgr.h" |
44 #endif | 44 #endif |
45 | 45 |
46 int x_handle_non_fully_specified_fonts; | 46 int x_handle_non_fully_specified_fonts; |
47 | 47 |
90 static int | 90 static int |
91 x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, | 91 x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name, |
92 Lisp_Object device, Error_Behavior errb) | 92 Lisp_Object device, Error_Behavior errb) |
93 { | 93 { |
94 XColor color; | 94 XColor color; |
95 #ifdef USE_XFT | 95 #ifdef HAVE_XFT |
96 XftColor xftColor; | 96 XftColor xftColor; |
97 #endif | 97 #endif |
98 int result; | 98 int result; |
99 | 99 |
100 result = x_parse_nearest_color (XDEVICE (device), &color, name, errb); | 100 result = x_parse_nearest_color (XDEVICE (device), &color, name, errb); |
109 COLOR_INSTANCE_X_DEALLOC (c) = 0; | 109 COLOR_INSTANCE_X_DEALLOC (c) = 0; |
110 else | 110 else |
111 COLOR_INSTANCE_X_DEALLOC (c) = 1; | 111 COLOR_INSTANCE_X_DEALLOC (c) = 1; |
112 COLOR_INSTANCE_X_COLOR (c) = color; | 112 COLOR_INSTANCE_X_COLOR (c) = color; |
113 | 113 |
114 #ifdef USE_XFT | 114 #ifdef HAVE_XFT |
115 xftColor.pixel = color.pixel; | 115 xftColor.pixel = color.pixel; |
116 xftColor.color.red = color.red; | 116 xftColor.color.red = color.red; |
117 xftColor.color.green = color.green; | 117 xftColor.color.green = color.green; |
118 xftColor.color.blue = color.blue; | 118 xftColor.color.blue = color.blue; |
119 xftColor.color.alpha = 0xffff; | 119 xftColor.color.alpha = 0xffff; |
216 Lisp_Object device, Error_Behavior errb) | 216 Lisp_Object device, Error_Behavior errb) |
217 { | 217 { |
218 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device)); | 218 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device)); |
219 Extbyte *extname; | 219 Extbyte *extname; |
220 XFontStruct *fs = NULL; /* _F_ont _S_truct */ | 220 XFontStruct *fs = NULL; /* _F_ont _S_truct */ |
221 #ifdef USE_XFT | 221 #ifdef HAVE_XFT |
222 XftFont *rf = NULL; /* _R_ender _F_ont (X Render extension) */ | 222 XftFont *rf = NULL; /* _R_ender _F_ont (X Render extension) */ |
223 #else | 223 #else |
224 #define rf (0) | 224 #define rf (0) |
225 #endif | 225 #endif |
226 | 226 |
227 #ifdef USE_XFT | 227 #ifdef HAVE_XFT |
228 DEBUG_XFT1 (2, "attempting to initialize font spec %s\n", | 228 DEBUG_XFT1 (2, "attempting to initialize font spec %s\n", |
229 XSTRING_DATA(f->name)); | 229 XSTRING_DATA(f->name)); |
230 /* #### serialize (optimize) these later... */ | 230 /* #### serialize (optimize) these later... */ |
231 /* #### This function really needs to go away. | 231 /* #### This function really needs to go away. |
232 The problem is that the fontconfig/Xft functions work much too hard | 232 The problem is that the fontconfig/Xft functions work much too hard |
270 | 270 |
271 /* Now that we're sure that we will succeed, we can allocate data without | 271 /* Now that we're sure that we will succeed, we can allocate data without |
272 fear that the finalize method may get fucked. */ | 272 fear that the finalize method may get fucked. */ |
273 f->data = xnew (struct x_font_instance_data); | 273 f->data = xnew (struct x_font_instance_data); |
274 | 274 |
275 #ifdef USE_XFT | 275 #ifdef HAVE_XFT |
276 FONT_INSTANCE_X_XFTFONT (f) = rf; | 276 FONT_INSTANCE_X_XFTFONT (f) = rf; |
277 if (rf) | 277 if (rf) |
278 /* Have an Xft font, initialize font info from it. */ | 278 /* Have an Xft font, initialize font info from it. */ |
279 { | 279 { |
280 DEBUG_XFT4 (2, "pre-initial ascent %d descent %d width %d height %d\n", | 280 DEBUG_XFT4 (2, "pre-initial ascent %d descent %d width %d height %d\n", |
377 f->proportional_p = (fs->min_bounds.width != fs->max_bounds.width || | 377 f->proportional_p = (fs->min_bounds.width != fs->max_bounds.width || |
378 (x_handle_non_fully_specified_fonts && | 378 (x_handle_non_fully_specified_fonts && |
379 !fs->all_chars_exist)); | 379 !fs->all_chars_exist)); |
380 } | 380 } |
381 | 381 |
382 #ifdef USE_XFT | 382 #ifdef HAVE_XFT |
383 if (debug_xft > 0) | 383 if (debug_xft > 0) |
384 { | 384 { |
385 int n = 3, d = 5; | 385 int n = 3, d = 5; |
386 /* check for weirdness */ | 386 /* check for weirdness */ |
387 if (n * f->height < d * f->width) | 387 if (n * f->height < d * f->width) |
409 unfortunately. */ | 409 unfortunately. */ |
410 if (FONT_INSTANCE_X_FONT (f)) | 410 if (FONT_INSTANCE_X_FONT (f)) |
411 write_fmt_string (printcharfun, " font id: 0x%lx,", | 411 write_fmt_string (printcharfun, " font id: 0x%lx,", |
412 (unsigned long) FONT_INSTANCE_X_FONT (f)->fid); | 412 (unsigned long) FONT_INSTANCE_X_FONT (f)->fid); |
413 | 413 |
414 #ifdef USE_XFT | 414 #ifdef HAVE_XFT |
415 /* #### What should we do here? For now, print the address. */ | 415 /* #### What should we do here? For now, print the address. */ |
416 if (FONT_INSTANCE_X_XFTFONT (f)) | 416 if (FONT_INSTANCE_X_XFTFONT (f)) |
417 write_fmt_string (printcharfun, " xft font: 0x%lx", | 417 write_fmt_string (printcharfun, " xft font: 0x%lx", |
418 (unsigned long) FONT_INSTANCE_X_XFTFONT (f)); | 418 (unsigned long) FONT_INSTANCE_X_XFTFONT (f)); |
419 #endif | 419 #endif |
421 | 421 |
422 static void | 422 static void |
423 x_finalize_font_instance (Lisp_Font_Instance *f) | 423 x_finalize_font_instance (Lisp_Font_Instance *f) |
424 { | 424 { |
425 | 425 |
426 #ifdef USE_XFT | 426 #ifdef HAVE_XFT |
427 DEBUG_XFT1 (0, "finalizing %s\n", (STRINGP (f->name) | 427 DEBUG_XFT1 (0, "finalizing %s\n", (STRINGP (f->name) |
428 ? (char *) XSTRING_DATA (f->name) | 428 ? (char *) XSTRING_DATA (f->name) |
429 : "(unnamed font)")); | 429 : "(unnamed font)")); |
430 #endif | 430 #endif |
431 | 431 |
435 { | 435 { |
436 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 436 Display *dpy = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
437 | 437 |
438 if (FONT_INSTANCE_X_FONT (f)) | 438 if (FONT_INSTANCE_X_FONT (f)) |
439 XFreeFont (dpy, FONT_INSTANCE_X_FONT (f)); | 439 XFreeFont (dpy, FONT_INSTANCE_X_FONT (f)); |
440 #ifdef USE_XFT | 440 #ifdef HAVE_XFT |
441 if (FONT_INSTANCE_X_XFTFONT (f)) | 441 if (FONT_INSTANCE_X_XFTFONT (f)) |
442 XftFontClose (dpy, FONT_INSTANCE_X_XFTFONT (f)); | 442 XftFontClose (dpy, FONT_INSTANCE_X_XFTFONT (f)); |
443 #endif | 443 #endif |
444 } | 444 } |
445 xfree (f->data, void *); | 445 xfree (f->data, void *); |
750 | 750 |
751 /* #### restructure this so that we return a valid truename at the end, | 751 /* #### restructure this so that we return a valid truename at the end, |
752 and otherwise only return when we return something desperate that | 752 and otherwise only return when we return something desperate that |
753 doesn't get stored for future use. */ | 753 doesn't get stored for future use. */ |
754 | 754 |
755 #ifdef USE_XFT | 755 #ifdef HAVE_XFT |
756 /* First, try an Xft font. */ | 756 /* First, try an Xft font. */ |
757 if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f)) | 757 if (NILP (FONT_INSTANCE_TRUENAME (f)) && FONT_INSTANCE_X_XFTFONT (f)) |
758 { | 758 { |
759 /* The font is already open, we just unparse. */ | 759 /* The font is already open, we just unparse. */ |
760 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern); | 760 FcChar8 *res = FcNameUnparse (FONT_INSTANCE_X_XFTFONT (f)->pattern); |
777 "Couldn't unparse Xft font to truename", | 777 "Couldn't unparse Xft font to truename", |
778 wrap_font_instance(f), Qfont, errb); | 778 wrap_font_instance(f), Qfont, errb); |
779 /* used to return Qnil here */ | 779 /* used to return Qnil here */ |
780 } | 780 } |
781 } | 781 } |
782 #endif /* USE_XFT */ | 782 #endif /* HAVE_XFT */ |
783 | 783 |
784 /* OK, fall back to core font. */ | 784 /* OK, fall back to core font. */ |
785 if (NILP (FONT_INSTANCE_TRUENAME (f)) | 785 if (NILP (FONT_INSTANCE_TRUENAME (f)) |
786 && FONT_INSTANCE_X_FONT (f)) | 786 && FONT_INSTANCE_X_FONT (f)) |
787 { | 787 { |
959 fixed-width fonts. Since most people don't use characters which could | 959 fixed-width fonts. Since most people don't use characters which could |
960 cause problems this is set to nil by default. | 960 cause problems this is set to nil by default. |
961 */ ); | 961 */ ); |
962 x_handle_non_fully_specified_fonts = 0; | 962 x_handle_non_fully_specified_fonts = 0; |
963 | 963 |
964 #ifdef USE_XFT | 964 #ifdef HAVE_XFT |
965 Fprovide (intern ("xft-fonts")); | 965 Fprovide (intern ("xft-fonts")); |
966 #endif | 966 #endif |
967 } | 967 } |
968 | 968 |
969 void | 969 void |