aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 87a9006ae22..4bdcd1e406e 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -244,6 +244,17 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
244#define check_x check_mac 244#define check_x check_mac
245#endif /* MAC_OS */ 245#endif /* MAC_OS */
246 246
247#ifdef HAVE_NS
248#include "nsterm.h"
249#undef FRAME_X_DISPLAY_INFO
250#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
251#define x_display_info ns_display_info
252#define FRAME_X_FONT_TABLE FRAME_NS_FONT_TABLE
253#define check_x check_ns
254#define x_list_fonts ns_list_fonts
255#define GCGraphicsExposures 0
256#endif /* HAVE_NS */
257
247#include "buffer.h" 258#include "buffer.h"
248#include "dispextern.h" 259#include "dispextern.h"
249#include "blockinput.h" 260#include "blockinput.h"
@@ -556,6 +567,10 @@ static void x_free_gc P_ ((struct frame *, GC));
556extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int)); 567extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
557#endif /* WINDOWSNT */ 568#endif /* WINDOWSNT */
558 569
570#ifdef HAVE_NS
571extern Lisp_Object ns_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
572#endif /* HAVE_NS */
573
559#ifdef USE_X_TOOLKIT 574#ifdef USE_X_TOOLKIT
560static void x_update_menu_appearance P_ ((struct frame *)); 575static void x_update_menu_appearance P_ ((struct frame *));
561 576
@@ -766,6 +781,31 @@ x_free_gc (f, gc)
766 781
767#endif /* WINDOWSNT */ 782#endif /* WINDOWSNT */
768 783
784#ifdef HAVE_NS
785/* NS emulation of GCs */
786
787static INLINE GC
788x_create_gc (f, mask, xgcv)
789 struct frame *f;
790 unsigned long mask;
791 XGCValues *xgcv;
792{
793 GC gc = xmalloc (sizeof (*gc));
794 if (gc)
795 bcopy(xgcv, gc, sizeof(XGCValues));
796 return gc;
797}
798
799static INLINE void
800x_free_gc (f, gc)
801 struct frame *f;
802 GC gc;
803{
804 if (gc)
805 xfree (gc);
806}
807#endif /* HAVE_NS */
808
769#ifdef MAC_OS 809#ifdef MAC_OS
770/* Mac OS emulation of GCs */ 810/* Mac OS emulation of GCs */
771 811
@@ -872,8 +912,11 @@ init_frame_faces (f)
872#ifdef MAC_OS 912#ifdef MAC_OS
873 if (!FRAME_MAC_P (f) || FRAME_MAC_WINDOW (f)) 913 if (!FRAME_MAC_P (f) || FRAME_MAC_WINDOW (f))
874#endif 914#endif
915#ifdef HAVE_NS
916 if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f))
917#endif
875 if (!realize_basic_faces (f)) 918 if (!realize_basic_faces (f))
876 abort (); 919 abort ();
877} 920}
878 921
879 922
@@ -1269,6 +1312,10 @@ defined_color (f, color_name, color_def, alloc)
1269 else if (FRAME_MAC_P (f)) 1312 else if (FRAME_MAC_P (f))
1270 return mac_defined_color (f, color_name, color_def, alloc); 1313 return mac_defined_color (f, color_name, color_def, alloc);
1271#endif 1314#endif
1315#ifdef HAVE_NS
1316 else if (FRAME_NS_P (f))
1317 return ns_defined_color (f, color_name, color_def, alloc, 1);
1318#endif
1272 else 1319 else
1273 abort (); 1320 abort ();
1274} 1321}
@@ -1558,6 +1605,7 @@ free_face_colors (f, face)
1558 struct frame *f; 1605 struct frame *f;
1559 struct face *face; 1606 struct face *face;
1560{ 1607{
1608/* PENDING(NS): need to do something here? */
1561#ifdef HAVE_X_WINDOWS 1609#ifdef HAVE_X_WINDOWS
1562 if (face->colors_copied_bitwise_p) 1610 if (face->colors_copied_bitwise_p)
1563 return; 1611 return;
@@ -2754,7 +2802,7 @@ merge_face_ref (f, face_ref, to, err_msgs, named_merge_points)
2754 } 2802 }
2755 else if (EQ (keyword, QCstipple)) 2803 else if (EQ (keyword, QCstipple))
2756 { 2804 {
2757#ifdef HAVE_X_WINDOWS 2805#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
2758 Lisp_Object pixmap_p = Fbitmap_spec_p (value); 2806 Lisp_Object pixmap_p = Fbitmap_spec_p (value);
2759 if (!NILP (pixmap_p)) 2807 if (!NILP (pixmap_p))
2760 to[LFACE_STIPPLE_INDEX] = value; 2808 to[LFACE_STIPPLE_INDEX] = value;
@@ -3262,14 +3310,14 @@ FRAME 0 means change the face on all frames, and change the default
3262 } 3310 }
3263 else if (EQ (attr, QCstipple)) 3311 else if (EQ (attr, QCstipple))
3264 { 3312 {
3265#ifdef HAVE_X_WINDOWS 3313#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
3266 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) 3314 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
3267 && !NILP (value) 3315 && !NILP (value)
3268 && NILP (Fbitmap_spec_p (value))) 3316 && NILP (Fbitmap_spec_p (value)))
3269 signal_error ("Invalid stipple attribute", value); 3317 signal_error ("Invalid stipple attribute", value);
3270 old_value = LFACE_STIPPLE (lface); 3318 old_value = LFACE_STIPPLE (lface);
3271 LFACE_STIPPLE (lface) = value; 3319 LFACE_STIPPLE (lface) = value;
3272#endif /* HAVE_X_WINDOWS */ 3320#endif /* HAVE_X_WINDOWS || HAVE_NS */
3273 } 3321 }
3274 else if (EQ (attr, QCwidth)) 3322 else if (EQ (attr, QCwidth))
3275 { 3323 {