emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfaces.c,v


From: Adrian Robert
Subject: [Emacs-diffs] Changes to emacs/src/xfaces.c,v
Date: Tue, 15 Jul 2008 18:15:52 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Adrian Robert <arobert> 08/07/15 18:15:19

Index: src/xfaces.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfaces.c,v
retrieving revision 1.405
retrieving revision 1.406
diff -u -b -r1.405 -r1.406
--- src/xfaces.c        8 Jul 2008 17:27:28 -0000       1.405
+++ src/xfaces.c        15 Jul 2008 18:15:18 -0000      1.406
@@ -244,6 +244,17 @@
 #define check_x check_mac
 #endif /* MAC_OS */
 
+#ifdef HAVE_NS
+#include "nsterm.h"
+#undef FRAME_X_DISPLAY_INFO
+#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
+#define x_display_info ns_display_info
+#define FRAME_X_FONT_TABLE FRAME_NS_FONT_TABLE
+#define check_x check_ns
+#define x_list_fonts ns_list_fonts
+#define GCGraphicsExposures 0
+#endif /* HAVE_NS */
+
 #include "buffer.h"
 #include "dispextern.h"
 #include "blockinput.h"
@@ -556,6 +567,10 @@
 extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
 #endif /* WINDOWSNT */
 
+#ifdef HAVE_NS
+extern Lisp_Object ns_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
+#endif /* HAVE_NS */
+
 #ifdef USE_X_TOOLKIT
 static void x_update_menu_appearance P_ ((struct frame *));
 
@@ -766,6 +781,31 @@
 
 #endif  /* WINDOWSNT */
 
+#ifdef HAVE_NS
+/* NS emulation of GCs */
+
+static INLINE GC
+x_create_gc (f, mask, xgcv)
+     struct frame *f;
+     unsigned long mask;
+     XGCValues *xgcv;
+{
+  GC gc = xmalloc (sizeof (*gc));
+  if (gc)
+      bcopy(xgcv, gc, sizeof(XGCValues));
+  return gc;
+}
+
+static INLINE void
+x_free_gc (f, gc)
+     struct frame *f;
+     GC gc;
+{
+  if (gc)
+      xfree (gc);
+}
+#endif  /* HAVE_NS */
+
 #ifdef MAC_OS
 /* Mac OS emulation of GCs */
 
@@ -872,6 +912,9 @@
 #ifdef MAC_OS
   if (!FRAME_MAC_P (f) || FRAME_MAC_WINDOW (f))
 #endif
+#ifdef HAVE_NS
+  if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f))
+#endif
     if (!realize_basic_faces (f))
       abort ();
 }
@@ -1269,6 +1312,10 @@
   else if (FRAME_MAC_P (f))
     return mac_defined_color (f, color_name, color_def, alloc);
 #endif
+#ifdef HAVE_NS
+  else if (FRAME_NS_P (f))
+    return ns_defined_color (f, color_name, color_def, alloc, 1);
+#endif
   else
     abort ();
 }
@@ -1558,6 +1605,7 @@
      struct frame *f;
      struct face *face;
 {
+/* PENDING(NS): need to do something here? */
 #ifdef HAVE_X_WINDOWS
   if (face->colors_copied_bitwise_p)
     return;
@@ -2754,7 +2802,7 @@
                }
              else if (EQ (keyword, QCstipple))
                {
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
                  Lisp_Object pixmap_p = Fbitmap_spec_p (value);
                  if (!NILP (pixmap_p))
                    to[LFACE_STIPPLE_INDEX] = value;
@@ -3262,14 +3310,14 @@
     }
   else if (EQ (attr, QCstipple))
     {
-#ifdef HAVE_X_WINDOWS
+#if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
       if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)
          && !NILP (value)
          && NILP (Fbitmap_spec_p (value)))
        signal_error ("Invalid stipple attribute", value);
       old_value = LFACE_STIPPLE (lface);
       LFACE_STIPPLE (lface) = value;
-#endif /* HAVE_X_WINDOWS */
+#endif /* HAVE_X_WINDOWS || HAVE_NS */
     }
   else if (EQ (attr, QCwidth))
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]