1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #ifndef _ANDROID_TERM_H_
21 #define _ANDROID_TERM_H_
22
23 #include "androidgui.h"
24 #include "frame.h"
25 #include "character.h"
26 #include "dispextern.h"
27 #include "font.h"
28
29 struct android_bitmap_record
30 {
31
32 android_pixmap pixmap, mask;
33
34
35 char *file;
36
37
38 int refcount;
39
40
41 int height, width, depth;
42
43
44 bool have_mask;
45 };
46
47 struct android_display_info
48 {
49
50 struct android_display_info *next;
51
52
53 struct terminal *terminal;
54
55
56 Emacs_Window root_window;
57
58
59
60 Lisp_Object name_list_element;
61
62
63 Lisp_Object color_map;
64
65
66 double resx, resy;
67
68
69
70
71 double font_resolution;
72
73
74 struct android_gc *scratch_cursor_gc;
75
76
77 Mouse_HLInfo mouse_highlight;
78
79
80 int n_planes;
81
82
83 int grabbed;
84
85
86 int smallest_char_width;
87
88
89 int smallest_font_height;
90
91
92 int n_fonts;
93
94
95 struct android_bitmap_record *bitmaps;
96
97
98 ptrdiff_t bitmaps_size;
99
100
101 ptrdiff_t bitmaps_last;
102
103
104 struct frame *focus_frame;
105
106
107 struct frame *x_focus_event_frame;
108
109
110
111
112 struct frame *highlight_frame;
113
114
115 struct frame *pending_autoraise_frame;
116
117
118
119 struct frame *last_mouse_frame;
120
121
122
123 struct frame *last_mouse_glyph_frame;
124
125
126
127 struct frame *last_mouse_motion_frame;
128
129
130
131
132
133 int last_mouse_motion_x, last_mouse_motion_y;
134
135
136 Emacs_Rectangle last_mouse_glyph;
137
138
139 Time last_mouse_movement_time;
140
141
142
143 int menu_event_id;
144
145
146 android_cursor invisible_cursor;
147 };
148
149
150
151
152 struct android_touch_point
153 {
154
155 struct android_touch_point *next;
156
157
158 int tool_id, x, y;
159
160
161 bool tool_bar_p;
162 };
163
164 struct android_output
165 {
166
167 struct android_gc *normal_gc, *reverse_gc, *cursor_gc;
168
169
170 Emacs_Window window;
171
172
173 Emacs_Window parent_desc;
174
175
176 struct font *font;
177
178
179 int baseline_offset;
180
181
182
183 int fontset;
184
185
186 unsigned long cursor_pixel;
187 unsigned long mouse_pixel;
188 unsigned long cursor_foreground_pixel;
189
190
191
192 unsigned long scroll_bar_foreground_pixel;
193
194
195
196
197 unsigned long scroll_bar_background_pixel;
198
199
200 Emacs_Cursor text_cursor;
201 Emacs_Cursor nontext_cursor;
202 Emacs_Cursor modeline_cursor;
203 Emacs_Cursor hand_cursor;
204 Emacs_Cursor hourglass_cursor;
205 Emacs_Cursor horizontal_drag_cursor;
206 Emacs_Cursor vertical_drag_cursor;
207 Emacs_Cursor current_cursor;
208 Emacs_Cursor left_edge_cursor;
209 Emacs_Cursor top_left_corner_cursor;
210 Emacs_Cursor top_edge_cursor;
211 Emacs_Cursor top_right_corner_cursor;
212 Emacs_Cursor right_edge_cursor;
213 Emacs_Cursor bottom_right_corner_cursor;
214 Emacs_Cursor bottom_edge_cursor;
215 Emacs_Cursor bottom_left_corner_cursor;
216
217
218 bool hourglass;
219
220
221 struct android_display_info *display_info;
222
223
224 bool_bf has_been_visible : 1;
225
226
227
228 bool_bf alpha_identical_p : 1;
229
230
231
232
233 bool_bf complete : 1;
234
235
236
237 bool_bf need_buffer_flip : 1;
238
239
240
241 bool_bf need_cursor_updates : 1;
242
243
244 struct relief {
245 struct android_gc *gc;
246 unsigned long pixel;
247 } black_relief, white_relief;
248
249
250
251 unsigned long relief_background;
252
253
254
255 int focus_state;
256
257
258
259 struct android_touch_point *touch_points;
260
261
262
263 int extracted_text_flags;
264
265
266 int extracted_text_token;
267
268
269 int extracted_text_hint;
270 };
271
272 enum
273 {
274
275
276
277
278
279 FOCUS_NONE = 0,
280 FOCUS_IMPLICIT = 1,
281 FOCUS_EXPLICIT = 2
282 };
283
284
285 #define FRAME_ANDROID_OUTPUT(f) ((f)->output_data.android)
286 #define FRAME_OUTPUT_DATA(f) ((f)->output_data.android)
287
288
289 #define FRAME_ANDROID_WINDOW(f) ((f)->output_data.android->window)
290 #define FRAME_NATIVE_WINDOW(f) ((f)->output_data.android->window)
291
292
293 #define FRAME_ANDROID_NEED_BUFFER_FLIP(f) \
294 ((f)->output_data.android->need_buffer_flip)
295
296
297
298
299
300 #define FRAME_ANDROID_DRAWABLE(f) \
301 (((f))->output_data.android->need_buffer_flip = true, \
302 FRAME_ANDROID_WINDOW ((f)))
303
304
305
306 #define FRAME_ANDROID_COMPLETE_P(f) \
307 ((f)->output_data.android->complete)
308
309 #define FRAME_FONT(f) ((f)->output_data.android->font)
310 #define FRAME_FONTSET(f) ((f)->output_data.android->fontset)
311
312 #define FRAME_BASELINE_OFFSET(f) \
313 ((f)->output_data.android->baseline_offset)
314
315
316
317 #define FRAME_DISPLAY_INFO(f) ((f)->output_data.android->display_info)
318
319
320 #define BLACK_PIX_DEFAULT(f) 0
321 #define WHITE_PIX_DEFAULT(f) 0xffffffff
322
323
324
325
326
327
328
329
330
331
332
333 struct scroll_bar
334 {
335
336 union vectorlike_header header;
337
338
339 Lisp_Object window;
340
341
342 Lisp_Object next, prev;
343
344
345
346
347 Emacs_Window x_window;
348
349
350
351 int top, left, width, height;
352
353
354
355
356
357
358
359
360
361
362
363
364 int start, end;
365
366
367
368
369
370 int dragging;
371
372
373 bool horizontal;
374 };
375
376
377 #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))
378
379
380
381
382
383
384 extern struct android_display_info *x_display_list;
385
386
387
388
389
390
391
392
393 extern void android_free_gcs (struct frame *);
394 extern void android_default_font_parameter (struct frame *, Lisp_Object);
395 extern void android_set_preeditarea (struct window *, int, int);
396
397
398
399 extern void android_term_init (void);
400 extern void android_set_window_size (struct frame *, bool, int, int);
401 extern void android_iconify_frame (struct frame *);
402 extern void android_make_frame_visible (struct frame *);
403 extern void android_make_frame_invisible (struct frame *);
404 extern void android_free_frame_resources (struct frame *);
405
406 extern int android_parse_color (struct frame *, const char *,
407 Emacs_Color *);
408 extern bool android_alloc_nearest_color (struct frame *, Emacs_Color *);
409 extern void android_query_colors (struct frame *, Emacs_Color *, int);
410 extern void android_clear_under_internal_border (struct frame *);
411
412 extern void syms_of_androidterm (void);
413 extern void mark_androidterm (void);
414
415
416
417 extern void android_change_tab_bar_height (struct frame *, int);
418 extern void android_change_tool_bar_height (struct frame *, int);
419 extern void android_set_scroll_bar_default_width (struct frame *);
420 extern void android_set_scroll_bar_default_height (struct frame *);
421 extern bool android_defined_color (struct frame *, const char *,
422 Emacs_Color *, bool, bool);
423 extern void android_implicitly_set_name (struct frame *, Lisp_Object,
424 Lisp_Object);
425 extern void android_explicitly_set_name (struct frame *, Lisp_Object,
426 Lisp_Object);
427
428 extern void syms_of_androidfns (void);
429
430
431
432 extern struct font_driver androidfont_driver;
433
434 extern void init_androidfont (void);
435 extern void syms_of_androidfont (void);
436
437 extern void android_finalize_font_entity (struct font_entity *);
438
439
440
441 #ifndef ANDROID_STUBIFY
442
443 extern unsigned int current_menu_serial;
444
445 #endif
446
447 extern Lisp_Object android_menu_show (struct frame *, int, int, int,
448 Lisp_Object, const char **);
449 extern Lisp_Object android_popup_dialog (struct frame *, Lisp_Object,
450 Lisp_Object);
451
452 extern void init_androidmenu (void);
453 extern void syms_of_androidmenu (void);
454
455
456
457 extern const struct font_driver android_sfntfont_driver;
458
459 extern void sfntfont_android_shrink_scanline_buffer (void);
460 extern void init_sfntfont_android (void);
461 extern void syms_of_sfntfont_android (void);
462
463
464
465 #ifndef ANDROID_STUBIFY
466
467 extern void init_androidselect (void);
468 extern void syms_of_androidselect (void);
469
470 #endif
471
472
473
474 #define RGB_TO_ULONG(r, g, b) (((r) << 16) | ((g) << 8) | (b))
475 #define RED_FROM_ULONG(color) (((color) >> 16) & 0xff)
476 #define GREEN_FROM_ULONG(color) (((color) >> 8) & 0xff)
477 #define BLUE_FROM_ULONG(color) ((color) & 0xff)
478
479
480
481 #endif