aboutsummaryrefslogtreecommitdiffstats
path: root/src/haiku_support.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* New variable haiku-pass-control-tab-to-systemTor-björn Claesson2024-04-041-0/+2
| | | | | | | | | | | | | | Allow passing C-TAB on to the Haiku operating system, fixing window switching when an Emacs frame has focus (Bug#70138). * src/haiku_support.cc (DispatchMessage): Conditionally pass message to BWindow. * src/haiku_support.h: * src/haikufns.c (haiku_should_pass_control_tab_to_system): Add variable haiku-pass-control-tab-to-system, and C function haiku_should_pass_control_tab_to_system. Co-authored-by: Po Lu <luangruo@yahoo.com> Copyright-paperwork-exempt: yes
* Merge from savannah/emacs-29Po Lu2024-01-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
| |
* | Introduce support for Desktop Notifications on HaikuPo Lu2023-08-171-0/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/os.texi (Desktop Notifications): Document Haiku desktop notifications. * etc/NEWS: Announce this change. * lisp/org/org-clock.el (haiku-notifications-notify): New declaration. (org-show-notification): Employ that function. * src/haiku_io.c (haiku_len) <NOTIFICATION_CLICK_EVENT>: Return the length for this type of event. * src/haiku_select.cc (my_team_id, be_display_notification): New functions. * src/haiku_support.cc (my_team_id, ArgvReceived): New functions. * src/haiku_support.h (enum haiku_event_type): New event type NOTIFICATION_CLICK_EVENT. (struct haiku_notification_click_event): New structure. * src/haikuselect.c (haiku_notifications_notify_1) (Fhaiku_notifications_notify): New functions. (syms_of_haikuselect): Register new defsubr. * src/haikuterm.c (haiku_read_socket): * src/haikuselect.h: * src/termhooks.h: Add new events for notification clicks on Haiku.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* ; Fix typosStefan Kangas2022-11-181-1/+1
|
* Implement font-use-system-font on HaikuPo Lu2022-09-251-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/frames.texi (Fonts): Update documentation to say what font-use-system-font really does and where it can be used. * src/haiku_font_support.cc (language_code_points): Fix coding style. (font_style_to_flags, be_font_style_to_flags): Accept const char *. (be_send_font_settings, be_listen_font_settings) (be_lock_font_defaults, be_unlock_font_defaults) (be_get_font_default, be_get_font_size): New functions used to retrieve default font data. * src/haiku_io.c (haiku_len): Handle FONT_CHANGE_EVENT. * src/haiku_support.h (enum haiku_event_type): New event type FONT_CHANGE_EVENT. (enum haiku_what_font): New enum. (struct haiku_font_change_event): New struct. * src/haikufont.c (Ffont_get_system_normal_font) (Ffont_get_system_font, haiku_handle_font_change_event): New functions. (syms_of_haikufont): Provide `dynamic-setting' and define new variables and subrs. * src/haikuterm.c (haiku_default_font_parameter): Use system font. (haiku_read_socket): Handle FONT_CHANGE_EVENTS. (haiku_term_init): Start listening for font configuration changes. * src/haikuterm.h: Update prototypes. * src/xsettings.c (Ffont_get_system_normal_font) (Ffont_get_system_font): Update doc string. (syms_of_xsettings): Replace calls to intern with a static string.
* Implement wallpaper.el support for HaikuPo Lu2022-09-141-0/+3
| | | | | | | | | | | | | | | | * lisp/image/wallpaper.el (haiku-set-wallpaper, wallpaper-set): Use `haiku-set-wallpaper' on Haiku. * lisp/term/haiku-win.el (haiku-write-node-attribute) (haiku-send-message, haiku-set-wallpaper): New function. * src/haiku_support.cc (be_write_node_message, be_send_message): New functions. * src/haiku_support.h: Update prototypes. * src/haikuselect.c (haiku_message_to_lisp) (haiku_lisp_to_message): Fix CSTR type handling to include NULL byte. (haiku_report_system_error, Fhaiku_write_node_attribute) (Fhaiku_send_message): New functions. (syms_of_haikuselect): Add defsubrs.
* Implement primitive frame synchronization on HaikuPo Lu2022-08-011-0/+1
| | | | | | | | | | | | | | | | | | | Instead of relying on a compositor to do the work, we simply wait for VBLANK and hope that the update finishes soon enough. * doc/lispref/frames.texi (Management Parameters): Document that frame synchronization is now supported on Haiku. * src/haiku_support.cc (class EmacsView): New field `use_frame_synchronization'. (FlipBuffers): Wait for vertical blanking period. (be_set_use_frame_synchronization): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Set `use-frame-synchronization'. (haiku_set_use_frame_synchronization) (haiku_frame_parm_handlers): New param handler.
* Fix grab view persisting on Haiku after popup menu closesPo Lu2022-07-281-0/+1
| | | | | | | | * src/haiku_support.cc (BasicMouseUp): Improve handling of wait_for_release_message. (be_clear_grab_view): New function. * src/haiku_support.h: Update prototypes. * src/haikumenu.c (haiku_menu_show): Call it here.
* ; Fix typosStefan Kangas2022-07-141-1/+1
|
* Improve behavior of sticky tooltips on HaikuPo Lu2022-07-081-2/+1
| | | | | | | | | | | * src/haiku_support.cc (class EmacsView, MouseMoved): Remove `tooltip_position'. (class EmacsMotionSuppressionView): New class. (BView_set_and_show_sticky_tooltip): Rename to `be_show_sticky_tooltip'. Add motion suppression view. * src/haiku_support.h: Update prototypes. * src/haikufns.c (Fx_show_tip): Update for renamed function.
* Port `x-lost-selection-functions' to HaikuPo Lu2022-07-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/haiku_io.c (haiku_len): Add `CLIPBOARD_CHANGED_EVENT'. * src/haiku_select.cc (be_update_clipboard_count): Set ownership flags. (be_handle_clipboard_changed_message): (be_start_watching_selection): New functions. * src/haiku_support.cc (class Emacs): Handle B_CLIPBOARD_CHANGED. * src/haiku_support.h (enum haiku_event_type): New event `CLIPBOARD_CHANGED_EVENT'. (struct haiku_clipboard_changed_event): New struct. * src/haikuselect.c (haiku_handle_selection_clear) (haiku_selection_disowned, haiku_start_watching_selections): New functions. (syms_of_haikuselect): New defsym and defvar. * src/haikuselect.h: Update prototypes. * src/haikuterm.c (haiku_read_socket): Handle selection events. (haiku_term_init): Start watching selections. * src/haikuterm.h: Update prototypes. * src/keyboard.c (kbd_buffer_get_event, process_special_events) (mark_kboards): Handle SELECTON_CLEAR_EVENTs correctly on Haiku.
* Implement stipples for images on HaikuPo Lu2022-06-271-0/+2
| | | | | | | | | | | * src/haiku_draw_support.cc (be_draw_bitmap_with_mask): New function. * src/haiku_support.h: Add prototype. * src/haikuterm.c (haiku_draw_image_glyph_string): Draw stipple correctly. (haiku_draw_glyph_string): Fix conditions under which row->stipple_p is set.
* Implement image transform smoothing on HaikuPo Lu2022-06-251-1/+1
| | | | | | | | | * src/dispextern.h (struct image): New field `use_bilinear_filtering'. * src/haiku_draw_support.cc (BView_DrawBitmap): Accept it. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_draw_image_glyph_string): * src/image.c (image_set_transform): Set it.
* Implement "flip" image transforms on HaikuPo Lu2022-06-251-4/+7
| | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct image): New field `transform', `original_width' and `original_height'. * src/haiku_draw_support.cc (BView_DrawMask): Rename to `be_draw_image_mask' and fix coding style. (rotate_bitmap_270, BBitmap_transform_bitmap, rotate_bitmap_90): Delete functions. (be_apply_affine_transform): New function. (be_apply_inverse_transform): New function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_translate_transform): New function. (haiku_draw_image_glyph_string): Use affine transforms to implement images. * src/image.c (image_set_transform): Implement using affine transforms on Haiku too.
* Allow toggling antialiasing inside the Haiku font dialogPo Lu2022-06-211-1/+2
| | | | | | | | | | | | | | | | | | | | | * src/haiku_support.cc (struct font_selection_dialog_message): New field `disable_antialias'. (MessageReceived): Handle new message SET_DISABLE_ANTIALIASING. (class DualLayoutView): Rename to `TripleLayoutView'. (class TripleLayoutView): Rename from `DualLayoutView'. (MinSize): Update computations for three views. (class EmacsFontSelectionDialog, UpdatePreview) (EmacsFontSelectionDialog): Add an antialiasing checkbox to control antialiasing. (be_select_font): New arguments `initial_antialias' and `disable_antialias'. * src/haiku_support.h: Update prototypes. * src/haikufont.c (haikufont_pattern_from_object): Set FSPEC_ANTIALIAS. (Fx_select_font): Update accordingly.
* Respect `:antialias' on HaikuPo Lu2022-06-201-0/+6
| | | | | | | | | | | | | | | * src/haiku_font_support.cc (BFont_find): Pass through FSPEC_ANTIALIAS. (be_set_font_antialiasing): New function. * src/haiku_support.h (enum haiku_font_specification): New enum FSPEC_ANTIALIAS. (struct haiku_font_pattern): New field `use_antialiasing'. * src/haikufont.c (haikufont_pattern_to_entity) (haikufont_spec_or_entity_to_pattern, haikufont_open): Respect antialiasing. (syms_of_haikufont): New defsym `:indices'.
* Fix handling of scroll bar clicks on HaikuPo Lu2022-06-121-1/+2
| | | | | | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsView, BasicMouseDown) (BasicMouseUp): Move MouseDown and MouseUp here. New parameter `scroll_bar'. (MouseDown, MouseUp): Call basic variants. (class EmacsScrollBar): New field `parent'. (BScrollBar_make_for_view): Rename to `be_create_scroll_bar_for_view'. * src/haiku_support.h (struct haiku_button_event): New field `scroll_bar'. * src/haikuterm.c (haiku_scroll_bar_from_widget): Handle NULL widget. (haiku_scroll_bar_create): Update calls. (haiku_mouse_position): Fix scroll bar part. (haiku_read_socket): Handle button events on scroll bars as scroll bar click events.
* Fix coding style of some Haiku filesPo Lu2022-06-071-2/+2
| | | | | | | | | | * src/haiku_support.cc: (FrameResized): (class EmacsView, AfterResize): Fix coding and initializer style. * src/haiku_support.h (struct haiku_resize_event): Rename confusingly named fields. * src/haikuterm.c (haiku_read_socket): Update accordingly.
* Implement monitor change functions on HaikuPo Lu2022-05-231-1/+7
| | | | | | | | | | | | | | | | * src/haiku_io.c (haiku_len): Handle new event type. * src/haiku_support.cc (class EmacsScreenChangeMonitor): New class. (class Emacs, Emacs): Create new screen change monitor. (DispatchMessage): Update fullscreen state if the screen changed. (SetFullscreen): Don't punt if fullscreen mode is identical. * src/haiku_support.h (enum haiku_event_type): New event `SCREEN_CHANGE_EVENT'. (struct haiku_screen_changed_event): New struct. * src/haikuterm.c (haiku_read_socket): Handle new event.
* Compute frame workareas on HaikuPo Lu2022-05-211-0/+1
| | | | | | | | | | | | | | * lisp/frame.el (display-monitor-attributes-list): Implement specially on Haiku as well. * src/haiku_support.cc (get_zoom_rect): New function. Extract CalculateZoomRect here. (class EmacsWindow, SetFullscreen): Use that instead of CalculateZoomRect. (be_get_explicit_workarea): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (Fhaiku_display_monitor_attributes_list): New function. (syms_of_haikufns): Register new subr.
* Fix race conditions processing zoom events on HaikuPo Lu2022-05-201-0/+1
| | | | | | | | | * src/haiku_support.cc (Zoom): * src/haiku_support.h (struct haiku_zoom_event): Include the current fullscreen mode in the event. * src/haikuterm.c (haiku_read_socket): Use that instead of the current frame's fullscreen mode.
* Implement `cross-disabled-images' on HaikuPo Lu2022-05-201-0/+2
| | | | | | | | | | * src/haiku_draw_support.cc (be_draw_cross_on_pixmap_1) (be_draw_cross_on_pixmap): New functions. * src/haiku_support.h: Update prototypes. * src/image.c (image_pixmap_draw_cross, image_disable_image): Implement drawing cross on Haiku.
* Fix race conditions processing frame fullscreen state on HaikuPo Lu2022-05-191-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Size Parameters): Remove note saying Haiku doesn't support `fullwidth' and `fullboth'. * src/haiku_support.cc (subset_windows, class EmacsWindow) (Unparent, ParentTo): Stop calling old fullscreen functions. (ClearFullscreen, FullscreenRectForMode, SetFullscreen): New functions. Completely rewrite old zoom and fullscreen handling code. (Zoom): Send a ZOOM_EVENT and don't actually zoom. (BWindow_zoom, EmacsWindow_make_fullscreen, EmacsWindow_unzoom): Delete functions. (be_set_window_fullscreen_mode): New function. * src/haiku_support.h (struct haiku_zoom_event): Remove `zoomed_p' parameter. (enum haiku_fullscreen_mode): New enum. Update prototypes. * src/haikufns.c (Fx_display_pixel_height): Return height instead of width. * src/haikuterm.c (haiku_make_fullscreen_consistent) (haiku_read_socket, haiku_fullscreen): Adjust to always set zoom and fullscreen in the main thread instead of the UI threads. * src/haikuterm.h (struct haiku_output): Remove flag `zoomed_p' and add field `fullscreen_mode'.
* Fix race conditions when calculating Haiku frame geometryPo Lu2022-05-181-0/+2
| | | | | | | | | * src/haiku_support.cc (be_lock_window, be_unlock_window): New functions. * src/haiku_support.h: Update prototypes. * src/haikufns.c (frame_geometry): Lock window before asking for its dimensions and frame.
* Avoid race conditions when computing real frame positions on HaikuPo Lu2022-05-171-2/+4
| | | | | | | | | | | | | | | | * src/haiku_support.cc (DispatchMessage): Accept SEND_MOVE_FRAME_EVENT. (class EmacsWindow, FrameMoved): Include decorator frame in MOVE_EVENT events. (be_send_move_frame_event): New function. * src/haiku_support.h (struct haiku_move_event): Include decorator dimensions. Update prototypes. * src/haikufns.c (haiku_update_after_decoration_change): Ask for a move frame event and don't do anything if configury is not yet complete. * src/haikuterm.c (haiku_read_socket): Adjust accordingly.
* Rewrite Haiku frame geometry code to handle decorator framesPo Lu2022-05-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Frame Layout): Document changes to Haiku frame layout. * src/haiku_support.cc (class EmacsWindow, MoveToIncludingFrame) (EmacsMoveTo, MakeFullscreen): Move to an offset including the decorator frames. (be_get_window_decorator_dimensions): (be_get_window_decorator_frame): New functions. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_update_after_decoration_change): New function. (haiku_create_frame, haiku_set_undecorated) (haiku_set_override_redirect): Call that function. (frame_geometry): Actually calculate frame geometry based on decorator and frame sizes. * src/haikuterm.c (haiku_coords_from_parent): Use frame width instead. (haiku_read_socket): Set left and top positions based on decorator width and height. * src/haikuterm.h (struct haiku_output): New field `frame_x' and `frame_y'.
* Clean up Haiku code after file panel changesPo Lu2022-05-161-20/+2
| | | | | | | | * src/haiku_support.cc: * src/haiku_support.h: Stop including pthread.h and specpdl_ref. * src/haikumenu.c (run_menu_bar_help_event): Ignore invalid help events instead of aborting.
* Simplify Haiku cursor management codePo Lu2022-05-151-8/+19
| | | | | | | | | | | | | * src/haiku_support.cc (BCursor_create_default) (BCursor_create_modeline, BCursor_from_id, BCursor_create_i_beam) (BCursor_create_progress_cursor, BCursor_create_grab) (BCursor_delete): Delete specialized cursor creation functions. (be_delete_cursor, be_create_cursor_from_id): New functions. (BView_set_view_cursor): Fix coding style. * src/haiku_support.h (enum haiku_cursor): Add all cursor IDs. * src/haikufns.c (haiku_free_custom_cursors): (haiku_set_mouse_color): * src/haikuterm.c (haiku_term_init): Adjust accordingly.
* Allow actually setting cursor colors on HaikuPo Lu2022-05-131-0/+1
| | | | | | | | | | | | | | | | | | | * src/haiku_support.cc (be_create_pixmap_cursor): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Change default cursor color to "font-color". (haiku_create_tip_frame): Likewise. (struct user_cursor_bitmap_info): New struct. (cursor_bitmaps): New list of bitmaps corresponding to cursors. (haiku_create_colored_cursor): New function. (haiku_free_custom_cursors): Set current cursor to the default cursor before freeing the original value. (haiku_set_mouse_color): Actually recolor cursors based on built-in bitmaps. * src/haikuterm.c (haiku_defined_color): Clean up coding style.
* Add support for changing pointer types on HaikuPo Lu2022-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Pointer Shape): Document that the pointer shape can now be changed on some window systems other than X. * lisp/term/haiku-win.el (x-pointer-X-cursor, x-pointer-arrow) (x-pointer-bottom-left-corner, x-pointer-bottom-right-corner) (x-pointer-bottom-side, x-pointer-clock, x-pointer-cross) (x-pointer-cross-reverse, x-pointer-crosshair) (x-pointer-diamond-cross, x-pointer-hand1, x-pointer-hand2) (x-pointer-left-side, x-pointer-right-side) (x-pointer-sb-down-arrow, x-pointer-sb-left-arrow) (x-pointer-sb-right-arrow, x-pointer-sb-up-arrow, x-pointer-target) (x-pointer-top-left-corner, x-pointer-top-right-corner) (x-pointer-top-side, x-pointer-watch, x-pointer-invisible): New pointer constants. * src/haiku_support.cc (BCursor_from_id): Accept int instead of enum. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_create_frame): Stop manually assigning cursors and set default value of the mouse color property. (haiku_free_frame_resources): Free custom cursors too. (struct user_cursor_info, INIT_USER_CURSOR): New struct. (haiku_free_custom_cursors): New function. (haiku_set_mouse_color): New param handler. (haiku_frame_parm_handlers): Add param handler. (syms_of_haikufns): New cursor shape variables from X. * src/haikuterm.h: Update prototypes.
* Use default external browser by default on HaikuPo Lu2022-05-091-0/+2
| | | | | | | | | | | | | * lisp/net/browse-url.el (browse-url-default-browser): Use that by default on Haiku. (browse-url-default-haiku-browser): New function. * src/haiku_support.cc (be_roster_launch): * src/haiku_support.h: New function. Update prototypes. * src/haikuselect.c (haiku_message_to_lisp): Encode and decode files correctly. (haiku_lisp_to_message): Encode and decode files correctly. (Fhaiku_roster_launch): New function. (syms_of_haikuselect): Update defsubrs.
* Implement bitmap loading for faces on HaikuPo Lu2022-05-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Stipples don't completely work yet. * lisp/faces.el (face-valid-attribute-values): Enable `:stipple' on Haiku. * src/haiku_draw_support.cc (BView_DrawBitmap) (BView_DrawBitmapWithEraseOp, BView_DrawMask): Don't push and pop states. (BView_DrawBitmapTiled): New function. * src/haiku_support.cc (BBitmap_import_mono_bits): Delete function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (get_string_resource): Fix coding style. (haiku_get_bitmap, haiku_draw_stipple_background): Implement partially. (haiku_set_scroll_bar_default_width) (haiku_set_scroll_bar_default_height, haiku_scroll_bar_create) (haiku_set_horizontal_scroll_bar, haiku_set_vertical_scroll_bar) (haiku_create_terminal, haiku_scroll_bar_remove): Fix coding style. * src/image.c (image_create_bitmap_from_data) (image_create_bitmap_from_file): Implement on Haiku.
* Implement `sticky' frame parameter on HaikuPo Lu2022-05-071-0/+1
| | | | | | | * src/haiku_support.cc (BWindow_set_sticky): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_sticky, haiku_frame_parm_handlers): New frame param handler.
* Fix calculation of display resolution on HaikuPo Lu2022-05-061-2/+2
| | | | | | | | | | | | | | * src/haiku_support.cc (BScreen_px_dim): Rename to `be_get_screen_dimensions'. (BScreen_res): Rename to `be_get_display_resolution' and fix resolution computation. * src/haiku_support.h: Update prototypes. * src/haikufns.c (compute_tip_xy, Fx_display_pixel_width) (Fx_display_pixel_height, Fx_display_mm_height) (Fx_display_mm_width): Update accordingly. * src/haikuterm.c (haiku_term_init): Likewise.
* Speed up opening fonts on HaikuPo Lu2022-05-051-5/+43
| | | | | | | | | | | | | | | * src/font.h (font_property_index): Note that some font drivers use the extra data in a font entity to store driver-specific information. * src/haiku_font_support.cc (BFont_find): Set font indices. (be_open_font_at_index): New function. (BFont_open_pattern): Clean up coding style. * src/haiku_support.h (enum haiku_font_specification) (struct haiku_font_pattern): New fields and specifications for indices. * src/haikufont.c (haikufont_pattern_to_entity, haikufont_open): Use indices to open fonts if available in the extra data.
* Set initial size in the Haiku font dialogPo Lu2022-05-041-1/+1
| | | | | | | | | * src/haiku_support.cc (class EmacsFontSelectionDialog) (EmacsFontSelectionDialog): New argument `initial_size'. (be_select_font): Likewise. * src/haiku_support.h: Update prototypes. * src/haikufont.c (Fx_select_font): Set font dialog size to the pixel size of the current font.
* Clean up Haiku file panel codePo Lu2022-05-041-12/+1
| | | | | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (x-file-dialog): Fix nil values of `default-filename'. * src/haiku_io.c (haiku_len): Remove `FILE_PANEL_EVENT'. (record_c_unwind_protect_from_cxx, c_specpdl_idx_from_cxx) (c_unbind_to_nil_from_cxx): Delete functions. * src/haiku_support.cc (MessageReceived): Write pointer to buffer to file panel port instead. (struct popup_file_dialog_data): Delete strict. (unwind_popup_file_dialog): Delete functions. (be_popup_file_dialog): Accept a pointer to `process_pending_signals' and run nested event loop as usual. * src/haiku_support.h (enum haiku_event_type): Remove `FILE_PANEL_EVENT'. (struct haiku_file_panel_event): Delete struct. * src/haikufns.c (unwind_popup): Delete function. (Fhaiku_read_file_name): Update and quit on invalid filename. * src/haikuterm.c (struct unhandled_event): Delete struct. (haiku_read_socket): Remove "unhandled events".
* Fix handling of some weights in the Haiku font driverPo Lu2022-05-021-2/+0
| | | | | | | | * src/haiku_font_support.cc (font_style_to_flags): * src/haiku_support.h (enum haiku_font_weight): * src/haikufont.c (haikufont_weight_to_lisp) (haikufont_lisp_to_weight): Make `ultralight' and `extralight' mean the same thing.
* Default to currently selected font in Haiku font dialogsPo Lu2022-05-021-1/+3
| | | | | | | | | | | | | | | | | | | | * src/haiku_font_support.cc (be_find_font_indices): New function. * src/haiku_support.cc (class EmacsFontSelectionDialog) (UpdateStylesForIndex, EmacsFontSelectionDialog): Allow specifying an initial font family and style. (be_select_font): New parameters `initial_family' and `initial_style'. * src/haiku_support.h: Update prototypes. * src/haikufont.c (haikufont_lisp_to_weight) (haikufont_lisp_to_slant, haikufont_lisp_to_width): Handle `regular'. (haikufont_pattern_from_object): New function. (haikufont_spec_or_entity_to_pattern): Fix coding style. (Fx_select_font): Compute indices based on currently selected font. (syms_of_haikufont): New defsyms.
* Improve display of Haiku font dialogPo Lu2022-05-011-1/+0
| | | | | | | | | | | * src/haiku_support.cc (EmacsFontSelectionDialog) (class EmacsFontSelectionDialog, FrameResized): Set minimum size based on individual view dimensions and add label to size control. (BWindow_set_min_size): Delete function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_update_size_hints): Stop setting min size, since that doesn't work correctly on Haiku.
* Allow specifying font size in the Haiku font selection dialogPo Lu2022-05-011-1/+2
| | | | | | | | | | | | | * src/haiku_support.cc (struct font_selection_dialog_message): New fields `size' and `size_specified'. (class EmacsFontSelectionDialog): New `size_entry' control. (MessageReceived): Set size from that control if available. (EmacsFontSelectionDialog): Initialize that control. (FrameResized): Handle layout for that control. (be_select_font): New field `size'. * src/haiku_support.h: Update prototypes. * src/haikufont.c (Fx_select_font): Populate font spec with size.
* Allow quitting inside font selection dialogs on HaikuPo Lu2022-05-011-1/+1
| | | | | | | | | * src/haiku_support.cc (WaitForChoice): Accept new function for checking quit flag. (be_select_font): Pass that function. * src/haiku_support.h: Update prototypes. * src/haikufont.c (haikufont_should_quit_popup): New function. (Fx_select_font): Give said function to `be_select_font'.
* Improvements to the Haiku font dialogPo Lu2022-05-011-1/+1
| | | | | | | | | | * src/haiku_support.cc (class EmacsFontSelectionDialog) (EmacsFontSelectionDialog, FrameResized): Fix colors and respect monospace only. (be_select_font): New parameter `allow_monospace_only'. * src/haiku_support.h: Update prototype. * src/haikufont.c (Fx_select_font): Respect `exclude-proportional'.
* Implement font selection dialog on HaikuPo Lu2022-05-011-0/+4
| | | | | | | | | | | | | | | * src/haiku_font_support.cc (font_style_to_flags): Handle style allocation failures. (be_font_style_to_flags): New function. * src/haiku_support.cc (struct font_selection_dialog_message): New struct. (class EmacsFontSelectionDialog): New class. (be_select_font): New function. * src/haiku_support.h: Update prototypes. * src/haikufont.c (Fx_select_font): New function. (syms_of_haikufont): Define new subr.
* Fix colorspace calculations on HaikuPo Lu2022-04-291-0/+1
| | | | | | | | | | | | | | | | | | * src/haiku_support.cc (be_get_display_planes) (be_get_display_color_cells): Handle grayscale basic colorspaces correctly. (be_is_display_grayscale): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_no_accept_focus, haiku_iconify_frame) (Fxw_display_color_p, Fxw_color_values, Fx_display_grayscale_p): Actually handle grayscale colorspaces. (Fx_display_pixel_width, Fx_display_pixel_height) (Fx_display_mm_height, Fx_display_mm_width): Clean up coding style. (Fx_display_visual_class): Handle grayscale colorspaces. (syms_of_haikufns): New defsyms.
* Add simple session management support to HaikuPo Lu2022-04-271-16/+26
| | | | | | | | | | | | | | | | | | | | | | * lisp/term/common-win.el (emacs-save-session-functions): Move from x-win.el to common-win.el. * lisp/term/haiku-win.el (haiku-save-session-reply) (emacs-session-save, handle-save-session): New functions. * lisp/term/x-win.el (emacs-save-session-functions): Delete. * src/haiku_font_support.cc (font_style_to_flags): * src/haiku_support.h (enum haiku_font_weight): Turn weight macros into enum. (struct haiku_font_pattern): Likewise. (struct haiku_session_manager_reply): New struct. * src/haiku_io.c (haiku_io_init): Create sm port. * src/haiku_support.cc (QuitRequested): Wait for reply from sm port. * src/haikufns.c (Fhaiku_save_session_reply): New function. (syms_of_haikufns): Define new subr. * src/haikuterm.c (haiku_read_socket): Send session management events. (haiku_term_init): Check new port.
* Delete some unused functions on HaikuPo Lu2022-04-251-2/+0
| | | | | | * src/haiku_support.cc (haiku_current_workspace) (BWindow_workspaces): * src/haiku_support.h: Remove unused functions and prototypes.