diff options
| author | Po Lu | 2023-01-14 22:12:16 +0800 |
|---|---|---|
| committer | Po Lu | 2023-01-14 22:12:16 +0800 |
| commit | 2b87ab7b27163fbd7b6b64c5a44e26b0e692c00a (patch) | |
| tree | 3ab31df90bd435009d2d42b636ce3baf33bd2b28 /src/androidterm.c | |
| parent | 28a9baccd4c8e997895d3adb3cfce4a11fa29896 (diff) | |
| download | emacs-2b87ab7b27163fbd7b6b64c5a44e26b0e692c00a.tar.gz emacs-2b87ab7b27163fbd7b6b64c5a44e26b0e692c00a.zip | |
Update Android port
* java/Makefile.in (clean): Fix distclean and bootstrap-clean rules.
* java/debug.sh (jdb_port):
(attach_existing):
(num_pids):
(line): Add new options to upload a gdbserver binary to the device.
* java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): Make
focusedActivities public.
* java/org/gnu/emacs/EmacsContextMenu.java (EmacsContextMenu):
New class.
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Fix
bounds computation.
* java/org/gnu/emacs/EmacsGC.java (markDirty): Set stroke width
explicitly.
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(getLocationOnScreen, nameKeysym): New functions.
* java/org/gnu/emacs/EmacsView.java (EmacsView): Disable focus
highlight.
(onCreateContextMenu, popupMenu, cancelPopupMenu): New
functions.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): Implement a
kind of ``override redirect'' window for tooltips.
* src/android.c (struct android_emacs_service): New method
`name_keysym'.
(android_run_select_thread, android_init_events):
(android_select): Release select thread on semaphores instead of
signals to avoid one nasty race on SIGUSR2 delivery.
(android_init_emacs_service): Initialize new method.
(android_create_window): Handle CW_OVERRIDE_REDIRECT.
(android_move_resize_window, android_map_raised)
(android_translate_coordinates, android_get_keysym_name)
(android_build_string, android_exception_check): New functions.
* src/android.h: Update prototypes.
* src/androidfns.c (android_set_parent_frame, Fx_create_frame)
(unwind_create_tip_frame, android_create_tip_frame)
(android_hide_tip, compute_tip_xy, Fx_show_tip, Fx_hide_tip)
(syms_of_androidfns): Implement tooltips and iconification
reporting.
* src/androidgui.h (enum android_window_value_mask): Add
CWOverrideRedirect.
(struct android_set_window_attributes): Add `override_redirect'.
(ANDROID_IS_MODIFIER_KEY): Recognize Caps Lock.
* src/androidmenu.c (struct android_emacs_context_menu): New
struct.
(android_init_emacs_context_menu, android_unwind_local_frame)
(android_push_local_frame, android_menu_show, init_androidmenu):
New functions.
* src/androidterm.c (handle_one_android_event): Fix NULL pointer
dereference.
(android_fullscreen_hook): Handle fullscreen correctly.
(android_draw_box_rect): Fix top line.
(get_keysym_name): Implement function.
(android_create_terminal): Remove scroll bar stubs and add menu
hook.
* src/androidterm.h: Update prototypes.
* src/emacs.c (android_emacs_init): Initialize androidmenu.c.
* xcompile/Makefile.in: Fix clean rules.
Diffstat (limited to 'src/androidterm.c')
| -rw-r--r-- | src/androidterm.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/androidterm.c b/src/androidterm.c index a8325312498..002d39af707 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -559,6 +559,9 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 559 | f = android_window_to_frame (dpyinfo, | 559 | f = android_window_to_frame (dpyinfo, |
| 560 | configureEvent.xconfigure.window); | 560 | configureEvent.xconfigure.window); |
| 561 | 561 | ||
| 562 | if (!f) | ||
| 563 | goto OTHER; | ||
| 564 | |||
| 562 | int width = configureEvent.xconfigure.width; | 565 | int width = configureEvent.xconfigure.width; |
| 563 | int height = configureEvent.xconfigure.height; | 566 | int height = configureEvent.xconfigure.height; |
| 564 | 567 | ||
| @@ -884,10 +887,6 @@ handle_one_android_event (struct android_display_info *dpyinfo, | |||
| 884 | inev.ie.arg = tab_bar_arg; | 887 | inev.ie.arg = tab_bar_arg; |
| 885 | } | 888 | } |
| 886 | } | 889 | } |
| 887 | else | ||
| 888 | { | ||
| 889 | /* TODO: scroll bars */ | ||
| 890 | } | ||
| 891 | 890 | ||
| 892 | if (event->type == ANDROID_BUTTON_PRESS) | 891 | if (event->type == ANDROID_BUTTON_PRESS) |
| 893 | { | 892 | { |
| @@ -1451,7 +1450,12 @@ android_make_frame_visible_invisible (struct frame *f, bool visible) | |||
| 1451 | static void | 1450 | static void |
| 1452 | android_fullscreen_hook (struct frame *f) | 1451 | android_fullscreen_hook (struct frame *f) |
| 1453 | { | 1452 | { |
| 1454 | /* TODO */ | 1453 | /* Explicitly setting fullscreen is not supported on Android. */ |
| 1454 | |||
| 1455 | if (!FRAME_PARENT_FRAME (f)) | ||
| 1456 | store_frame_param (f, Qfullscreen, Qmaximized); | ||
| 1457 | else | ||
| 1458 | store_frame_param (f, Qfullscreen, Qnil); | ||
| 1455 | } | 1459 | } |
| 1456 | 1460 | ||
| 1457 | void | 1461 | void |
| @@ -2360,7 +2364,7 @@ android_draw_box_rect (struct glyph_string *s, | |||
| 2360 | 2364 | ||
| 2361 | /* Top. */ | 2365 | /* Top. */ |
| 2362 | android_fill_rectangle (FRAME_ANDROID_DRAWABLE (s->f), s->gc, left_x, | 2366 | android_fill_rectangle (FRAME_ANDROID_DRAWABLE (s->f), s->gc, left_x, |
| 2363 | left_x, right_x - left_x + 1, hwidth); | 2367 | top_y, right_x - left_x + 1, hwidth); |
| 2364 | 2368 | ||
| 2365 | /* Left. */ | 2369 | /* Left. */ |
| 2366 | if (left_p) | 2370 | if (left_p) |
| @@ -3958,7 +3962,14 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) | |||
| 3958 | char * | 3962 | char * |
| 3959 | get_keysym_name (int keysym) | 3963 | get_keysym_name (int keysym) |
| 3960 | { | 3964 | { |
| 3961 | return (char *) "UNKNOWN KEYSYM"; | 3965 | static char buffer[64]; |
| 3966 | |||
| 3967 | #ifndef ANDROID_STUBIFY | ||
| 3968 | android_get_keysym_name (keysym, buffer, 64); | ||
| 3969 | #else | ||
| 3970 | emacs_abort (); | ||
| 3971 | #endif | ||
| 3972 | return buffer; | ||
| 3962 | } | 3973 | } |
| 3963 | 3974 | ||
| 3964 | 3975 | ||
| @@ -4009,20 +4020,13 @@ android_create_terminal (struct android_display_info *dpyinfo) | |||
| 4009 | terminal->set_new_font_hook = android_new_font; | 4020 | terminal->set_new_font_hook = android_new_font; |
| 4010 | terminal->set_bitmap_icon_hook = android_bitmap_icon; | 4021 | terminal->set_bitmap_icon_hook = android_bitmap_icon; |
| 4011 | terminal->implicit_set_name_hook = android_implicitly_set_name; | 4022 | terminal->implicit_set_name_hook = android_implicitly_set_name; |
| 4012 | /* terminal->menu_show_hook = android_menu_show; XXX */ | 4023 | terminal->menu_show_hook = android_menu_show; |
| 4013 | terminal->change_tab_bar_height_hook = android_change_tab_bar_height; | 4024 | terminal->change_tab_bar_height_hook = android_change_tab_bar_height; |
| 4014 | terminal->change_tool_bar_height_hook = android_change_tool_bar_height; | 4025 | terminal->change_tool_bar_height_hook = android_change_tool_bar_height; |
| 4015 | /* terminal->set_vertical_scroll_bar_hook */ | ||
| 4016 | /* = android_set_vertical_scroll_bar; */ | ||
| 4017 | /* terminal->set_horizontal_scroll_bar_hook */ | ||
| 4018 | /* = android_set_horizontal_scroll_bar; */ | ||
| 4019 | terminal->set_scroll_bar_default_width_hook | 4026 | terminal->set_scroll_bar_default_width_hook |
| 4020 | = android_set_scroll_bar_default_width; | 4027 | = android_set_scroll_bar_default_width; |
| 4021 | terminal->set_scroll_bar_default_height_hook | 4028 | terminal->set_scroll_bar_default_height_hook |
| 4022 | = android_set_scroll_bar_default_height; | 4029 | = android_set_scroll_bar_default_height; |
| 4023 | /* terminal->condemn_scroll_bars_hook = android_condemn_scroll_bars; */ | ||
| 4024 | /* terminal->redeem_scroll_bars_hook = android_redeem_scroll_bars; */ | ||
| 4025 | /* terminal->judge_scroll_bars_hook = android_judge_scroll_bars; */ | ||
| 4026 | terminal->free_pixmap = android_free_pixmap_hook; | 4030 | terminal->free_pixmap = android_free_pixmap_hook; |
| 4027 | terminal->delete_frame_hook = android_delete_frame; | 4031 | terminal->delete_frame_hook = android_delete_frame; |
| 4028 | terminal->delete_terminal_hook = android_delete_terminal; | 4032 | terminal->delete_terminal_hook = android_delete_terminal; |