summaryrefslogtreecommitdiff
path: root/src/haiku_support.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Minor cleanups to Haiku menu codePo Lu2022-04-191-9/+10
| | | | | | | | | | | | | * src/haiku_draw_support.cc (BView_SetHighColorForVisibleBell): Delete function. * src/haiku_font_support.cc (BFont_dat): Rename to `BFont_metrics'. * src/haiku_support.cc (DrawContent): Use correct UI color for control text. * src/haiku_support.h (HAIKU_MODIFIER_ALT): Turn into enum. (enum haiku_modifier_specification): New enum. * src/haikufont.c (haikufont_open, haikufont_close): Fix coding style.
* Fix Haiku menu bars when redisplay happens immediately after activationPo Lu2022-04-181-1/+1
| | | | | | | | | | * src/haiku_support.cc (MessageReceived): Make `REPLAY_MENU_BAR' messages synchronous. (be_replay_menu_bar_event): Return whether or not the menu bar really opened. * src/haiku_support.h: Update prototypes. * src/haikumenu.c (haiku_activate_menubar): Immediately activate menu bar after replaying event.
* Fix hangs when clicking on Haiku menu bar to activate framePo Lu2022-04-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | * src/haiku_io.c (haiku_len): Handle new event `MENU_BAR_CLICK'. * src/haiku_support.cc (class EmacsWindow): Remove most of the menu bar cv stuff. (MessageReceived): Handle REPLAY_MENU_BAR message. (EmacsWindow_signal_menu_update_complete): Delete function. (be_replay_menu_bar_event): New function. * src/haiku_support.h (enum haiku_event_type): New event type `MENU_BAR_CLICK'. (struct haiku_menu_bar_click_event): New struct. * src/haikumenu.c (haiku_activate_menubar): New function. * src/haikuterm.c (haiku_read_socket): Save a MENU_BAR_ACTIVATE_EVENT and the menu bar click event instead of handling the menu bar update synchronously. (haiku_create_terminal): Set `activate_menubar_hook'. (syms_of_haikuterm): Remove extraneous newline. * src/haikuterm.h (struct haiku_output): New field `saved_menu_event'.
* Fix default registry of Haiku font backendPo Lu2022-04-151-15/+14
| | | | | | | | | | | * src/haiku_support.h (struct haiku_zoom_event): Fix coding style. (enum haiku_font_specification): Move FSPECs over here. * src/haikufont.c (haikufont_apply_registry) (haikufont_get_fallback_entity, haikufont_pattern_to_entity) (haikufont_spec_or_entity_to_pattern, haikufont_list): Use `iso10646-1' as the default registry instead of `utf8', which is not a registry.
* ; * src/haiku_support.h: Fix header coding style.Po Lu2022-04-151-2/+2
|
* Clean up keysyms from Haiku headersPo Lu2022-04-151-38/+0
| | | | | | * src/haiku_support.cc (keysym_from_raw_char): Add keysym numbers here and use those instead. * src/haiku_support.h: Delete all the X11 keysym definitions.
* Clean up various bits of Haiku codePo Lu2022-04-151-548/+228
| | | | | | | | | | | | | | | | | | | | * src/haiku_font_support.cc (BFont_string_width): Delete unused function. * src/haiku_support.cc (BWindow_new): Clean up type of `view'. (BWindow_quit): Clean up coding style. (BView_mouse_down, BView_mouse_up, BView_mouse_moved): Delete unused functions. (unwind_popup_file_dialog): Clean up coding style. (be_popup_file_dialog_safe_set_target): Delete function. (be_popup_file_dialog): Improve code clarity. * src/haiku_support.h: Fix coding style. * src/haikufns.c (haiku_get_color, haiku_display_info_for_name) (check_haiku_display_info, Fhaiku_read_file_name) (Fx_display_save_under, Fhaiku_frame_restack): Remove references to "Be displays" and replace them with "Haiku displays". * src/haikuselect.h: Clean up coding style. * src/haikuterm.c (haiku_read_socket): Clean up coding style and fix a few latent bugs.
* Fix freezes when trying to accelerate menu bar on HaikuPo Lu2022-04-131-2/+1
| | | | | | | | | | | | | * src/haiku_support.cc (class EmacsWindow): New field `menus_begun'. (MenusBeginning): Don't send menu bar open events when that is set, instead set it to true. (BMenuBar_start_tracking): Stop locking the menu bar here and send a special BE_MENU_BAR_OPEN event instead. * src/haiku_support.h (struct haiku_menu_bar_state_event): Delete field `no_lock'. * src/haikumenu.c (Fhaiku_menu_bar_open): * src/haikuterm.c (haiku_read_socket): Update accordingly.
* Fix generation of extra DND events while dragging on HaikuPo Lu2022-04-041-0/+3
| | | | | | | | * src/haiku_support.cc (be_drag_message): Set new DND flag. (be_drag_and_drop_in_progress): New function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_read_socket): Don't store DND motion events if DND is in progress.
* Implement new DND options on HaikuPo Lu2022-04-031-0/+1
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-drag-and-drop): Handle special drag and drop motion events. * src/haiku_support.cc (MouseMoved): Set `dnd_message' flag. * src/haiku_support.h (struct haiku_mouse_motion_event): New member `dnd_message'. * src/haikuterm.c (haiku_read_socket): Create special DND events when the mouse moves with a drop message.
* Implement new drag and drop parameter on HaikuPo Lu2022-03-251-1/+1
| | | | | | | | | | * lisp/term/haiku-win.el (x-begin-drag): Implement `allow-current-frame'. * src/haiku_support.cc (be_drag_message): New argument `allow_same_view'. * src/haiku_support.h: Update prototypes. * src/haikuselect.c (Fhaiku_drag_message): New parameter `allow-same-frame'.
* Simplify fullscreen management on HaikuPo Lu2022-03-221-4/+2
| | | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsWindow, Zoom, UnZoom): Track zoom state manually instead of guessing what the system currently thinks it is. (MakeFullscreen): Always unzoom first. * src/haiku_support.h (struct haiku_zoom_event): Remove all fields and add a single field `zoomed'. * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame): Remove use of pending_zoom fields. * src/haikuterm.c (haiku_read_socket): Simplify handling of zoom events. (haiku_fullscreen): Simplify handling of different zoom states. * src/haikuterm.h (struct haiku_output): Remove all pending_zoom fields since they are no longer required.
* Minor fixes to Haiku DND supportPo Lu2022-03-211-2/+3
| | | | | | | | | | * src/haiku_support.cc (MessageReceived): If source is remote, don't test window ID. (MouseMoved): Don't send mouse motion if dragging. (be_drag_message): Return true if quit-flag. * src/haiku_support.h: Update prototypes. * src/haikuselect.c (haiku_should_quit_drag): New function. (Fhaiku_drag_message): If rc is true, quit.
* Implement cross-program drag-and-drop on HaikuPo Lu2022-03-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Fix documentation of `x-begin-drag' to match actual function arity. * lisp/term/haiku-win.el (haiku-dnd-selection-value): New variable. (haiku-dnd-selection-converters): New variable. (haiku-dnd-convert-string): New function. (gui-backend-get-selection, gui-backend-set-selection): Handle XdndSelection specially. (x-begin-drag): New function. * src/haiku_select.cc (be_create_simple_message) (be_add_message_data): New functions. * src/haiku_support.cc (WAIT_FOR_RELEASE): New message type. (class EmacsView, MouseUp): If waiting for release, reply and drop event. (be_drag_message, be_drag_message_thread_entry): New functions. * src/haiku_support.h: Update prototypes. * src/haikuselect.c (lisp_to_type_code, haiku_lisp_to_message) (Fhaiku_drag_message): New functions. (syms_of_haikuselect): Define new subr. * src/haikuselect.h: Update prototypes.
* Redo Haiku DND supportPo Lu2022-03-161-4/+6
| | | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-handle-drag-n-drop-event): Update for new DND event format. * src/haiku_io.c (haiku_len): Handle DRAG_AND_DROP_EVENTs. * src/haiku_select.cc (be_enum_message, be_get_refs_data) (be_get_message_data): New function. * src/haiku_support.cc (class Emacs): Remove `RefsReceived'. (MessageReceived): Generate new kind of drag-n-drop events. * src/haiku_support.h (enum haiku_event_type): Rename `REFS_EVENT' to `DRAG_AND_DROP_EVENT'. (struct haiku_refs_event): Delete struct. (struct haiku_drag_and_drop_event): New struct. * src/haikuselect.c (haiku_message_to_lisp): New function. (syms_of_haikuselect): New symbols. * src/haikuselect.h: Update prototypes. * src/haikuterm.c (haiku_read_socket): Handle new type of drag-and-drop events by serializing drop message to Lisp and letting Lisp code do the processing. * src/haikuterm.h: Update prototypes.
* Clean up some Haiku toolkit codePo Lu2022-03-141-1/+1
| | | | | | | | | * src/haiku_io.c (haiku_read_with_timeout): Accept `bigtime_t' instead of `time_t' for values which are cast to bigtime_t anyway. * src/haiku_support.cc (BMenu_run): Read all help events instead of just one. * src/haiku_support.h: Update prototypes.
* Allow dragging scroll bar for overscroll on HaikuPo Lu2022-03-131-1/+1
| | | | | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsScrollBar): New fields `in_overscroll', `can_overscroll', `last_overscroll', `last_reported_overscroll_value' and `max_value'. (ValueChanged): Make very sure extraneous value are not generated. (MouseUp): Clear overscroll if enabled. (MouseMoved): If overscroll is enabled and dragging downwards fails to dislodge the maximum value, enable overscrolling. (BView_scroll_bar_update): New parameter `can_overscroll' * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_set_scroll_bar_thumb) (haiku_set_horizontal_scroll_bar_thumb): Adjust parameters to scroll bar update functions. (haiku_read_socket): Take ceiling of bar position if horizontal.
* Fix scroll bar portion on Haiku scroll barsPo Lu2022-03-111-1/+2
| | | | | | | | | | | | | | | | | * src/haiku_support.cc (EmacsScrollBar): Set steps to appropriate value. (ValueChanged): Test new value against old value before sending value event. (MessageReceived): Handle portion and range. (BView_scroll_bar_update): New argument for portion. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_set_scroll_bar_thumb): (haiku_set_horizontal_scroll_bar_thumb): New functions. (haiku_set_horizontal_scroll_bar): (haiku_set_vertical_scroll_bar): Use those functions to set scroll bar values. (haiku_read_socket): Handle new meanings of scroll bar values. * src/haikuterm.h (struct scroll_bar):
* Improve handling of tooltips inside menus on HaikuPo Lu2022-03-091-1/+1
| | | | | | | | | * src/haiku_support.cc (BMenu_run): Make `process_pending_signals_function' return a struct timespec. * src/haiku_support.h: Update prototypes. * src/haikumenu.c (haiku_process_pending_signals_for_menu): Return result of `timer_run'. * src/haikuterm.c (haiku_flush): Flip buffers if frame is dirty.
* Obey decorator-specified width and height of tooltip frames on HaikuPo Lu2022-03-051-0/+3
| | | | | | | | | | * src/haiku_support.cc (BWindow_dimensions): New functions. * src/haiku_support.h: Update prototypes. * src/haikufns.c (Fx_show_tip): Use actual dimensions, because the decorator might specify a minimum width and height for the tooltip frame. * src/haikuterm.c (haiku_update_size_hints): Ignore tooltip frames.
* Prevent crashes on event for removed scroll bar on HaikuPo Lu2022-02-261-0/+3
| | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsScrollBar): Remove field `scroll_bar'. (ValueChanged, MouseDown, MouseUp, BScrollBar_make_for_view): Adjust for changes. * src/haiku_support.h (struct haiku_scroll_bar_value_event) (struct haiku_scroll_bar_drag_event) (struct haiku_scroll_bar_part_event): New field `window'. * src/haikuterm.c (haiku_scroll_bar_from_widget): New function. (haiku_read_socket): Adjust for changes in scroll bar event structures.
* Improve scroll bar button handling on HaikuPo Lu2022-02-261-0/+13
| | | | | | | | | | | | | | | | | | | | * src/haiku_io.c (haiku_len): Add `SCROLL_BAR_PART_EVENT'. * src/haiku_support.cc (class EmacsScrollBar): New fields `dragging' and `current_state', along with `old_value' and `current_part'. (EmacsScrollBar): Set horizontal flag to `horizontal_p'. (MessageReceived): Set old_value when receiving SCROLL_BAR_UPDATE message. (ValueChanged): Don't allow scroll bar values to change while dragging. (MouseUp, MouseDown): Calculate button under mouse and act accordingly. * src/haiku_support.h (enum haiku_event_type): New event `SCROLL_BAR_PART_EVENT'. (enum haiku_scroll_bar_part): New enumerator. (struct haiku_scroll_bar_part_event): New struct. * src/haikuterm.c (haiku_read_socket): Handle SCROLL_BAR_PART_EVENTs.
* Improve tracking of modified regions on HaikuPo Lu2022-02-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsView): New field `invalid_region'. (FlipBuffers): Only invalidate that region. (SetUpDoubleBuffering): Clear that region. (BView_draw_lock): New parameters for denoting the region to invalidate. (BView_invalidate_region): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_set_background_color): * src/haikumenu.c (digest_menu_items): * src/haikuterm.c (haiku_clip_to_string): (haiku_flip_buffers): (haiku_clear_frame_area): (haiku_clear_frame): (haiku_draw_glyph_string): (haiku_after_update_window_line): (haiku_draw_window_cursor): (haiku_draw_vertical_window_border): (haiku_draw_window_divider): (haiku_draw_fringe_bitmap): (haiku_scroll_run): (haiku_read_socket): (haiku_flash): (haiku_clear_under_internal_border): Mark appropriate region as invalid before buffer flip.
* Fix auto-lower when the mouse moves onto a scrollbar on HaikuPo Lu2022-02-241-0/+3
| | | | | | | | * src/haiku_support.cc (MouseMoved): (BView_inside_scroll_bar): New functions. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_read_socket): Don't auto-lower if the pointer left the view for a scroll bar.
* Implement left-right separators for dialog boxes on HaikuPo Lu2022-02-211-0/+3
| | | | | | | | | | | * src/haiku_support.cc (BAlert_set_offset_spacing): New function. * src/haiku_support.h: Update prototypes. * src/haikumenu.c (struct submenu_stack_cell): Remove unused struct. (haiku_dialog_show): Use offset spacing if a left-right boundary was seen and make sure the user can always quit a dialog if no enabled items exist.
* Handle GUI input while inside popup dialog on HaikuPo Lu2022-02-201-2/+5
| | | | | | | | | | | | * src/haiku_support.cc (alert_popup_value): New variable. (be_alert_thread_entry): New function. (BAlert_go): Complete rewrite that allows async input to be handled while the popup is active. * src/haiku_support.h: Update prototypes. * src/haikumenu.c (haiku_dialog_show, haiku_popup_dialog): Stop blocking input and pass required callbacks to `BAlert_go'. * src/haikuterm.c (haiku_term_init): Set interrupt input mode to t.
* Don't auto-lower when moving onto a menu bar on HaikuPo Lu2022-02-171-1/+8
| | | | | | | | | | | * src/haiku_io.c (haiku_len): Handle `MENU_BAR_LEFT'. * src/haiku_support.cc (EmacsMenuBar::MouseMoved): New function. * src/haiku_support.h (enum haiku_event_type): New event `MENU_BAR_LEFT'. (struct haiku_menu_bar_left_event): New structure. * src/haikuterm.c (haiku_read_socket): Don't auto-lower when the mouse exits the frame view onto the menu bar and handle MENU_BAR_LEFT events.
* Fix wide fringe bitmap processing on HaikuPo Lu2022-02-141-0/+4
| | | | | | | | | | | * src/haiku_support.cc (BBitmap_import_mono_bits): Rewrite to use ImportBits. (BBitmap_import_fringe_bitmap): New function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_define_fringe_bitmap): Pass entire short array to BBitmap_import_fringe_bitmap instead.
* Fix the Haiku portPo Lu2022-02-131-0/+18
| | | | | * src/haiku_support.h [__cplusplus]: Define `specpdl_ref' type on C++ since that code cannot include lisp.h.
* Replace ptrdiff_t with new specpdl_ref type for specpdl referencesMattias EngdegÄrd2022-02-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The specpdl_ref type is just an alias for ptrdiff_t; the compiled code remains the same. All operations on specpdl_ref (arithmetic, comparison etc) now go through inline functions. The bulk of the change is almost completely mechanical. It is done to prepare for a type-safe representation and subsequent performance improvement. * src/lisp.h (specpdl_ref, specpdl_count_to_ref, specpdl_ref_to_count) (specpdl_ref_eq, specpdl_ref_lt, specpdl_ref_valid_p) (make_invalid_specpdl_ref, specpdl_ref_add, specpdl_ref_to_ptr): New. (SPECPDL_INDEX, struct handler, USE_SAFE_ALLOCA, safe_free) (safe_free_unbind_to): * src/alloc.c (run_finalizer_function, inhibit_garbage_collection) (garbage_collect, Fgarbage_collect, which_symbols): * src/bidi.c (bidi_at_paragraph_end, bidi_find_paragraph_start): * src/buffer.c (Fkill_buffer, Fset_buffer_major_mode, Fmove_overlay) (Fdelete_overlay): * src/bytecode.c (exec_byte_code): * src/callint.c (Ffuncall_interactively, Fcall_interactively): * src/callproc.c (Fcall_process, call_process, create_temp_file) (Fcall_process_region): * src/charset.c (load_charset_map_from_file): * src/coding.c (decode_coding_gap, decode_coding_object) (encode_coding_object, Fread_coding_system): * src/comp.c (emit_static_object, helper_unbind_n, load_comp_unit): * src/composite.c (update_compositions, autocmp_chars): * src/cygw32.c (conv_filename_to_w32_unicode) (conv_filename_from_w32_unicode): * src/data.c (notify_variable_watchers): * src/decompress.c (Fzlib_decompress_region): * src/dired.c (directory_files_internal, file_name_completion) (file_attributes): * src/dispnew.c (Fredisplay): * src/doc.c (get_doc_string, Fsnarf_documentation): * src/editfns.c (Fsave_excursion, Fsave_current_buffer) (Freplace_buffer_contents, Fsubst_char_in_region, Fsave_restriction) (styled_format): * src/emacs-module.c (Fmodule_load, funcall_module): * src/emacs.c (init_cmdargs, Fdump_emacs): * src/eval.c (call_debugger, do_debug_on_call, FletX, Flet) (Ffuncall_with_delayed_message, Funwind_protect) (internal_lisp_condition_case, signal_or_quit) (load_with_autoload_queue, Feval, grow_specpdl_allocation) (record_in_backtrace, eval_sub, Ffuncall, apply_lambda) (funcall_lambda, clear_unwind_protect, set_unwind_protect) (set_unwind_protect_ptr, unbind_to, Fbacktrace_eval): * src/fileio.c (Fmake_temp_file_internal, Fcopy_file, Frename_file) (Finsert_file_contents, write_region, Fdo_auto_save): * src/fns.c (Fyes_or_no_p, Frequire, hash_table_user_defined_call): * src/fringe.c (update_window_fringes): * src/gtkutil.c (xg_dialog_run): * src/haiku_io.c (c_specpdl_idx_from_cxx): * src/haiku_support.cc (be_popup_file_dialog): * src/haiku_support.h (c_specpdl_idx_from_cxx): * src/haikufns.c (haiku_create_frame, haiku_create_tip_frame) (haiku_hide_tip, Fx_show_tip, Fhaiku_read_file_name): * src/haikumenu.c (haiku_popup_dialog, set_frame_menubar): * src/image.c (slurp_file): * src/indent.c (line_number_display_width, Fvertical_motion): * src/insdel.c (signal_before_change, signal_after_change) (Fcombine_after_change_execute): * src/intervals.c (get_local_map): * src/json.c (lisp_to_json_nonscalar_1, Fjson_serialize, Fjson_insert) (Fjson_parse_string, Fjson_parse_buffer): * src/keyboard.c (recursive_edit_1, Frecursive_edit, cmd_error) (Finternal_track_mouse, command_loop_1, read_menu_command) (safe_run_hooks, read_event_from_main_queue, read_char, timer_check_2) (menu_item_eval_property, read_key_sequence, read_key_sequence_vs) (Fsuspend_emacs): * src/keymap.c (Fcurrent_active_maps, Fdescribe_vector) (Fhelp__describe_vector): * src/lread.c (Fload, save_match_data_load, readevalloop) (Feval_buffer, Feval_region, grow_read_buffer, read_integer, read1): * src/macros.c (Fexecute_kbd_macro): * src/menu.c (x_popup_menu_1): * src/minibuf.c (read_minibuf, set_minibuffer_mode) (read_minibuf_unwind, Fread_string, Fread_buffer): * src/nsfns.m (Fx_create_frame, Fx_show_tip): * src/nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog): * src/pdumper.c (Fdump_emacs_portable): * src/pgtkfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fpgtk_print_frames_dialog, Fx_file_dialog, Fx_select_font): * src/pgtkmenu.c (set_frame_menubar, create_and_show_popup_menu) (pgtk_menu_show, create_and_show_dialog, pgtk_dialog_show) (pgtk_popup_dialog): * src/pgtkterm.c (pgtk_cr_export_frames): * src/print.c (PRINTPREPARE, temp_output_buffer_setup) (Fprin1_to_string, print_vectorlike): * src/process.c (Fmake_process, create_process, Fmake_pipe_process) (Fmake_serial_process, connect_network_socket, Fmake_network_process) (network_interface_info, server_accept_connection) (wait_reading_process_output, read_process_output, exec_sentinel): * src/regex-emacs.c (re_match_2_internal): * src/search.c (looking_at_1, fast_looking_at, search_buffer_re): * src/sound.c (Fplay_sound_internal): * src/sysdep.c (system_process_attributes): * src/term.c (tty_menu_show): * src/textprop.c (Fnext_single_char_property_change) (Fprevious_single_char_property_change, add_text_properties_1) (set_text_properties, set_text_properties_1, Fremove_text_properties) (Fremove_list_of_text_properties): * src/thread.c (Fmutex_lock, invoke_thread_function): * src/undo.c (truncate_undo_list): * src/w32fns.c (Fx_create_frame, w32_create_tip_frame, w32_hide_tip) (Fx_show_tip, Fx_file_dialog): * src/w32font.c (Fx_select_font): * src/w32menu.c (set_frame_menubar): * src/window.c (window_list, next_window, window_list_1) (run_window_configuration_change_hook, Frun_window_scroll_functions) (run_window_change_functions, set_window_buffer) (temp_output_buffer_show, window_scroll, scroll_command) (Fscroll_other_window, Fscroll_other_window_down): * src/xdisp.c (safe__call, handle_fontified_prop, handle_face_prop) (handle_single_display_spec, Fbuffer_text_pixel_size) (message_dolog, with_echo_area_buffer, setup_echo_area_for_printing) (display_echo_area, set_message, clear_message, echo_area_display) (gui_consider_frame_title, prepare_menu_bars, update_menu_bar) (update_tab_bar, update_tool_bar, redisplay_internal) (redisplay_preserve_echo_area, run_window_scroll_functions) (redisplay_window, extend_face_to_end_of_line) (display_count_lines_logically, display_count_lines_visually) (display_mode_lines, display_mode_line, Fformat_mode_line) (decode_mode_spec): * src/xfns.c (Fx_create_frame, x_create_tip_frame, x_hide_tip) (Fx_show_tip, Fx_file_dialog, Fx_select_font, Fx_print_frames_dialog): * src/xmenu.c (set_frame_menubar, create_and_show_popup_menu) (x_menu_show, create_and_show_dialog, x_dialog_show) (xw_popup_dialog): * src/xselect.c (x_get_local_selection, x_reply_selection_request) (x_handle_selection_request, wait_for_property_change): * src/xterm.c (x_cr_export_frames, x_connection_closed): Replace ptrdiff_t with specpdl_ref for referencing specpdl and use the corresponding functions instead of direct arithmetic.
* Implement visual bell on Haiku like on XPo Lu2022-02-121-7/+3
| | | | | | | | | | | | | | | * src/haiku_draw_support.cc (BView_FillRectangleForVisibleBell): Delete function. (BView_InvertRect): New function. * src/haiku_support.cc (class EmacsView): Delete field `visible_bell_color' and visible bell related methods. (EmacsView_do_visible_bell): Delete function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_flash): Implement using `BView_InvertRect'. (haiku_beep): Use `haiku_flash' instead.
* Implement `list_family' for the haikufont driverPo Lu2022-02-091-0/+3
| | | | | | | | * src/haiku_font_support.cc (be_list_font_families): New function. * src/haiku_support.h: Update prototypes. * src/haikufont.c (haikufont_list_family): New function. (haikufont_driver): Add `haikufont_list_family'.
* Stop creating cairo contexts in haiku_begin_cr_clipPo Lu2022-02-031-2/+2
| | | | | | | | | | | | | | | | * src/haikufont.c (haikufont_draw): * src/ftcrfont.c (ftcrfont_draw): Stop holding the draw lock. * src/haiku_support.cc (class EmacsView): New field `cairo_context'. (DetachCairoSurface): Destroy cairo_context. (AttachCairoSurface): Create cairo_context from the surface. (EmacsView_cairo_surface): Delete function. (EmacsView_cairo_context): New function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_begin_cr_clip): (haiku_end_cr_clip): Retrieve the existing cairo context instead of creating a new one. * src/haikuterm.h (FRAME_CR_CONTEXT): New macro.
* Write a dummy event on each popup menu eventPo Lu2022-01-291-1/+7
| | | | | | | | | | * src/haiku_io.c (haiku_len): Add new event. * src/haiku_support.cc (be_popup_menu_thread_entry): (Highlight): Write a dummy event to the event port. * src/haiku_support.h (enum haiku_event_type): New `DUMMY_EVENT' type. (struct haiku_dummy_event): New structure. * src/haikuterm.c (haiku_read_socket): Handle dummy events.
* Implement real menu help-echo text on HaikuPo Lu2022-01-291-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/tooltip.el (tooltip-show-help): Remove Haiku-specific conditional since that's now taken care of by C code. * src/haiku_io.c (haiku_read_size): (haiku_read_with_timeout): (haiku_write_without_signal): Add parameter `popup_p'. All callers changed. (port_popup_menu_to_emacs): New variable. * src/haiku_support.cc (struct be_popup_menu_data): New structure. (be_popup_menu_thread_entry): New function. (class EmacsMenuItem): New field `menu_ptr'. (Highlight): Send help text to the popup port if this item isn't for a menu bar. (BMenu_add_item): Set menu_ptr appropriately. (BMenu_run): Complete rewrite that allows to read help text from the menu bar port. * src/haiku_support.h (struct haiku_menu_bar_help_event): New fields for popup menus. * src/haikumenu.c (digest_menu_items): Only set help tooltip on popup menus when system tooltips are enabled. (haiku_menu_show_help): (haiku_process_pending_signals_for_menu): New functions. (haiku_menu_show): Pass new callbacks.
* Improve reliability of menu bar updates on HaikuPo Lu2022-01-251-0/+4
| | | | | | | | | | | | | | | * src/haiku_support.cc (class EmacsWindow): New fields `menu_update_cv', `menu_update_mutex' and `menu_updated_p'. (~EmacsWindow): Destroy cv and mutex. (MenusBeginning): Release lock and wait for condition to be become true. (EmacsWindow_signal_menu_update_complete): New function. * src/haiku_support.h (struct haiku_menu_bar_state_event): New field `no_lock'. * src/haikumenu.c (Fhaiku_menu_bar_open): Always update menu bar. * src/haikuterm.c (haiku_read_socket): Always update menu bar and signal the window thread after update completion.
* Use more reliable timestamps for some kinds of events on HaikuPo Lu2022-01-191-1/+7
| | | | | | | | | | | | | * src/haiku_support.cc (DispatchMessage): (MouseMoved): (MouseDown): (MouseUp): Set `time' field of event structures to input server time. * src/haiku_support.h (struct haiku_key_event): (struct haiku_mouse_motion_event): (struct haiku_button_event): New field `time'. * src/haikuterm.c (haiku_read_socket): Use input server time if provided.
* Load X resources from a settings file like other programs on HaikuPo Lu2022-01-101-0/+3
| | | | | | | | | | * doc/emacs/haiku.texi (Haiku Basics): Document how X resources are discovered on Haiku. * src/haiku_support.cc (class Emacs): Load settings file. (be_find_setting): New function. * src/haiku_support.h (be_find_setting): New prototype. * src/haikuterm.c (get_string_resource): Look in the settings file if there's nothing in the in-memory resource database.
* Don't hard code key codes on HaikuPo Lu2022-01-101-6/+2
| | | | | | | | | | * src/haiku_support.cc (keysym_from_raw_char): New function. (DispatchMessage): Map raw character to keysym if applicable. (be_map_key): Delete function. * src/haiku_support.h (struct haiku_key_event): Update fields to hold keysym and character instead. * src/haikuterm.c (haiku_read_socket): Don't call be_map_key, and use keysym field if provided instead.
* Map some more keypad keys on HaikuPo Lu2022-01-101-1/+1
| | | | | | | * src/haiku_support.cc (BMapKey): Rename to `be_map_key'. (be_map_key): Recognize more key codes. * src/haiku_support.h (BMapKey, be_map_key): Adjust accordingly. * src/haikuterm.c (haiku_read_socket): Likewise.
* Implement override redirect on HaikuPo Lu2022-01-091-0/+3
| | | | | | | | | | | * src/haiku_support.cc (pre_override_redirect_style): (pre_override_redirect_feel): New variables. (BWindow_set_override_redirect): * src/haiku_support.h (BWindow_set_override_redirect): New functions. * src/haikufns.c (haiku_create_frame): Set override redirect. (haiku_set_override_redirect): New function. (haiku_frame_parm_handlers): Add `haiku_set_override_redirect'
* Enable subpixel antialiasing on the Cairo font driver on HaikuPo Lu2022-01-051-0/+3
| | | | | | | | | | | * src/ftcrfont.c (ftcrfont_open): Manually enable subpixel antialiasing on Haiku. * src/haiku_support.cc (get_subpixel_antialiasing): New function declaration. (be_use_subpixel_antialising): * src/haiku_support.h (be_use_subpixel_antialising): New functions.
* Rationalize Haiku rectangle handlingPo Lu2022-01-041-0/+24
| | | | | | | | | | | | | | | | | | * src/haiku_draw_support.cc (BView_DrawBitmapWithEraseOp): (BView_DrawMask): (rotate_bitmap_270): (rotate_bitmap_90): (BBitmap_transform_bitmap): * src/haiku_support.cc (UnZoom): (GetParentWidthHeight): (MakeFullscreen): (AttachCairoSurface): (AfterResize): (DrawContent): (BView_cr_dump_clipping): Use new rectangle handling macros. * src/haiku_support.h (BE_RECT_WIDTH, BE_RECT_HEIGHT): New macros.
* Improve Haiku frame restacking logicPo Lu2022-01-041-0/+3
| | | | | | | | * src/haiku_support.cc (BWindow_is_active): * src/haiku_support.h (BWindow_is_active): New functions. * src/haikufns.c (Fhaiku_frame_restack): Prevent the newly raised frame from being sent to the back of the display.
* Find a way to make restacking frames work on HaikuPo Lu2022-01-041-0/+3
| | | | | | | | | | | | | * doc/lispref/frames.texi (Raising and Lowering): Update documentation to reflect that restacking frames is now supported on Haiku. * lisp/frame.el (haiku-frame-restack): New declaration. (frame-restack): Use `haiku-frame-restack' on Haiku. * src/haiku_support.cc (BWindow_send_behind): * src/haiku_support.h (BWindow_send_behind): * src/haikufns.c (Fhaiku_frame_restack): New functions. (syms_of_haikufns): New subr `haiku-frame-restack'.
* Make quitting actually work in Haiku file dialogsPo Lu2022-01-021-1/+2
| | | | | | | | * src/haiku_support.h: (be_popup_file_dialog) * src/haiku_support.cc (be_popup_file_dialog): New parameter `maybe_quit_function'. * src/haikufns.c (Fhaiku_read_file_name): Pass `maybe_quit' as the maybe_quit_function.
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* On Haiku, sync a frames's connection to the app sever after raisingPo Lu2021-12-311-0/+3
| | | | | | | | * src/haiku_support.h: (BWindow_sync) * src/haiku_support.cc (BWindow_sync): New function. * src/haikuterm.c (haiku_frame_raise_lower): Synchronize window after raising it to avoid situations where raising windows is done out-of-order, such as when ediff raises a frame.
* Add support for the Haiku operating system and its window systemPo Lu2021-11-201-0/+869
* .gitignore: Add binaries specific to Haiku. * Makefie.in (HAVE_BE_APP): New variable. (install-arch-dep): Install Emacs and Emacs.pdmp when using Haiku. * configure.ac: Detect and configure for Haiku and various related configurations. (be-app, be-freetype, be-cairo): New options. (HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ) (HAIKU_LIBS, HAIKU_CFLAGS): New variables. (HAIKU, HAVE_TINY_SPEED_T): New define. (emacs_config_features): Add BE_APP. * doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku appendix. * doc/emacs/emacs.texi: Add Haiku appendix to menus and include it. * doc/emacs/haiku.texi: New Haiku appendix. * doc/lispref/display.texi (Defining Faces, Window Systems): Explain meaning of `haiku' as a window system identifier. (haiku-use-system-tooltips): Explain meaning of system tooltips on Haiku. * doc/lispref/frames.texi (Multiple Terminals): Explain meaning of haiku as a display type. (Frame Layout): Clarify section for Haiku frames. (Size Parameters): Explain limitations of fullwidth and fullheight on Haiku. (Management Parameters): Explain limitations of inhibiting double buffering on builds with Cairo, and the inability of frames with no-accept-focus to receive keyboard input on Haiku. (Font and Color Parameters): Explain the different font backends available on Haiku. (Raising and Lowering): Explain that lowering and restacking frames doesn't work on Haiku. (Child Frames): Explain oddities of child frame visibility on Haiku. * doc/lispref/os.texi (System Environment): Explain meaning of haiku. * etc/MACHINES: Add appropriate notices for Haiku. * etc/NEWS: Document changes. * etc/PROBLEMS: Document font spacing bug on Haiku. * lib-src/Makefile.in: Build be-resources binary on Haiku. (CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS) (HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables. (DONT_INSTALL): Add be-resources binary if on Haiku. (be-resources): New target. * lib-src/be_resources: Add helper binary for setting resources on the Emacs application. * lib-src/emacsclient.c (decode_options): Set alt_display to "be" on Haiku. * lisp/cus-edit.el (custom-button, custom-button-mouse) (custom-button-unraised, custom-button-pressed): Update face definitions for Haiku. * lisp/cus-start.el: Add haiku-debug-on-fatal-error and haiku-use-system-tooltips. * lisp/faces.el (face-valid-attribute-values): Clarify attribute comment for Haiku. (tool-bar): Add appropriate toolbar color for Haiku. * lisp/frame.el (haiku-frame-geometry) (haiku-mouse-absolute-pixel-position) (haiku-set-mouse-absolute-pixel-position) (haiku-frame-edges) (haiku-frame-list-z-order): New function declarations. (frame-geometry, frame-edges) (mouse-absolute-pixel-position) (set-mouse-absolute-pixel-position) (frame-list-z-order): Call appropriate window system functions on Haiku. (display-mouse-p, display-graphic-p) (display-images-p, 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): Update type tests for Haiku. * lisp/international/mule-cmds.el (set-coding-system-map): Also prevent set-terminal-coding-system from appearing in the menu bar on Haiku. * lisp/loadup.el: Load Haiku-specific files when built with Haiku, and don't rename newly built Emacs on Haiku as BFS doesn't support hard links. * lisp/menu-bar.el (menu-bar-open): Add for Haiku. * lisp/mwheel.el (mouse-wheel-down-event): Expect wheel-up on Haiku. (mouse-wheel-up-event): Expect wheel-down on Haiku. (mouse-wheel-left-event): Expect wheel-left on Haiku. (mouse-wheel-right-event): Expect wheel-right on Haiku. * lisp/net/browse-url.el (browse-url--browser-defcustom-type): Add option for WebPositive. (browse-url-webpositive-program): New variable. (browse-url-default-program): Search for WebPositive. (browse-url-webpositive): New function. * lisp/net/eww.el (eww-form-submit, eww-form-file) (eww-form-checkbox, eww-form-select): Define faces appropriately for Haiku. * lisp/term/haiku-win.el: New file. * lisp/tooltip.el (menu-or-popup-active-p): New function declaration. (tooltip-show-help): Don't use tooltips on Haiku when a menu is active. * lisp/version.el (haiku-get-version-string): New function declaration. (emacs-version): Add Haiku version string if appropriate. * src/Makefile.in: Also produce binary named "Emacs" with Haiku resources set. (CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS) (HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS) (ALL_CXX_FLAGS): New variables. (.SUFFIXES): Add .cc. (.cc.o): New target. (base_obj): Add Haiku C objects. (doc_obj, obj): Split objects that should scanned for documentation into doc_obj. (SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects. (all): Depend on Emacs and Emacs.pdmp on Haiku. (LIBES): Add Haiku libraries. (gl-stamp) ($(etc)/DOC): Scan doc_obj instead of obj (temacs$(EXEEXT): Use C++ linker on Haiku. (ctagsfiles3): New variable. (TAGS): Scan C++ files. * src/alloc.c (garbage_collect): Mark Haiku display. * src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable on Haiku. (struct image): Add fields for Haiku transforms. (RGB_PIXEL_COLOR): Define to unsigned long on Haiku as well. (sit_for): Also check USABLE_SIGPOLL. (init_display_interactive): Set initial window system to Haiku on Haiku builds. * src/emacs.c (main): Define Haiku syms and init haiku clipboard. (shut_down_emacs): Quit BApplication on Haiku and trigger debug on aborts if haiku_debug_on_fatal_error. (Vsystem_type): Update docstring. * src/fileio.c (next-read-file-uses-dialog-p): Enable on Haiku. * src/filelock.c (WTMP_FILE): Only define if BOOT_TIME is also defined. * src/floatfns.c (double_integer_scale): Work around Haiku libroot brain damage. * src/font.c (syms_of_font): Define appropriate font driver symbols for Haiku builds with various options. * src/font.h: Also enable ftcrfont on Haiku builds with Cairo. (font_data_structures_may_be_ill_formed): Also enable on Haiku builds that have Cairo. * src/frame.c (Fframep): Update doc-string for Haiku builds and return haiku if appropriate. (syms_of_frame): New symbol `haiku'. * src/frame.h (struct frame): Add output data for Haiku. (FRAME_HAIKU_P): New macro. (FRAME_WINDOW_P): Test for Haiku frames as well. * src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG) (BLUE_FROM_ULONG): New macros. (ftcrfont_draw): Add haiku specific code for Haiku builds with Cairo. * src/ftfont.c (ftfont_open): Set face. (ftfont_has_char, ftfont_text_extents): Work around crash. (syms_of_ftfont): New symbol `mono'. * src/ftfont.h (struct font_info): Enable Cairo-specific fields for Cairo builds on Haiku. * src/haiku_draw_support.cc: * src/haiku_font_support.cc: * src/haiku_io.c: * src/haiku_select.cc: * src/haiku_support.cc: * src/haiku_support.h: * src/haikufns.c: * src/haikufont.c: * src/haikugui.h: * src/haikuimage.c: * src/haikumenu.c: * src/haikuselect.c: * src/haikuselect.h: * src/haikuterm.c: * src/haikuterm.h: Add new files for Haiku windowing support. * src/haiku.c: Add new files for Haiku operating system support. * src/image.c: Implement image transforms and native XPM support on Haiku. (GET_PIXEL, PUT_PIXEL, NO_PIXMAP) (PIX_MASK_RETAIN, PIX_MASK_DRAW) (RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG) (BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG) (BLUE16_FROM_ULONG): Define to appropriate values on Haiku. (image_create_bitmap_from_data): Add Haiku support. (image_create_bitmap_from_file): Add TODO on Haiku. (free_bitmap_record): Free bitmap on Haiku. (image_size_in_bytes): Implement for Haiku bitmaps. (image_set_transform): Implement on Haiku. (image_create_x_image_and_pixmap_1): Implement on Haiku, 24-bit or 1-bit only. (image_destroy_x_image, image_get_x_image): Use correct img and pixmap values on Haiku. (lookup_rgb_color): Use correct macro on Haiku. (image_to_emacs_colors): Implement on Haiku. (image_disable_image): Disable on Haiku. (image_can_use_native_api): Test for translator presence on Haiku. (native_image_load): Use translator on Haiku. (imagemagick_load_image): Add Haiku-specific quirks. (Fimage_transforms_p): Allow rotate90 on Haiku. (image_types): Enable native XPM support on Haiku. (syms_of_image): Enable XPM images on Haiku. * src/keyboard.c (kbd_buffer_get_event) (handle_async_input, handle_input_available_signal) (handle_user_signal, Fset_input_interrupt_mode) (init_keyboard): Check for USABLE_SIGPOLL along with USABLE_SIGIO. * src/lisp.h (pD): Work around broken Haiku headers. (HAVE_EXT_MENU_BAR): Define on Haiku. (handle_input_available_signal): Enable if we just have SIGPOLL as well. * src/menu.c (have_boxes): Return true on Haiku. (single_menu_item): Enable toolkit menus on Haiku. (find_and_call_menu_selection): Also enable on Haiku. * src/process.c (keyboard_bit_set): Enable with only usable SIGPOLL. (wait_reading_process_output): Test for SIGPOLL as well as SIGIO availability. * src/sound.c (sound_perror, vox_open) (vox_configure, vox_close): Enable for usable SIGPOLL as well. * src/sysdep.c (sys_subshell): Enable for usable SIGPOLL. (reset_sigio): Make conditional on F_SETOWN. (request_sigio, unrequest_sigio) (emacs_sigaction_init): Also handle SIGPOLLs. (init_sys_modes): Disable TCXONC usage on Haiku, as it doesn't have any ttys other than pseudo ttys, which don't support C-s/C-q flow control, and causes compiler warnings. (speeds): Disable high speeds if HAVE_TINY_SPEED_T. * src/termhooks.h (enum output_method): Add output_haiku. (struct terminal): Add Haiku display info. (TERMINAL_FONT_CACHE): Enable for Haiku. * src/terminal.c (Fterminal_live_p): Return `haiku' if appropriate. * src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging variables. * src/xdisp.c (redisplay_internal) (note_mouse_highlight): Return on Haiku if a popup is activated. (display_menu_bar): Return on Haiku if frame is a Haiku frame. * src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku. (x_create_gc): Enable dummy GC code on Haiku. * src/xfns.c (x-server-version, x-file-dialog): Add Haiku specifics to doc strings. * src/xterm.c (syms_of_xterm): Add Haiku information to doc string.