root/src/haikugui.h

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

INCLUDED FROM


     1 /* Haiku window system support
     2    Copyright (C) 2021-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 _HAIKU_GUI_H_
    20 #define _HAIKU_GUI_H_
    21 
    22 typedef struct haiku_char_struct
    23 {
    24   int rbearing;
    25   int lbearing;
    26   int width;
    27   int ascent;
    28   int descent;
    29 } XCharStruct;
    30 
    31 struct haiku_rect
    32 {
    33   int x, y;
    34   int width, height;
    35 };
    36 
    37 typedef void *haiku;
    38 
    39 typedef haiku Emacs_Pixmap;
    40 typedef haiku Emacs_Window;
    41 typedef haiku Emacs_Cursor;
    42 typedef haiku Drawable;
    43 
    44 #define NativeRectangle struct haiku_rect
    45 #define CONVERT_TO_EMACS_RECT(xr, nr)   \
    46   ((xr).x     = (nr).x,                 \
    47    (xr).y     = (nr).y,                 \
    48    (xr).width = (nr).width,             \
    49    (xr).height = (nr).height)
    50 
    51 #define CONVERT_FROM_EMACS_RECT(xr, nr) \
    52   ((nr).x    = (xr).x,                  \
    53    (nr).y    = (xr).y,                  \
    54    (nr).width  = (xr).width,            \
    55    (nr).height = (xr).height)
    56 
    57 #define STORE_NATIVE_RECT(nr, px, py, pwidth, pheight)  \
    58   ((nr).x    = (px),                                    \
    59    (nr).y    = (py),                                    \
    60    (nr).width  = (pwidth),                              \
    61    (nr).height = (pheight))
    62 
    63 #define ForgetGravity           0
    64 #define NorthWestGravity        1
    65 #define NorthGravity            2
    66 #define NorthEastGravity        3
    67 #define WestGravity             4
    68 #define CenterGravity           5
    69 #define EastGravity             6
    70 #define SouthWestGravity        7
    71 #define SouthGravity            8
    72 #define SouthEastGravity        9
    73 #define StaticGravity           10
    74 
    75 #define NoValue         0x0000
    76 #define XValue          0x0001
    77 #define YValue          0x0002
    78 #define WidthValue      0x0004
    79 #define HeightValue     0x0008
    80 #define AllValues       0x000F
    81 #define XNegative       0x0010
    82 #define YNegative       0x0020
    83 
    84 #define USPosition      (1L << 0) /* user specified x, y */
    85 #define USSize          (1L << 1) /* user specified width, height */
    86 #define PPosition       (1L << 2) /* program specified position */
    87 #define PSize           (1L << 3) /* program specified size */
    88 #define PMinSize        (1L << 4) /* program specified minimum size */
    89 #define PMaxSize        (1L << 5) /* program specified maximum size */
    90 #define PResizeInc      (1L << 6) /* program specified resize increments */
    91 #define PAspect         (1L << 7) /* program specified min, max aspect ratios */
    92 #define PBaseSize       (1L << 8) /* program specified base for incrementing */
    93 #define PWinGravity     (1L << 9) /* program specified window gravity */
    94 
    95 typedef haiku Window;
    96 typedef int Display;
    97 
    98 /* Cursor bitmaps.  These are only used to create colored cursors when
    99    the user specifies a mouse color.  */
   100 
   101 MAYBE_UNUSED static unsigned char cross_ptr_bits[] =
   102   {
   103     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
   104     0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
   105     0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
   106     0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   107     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   108     0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xf0, 0x1f, 0x00, 0x00,
   109     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   110     0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   111     0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
   112     0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80,
   113     0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   114     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   115   };
   116 
   117 MAYBE_UNUSED static unsigned char cross_ptrmask_bits[] =
   118   {
   119     0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01,
   120     0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0,
   121     0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00,
   122     0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   123     0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   124     0x00, 0xfc, 0x07, 0xf0, 0x1f, 0xfe, 0x0f, 0xf8, 0x3f, 0xfc, 0x07,
   125     0xf0, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   126     0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   127     0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01,
   128     0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0,
   129     0x01, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
   130     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   131   };
   132 
   133 MAYBE_UNUSED static unsigned char ibeam_ptr_bits[] =
   134   {
   135     0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xc0, 0x01, 0xc0, 0x01, 0xc0,
   136     0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01,
   137     0xc0, 0x01, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00
   138   };
   139 
   140 MAYBE_UNUSED static unsigned char ibeam_ptrmask_bits[] =
   141   {
   142     0x00, 0x00, 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0xe0, 0x03, 0xe0,
   143     0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03, 0xe0, 0x03,
   144     0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0x00, 0x00
   145   };
   146 
   147 MAYBE_UNUSED static unsigned char hand_ptr_bits[] =
   148   {
   149    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xa0, 0x02, 0xa0,
   150    0x02, 0xf0, 0x07, 0xf0, 0x07, 0xf0, 0x07, 0xf0, 0x07, 0xf0, 0x07,
   151    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   152   };
   153 
   154 MAYBE_UNUSED static unsigned char hand_ptrmask_bits[] =
   155   {
   156     0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0xf0, 0x07, 0xf0, 0x07, 0xf8,
   157     0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f, 0xf8, 0x0f,
   158     0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   159   };
   160 
   161 MAYBE_UNUSED static unsigned char horizd_ptr_bits[] =
   162   {
   163     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x28,
   164     0x0a, 0xf4, 0x17, 0x02, 0x20, 0xf4, 0x17, 0x28, 0x0a, 0x10, 0x04,
   165     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   166   };
   167 
   168 MAYBE_UNUSED static unsigned char horizd_ptrmask_bits[] =
   169   {
   170     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x38,
   171     0x0e, 0xfc, 0x1f, 0xfe, 0x3f, 0xfc, 0x1f, 0x38, 0x0e, 0x10, 0x04,
   172     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
   173   };
   174 
   175 MAYBE_UNUSED static unsigned char vertd_ptr_bits[] =
   176   {
   177     0x00, 0x00, 0x80, 0x00, 0x40, 0x01, 0x20, 0x02, 0x50, 0x05, 0x60,
   178     0x03, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x60, 0x03, 0x50, 0x05,
   179     0x20, 0x02, 0x40, 0x01, 0x80, 0x00, 0x00, 0x00
   180   };
   181 
   182 MAYBE_UNUSED static unsigned char vertd_ptrmask_bits[] =
   183   {
   184     0x00, 0x00, 0x80, 0x00, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07, 0xe0,
   185     0x03, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0xf0, 0x07,
   186     0xe0, 0x03, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00
   187   };
   188 
   189 MAYBE_UNUSED static unsigned char hourglass_bits[] =
   190   {
   191     0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x10, 0x04, 0x08, 0x08, 0x24,
   192     0x10, 0x44, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x88, 0x08,
   193     0x10, 0x04, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00
   194   };
   195 
   196 MAYBE_UNUSED static unsigned char hourglass_mask_bits[] =
   197   {
   198     0x00, 0x00, 0x00, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0xfc,
   199     0x1f, 0xfc, 0x1f, 0xfc, 0x1f, 0xfc, 0x1f, 0xfc, 0x1f, 0xf8, 0x0f,
   200     0xf0, 0x07, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00
   201   };
   202 
   203 #endif /* _HAIKU_GUI_H_ */

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