root/src/haiku_support.h

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

INCLUDED FROM


     1 /* Haiku window system support.  Hey Emacs, this is -*- C++ -*-
     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_SUPPORT_H
    20 #define _HAIKU_SUPPORT_H
    21 
    22 #include <stdint.h>
    23 
    24 #ifdef HAVE_FREETYPE
    25 #include <ft2build.h>
    26 #include <fontconfig/fontconfig.h>
    27 #include FT_FREETYPE_H
    28 #include FT_SIZES_H
    29 #endif
    30 
    31 #ifdef USE_BE_CAIRO
    32 #include <cairo.h>
    33 #endif
    34 
    35 #include <math.h>
    36 
    37 #include <kernel/OS.h>
    38 
    39 enum haiku_cursor
    40   {
    41     CURSOR_ID_SYSTEM_DEFAULT               = 1,
    42     CURSOR_ID_CONTEXT_MENU                 = 3,
    43     CURSOR_ID_COPY                         = 4,
    44     CURSOR_ID_CREATE_LINK                  = 29,
    45     CURSOR_ID_CROSS_HAIR                   = 5,
    46     CURSOR_ID_FOLLOW_LINK                  = 6,
    47     CURSOR_ID_GRAB                         = 7,
    48     CURSOR_ID_GRABBING                     = 8,
    49     CURSOR_ID_HELP                         = 9,
    50     CURSOR_ID_I_BEAM                       = 2,
    51     CURSOR_ID_I_BEAM_HORIZONTAL            = 10,
    52     CURSOR_ID_MOVE                         = 11,
    53     CURSOR_ID_NO_CURSOR                    = 12,
    54     CURSOR_ID_NOT_ALLOWED                  = 13,
    55     CURSOR_ID_PROGRESS                     = 14,
    56     CURSOR_ID_RESIZE_NORTH                 = 15,
    57     CURSOR_ID_RESIZE_EAST                  = 16,
    58     CURSOR_ID_RESIZE_SOUTH                 = 17,
    59     CURSOR_ID_RESIZE_WEST                  = 18,
    60     CURSOR_ID_RESIZE_NORTH_EAST            = 19,
    61     CURSOR_ID_RESIZE_NORTH_WEST            = 20,
    62     CURSOR_ID_RESIZE_SOUTH_EAST            = 21,
    63     CURSOR_ID_RESIZE_SOUTH_WEST            = 22,
    64     CURSOR_ID_RESIZE_NORTH_SOUTH           = 23,
    65     CURSOR_ID_RESIZE_EAST_WEST             = 24,
    66     CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST = 25,
    67     CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST = 26,
    68     CURSOR_ID_ZOOM_IN                      = 27,
    69     CURSOR_ID_ZOOM_OUT                     = 28
    70   };
    71 
    72 enum haiku_z_group
    73   {
    74     Z_GROUP_ABOVE,
    75     Z_GROUP_NONE,
    76     Z_GROUP_BELOW,
    77   };
    78 
    79 enum haiku_alert_type
    80   {
    81     HAIKU_EMPTY_ALERT = 0,
    82     HAIKU_INFO_ALERT,
    83     HAIKU_IDEA_ALERT,
    84     HAIKU_WARNING_ALERT,
    85     HAIKU_STOP_ALERT
    86   };
    87 
    88 enum haiku_event_type
    89   {
    90     QUIT_REQUESTED,
    91     FRAME_RESIZED,
    92     FRAME_EXPOSED,
    93     KEY_DOWN,
    94     KEY_UP,
    95     ACTIVATION,
    96     MOUSE_MOTION,
    97     BUTTON_DOWN,
    98     BUTTON_UP,
    99     ICONIFICATION,
   100     MOVE_EVENT,
   101     SCROLL_BAR_VALUE_EVENT,
   102     SCROLL_BAR_PART_EVENT,
   103     SCROLL_BAR_DRAG_EVENT,
   104     WHEEL_MOVE_EVENT,
   105     MENU_BAR_RESIZE,
   106     MENU_BAR_CLICK,
   107     MENU_BAR_OPEN,
   108     MENU_BAR_SELECT_EVENT,
   109     MENU_BAR_CLOSE,
   110     MENU_BAR_HELP_EVENT,
   111     ZOOM_EVENT,
   112     DRAG_AND_DROP_EVENT,
   113     APP_QUIT_REQUESTED_EVENT,
   114     DUMMY_EVENT,
   115     SCREEN_CHANGED_EVENT,
   116     MENU_BAR_LEFT,
   117     CLIPBOARD_CHANGED_EVENT,
   118     FONT_CHANGE_EVENT,
   119   };
   120 
   121 struct haiku_clipboard_changed_event
   122 {
   123   char dummy;
   124 };
   125 
   126 struct haiku_screen_changed_event
   127 {
   128   bigtime_t when;
   129 };
   130 
   131 struct haiku_quit_requested_event
   132 {
   133   void *window;
   134 };
   135 
   136 struct haiku_resize_event
   137 {
   138   void *window;
   139   float width;
   140   float height;
   141 };
   142 
   143 struct haiku_expose_event
   144 {
   145   void *window;
   146   int x;
   147   int y;
   148   int width;
   149   int height;
   150 };
   151 
   152 struct haiku_drag_and_drop_event
   153 {
   154   void *window;
   155   int x, y;
   156   void *message;
   157 };
   158 
   159 struct haiku_app_quit_requested_event
   160 {
   161   char dummy;
   162 };
   163 
   164 struct haiku_dummy_event
   165 {
   166   char dummy;
   167 };
   168 
   169 enum haiku_modifier_specification
   170   {
   171     HAIKU_MODIFIER_ALT   = 1,
   172     HAIKU_MODIFIER_CTRL  = (1 << 1),
   173     HAIKU_MODIFIER_SHIFT = (1 << 2),
   174     HAIKU_MODIFIER_SUPER = (1 << 3),
   175   };
   176 
   177 struct haiku_key_event
   178 {
   179   void *window;
   180   int modifiers;
   181   unsigned keysym;
   182   uint32_t multibyte_char;
   183 
   184   /* Time the keypress occurred, in microseconds.  */
   185   bigtime_t time;
   186 };
   187 
   188 struct haiku_activation_event
   189 {
   190   void *window;
   191   int activated_p;
   192 };
   193 
   194 struct haiku_mouse_motion_event
   195 {
   196   void *window;
   197   bool just_exited_p;
   198   int x;
   199   int y;
   200   bigtime_t time;
   201   bool dnd_message;
   202 };
   203 
   204 struct haiku_menu_bar_left_event
   205 {
   206   void *window;
   207   int x, y;
   208 };
   209 
   210 struct haiku_menu_bar_click_event
   211 {
   212   void *window;
   213   int x, y;
   214 };
   215 
   216 struct haiku_button_event
   217 {
   218   void *window;
   219   void *scroll_bar;
   220   int btn_no;
   221   int modifiers;
   222   int x;
   223   int y;
   224   bigtime_t time;
   225 };
   226 
   227 struct haiku_iconification_event
   228 {
   229   void *window;
   230   int iconified_p;
   231 };
   232 
   233 struct haiku_move_event
   234 {
   235   void *window;
   236   int x, y;
   237   int decorator_width;
   238   int decorator_height;
   239 };
   240 
   241 struct haiku_wheel_move_event
   242 {
   243   void *window;
   244   int modifiers;
   245   float delta_x;
   246   float delta_y;
   247 };
   248 
   249 struct haiku_menu_bar_select_event
   250 {
   251   void *window;
   252   void *ptr;
   253 };
   254 
   255 struct haiku_menu_bar_help_event
   256 {
   257   void *window;
   258   int mb_idx;
   259   void *data;
   260   bool highlight_p;
   261 };
   262 
   263 struct haiku_zoom_event
   264 {
   265   void *window;
   266   int fullscreen_mode;
   267 };
   268 
   269 enum haiku_font_specification
   270   {
   271     FSPEC_FAMILY      = 1,
   272     FSPEC_STYLE       = 1 << 1,
   273     FSPEC_SLANT       = 1 << 2,
   274     FSPEC_WEIGHT      = 1 << 3,
   275     FSPEC_SPACING     = 1 << 4,
   276     FSPEC_WANTED      = 1 << 5,
   277     FSPEC_NEED_ONE_OF = 1 << 6,
   278     FSPEC_WIDTH       = 1 << 7,
   279     FSPEC_LANGUAGE    = 1 << 8,
   280     FSPEC_INDICES     = 1 << 9,
   281     FSPEC_ANTIALIAS   = 1 << 10,
   282   };
   283 
   284 typedef char haiku_font_family_or_style[64];
   285 
   286 enum haiku_font_slant
   287   {
   288     NO_SLANT = -1,
   289     SLANT_OBLIQUE,
   290     SLANT_REGULAR,
   291     SLANT_ITALIC
   292   };
   293 
   294 enum haiku_font_width
   295   {
   296     NO_WIDTH = -1,
   297     ULTRA_CONDENSED,
   298     EXTRA_CONDENSED,
   299     CONDENSED,
   300     SEMI_CONDENSED,
   301     NORMAL_WIDTH,
   302     SEMI_EXPANDED,
   303     EXPANDED,
   304     EXTRA_EXPANDED,
   305     ULTRA_EXPANDED
   306   };
   307 
   308 enum haiku_font_language
   309   {
   310     LANGUAGE_CN,
   311     LANGUAGE_KO,
   312     LANGUAGE_JP,
   313     MAX_LANGUAGE /* This isn't a language. */
   314   };
   315 
   316 enum haiku_font_weight
   317   {
   318     NO_WEIGHT         = -1,
   319     HAIKU_THIN        = 0,
   320     HAIKU_EXTRALIGHT  = 40,
   321     HAIKU_LIGHT       = 50,
   322     HAIKU_SEMI_LIGHT  = 75,
   323     HAIKU_REGULAR     = 100,
   324     HAIKU_SEMI_BOLD   = 180,
   325     HAIKU_BOLD        = 200,
   326     HAIKU_EXTRA_BOLD  = 205,
   327     HAIKU_BOOK        = 400,
   328     HAIKU_HEAVY       = 800,
   329     HAIKU_ULTRA_HEAVY = 900,
   330     HAIKU_BLACK       = 1000,
   331     HAIKU_MEDIUM      = 2000,
   332   };
   333 
   334 enum haiku_fullscreen_mode
   335   {
   336     FULLSCREEN_MODE_NONE,
   337     FULLSCREEN_MODE_WIDTH,
   338     FULLSCREEN_MODE_HEIGHT,
   339     FULLSCREEN_MODE_BOTH,
   340     FULLSCREEN_MODE_MAXIMIZED,
   341   };
   342 
   343 struct haiku_font_pattern
   344 {
   345   /* Bitmask indicating which fields are set.  */
   346   int specified;
   347 
   348   /* The next font in this list.  */
   349   struct haiku_font_pattern *next;
   350 
   351   /* The last font in the list during font lookup.  */
   352   struct haiku_font_pattern *last;
   353 
   354   /* The next font in the list whose family differs from this one.
   355      Only valid during font lookup.  */
   356   struct haiku_font_pattern *next_family;
   357 
   358   /* The family of the font.  */
   359   haiku_font_family_or_style family;
   360 
   361   /* The style of the font.  */
   362   haiku_font_family_or_style style;
   363 
   364   /* Whether or the font is monospace.  */
   365   int mono_spacing_p;
   366 
   367   /* The slant of the font.  */
   368   enum haiku_font_slant slant;
   369 
   370   /* The width of the font.  */
   371   enum haiku_font_width width;
   372 
   373   /* The language of the font.  Used during font lookup.  */
   374   enum haiku_font_language language;
   375 
   376   /* The weight of the font.  */
   377   enum haiku_font_weight weight;
   378 
   379   /* List of characters that must be present in the font for the match
   380      to succeed.  */
   381   int *wanted_chars;
   382 
   383   /* The number of characters in `wanted_chars'.  */
   384   int want_chars_len;
   385 
   386   /* List of characters.  The font must fulfill at least one of
   387      them for the match to succeed.  */
   388   int *need_one_of;
   389 
   390   /* The number of characters in `need_one_of'.  */
   391   int need_one_of_len;
   392 
   393   /* The index of the family of the font this pattern represents.  */
   394   int family_index;
   395 
   396   /* The index of the style of the font this pattern represents.  */
   397   int style_index;
   398 
   399   /* Temporary field used during font enumeration.  */
   400   int oblique_seen_p;
   401 
   402   /* Whether or not to enable antialiasing in the font.  This field is
   403      special in that it's not handled by `BFont_open_pattern'.  */
   404   int use_antialiasing;
   405 };
   406 
   407 struct haiku_scroll_bar_value_event
   408 {
   409   void *scroll_bar;
   410   void *window;
   411   int position;
   412 };
   413 
   414 struct haiku_scroll_bar_drag_event
   415 {
   416   void *scroll_bar;
   417   void *window;
   418   int dragging_p;
   419 };
   420 
   421 enum haiku_scroll_bar_part
   422   {
   423     HAIKU_SCROLL_BAR_UP_BUTTON,
   424     HAIKU_SCROLL_BAR_DOWN_BUTTON
   425   };
   426 
   427 struct haiku_scroll_bar_part_event
   428 {
   429   void *scroll_bar;
   430   void *window;
   431   enum haiku_scroll_bar_part part;
   432 };
   433 
   434 struct haiku_menu_bar_resize_event
   435 {
   436   void *window;
   437   int width;
   438   int height;
   439 };
   440 
   441 struct haiku_menu_bar_state_event
   442 {
   443   void *window;
   444 };
   445 
   446 enum haiku_what_font
   447   {
   448     FIXED_FAMILY,
   449     FIXED_STYLE,
   450     DEFAULT_FAMILY,
   451     DEFAULT_STYLE,
   452   };
   453 
   454 struct haiku_font_change_event
   455 {
   456   /* New family, style and size of the font.  */
   457   haiku_font_family_or_style new_family;
   458   haiku_font_family_or_style new_style;
   459   int new_size;
   460 
   461   /* What changed.  FIXED_FAMILY means this is the new fixed font.
   462      DEFAULT_FAMILY means this is the new plain font.  The other enums
   463      have no meaning.  */
   464   enum haiku_what_font what;
   465 };
   466 
   467 struct haiku_session_manager_reply
   468 {
   469   bool quit_reply;
   470 };
   471 
   472 #ifdef __cplusplus
   473 /* Haiku's built in Height and Width functions for calculating
   474    rectangle sizes are broken, probably for compatibility with BeOS:
   475    they do not round up in a reasonable fashion, and they return the
   476    numerical difference between the end and start sides in both
   477    directions, instead of the actual size.
   478 
   479    For example:
   480 
   481      BRect (1, 1, 5, 5).IntegerWidth ()
   482 
   483    Will return 4, when in reality the rectangle is 5 pixels wide,
   484    since the left corner is also a pixel!
   485 
   486    All code in Emacs should use the macros below to calculate the
   487    dimensions of a BRect, instead of relying on the broken Width and
   488    Height functions.  */
   489 
   490 #define BE_RECT_HEIGHT(rect)    (ceil (((rect).bottom - (rect).top) + 1))
   491 #define BE_RECT_WIDTH(rect)     (ceil (((rect).right - (rect).left) + 1))
   492 #endif /* __cplusplus */
   493 
   494 #ifdef __cplusplus
   495 extern "C"
   496 {
   497 #endif
   498 #include <OS.h>
   499 
   500 #ifdef __cplusplus
   501 typedef void *haiku;
   502 
   503 extern void haiku_put_pixel (haiku, int, int, unsigned long);
   504 extern unsigned long haiku_get_pixel (haiku, int, int);
   505 #endif
   506 
   507 extern port_id port_application_to_emacs;
   508 extern port_id port_popup_menu_to_emacs;
   509 extern port_id port_emacs_to_session_manager;
   510 
   511 extern void haiku_io_init (void);
   512 extern void haiku_io_init_in_app_thread (void);
   513 
   514 extern void haiku_read_size (ssize_t *, bool);
   515 
   516 extern int haiku_read (enum haiku_event_type *, void *, ssize_t);
   517 extern int haiku_read_with_timeout (enum haiku_event_type *, void *, ssize_t,
   518                                     bigtime_t, bool);
   519 extern int haiku_write (enum haiku_event_type, void *);
   520 extern int haiku_write_without_signal (enum haiku_event_type, void *, bool);
   521 
   522 extern void rgb_color_hsl (uint32_t, double *, double *, double *);
   523 extern void hsl_color_rgb (double, double, double, uint32_t *);
   524 
   525 extern void *BBitmap_new (int, int, int);
   526 extern void *BBitmap_data (void *);
   527 extern int BBitmap_convert (void *, void **);
   528 extern void be_draw_cross_on_pixmap (void *, int, int, int, int,
   529                                      uint32_t);
   530 
   531 extern void BBitmap_free (void *);
   532 
   533 extern void BBitmap_dimensions (void *, int *, int *,  int *, int *,
   534                                 int32_t *, int *);
   535 extern void *BApplication_setup (void);
   536 extern void *BWindow_new (void **);
   537 extern void BWindow_quit (void *);
   538 
   539 extern void BWindow_set_offset (void *, int, int);
   540 extern void BWindow_iconify (void *);
   541 extern void BWindow_set_visible (void *, int);
   542 extern void BWindow_retitle (void *, const char *);
   543 extern void BWindow_resize (void *, int, int);
   544 extern void BWindow_activate (void *);
   545 extern void BWindow_center_on_screen (void *);
   546 extern void BWindow_change_decoration (void *, int);
   547 extern void BWindow_set_tooltip_decoration (void *);
   548 extern void BWindow_set_avoid_focus (void *, int);
   549 extern void BWindow_set_size_alignment (void *, int, int);
   550 extern void BWindow_sync (void *);
   551 extern void BWindow_send_behind (void *, void *);
   552 extern bool BWindow_is_active (void *);
   553 extern void BWindow_set_override_redirect (void *, bool);
   554 extern void BWindow_dimensions (void *, int *, int *);
   555 extern void BWindow_set_z_group (void *, enum haiku_z_group);
   556 extern void BWindow_set_sticky (void *, bool);
   557 extern void BWindow_Flush (void *);
   558 
   559 extern void BFont_close (void *);
   560 extern void BFont_metrics (void *, int *, int *, int *, int *,
   561                            int *, int *, int *, int *, int *, int *);
   562 extern int BFont_have_char_p (void *, int32_t);
   563 extern int BFont_have_char_block (void *, int32_t, int32_t);
   564 extern void BFont_char_bounds (void *, const char *, int *, int *, int *);
   565 extern void BFont_nchar_bounds (void *, const char *, int *, int *,
   566                                 int *, int32_t);
   567 extern struct haiku_font_pattern *BFont_find (struct haiku_font_pattern *);
   568 
   569 extern void BView_StartClip (void *);
   570 extern void BView_EndClip (void *);
   571 extern void BView_SetHighColor (void *, uint32_t);
   572 extern void BView_SetLowColor (void *, uint32_t);
   573 extern void BView_SetPenSize (void *, int);
   574 extern void BView_SetFont (void *, void *);
   575 extern void BView_MovePenTo (void *, int, int);
   576 extern void BView_DrawString (void *, const char *, ptrdiff_t);
   577 extern void BView_DrawChar (void *, char);
   578 extern void BView_FillRectangle (void *, int, int, int, int);
   579 extern void BView_FillRectangleAbs (void *, int, int, int, int);
   580 extern void BView_FillTriangle (void *, int, int, int, int, int, int);
   581 extern void BView_StrokeRectangle (void *, int, int, int, int);
   582 extern void BView_SetViewColor (void *, uint32_t);
   583 extern void BView_ClipToRect (void *, int, int, int, int);
   584 extern void BView_ClipToInverseRect (void *, int, int, int, int);
   585 extern void BView_StrokeLine (void *, int, int, int, int);
   586 extern void BView_CopyBits (void *, int, int, int, int, int, int, int, int);
   587 extern void BView_InvertRect (void *, int, int, int, int);
   588 extern void BView_DrawBitmap (void *, void *, int, int, int, int, int, int,
   589                               int, int, bool);
   590 extern void BView_DrawBitmapWithEraseOp (void *, void *, int, int, int, int);
   591 extern void BView_DrawBitmapTiled (void *, void *, int, int,
   592                                    int, int, int, int, int, int);
   593 
   594 extern void BView_resize_to (void *, int, int);
   595 extern void BView_set_view_cursor (void *, void *);
   596 extern void BView_move_frame (void *, int, int, int, int);
   597 extern void BView_scroll_bar_update (void *, int, int, int, int, bool);
   598 
   599 extern void *be_transform_bitmap (void *, void *, uint32_t, double,
   600                                   int, int, bool);
   601 extern void be_apply_affine_transform (void *, double, double, double,
   602                                        double, double, double);
   603 extern void be_apply_inverse_transform (double (*)[3], int, int, int *, int *);
   604 extern void be_draw_image_mask (void *, void *, int, int, int, int, int, int,
   605                                 int, int, uint32_t);
   606 extern void be_draw_bitmap_with_mask (void *, void *, void *, int, int, int,
   607                                       int, int, int, int, int, bool);
   608 
   609 extern void be_get_display_resolution (double *, double *);
   610 extern void be_get_screen_dimensions (int *, int *);
   611 
   612 /* Functions for creating and freeing cursors.  */
   613 extern void *be_create_cursor_from_id (int);
   614 extern void *be_create_pixmap_cursor (void *, int, int);
   615 extern void be_delete_cursor (void *);
   616 
   617 extern void *be_make_scroll_bar_for_view (void *, int, int, int, int, int);
   618 extern void BScrollBar_delete (void *);
   619 extern int BScrollBar_default_size (int);
   620 
   621 extern void BView_invalidate (void *);
   622 extern void BView_draw_lock (void *, bool, int, int, int, int);
   623 extern void BView_invalidate_region (void *, int, int, int, int);
   624 extern void BView_draw_unlock (void *);
   625 extern void BBitmap_import_fringe_bitmap (void *, unsigned short *, int, int);
   626 
   627 extern void haiku_font_pattern_free (struct haiku_font_pattern *);
   628 
   629 extern int BFont_open_pattern (struct haiku_font_pattern *, void **, float);
   630 extern void BFont_populate_fixed_family (struct haiku_font_pattern *);
   631 extern void BFont_populate_plain_family (struct haiku_font_pattern *);
   632 
   633 extern void BView_publish_scroll_bar (void *, int, int, int, int);
   634 extern void BView_forget_scroll_bar (void *, int, int, int, int);
   635 extern bool BView_inside_scroll_bar (void *, int, int);
   636 extern void BView_get_mouse (void *, int *, int *);
   637 extern void BView_convert_to_screen (void *, int *, int *);
   638 extern void BView_convert_from_screen (void *, int *, int *);
   639 
   640 extern void BView_emacs_delete (void *);
   641 
   642 extern void *BPopUpMenu_new (const char *);
   643 
   644 extern void BMenu_add_item (void *, const char *, void *, bool,
   645                             bool, bool, void *, const char *,
   646                             const char *);
   647 extern void BMenu_add_separator (void *);
   648 extern void *BMenu_new_submenu (void *, const char *, bool);
   649 extern void *BMenu_new_menu_bar_submenu (void *, const char *);
   650 extern int BMenu_count_items (void *);
   651 extern void *BMenu_item_at (void *, int);
   652 extern void *BMenu_run (void *, int, int, void (*) (void *, void *),
   653                         void (*) (void), void (*) (void),
   654                         struct timespec (*) (void), void *);
   655 extern void BPopUpMenu_delete (void *);
   656 extern void *BMenuBar_new (void *);
   657 extern void BMenu_delete_all (void *);
   658 extern void BMenuBar_delete (void *);
   659 extern void BMenu_item_set_label (void *, const char *);
   660 extern void *BMenu_item_get_menu (void *);
   661 extern void BMenu_delete_from (void *, int, int);
   662 
   663 extern void haiku_ring_bell (void);
   664 
   665 extern void *BAlert_new (const char *, enum haiku_alert_type);
   666 extern void *BAlert_add_button (void *, const char *);
   667 extern void BAlert_set_offset_spacing (void *);
   668 extern int32 BAlert_go (void *, void (*) (void), void (*) (void),
   669                         void (*) (void));
   670 extern void BButton_set_enabled (void *, int);
   671 extern void BView_set_tooltip (void *, const char *);
   672 extern void BView_show_tooltip (void *);
   673 extern void be_show_sticky_tooltip (void *, const char *, int, int);
   674 
   675 extern void BAlert_delete (void *);
   676 
   677 extern void EmacsWindow_parent_to (void *, void *);
   678 extern void EmacsWindow_unparent (void *);
   679 extern void EmacsWindow_move_weak_child (void *, void *, int, int);
   680 
   681 extern void be_get_version_string (char *, int);
   682 extern int be_get_display_planes (void);
   683 extern int be_get_display_color_cells (void);
   684 extern bool be_is_display_grayscale (void);
   685 extern void be_warp_pointer (int, int);
   686 
   687 extern void EmacsView_set_up_double_buffering (void *);
   688 extern void EmacsView_disable_double_buffering (void *);
   689 extern void EmacsView_flip_and_blit (void *);
   690 extern int EmacsView_double_buffered_p (void *);
   691 
   692 extern char *be_popup_file_dialog (int, const char *, int,
   693                                    int, void *, const char *,
   694                                    const char *, void (*) (void));
   695 
   696 #ifdef HAVE_NATIVE_IMAGE_API
   697 extern int be_can_translate_type_to_bitmap_p (const char *);
   698 extern void *be_translate_bitmap_from_file_name (const char *);
   699 extern void *be_translate_bitmap_from_memory (const void *, size_t);
   700 #endif
   701 
   702 extern bool BMenuBar_start_tracking (void *);
   703 extern size_t BBitmap_bytes_length (void *);
   704 
   705 #ifdef USE_BE_CAIRO
   706 extern cairo_t *EmacsView_cairo_context (void *);
   707 extern void BView_cr_dump_clipping (void *, cairo_t *);
   708 extern void EmacsWindow_begin_cr_critical_section (void *);
   709 extern void EmacsWindow_end_cr_critical_section (void *);
   710 #endif
   711 
   712 extern void BMenu_add_title (void *, const char *);
   713 
   714 extern int be_plain_font_height (void);
   715 extern int be_string_width_with_plain_font (const char *);
   716 extern void be_init_font_data (void);
   717 extern void be_evict_font_cache (void);
   718 extern int be_get_display_screens (void);
   719 extern bool be_use_subpixel_antialiasing (void);
   720 extern const char *be_find_setting (const char *);
   721 extern haiku_font_family_or_style *be_list_font_families (size_t *);
   722 extern void be_font_style_to_flags (const char *, struct haiku_font_pattern *);
   723 extern void *be_open_font_at_index (int, int, float);
   724 extern void be_set_font_antialiasing (void *, bool);
   725 extern int be_get_ui_color (const char *, uint32_t *);
   726 
   727 extern void BMessage_delete (void *);
   728 
   729 extern bool be_drag_message (void *, void *, bool, void (*) (void),
   730                              void (*) (void), void (*) (void),
   731                              bool (*) (void));
   732 extern bool be_drag_and_drop_in_progress (void);
   733 
   734 extern bool be_replay_menu_bar_event (void *, struct haiku_menu_bar_click_event *);
   735 extern bool be_select_font (void (*) (void), bool (*) (void),
   736                             haiku_font_family_or_style *,
   737                             haiku_font_family_or_style *,
   738                             int *, bool, int, int, int,
   739                             bool, bool *);
   740 
   741 extern int be_find_font_indices (struct haiku_font_pattern *, int *, int *);
   742 extern status_t be_roster_launch (const char *, const char *, char **,
   743                                   ptrdiff_t, void *, team_id *);
   744 extern void be_get_window_decorator_dimensions (void *, int *, int *, int *, int *);
   745 extern void be_get_window_decorator_frame (void *, int *, int *, int *, int *);
   746 extern void be_send_move_frame_event (void *);
   747 extern void be_set_window_fullscreen_mode (void *, enum haiku_fullscreen_mode);
   748 
   749 extern status_t be_write_node_message (const char *, const char *, void *);
   750 extern void be_send_message (const char *, void *);
   751 
   752 extern void be_lock_window (void *);
   753 extern void be_unlock_window (void *);
   754 extern bool be_get_explicit_workarea (int *, int *, int *, int *);
   755 extern void be_clear_grab_view (void);
   756 extern void be_set_use_frame_synchronization (void *, bool);
   757 
   758 extern void be_listen_font_settings (void);
   759 
   760 extern bool be_lock_font_defaults (void);
   761 extern const char *be_get_font_default (enum haiku_what_font);
   762 extern int be_get_font_size (enum haiku_what_font);
   763 extern void be_unlock_font_defaults (void);
   764 #ifdef __cplusplus
   765 }
   766 
   767 extern _Noreturn void gui_abort (const char *);
   768 extern void *find_appropriate_view_for_draw (void *);
   769 #endif /* _cplusplus */
   770 
   771 #endif /* _HAIKU_SUPPORT_H_ */
   772 
   773 // Local Variables:
   774 // eval: (setf (alist-get 'inextern-lang c-offsets-alist) 0)
   775 // End:

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