]> code.delx.au - gnu-emacs/blobdiff - src/nsgui.h
* cl-generic.el (cl-defmethod): Make docstring dynamic
[gnu-emacs] / src / nsgui.h
index df38db84adec32ddaa4562be2da9d116074048f6..8dac1bde9b5865dda2b4b35cbe4b3e31d570db2e 100644 (file)
@@ -1,12 +1,12 @@
 /* Definitions and headers for communication on the NeXT/Open/GNUstep API.
-   Copyright (C) 1995, 2005, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2005, 2008-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,9 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #ifndef __NSGUI_H__
 #define __NSGUI_H__
@@ -29,22 +27,14 @@ Boston, MA 02110-1301, USA.  */
 #warning "Z is defined.  If you get a later parse error in a header, check that buffer.h or other files #define-ing Z are not included."
 #endif  /* Z */
 #define Cursor FooFoo
-#undef init_process
 #endif  /* NS_IMPL_COCOA */
 
-#ifdef NS_IMPL_GNUSTEP
-#undef hash_remove
-#endif
+#undef verify
 
 #import <AppKit/AppKit.h>
 
-#ifdef NS_IMPL_GNUSTEP
-#define hash_remove emacs_hash_remove
-#endif
-
 #ifdef NS_IMPL_COCOA
 #undef Cursor
-#define init_process emacs_init_process
 #endif /* NS_IMPL_COCOA */
 #import <Foundation/NSDistantObject.h>
 
@@ -54,11 +44,9 @@ Boston, MA 02110-1301, USA.  */
 
 #endif /* __OBJC__ */
 
-
-/* menu-related */
-#define free_widget_value(wv) xfree (wv)
-#define malloc_widget_value() ((widget_value *) memset (xmalloc \
-    (sizeof (widget_value)), 0, sizeof (widget_value)))
+#undef verify
+#undef _GL_VERIFY_H
+#include <verify.h>
 
 /* Emulate XCharStruct.  */
 typedef struct _XCharStruct
@@ -70,7 +58,7 @@ typedef struct _XCharStruct
   int descent;
 } XCharStruct;
 
-/* 23: Fake tructure from Xlib.h to represent two-byte characters.  */
+/* Fake structure from Xlib.h to represent two-byte characters.  */
 #ifndef __OBJC__
 typedef unsigned short unichar;
 #endif
@@ -80,25 +68,21 @@ typedef unichar XChar2b;
   (*(chp) = ((XChar2b)((((b1) & 0x00ff) << 8) | ((b2) & 0x00ff))))
 
 #define XCHAR2B_BYTE1(chp) \
(((*chp) & 0xff00) >> 8)
 ((*(chp) & 0xff00) >> 8)
 
 #define XCHAR2B_BYTE2(chp) \
((*chp) & 0x00ff)
 (*(chp) & 0x00ff)
 
-#define FACE_DEFAULT (~0)
 
-
-/* PENDING: xfaces requires these structures, but the question is are we
-            forced to use them? */
+/* XXX: xfaces requires these structures, but the question is are we
+        forced to use them? */
 typedef struct _XGCValues
 {
+  unsigned long foreground;
+  unsigned long background;
 #ifdef __OBJC__
-  NSColor *foreground;
-  NSColor *background;
   struct ns_font *font;
 #else
-  void *foreground;
-  void *background;
   void *font;
 #endif
 } XGCValues;
@@ -135,20 +119,25 @@ typedef int Display;
 typedef Lisp_Object XrmDatabase;
 
 
-/* 23: some sort of attempt to normalize rectangle handling.. seems a bit much
-       for what is accomplished */
+/* some sort of attempt to normalize rectangle handling.. seems a bit much
+   for what is accomplished */
 typedef struct {
       int x, y;
       unsigned width, height;
 } XRectangle;
 
 #ifndef __OBJC__
-typedef struct _NSPoint { float x, y; } NSPoint;
-typedef struct _NSSize  { float width, height; } NSSize;
-typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect;
+#if defined (__LP64__) && __LP64__
+typedef double CGFloat;
+#else
+typedef float CGFloat;
 #endif
+typedef struct _NSPoint { CGFloat x, y; } NSPoint;
+typedef struct _NSSize  { CGFloat width, height; } NSSize;
+typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect;
+#endif  /* NOT OBJC */
 
-#define NativeRectangle struct _NSRect
+#define NativeRectangle NSRect
 
 #define CONVERT_TO_XRECT(xr, nr)               \
   ((xr).x     = (nr).origin.x,                 \