all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob f6c657cf4e4611a789d316f75787927e4b06a0e9 7460 bytes (raw)
name: src/haikuterm.h 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
 
/* Haiku window system support
   Copyright (C) 2021 Free Software Foundation, Inc.

This file is part of GNU Emacs.

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 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
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.  If not, see <https://www.gnu.org/licenses/>.  */

#ifndef _HAIKU_TERM_H_
#define _HAIKU_TERM_H_

#include <pthread.h>

#include "haikugui.h"
#include "frame.h"
#include "character.h"
#include "dispextern.h"
#include "font.h"

#define C_FRAME struct frame *
#define C_FONT struct font *
#define C_TERMINAL struct terminal *

#define HAVE_CHAR_CACHE_MAX 65535

extern int popup_activated_p ;
extern pthread_t app_thread_id;

struct haikufont_info
{
  struct font font;
  haiku be_font;
  ptrdiff_t charc_size;
  int *have_char_cache;
  struct font_metrics *met_cache;
};

struct haiku_bitmap_record
{
  haiku img;
  char *file;
  int refcount;
  int height, width, depth;
};

struct haiku_display_info
{
  /* Chain of all haiku_display_info structures. */
  struct haiku_display_info *next;
  C_TERMINAL terminal;

  Lisp_Object name_list_element;
  Lisp_Object color_map;

  int n_fonts;

  int smallest_char_width;
  int smallest_font_height;

  struct frame *focused_frame;
  struct frame *focus_event_frame;
  struct frame *last_mouse_glyph_frame;

  struct haiku_bitmap_record *bitmaps;
  ptrdiff_t bitmaps_size;
  ptrdiff_t bitmaps_last;

  int grabbed;
  int n_planes;
  int color_p;

  Window root_window;
  Lisp_Object rdb;

  Emacs_Cursor vertical_scroll_bar_cursor;
  Emacs_Cursor horizontal_scroll_bar_cursor;

  Mouse_HLInfo mouse_highlight;

  C_FRAME highlight_frame;
  C_FRAME last_mouse_frame;
  C_FRAME last_mouse_motion_frame;

  int last_mouse_motion_x;
  int last_mouse_motion_y;

  struct haiku_rect last_mouse_glyph;

  void *last_mouse_scroll_bar;

  haiku display;

  double resx, resy;
};

struct haiku_output
{
  Emacs_Cursor text_cursor;
  Emacs_Cursor nontext_cursor;
  Emacs_Cursor modeline_cursor;
  Emacs_Cursor hand_cursor;
  Emacs_Cursor hourglass_cursor;
  Emacs_Cursor horizontal_drag_cursor;
  Emacs_Cursor vertical_drag_cursor;
  Emacs_Cursor left_edge_cursor;
  Emacs_Cursor top_left_corner_cursor;
  Emacs_Cursor top_edge_cursor;
  Emacs_Cursor top_right_corner_cursor;
  Emacs_Cursor right_edge_cursor;
  Emacs_Cursor bottom_right_corner_cursor;
  Emacs_Cursor bottom_edge_cursor;
  Emacs_Cursor bottom_left_corner_cursor;
  Emacs_Cursor no_cursor;

  Emacs_Cursor current_cursor;

  struct haiku_display_info *display_info;

  int baseline_offset;
  int fontset;

  Emacs_Color cursor_color;

  Window window_desc, parent_desc;
  char explicit_parent;

  int titlebar_height;
  int toolbar_height;

  haiku window;
  haiku view;
  haiku menubar;

  int menu_up_to_date_p;

  C_FONT font;

  int hourglass_p;
  uint32_t cursor_fg;
  bool dirty_p;

  /* The pending position we're waiting for. */
  int pending_top, pending_left;
};

struct x_output
{
  /* Unused, makes term.c happy. */
};

extern struct haiku_display_info *x_display_list;
extern struct font_driver const haikufont_driver;

#ifdef HAVE_FREETYPE
extern struct font_driver const ftbefont_driver;
#ifdef HAVE_HARFBUZZ
extern struct font_driver ftbehbfont_driver;
#endif
#endif

struct scroll_bar
{
  /* These fields are shared by all vectors.  */
  union vectorlike_header header;

  /* The window we're a scroll bar for.  */
  Lisp_Object window;

  /* The next and previous in the chain of scroll bars in this frame.  */
  Lisp_Object next, prev;

  /* Fields after 'prev' are not traced by the GC.  */

