root/src/nsgui.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


     1 /* Definitions and headers for communication on the NeXT/Open/GNUstep API.
     2    Copyright (C) 1995, 2005, 2008-2023 Free Software Foundation, Inc.
     3 
     4 This file is part of GNU Emacs.
     5 
     6 GNU Emacs is free software: you can redistribute it and/or modify
     7 it under the terms of the GNU General Public License as published by
     8 the Free Software Foundation, either version 3 of the License, or (at
     9 your option) any later version.
    10 
    11 GNU Emacs is distributed in the hope that it will be useful,
    12 but WITHOUT ANY WARRANTY; without even the implied warranty of
    13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14 GNU General Public License for more details.
    15 
    16 You should have received a copy of the GNU General Public License
    17 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
    18 
    19 #ifndef __NSGUI_H__
    20 #define __NSGUI_H__
    21 
    22 /* This gets included from a couple of the plain (non-NS) .c files.  */
    23 #ifdef __OBJC__
    24 
    25 #ifdef NS_IMPL_COCOA
    26 #ifdef Z
    27 #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."
    28 #endif  /* Z */
    29 #define Cursor FooFoo
    30 #endif  /* NS_IMPL_COCOA */
    31 
    32 #undef verify
    33 
    34 #import <AppKit/AppKit.h>
    35 
    36 #ifdef NS_IMPL_COCOA
    37 #undef Cursor
    38 #endif /* NS_IMPL_COCOA */
    39 #import <Foundation/NSDistantObject.h>
    40 
    41 #ifdef NS_IMPL_COCOA
    42 #include <AvailabilityMacros.h>
    43 #endif /* NS_IMPL_COCOA */
    44 
    45 #endif /* __OBJC__ */
    46 
    47 #undef verify
    48 #undef _GL_VERIFY_H
    49 #include <verify.h>
    50 
    51 /* Emulate XCharStruct.  */
    52 typedef struct _XCharStruct
    53 {
    54   int rbearing;
    55   int lbearing;
    56   int width;
    57   int ascent;
    58   int descent;
    59 } XCharStruct;
    60 
    61 #ifdef __OBJC__
    62 typedef id Emacs_Pixmap;
    63 #else
    64 typedef void *Emacs_Pixmap;
    65 #endif
    66 
    67 #ifdef __OBJC__
    68 typedef NSCursor *Emacs_Cursor;
    69 #else
    70 typedef void *Emacs_Cursor;
    71 #endif
    72 
    73 typedef int Window;
    74 
    75 #ifndef __OBJC__
    76 #if defined (__LP64__) && __LP64__
    77 typedef double CGFloat;
    78 #else
    79 typedef float CGFloat;
    80 #endif
    81 typedef struct _NSPoint { CGFloat x, y; } NSPoint;
    82 typedef struct _NSSize  { CGFloat width, height; } NSSize;
    83 typedef struct _NSRect  { NSPoint origin; NSSize size; } NSRect;
    84 #endif  /* NOT OBJC */
    85 
    86 #define NativeRectangle NSRect
    87 
    88 #define CONVERT_TO_EMACS_RECT(xr, nr)           \
    89   ((xr).x     = (nr).origin.x,                  \
    90    (xr).y     = (nr).origin.y,                  \
    91    (xr).width = (nr).size.width,                \
    92    (xr).height = (nr).size.height)
    93 
    94 #define CONVERT_FROM_EMACS_RECT(xr, nr)         \
    95   ((nr).origin.x    = (xr).x,                   \
    96    (nr).origin.y    = (xr).y,                   \
    97    (nr).size.width  = (xr).width,               \
    98    (nr).size.height = (xr).height)
    99 
   100 #define STORE_NATIVE_RECT(nr, px, py, pwidth, pheight)  \
   101   ((nr).origin.x    = (px),                     \
   102    (nr).origin.y    = (py),                     \
   103    (nr).size.width  = (pwidth),                 \
   104    (nr).size.height = (pheight))
   105 
   106 
   107 
   108 
   109 /* This stuff needed by frame.c.  */
   110 #define ForgetGravity           0
   111 #define NorthWestGravity        1
   112 #define NorthGravity            2
   113 #define NorthEastGravity        3
   114 #define WestGravity             4
   115 #define CenterGravity           5
   116 #define EastGravity             6
   117 #define SouthWestGravity        7
   118 #define SouthGravity            8
   119 #define SouthEastGravity        9
   120 #define StaticGravity           10
   121 
   122 #define NoValue         0x0000
   123 #define XValue          0x0001
   124 #define YValue          0x0002
   125 #define WidthValue      0x0004
   126 #define HeightValue     0x0008
   127 #define AllValues       0x000F
   128 #define XNegative       0x0010
   129 #define YNegative       0x0020
   130 
   131 #define USPosition      (1L << 0) /* user specified x, y */
   132 #define USSize          (1L << 1) /* user specified width, height */
   133 
   134 #define PPosition       (1L << 2) /* program specified position */
   135 #define PSize           (1L << 3) /* program specified size */
   136 #define PMinSize        (1L << 4) /* program specified minimum size */
   137 #define PMaxSize        (1L << 5) /* program specified maximum size */
   138 #define PResizeInc      (1L << 6) /* program specified resize increments */
   139 #define PAspect         (1L << 7) /* program specified min, max aspect ratios */
   140 #define PBaseSize       (1L << 8) /* program specified base for incrementing */
   141 #define PWinGravity     (1L << 9) /* program specified window gravity */
   142 
   143 #endif  /* __NSGUI_H__ */

/* [<][>][^][v][top][bottom][index][help] */