aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPo Lu2022-12-31 18:04:18 +0800
committerPo Lu2022-12-31 18:04:18 +0800
commitcfbc8a5dbcd362b69b37b4e6832ae4a31834364c (patch)
treece003d03c4ae98f4e1d02186d78e5ae6e0d36e55 /lisp
parent785095c416f9bae43d2947849282b814e2c7942e (diff)
downloademacs-cfbc8a5dbcd362b69b37b4e6832ae4a31834364c.tar.gz
emacs-cfbc8a5dbcd362b69b37b4e6832ae4a31834364c.zip
Bring up the Android operating system and its window system
* .dir-locals.el (c-mode): Add ANDROID_EXPORT noise macro. * .gitignore: Add new files to ignore. * Makefile.in: Adjust for Android. * admin/merge-gnulib: Add new warning. * configure.ac: Detect Android. Run cross-configuration for Android when appropriate. * etc/DEBUG: Document how to debug Emacs on Android. * java/AndroidManifest.xml: * java/Makefile.in: * java/README: * java/debug.sh: * java/org/gnu/emacs/EmacsActivity.java (EmacsActivity): * java/org/gnu/emacs/EmacsApplication.java (EmacsApplication): * java/org/gnu/emacs/EmacsCopyArea.java (EmacsCopyArea): * java/org/gnu/emacs/EmacsDrawLine.java (EmacsDrawLine): * java/org/gnu/emacs/EmacsDrawPoint.java (EmacsDrawPoint): * java/org/gnu/emacs/EmacsDrawRectangle.java (EmacsDrawRectangle): * java/org/gnu/emacs/EmacsDrawable.java (EmacsDrawable): * java/org/gnu/emacs/EmacsFillPolygon.java (EmacsFillPolygon): * java/org/gnu/emacs/EmacsFillRectangle.java (EmacsFillRectangle): * java/org/gnu/emacs/EmacsFontDriver.java (EmacsFontDriver): * java/org/gnu/emacs/EmacsGC.java (EmacsGC): * java/org/gnu/emacs/EmacsHandleObject.java (EmacsHandleObject): * java/org/gnu/emacs/EmacsNative.java (EmacsNative): * java/org/gnu/emacs/EmacsPaintQueue.java (EmacsPaintQueue): * java/org/gnu/emacs/EmacsPaintReq.java (EmacsPaintReq): * java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): * java/org/gnu/emacs/EmacsSdk7FontDriver.java (EmacsSdk7FontDriver): * java/org/gnu/emacs/EmacsService.java (class Holder<T>) (EmacsService): * java/org/gnu/emacs/EmacsSurfaceView.java (EmacsSurfaceView): * java/org/gnu/emacs/EmacsThread.java (EmacsThread): * java/org/gnu/emacs/EmacsView.java (EmacsView): * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): New files and classes. * lib-src/Makefile.in (srcdir): * lib/Makefile.in (VPATH): (HAVE_NATIVE_COMP): (libgnu_a_SOURCES): (DEPFLAGS): Configure correctly for cross-compiling. * lib/faccessat.c: * lib/fpending.c (__fpending): * lib/open.c: * lib/unistd.c (_GL_UNISTD_INLINE): Temporary adjustments to gnulib. * lisp/frame.el (display-graphic-p): (display-screens): (display-pixel-height): (display-pixel-width): (display-mm-height): (display-mm-width): (display-backing-store): (display-save-under): (display-planes): (display-color-cells): (display-visual-class): Adjust for new window system `android'. * lisp/image/wallpaper.el (x-open-connection): Add declaration. * lisp/loadup.el (featurep): Load up files for Android. * lisp/net/eww.el (eww-form-submit, eww-form-file) (eww-form-checkbox, eww-form-select): Adjust faces for android. * lisp/term/android-win.el: New file. * src/Makefile.in: Add new targets emacs.so and android-emacs, then adjust for cross compilation. * src/alloc.c (cleanup_vector): Clean up Android font entities as well. (garbage_collect): Mark androidterm. * src/android-emacs.c (main): * src/android.c (ANDROID_THROW, enum android_fd_table_entry_flags) (struct android_emacs_service, struct android_emacs_pixmap) (struct android_graphics_point, struct android_event_container) (struct android_event_queue, android_run_select_thread) (android_handle_sigusr1, android_init_events, android_pending) (android_next_event, android_write_event, android_select) (android_run_debug_thread, android_user_full_name) (android_get_asset_name, android_fstat, android_fstatat) (android_file_access_p, android_hack_asset_fd, android_open) (android_close, JNICALL, android_init_emacs_service) (android_init_emacs_pixmap, android_init_graphics_point) (MAX_HANDLE, struct android_handle_entry, android_alloc_id) (android_destroy_handle, android_resolve_handle) (android_resolve_handle2, android_change_window_attributes) (android_create_window, android_set_window_background) (android_destroy_window, android_init_android_rect_class) (android_init_emacs_gc_class, android_create_gc, android_free_gc) (android_change_gc, android_set_clip_rectangles) (android_reparent_window, android_lookup_method) (android_clear_window, android_map_window, android_unmap_window) (android_resize_window, android_move_window, android_swap_buffers) (android_get_gc_values, android_set_foreground) (android_fill_rectangle, android_create_pixmap_from_bitmap_data) (android_set_clip_mask, android_set_fill_style, android_copy_area) (android_free_pixmap, android_set_background, android_fill_polygon) (android_draw_rectangle, android_draw_point, android_draw_line) (android_create_pixmap, android_set_ts_origin, android_clear_area): * src/android.h (ANDROID_EXPORT): * src/androidfns.c (android_display_info_for_name) (check_android_display_info, check_x_display_info, gamma_correct) (android_defined_color, android_decode_color) (android_implicitly_set_name, android_explicitly_set_name) (android_set_tool_bar_lines, android_change_tool_bar_height) (android_set_tab_bar_lines, android_change_tab_bar_height) (android_set_scroll_bar_default_height) (android_set_scroll_bar_default_width, android_icon_verify) (android_icon, android_make_gc, android_free_gcs) (unwind_create_frame, do_unwind_create_frame) (android_default_font_parameter, android_create_frame_window) (Fx_create_frame, Fxw_color_defined_p, Fxw_color_values) (Fxw_display_color_p, Fx_display_grayscale_p) (Fx_display_pixel_width, Fx_display_pixel_height) (Fx_display_planes, Fx_display_color_cells, Fx_display_screens) (Fx_display_mm_width, Fx_display_mm_height) (Fx_display_backing_store, Fx_display_visual_class) (Fx_display_monitor_attributes_list, Fx_frame_geometry) (Fx_frame_list_z_order, Fx_frame_restack) (Fx_mouse_absolute_pixel_position) (Fx_set_mouse_absolute_pixel_position, Fandroid_get_connection) (Fx_display_list, Fx_show_tip, Fx_hide_tip) (android_set_background_color, android_set_border_color) (android_set_cursor_color, android_set_cursor_type) (android_set_foreground_color) (android_set_child_frame_border_width) (android_set_internal_border_width, android_set_menu_bar_lines) (android_set_mouse_color, android_set_title, android_set_alpha) (android_frame_parm_handlers, syms_of_androidfns): * src/androidfont.c (struct android_emacs_font_driver) (struct android_emacs_font_spec, struct android_emacs_font_metrics) (struct android_emacs_font_object, struct android_integer) (struct androidfont_info, struct androidfont_entity) (android_init_font_driver, android_init_font_spec) (android_init_font_metrics, android_init_integer) (android_init_font_object, androidfont_get_cache) (androidfont_from_lisp, androidfont_from_java, androidfont_list) (androidfont_match, androidfont_draw, androidfont_open_font) (androidfont_close_font, androidfont_has_char) (androidfont_encode_char, androidfont_text_extents) (androidfont_list_family, androidfont_driver) (syms_of_androidfont_for_pdumper, syms_of_androidfont) (init_androidfont, android_finalize_font_entity): * src/androidgui.h (_ANDROID_GUI_H_, struct android_rectangle) (struct android_point, enum android_gc_function) (enum android_gc_value_mask, enum android_fill_style) (enum android_window_value_mask) (struct android_set_window_attributes, struct android_gc_values) (struct android_gc, enum android_swap_action, enum android_shape) (enum android_coord_mode, struct android_swap_info) (NativeRectangle, struct android_any_event) (struct android_key_event, struct android_configure_event) (union android_event): * src/androidterm.c (android_window_to_frame, android_clear_frame) (android_ring_bell, android_toggle_invisible_pointer) (android_update_begin, android_update_end, show_back_buffer) (android_flush_dirty_back_buffer_on, handle_one_android_event) (android_read_socket, android_frame_up_to_date) (android_buffer_flipping_unblocked_hook) (android_query_frame_background_color, android_parse_color) (android_alloc_nearest_color, android_query_colors) (android_mouse_position, android_get_focus_frame) (android_focus_frame, android_frame_rehighlight) (android_frame_raise_lower, android_make_frame_visible) (android_make_frame_invisible) (android_make_frame_visible_invisible, android_fullscreen_hook) (android_iconify_frame, android_set_window_size_1) (android_set_window_size, android_set_offset, android_set_alpha) (android_new_font, android_bitmap_icon, android_free_pixmap_hook) (android_free_frame_resources, android_delete_frame) (android_delete_terminal, android_scroll_run) (android_after_update_window_line, android_flip_and_flush) (android_clear_rectangle, android_reset_clip_rectangles) (android_clip_to_row, android_draw_fringe_bitmap) (android_set_cursor_gc, android_set_mouse_face_gc) (android_set_mode_line_face_gc, android_set_glyph_string_gc) (android_set_glyph_string_clipping) (android_set_glyph_string_clipping_exactly) (android_compute_glyph_string_overhangs) (android_clear_glyph_string_rect) (android_draw_glyph_string_background, android_fill_triangle) (android_make_point, android_inside_rect_p, android_clear_point) (android_draw_relief_rect, android_draw_box_rect) (HIGHLIGHT_COLOR_DARK_BOOST_LIMIT, android_setup_relief_color) (android_setup_relief_colors, android_draw_glyph_string_box) (android_draw_glyph_string_bg_rect, android_draw_image_relief) (android_draw_image_foreground, android_draw_image_foreground_1) (android_draw_image_glyph_string) (android_draw_stretch_glyph_string, android_draw_underwave) (android_draw_glyph_string_foreground) (android_draw_composite_glyph_string_foreground) (android_draw_glyphless_glyph_string_foreground) (android_draw_glyph_string, android_define_frame_cursor) (android_clear_frame_area, android_clear_under_internal_border) (android_draw_hollow_cursor, android_draw_bar_cursor) (android_draw_window_cursor, android_draw_vertical_window_border) (android_draw_window_divider, android_redisplay_interface) (frame_set_mouse_pixel_position, get_keysym_name) (android_create_terminal, android_term_init, syms_of_androidterm) (mark_androidterm): * src/androidterm.h (_ANDROID_TERM_H_, struct android_display_info) (struct android_output, FRAME_ANDROID_OUTPUT, XSCROLL_BAR): New files. * src/dired.c (file_attributes): Do not use openat on Android. * src/dispextern.h (No_Cursor): Define appropriately on Android. (struct glyph_string, struct face): Make gc field of type struct android_gc on Android. * src/dispnew.c (clear_current_matrices, clear_desired_matrices) (adjust_frame_glyphs_for_window_redisplay, free_glyphs) (update_frame, scrolling, char_ins_del_cost, update_frame_line) (init_display_interactive): Disable text terminal support completely on Android. Fix non-toolkit menus for non-X systems. * src/editfns.c (Fuser_full_name): Call android_user_full_name. * src/emacs.c (android_emacs_init): Make main this on Android. Prohibit argv sorting from exceeding end of argv. * src/epaths.in: Add path definitions for Android. * src/fileio.c (file_access_p): Call android_file_access_p. (file_name_directory): Avoid using openat on Android. (Fcopy_file): Adjust to call sys_fstat instead. (file_directory_p): (Finsert_file_contents): (write_region): Likewise. * src/filelock.c: * src/fns.c (Flocale_info): Pacify warning on Android. * src/font.c (font_make_entity_android): New function. * src/font.h: * src/frame.c (Fframep): (Fwindow_system): Handle new window system `android'. Update doc strings. (Fmake_terminal_frame): Disable on Android. (gui_display_get_resource): Disable get_string_resource_hook on Android. (syms_of_frame): New defsym `android'. * src/frame.h (GCALIGNED_STRUCT): Add new output data for Android. (ENUM_BF): Expand enumerator size. (FRAME_ANDROID_P, FRAME_WINDOW_P, MOUSE_HL_INFO): Add definitions for Android. * src/image.c (GET_PIXEL): (image_create_bitmap_from_file): (image_create_x_image_and_pixmap_1): (image_get_x_image): (slurp_file): (lookup_rgb_color): (image_to_emacs_colors): (image_from_emacs_colors): (image_pixmap_draw_cross): (image_disable_image): (MaskForeground): (gif_load): Add stubs for Android. * src/lisp.h: * src/lread.c (safe_to_load_version, maybe_swap_for_eln1, openp): * src/pdumper.c (pdumper_load): Call sys_fstat instead of fstat. * src/process.c (wait_reading_process_output): Use android_select instead of pselect. * src/scroll.c: Disable on Android. * src/sysdep.c (widen_foreground_group, reset_sys_modes) (init_signals, emacs_fstatat, sys_fstat): New function. (emacs_open, emacs_open_noquit, emacs_close): Implement differently on Android. (close_output_streams): Disable what is not required on Android. * src/term.c (OUTPUT1_IF, encode_terminal_code, string_cost) (string_cost_one_line, per_line_cost, calculate_costs) (struct fkey_table, tty_append_glyph, produce_glyphs) (tty_capable_p, Fsuspend_tty, Fresume_tty, device, init_tty) (maybe_fatal, syms_of_term): Disable text terminal support on Android. * src/termhooks.h (enum output_method): Add android output method. (GCALIGNED_STRUCT, TERMINAL_FONT_CACHE): Define for Android. * src/terminal.c (Fterminal_live_p): Implement for Android. * src/verbose.mk.in (AM_V_GLOBALS): Add JAVAC and DX. * src/xdisp.c (redisplay_internal): Disable text terminals on Android. (display_menu_bar): (display_tty_menu_item): (draw_row_with_mouse_face): (expose_frame): Make the non toolkit menu bar work on Android. * src/xfaces.c (GCGraphicsExposures): (x_create_gc): (x_free_gc): (Fx_load_color_file): Define for Android. * xcompile/Makefile.in (top_srcdir): (top_builddir): * xcompile/README: * xcompile/langinfo.h (nl_langinfo): New files.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/frame.el23
-rw-r--r--lisp/image/wallpaper.el2
-rw-r--r--lisp/loadup.el5
-rw-r--r--lisp/net/eww.el8
-rw-r--r--lisp/term/android-win.el62
5 files changed, 85 insertions, 15 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index e4cd2cd8ae2..62cc4d7a38d 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2137,7 +2137,8 @@ frames and several different fonts at once. This is true for displays
2137that use a window system such as X, and false for text-only terminals. 2137that use a window system such as X, and false for text-only terminals.
2138DISPLAY can be a display name, a frame, or nil (meaning the selected 2138DISPLAY can be a display name, a frame, or nil (meaning the selected
2139frame's display)." 2139frame's display)."
2140 (not (null (memq (framep-on-display display) '(x w32 ns pgtk haiku))))) 2140 (not (null (memq (framep-on-display display) '(x w32 ns pgtk haiku
2141 android)))))
2141 2142
2142(defun display-images-p (&optional display) 2143(defun display-images-p (&optional display)
2143 "Return non-nil if DISPLAY can display images. 2144 "Return non-nil if DISPLAY can display images.
@@ -2202,7 +2203,7 @@ DISPLAY should be either a frame or a display name (a string).
2202If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2203If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2203 (let ((frame-type (framep-on-display display))) 2204 (let ((frame-type (framep-on-display display)))
2204 (cond 2205 (cond
2205 ((memq frame-type '(x w32 ns haiku pgtk)) 2206 ((memq frame-type '(x w32 ns haiku pgtk android))
2206 (x-display-screens display)) 2207 (x-display-screens display))
2207 (t 2208 (t
2208 1)))) 2209 1))))
@@ -2222,7 +2223,7 @@ with DISPLAY. To get information for each physical monitor, use
2222`display-monitor-attributes-list'." 2223`display-monitor-attributes-list'."
2223 (let ((frame-type (framep-on-display display))) 2224 (let ((frame-type (framep-on-display display)))
2224 (cond 2225 (cond
2225 ((memq frame-type '(x w32 ns haiku pgtk)) 2226 ((memq frame-type '(x w32 ns haiku pgtk android))
2226 (x-display-pixel-height display)) 2227 (x-display-pixel-height display))
2227 (t 2228 (t
2228 (frame-height (if (framep display) display (selected-frame))))))) 2229 (frame-height (if (framep display) display (selected-frame)))))))
@@ -2242,7 +2243,7 @@ with DISPLAY. To get information for each physical monitor, use
2242`display-monitor-attributes-list'." 2243`display-monitor-attributes-list'."
2243 (let ((frame-type (framep-on-display display))) 2244 (let ((frame-type (framep-on-display display)))
2244 (cond 2245 (cond
2245 ((memq frame-type '(x w32 ns haiku pgtk)) 2246 ((memq frame-type '(x w32 ns haiku pgtk android))
2246 (x-display-pixel-width display)) 2247 (x-display-pixel-width display))
2247 (t 2248 (t
2248 (frame-width (if (framep display) display (selected-frame))))))) 2249 (frame-width (if (framep display) display (selected-frame)))))))
@@ -2280,7 +2281,7 @@ For graphical terminals, note that on \"multi-monitor\" setups this
2280refers to the height in millimeters for all physical monitors 2281refers to the height in millimeters for all physical monitors
2281associated with DISPLAY. To get information for each physical 2282associated with DISPLAY. To get information for each physical
2282monitor, use `display-monitor-attributes-list'." 2283monitor, use `display-monitor-attributes-list'."
2283 (and (memq (framep-on-display display) '(x w32 ns haiku pgtk)) 2284 (and (memq (framep-on-display display) '(x w32 ns haiku pgtk android))
2284 (or (cddr (assoc (or display (frame-parameter nil 'display)) 2285 (or (cddr (assoc (or display (frame-parameter nil 'display))
2285 display-mm-dimensions-alist)) 2286 display-mm-dimensions-alist))
2286 (cddr (assoc t display-mm-dimensions-alist)) 2287 (cddr (assoc t display-mm-dimensions-alist))
@@ -2301,7 +2302,7 @@ For graphical terminals, note that on \"multi-monitor\" setups this
2301refers to the width in millimeters for all physical monitors 2302refers to the width in millimeters for all physical monitors
2302associated with DISPLAY. To get information for each physical 2303associated with DISPLAY. To get information for each physical
2303monitor, use `display-monitor-attributes-list'." 2304monitor, use `display-monitor-attributes-list'."
2304 (and (memq (framep-on-display display) '(x w32 ns haiku pgtk)) 2305 (and (memq (framep-on-display display) '(x w32 ns haiku pgtk android))
2305 (or (cadr (assoc (or display (frame-parameter nil 'display)) 2306 (or (cadr (assoc (or display (frame-parameter nil 'display))
2306 display-mm-dimensions-alist)) 2307 display-mm-dimensions-alist))
2307 (cadr (assoc t display-mm-dimensions-alist)) 2308 (cadr (assoc t display-mm-dimensions-alist))
@@ -2319,7 +2320,7 @@ DISPLAY can be a display name or a frame.
2319If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2320If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2320 (let ((frame-type (framep-on-display display))) 2321 (let ((frame-type (framep-on-display display)))
2321 (cond 2322 (cond
2322 ((memq frame-type '(x w32 ns haiku pgtk)) 2323 ((memq frame-type '(x w32 ns haiku pgtk android))
2323 (x-display-backing-store display)) 2324 (x-display-backing-store display))
2324 (t 2325 (t
2325 'not-useful)))) 2326 'not-useful))))
@@ -2332,7 +2333,7 @@ DISPLAY can be a display name or a frame.
2332If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2333If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2333 (let ((frame-type (framep-on-display display))) 2334 (let ((frame-type (framep-on-display display)))
2334 (cond 2335 (cond
2335 ((memq frame-type '(x w32 ns haiku pgtk)) 2336 ((memq frame-type '(x w32 ns haiku pgtk android))
2336 (x-display-save-under display)) 2337 (x-display-save-under display))
2337 (t 2338 (t
2338 'not-useful)))) 2339 'not-useful))))
@@ -2345,7 +2346,7 @@ DISPLAY can be a display name or a frame.
2345If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2346If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2346 (let ((frame-type (framep-on-display display))) 2347 (let ((frame-type (framep-on-display display)))
2347 (cond 2348 (cond
2348 ((memq frame-type '(x w32 ns haiku pgtk)) 2349 ((memq frame-type '(x w32 ns haiku pgtk android))
2349 (x-display-planes display)) 2350 (x-display-planes display))
2350 ((eq frame-type 'pc) 2351 ((eq frame-type 'pc)
2351 4) 2352 4)
@@ -2360,7 +2361,7 @@ DISPLAY can be a display name or a frame.
2360If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2361If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2361 (let ((frame-type (framep-on-display display))) 2362 (let ((frame-type (framep-on-display display)))
2362 (cond 2363 (cond
2363 ((memq frame-type '(x w32 ns haiku pgtk)) 2364 ((memq frame-type '(x w32 ns haiku pgtk android))
2364 (x-display-color-cells display)) 2365 (x-display-color-cells display))
2365 ((eq frame-type 'pc) 2366 ((eq frame-type 'pc)
2366 16) 2367 16)
@@ -2377,7 +2378,7 @@ DISPLAY can be a display name or a frame.
2377If DISPLAY is omitted or nil, it defaults to the selected frame's display." 2378If DISPLAY is omitted or nil, it defaults to the selected frame's display."
2378 (let ((frame-type (framep-on-display display))) 2379 (let ((frame-type (framep-on-display display)))
2379 (cond 2380 (cond
2380 ((memq frame-type '(x w32 ns haiku pgtk)) 2381 ((memq frame-type '(x w32 ns haiku pgtk android))
2381 (x-display-visual-class display)) 2382 (x-display-visual-class display))
2382 ((and (memq frame-type '(pc t)) 2383 ((and (memq frame-type '(pc t))
2383 (tty-display-color-p display)) 2384 (tty-display-color-p display))
diff --git a/lisp/image/wallpaper.el b/lisp/image/wallpaper.el
index f083477ddf4..bc76f1a1087 100644
--- a/lisp/image/wallpaper.el
+++ b/lisp/image/wallpaper.el
@@ -432,6 +432,8 @@ See also `wallpaper-default-width'.")
432 432
433;;; wallpaper-set 433;;; wallpaper-set
434 434
435(declare-function x-open-connection "xfns.c")
436
435(defun wallpaper--x-monitor-name () 437(defun wallpaper--x-monitor-name ()
436 "Get the monitor name for `wallpaper-set'. 438 "Get the monitor name for `wallpaper-set'.
437On a graphical display, try using the same monitor as the current 439On a graphical display, try using the same monitor as the current
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 2a9aff4c1fe..16ad531cb68 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -306,6 +306,11 @@
306 (load "term/common-win") 306 (load "term/common-win")
307 (load "term/haiku-win"))) 307 (load "term/haiku-win")))
308 308
309(if (featurep 'android)
310 (progn
311 (load "term/common-win")
312 (load "term/android-win")))
313
309(if (or (eq system-type 'windows-nt) 314(if (or (eq system-type 'windows-nt)
310 (featurep 'w32)) 315 (featurep 'w32))
311 (progn 316 (progn
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index a8a985b8dea..9ffaa5cd369 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -240,7 +240,7 @@ parameter, and should return the (possibly) transformed URL."
240 :version "29.1") 240 :version "29.1")
241 241
242(defface eww-form-submit 242(defface eww-form-submit
243 '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line 243 '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
244 :box (:line-width 2 :style released-button) 244 :box (:line-width 2 :style released-button)
245 :background "#808080" :foreground "black")) 245 :background "#808080" :foreground "black"))
246 "Face for eww buffer buttons." 246 "Face for eww buffer buttons."
@@ -248,7 +248,7 @@ parameter, and should return the (possibly) transformed URL."
248 :group 'eww) 248 :group 'eww)
249 249
250(defface eww-form-file 250(defface eww-form-file
251 '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line 251 '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
252 :box (:line-width 2 :style released-button) 252 :box (:line-width 2 :style released-button)
253 :background "#808080" :foreground "black")) 253 :background "#808080" :foreground "black"))
254 "Face for eww buffer buttons." 254 "Face for eww buffer buttons."
@@ -256,7 +256,7 @@ parameter, and should return the (possibly) transformed URL."
256 :group 'eww) 256 :group 'eww)
257 257
258(defface eww-form-checkbox 258(defface eww-form-checkbox
259 '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line 259 '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
260 :box (:line-width 2 :style released-button) 260 :box (:line-width 2 :style released-button)
261 :background "lightgrey" :foreground "black")) 261 :background "lightgrey" :foreground "black"))
262 "Face for eww buffer buttons." 262 "Face for eww buffer buttons."
@@ -264,7 +264,7 @@ parameter, and should return the (possibly) transformed URL."
264 :group 'eww) 264 :group 'eww)
265 265
266(defface eww-form-select 266(defface eww-form-select
267 '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line 267 '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
268 :box (:line-width 2 :style released-button) 268 :box (:line-width 2 :style released-button)
269 :background "lightgrey" :foreground "black")) 269 :background "lightgrey" :foreground "black"))
270 "Face for eww buffer buttons." 270 "Face for eww buffer buttons."
diff --git a/lisp/term/android-win.el b/lisp/term/android-win.el
new file mode 100644
index 00000000000..8aeabee567d
--- /dev/null
+++ b/lisp/term/android-win.el
@@ -0,0 +1,62 @@
1;;; x-win.el --- parse relevant switches and set up for Android -*- lexical-binding:t -*-
2
3;; Copyright (C) 2023 Free Software Foundation, Inc.
4
5;; Author: FSF
6;; Keywords: terminals, i18n, android
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;; This file contains the support for initializing the Lisp side of
26;; Android windowing.
27
28;;; Code:
29
30
31(unless (featurep 'android)
32 (error "%s: Loading android-win without having Android"
33 invocation-name))
34
35;; Documentation-purposes only: actually loaded in loadup.el.
36(require 'frame)
37(require 'mouse)
38(require 'fontset)
39(require 'dnd)
40
41(add-to-list 'display-format-alist '(".*" . android))
42
43;; Window system initialization. This is extremely simple because all
44;; initialization is done in android_term_init.
45
46(cl-defmethod window-system-initialization (&context (window-system android)
47 &optional _ignored)
48 "Set up the window system. WINDOW-SYSTEM must be ANDROID.
49DISPLAY is ignored on Android."
50 ;; Just make sure the window system was initialized at startup.
51 (android-get-connection))
52
53(cl-defmethod frame-creation-function (params &context (window-system android))
54 (x-create-frame-with-faces params))
55
56(cl-defmethod handle-args-function (_ignored &context (window-system android))
57 ;; Nothing to do here: Android has no command line to provide
58 ;; arguments on.
59 (ignore))
60
61(provide 'android-win)
62;; android-win.el ends here.