  /* The position and size of the scroll bar in pixels, relative to the
     frame.  */
  int top, left, width, height;

  /* The actual scrollbar. */
  void *scroll_bar;

  /* Non-nil if the scroll bar handle is currently being dragged by
     the user.  */
  int dragging;

  /* The update position if we are waiting for a scrollbar update, or
     -1. */
  int update;

  /* The last known position of this scrollbar. */
  int position;

  /* The total number of units inside this scrollbar. */
  int total;

  /* True if the scroll bar is horizontal.  */
  bool horizontal;
};

#define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))

#define FRAME_DIRTY_P(f) (FRAME_OUTPUT_DATA (f)->dirty_p)
#define MAKE_FRAME_DIRTY(f) (FRAME_DIRTY_P (f) = 1)
#define FRAME_OUTPUT_DATA(f) ((f)->output_data.haiku)
#define FRAME_HAIKU_WINDOW(f) (FRAME_OUTPUT_DATA (f)->window)
#define FRAME_HAIKU_VIEW(f) ((MAKE_FRAME_DIRTY (f)), FRAME_OUTPUT_DATA (f)->view)
#define FRAME_HAIKU_MENU_BAR(f) (FRAME_OUTPUT_DATA (f)->menubar)
#define FRAME_DISPLAY_INFO(f) (FRAME_OUTPUT_DATA (f)->display_info)
#define FRAME_FONT(f) (FRAME_OUTPUT_DATA (f)->font)
#define FRAME_FONTSET(f) (FRAME_OUTPUT_DATA (f)->fontset)
#define FRAME_NATIVE_WINDOW(f) (FRAME_OUTPUT_DATA (f)->window)
#define FRAME_BASELINE_OFFSET(f) (FRAME_OUTPUT_DATA (f)->baseline_offset)
#define FRAME_CURSOR_COLOR(f) (FRAME_OUTPUT_DATA (f)->cursor_color)

extern void syms_of_haikuterm (void);
extern void syms_of_haikufns (void);
extern void syms_of_haikumenu (void);
extern void syms_of_haikufont (void);
extern void syms_of_haikuselect (void);
extern void init_haiku_select (void);

extern void haiku_iconify_frame (struct frame *);
extern void haiku_visualize_frame (struct frame *);
extern void haiku_unvisualize_frame (struct frame *);
extern void haiku_set_offset (struct frame *, int, int, int);
extern void haiku_set_frame_visible_invisible (struct frame *, bool);
extern void haiku_free_frame_resources (struct frame *f);
extern void haiku_scroll_bar_remove (struct scroll_bar *bar);
extern void haiku_clear_under_internal_border (struct frame *f);
extern void haiku_set_name (struct frame *f, Lisp_Object name, bool explicit_p);

extern struct haiku_display_info *haiku_term_init (void);

extern void mark_haiku_display (void);

extern int haiku_get_color (const char *name, Emacs_Color *color);
extern void haiku_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval);
extern void haiku_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval);
extern void haiku_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval);
extern void haiku_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval);
extern void haiku_change_tab_bar_height (struct frame *f, int height);
extern void haiku_change_tool_bar_height (struct frame *f, int height);

extern void haiku_query_color (uint32_t col, Emacs_Color *color);

extern unsigned long haiku_get_pixel (haiku bitmap, int x, int y);
extern void haiku_put_pixel (haiku bitmap, int x, int y, unsigned long pixel);

extern Lisp_Object haiku_menu_show (struct frame *f, int x, int y, int menu_flags,
				    Lisp_Object title, const char **error_name);
extern Lisp_Object haiku_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents);
extern void initialize_frame_menubar (struct frame *f);

#ifdef HAVE_FREETYPE
extern void syms_of_ftbefont (void);
#endif
#endif /* _HAIKU_TERM_H_ */

debug log:

solving f6c657cf4e ...
found f6c657cf4e in https://yhetil.org/emacs/87zgssfuz9.fsf@yahoo.com/

applying [1/1] https://yhetil.org/emacs/87zgssfuz9.fsf@yahoo.com/
diff --git a/src/haikuterm.h b/src/haikuterm.h
new file mode 100644
index 0000000000..f6c657cf4e

Checking patch src/haikuterm.h...
Applied patch src/haikuterm.h cleanly.

index at:
100644 f6c657cf4e4611a789d316f75787927e4b06a0e9	src/haikuterm.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.