comparison src/xfaces.c @ 44890:01b93e5e53a7

Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog, lisp/ChangeLog, and src/ChangeLog for list of changes.
author Andrew Choi <akochoi@shaw.ca>
date Fri, 26 Apr 2002 23:39:06 +0000
parents 413dd322c77d
children 8c610da8ea94
comparison
equal deleted inserted replaced
44889:e3b9f45140a5 44890:01b93e5e53a7
232 not maximum as on X. Redefine here. */ 232 not maximum as on X. Redefine here. */
233 #undef FONT_WIDTH 233 #undef FONT_WIDTH
234 #define FONT_WIDTH FONT_MAX_WIDTH 234 #define FONT_WIDTH FONT_MAX_WIDTH
235 #endif /* WINDOWSNT */ 235 #endif /* WINDOWSNT */
236 236
237 #ifdef macintosh 237 #ifdef MAC_OS
238 #include "macterm.h" 238 #include "macterm.h"
239 #define x_display_info mac_display_info 239 #define x_display_info mac_display_info
240 #define check_x check_mac 240 #define check_x check_mac
241 241 #endif /* MAC_OS */
242 extern XGCValues *XCreateGC (void *, WindowPtr, unsigned long, XGCValues *);
243
244 static INLINE GC
245 x_create_gc (f, mask, xgcv)
246 struct frame *f;
247 unsigned long mask;
248 XGCValues *xgcv;
249 {
250 GC gc;
251 gc = XCreateGC (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), mask, xgcv);
252 return gc;
253 }
254
255 static INLINE void
256 x_free_gc (f, gc)
257 struct frame *f;
258 GC gc;
259 {
260 XFreeGC (FRAME_MAC_DISPLAY (f), gc);
261 }
262 #endif
263 242
264 #include "buffer.h" 243 #include "buffer.h"
265 #include "dispextern.h" 244 #include "dispextern.h"
266 #include "blockinput.h" 245 #include "blockinput.h"
267 #include "window.h" 246 #include "window.h"
812 UNBLOCK_INPUT; 791 UNBLOCK_INPUT;
813 } 792 }
814 793
815 #endif /* WINDOWSNT */ 794 #endif /* WINDOWSNT */
816 795
796 #ifdef MAC_OS
797 /* Mac OS emulation of GCs */
798
799 extern XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *);
800
801 static INLINE GC
802 x_create_gc (f, mask, xgcv)
803 struct frame *f;
804 unsigned long mask;
805 XGCValues *xgcv;
806 {
807 GC gc;
808 gc = XCreateGC (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), mask, xgcv);
809 return gc;
810 }
811
812 static INLINE void
813 x_free_gc (f, gc)
814 struct frame *f;
815 GC gc;
816 {
817 XFreeGC (FRAME_MAC_DISPLAY (f), gc);
818 }
819
820 #endif /* MAC_OS */
821
817 /* Like stricmp. Used to compare parts of font names which are in 822 /* Like stricmp. Used to compare parts of font names which are in
818 ISO8859-1. */ 823 ISO8859-1. */
819 824
820 int 825 int
821 xstricmp (s1, s2) 826 xstricmp (s1, s2)
1380 #endif 1385 #endif
1381 #ifdef WINDOWSNT 1386 #ifdef WINDOWSNT
1382 else if (FRAME_W32_P (f)) 1387 else if (FRAME_W32_P (f))
1383 return w32_defined_color (f, color_name, color_def, alloc); 1388 return w32_defined_color (f, color_name, color_def, alloc);
1384 #endif 1389 #endif
1385 #ifdef macintosh 1390 #ifdef MAC_OS
1386 else if (FRAME_MAC_P (f)) 1391 else if (FRAME_MAC_P (f))
1387 return mac_defined_color (f, color_name, color_def, alloc); 1392 return mac_defined_color (f, color_name, color_def, alloc);
1388 #endif 1393 #endif
1389 else 1394 else
1390 abort (); 1395 abort ();
1887 /* Order by which font selection chooses fonts. The default values 1892 /* Order by which font selection chooses fonts. The default values
1888 mean `first, find a best match for the font width, then for the 1893 mean `first, find a best match for the font width, then for the
1889 font height, then for weight, then for slant.' This variable can be 1894 font height, then for weight, then for slant.' This variable can be
1890 set via set-face-font-sort-order. */ 1895 set via set-face-font-sort-order. */
1891 1896
1892 #ifdef macintosh 1897 #ifdef MAC_OS
1893 static int font_sort_order[4] = { 1898 static int font_sort_order[4] = {
1894 XLFD_SWIDTH, XLFD_POINT_SIZE, XLFD_WEIGHT, XLFD_SLANT 1899 XLFD_SWIDTH, XLFD_POINT_SIZE, XLFD_WEIGHT, XLFD_SLANT
1895 }; 1900 };
1896 #else 1901 #else
1897 static int font_sort_order[4]; 1902 static int font_sort_order[4];
4339 (resource, class, frame) 4344 (resource, class, frame)
4340 Lisp_Object resource, class, frame; 4345 Lisp_Object resource, class, frame;
4341 { 4346 {
4342 Lisp_Object value = Qnil; 4347 Lisp_Object value = Qnil;
4343 #ifndef WINDOWSNT 4348 #ifndef WINDOWSNT
4344 #ifndef macintosh 4349 #ifndef MAC_OS
4345 CHECK_STRING (resource); 4350 CHECK_STRING (resource);
4346 CHECK_STRING (class); 4351 CHECK_STRING (class);
4347 CHECK_LIVE_FRAME (frame); 4352 CHECK_LIVE_FRAME (frame);
4348 BLOCK_INPUT; 4353 BLOCK_INPUT;
4349 value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)), 4354 value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)),
4350 resource, class, Qnil, Qnil); 4355 resource, class, Qnil, Qnil);
4351 UNBLOCK_INPUT; 4356 UNBLOCK_INPUT;
4352 #endif /* not macintosh */ 4357 #endif /* not MAC_OS */
4353 #endif /* not WINDOWSNT */ 4358 #endif /* not WINDOWSNT */
4354 return value; 4359 return value;
4355 } 4360 }
4356 4361
4357 4362
4995 xgcv.font = face->font->fid; 5000 xgcv.font = face->font->fid;
4996 #endif 5001 #endif
4997 #ifdef WINDOWSNT 5002 #ifdef WINDOWSNT
4998 xgcv.font = face->font; 5003 xgcv.font = face->font;
4999 #endif 5004 #endif
5000 #ifdef macintosh 5005 #ifdef MAC_OS
5001 xgcv.font = face->font; 5006 xgcv.font = face->font;
5002 #endif 5007 #endif
5003 mask |= GCFont; 5008 mask |= GCFont;
5004 } 5009 }
5005 5010
6426 if ((fontset == -1) && default_face) 6431 if ((fontset == -1) && default_face)
6427 fontset = default_face->fontset; 6432 fontset = default_face->fontset;
6428 face->fontset = make_fontset_for_ascii_face (f, fontset); 6433 face->fontset = make_fontset_for_ascii_face (f, fontset);
6429 face->font = NULL; /* to force realize_face to load font */ 6434 face->font = NULL; /* to force realize_face to load font */
6430 6435
6431 #ifdef macintosh 6436 #ifdef MAC_OS
6432 /* Load the font if it is specified in ATTRS. This fixes 6437 /* Load the font if it is specified in ATTRS. This fixes
6433 changing frame font on the Mac. */ 6438 changing frame font on the Mac. */
6434 if (STRINGP (attrs[LFACE_FONT_INDEX])) 6439 if (STRINGP (attrs[LFACE_FONT_INDEX]))
6435 { 6440 {
6436 struct font_info *font_info = 6441 struct font_info *font_info =