summaryrefslogtreecommitdiff
path: root/src/haikuterm.c
Commit message (Collapse)AuthorAgeFilesLines
* Prefer C23 ckd_* to Gnulib *_WRAPV macrosPaul Eggert2023-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C23 has added ckd_add etc. macros with functionality equivalent to the older Gnulib INT_ADD_WRAPV macros, so switch to the more-standard names. * admin/merge-gnulib (GNULIB_MODULES): Add stdckdint. This merely makes the dependency explicit, as we were already using this Gnulib module indirectly. * lib-src/etags.c, src/lisp.h: Include stdckdint.h. * lib-src/etags.c (xnmalloc, xnrealloc): * src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string) (mark_memory): * src/bignum.c (emacs_mpz_pow_ui): * src/buffer.c (record_overlay_string, overlay_strings): * src/bytecode.c (exec_byte_code): * src/casefiddle.c (do_casify_multibyte_string): * src/ccl.c (ccl_driver, Fccl_execute_on_string): * src/character.c (char_width, c_string_width) (lisp_string_width, count_size_as_multibyte) (string_escape_byte8): * src/cmds.c (internal_self_insert): * src/coding.c (coding_alloc_by_realloc, produce_chars): * src/data.c (arith_driver): * src/dispnew.c (realloc_glyph_pool, init_display_interactive): * src/doprnt.c (parse_format_integer): * src/editfns.c (Freplace_buffer_contents, str2num) (styled_format): * src/emacs-module.c (module_global_reference_p) (module_make_global_ref, module_funcall): * src/eval.c (max_ensure_room): * src/fileio.c (blocks_to_bytes): * src/fns.c (Ffillarray): * src/font.c (font_intern_prop): * src/frame.c (check_frame_pixels): * src/gnutls.c (gnutls_hex_string, gnutls_symmetric_aead): * src/gtkutil.c (get_utf8_string): * src/haikuterm.c (haiku_term_init): * src/image.c (xbm_scan, image_to_emacs_colors) (image_detect_edges, png_load_body): * src/keyboard.c (Frecursion_depth): * src/keymap.c (Flookup_key, Fkey_description): * src/lisp.h (modiff_incr, SAFE_ALLOCA_LISP_EXTRA): * src/lread.c (read_bool_vector): * src/pgtkterm.c (pgtk_term_init): * src/regex-emacs.c (regex_compile): * src/term.c (encode_terminal_code): * src/termcap.c (tputs): * src/textconv.c (textconv_query): * src/timefns.c (timespec_ticks, lisp_time_hz_ticks) (Fdecode_time, check_tm_member): * src/tparam.c (tparam1): * src/w32term.c (w32_initialize_display_info): * src/xdisp.c (fill_column_indicator_column, decode_mode_spec): * src/xselect.c (selection_data_size, x_property_data_to_lisp): * src/xsmfns.c (smc_save_yourself_CB): * src/xterm.c (xm_setup_dnd_targets, x_sync_get_monotonic_time) (x_sync_current_monotonic_time, x_sync_note_frame_times) (x_display_set_last_user_time, x_term_init): Prefer the C23 stdckdint macros to their Gnulib intprops.h counterparts, since C23 is standard.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Fix automatic DPI adjustment and add workarounds for some systemsPo Lu2022-11-191-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (x-create-frame-with-faces): New field `delayed-font'. Set the `font-parameter' property to `font' in the given parameter list after face-set-after-frame-default is called. * src/fontset.c (Fset_fontset_font): Avoid changing `font-parameter' with the call to Fmodify_frame_parameters. * src/frame.c (gui_set_frame_parameters_1): New function. Factor out gui_set_frame_parameters here, and add an argument DEFAULT_PARAMETER. If the `font' parameter is set, and `default_parameter' is not, then set the `font-parameter' frame parameter to the `font' parameter as well, to keep track of which user-specified `font' frame parameter set the default face's font on the frame. (gui_set_frame_parameters): Call gui_set_frame_parameters_1 with new arg set to false. (gui_set_font): Remove broken implementation of `font-parameter'. (gui_default_parameter): If the default value was used, then call gui_set_frame_parameters_1 with the new argument set to false. This is because no font was specified as a frame parameter by the user, so Freconsider_frame_fonts is free to do anything it wants. (Freconsider_frame_fonts): If `font-parameter' is set, then use it. (syms_of_frame): New defsym Qfont_parameter. * src/frame.h: Update prototypes. * src/haikuterm.c (haiku_default_font_parameter): * src/pgtkfns.c (pgtk_default_font_parameter): * src/w32fns.c (w32_default_font_parameter): Stop setting `font-parameter' here. This code resulted in decades of automatic font rescaling not working correctly. * src/xfaces.c (set_font_frame_param): Clear the `font-parameter' frame parameter. (Finternal_merge_in_global_face): * src/xfns.c (x_default_font_parameter): Avoid changing `font-parameter' in response to changes to face attributes. * src/xsettings.c (apply_xft_settings): Add workaround for Cairo. (bug#59371, bug#59347, bug#59283, bug#59271, bug#59285, bug#59306.)
* Adapt last change to Haiku portPo Lu2022-10-161-5/+27
| | | | | | | | | | | * src/haikuterm.c (haiku_frame_up_to_date): (haiku_clear_frame): (haiku_update_begin): (haiku_flush): (haiku_flush_dirty_back_buffer_on): (haiku_read_socket): * src/haikuterm.h (struct haiku_output): (FRAME_COMPLETE_P): Synchronize logic with X.
* Implement font-use-system-font on HaikuPo Lu2022-09-251-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Remove intern calls with a static string from haiku*.cPo Lu2022-09-201-1/+3
| | | | | | | | * src/haikufns.c (Fx_show_tip, syms_of_haikufns): * src/haikufont.c (haikufont_maybe_handle_special_family) (syms_of_haikufont): * src/haikuterm.c (haiku_term_init, syms_of_haikuterm): Replace intern with real predefined symbols.
* Support "replacement characters" on TTY framesEli Zaretskii2022-08-271-0/+2
| | | | | | | | | | | | | | | | | | * src/nsterm.m (ns_draw_glyphless_glyph_string_foreground): * src/pgtkterm.c (pgtk_draw_glyphless_glyph_string_foreground): * src/haikuterm.c (haiku_draw_glyphless_glyph_string_foreground): * src/xterm.c (x_draw_glyphless_glyph_string_foreground): * src/w32term.c (w32_draw_glyphless_glyph_string_foreground): * src/xdisp.c (lookup_glyphless_char_display): Handle extra-slot of 'glyphless-char-display' that is a cons cell. (syms_of_xdisp) <glyphless-char-display>: Update doc string. * etc/NEWS: * doc/lispref/display.texi (Glyphless Chars): Document the new feature. * lisp/faces.el (glyphless-char): Make the face stand out on TTY frames that don't support the underline attribute.
* Improve frame synchronization support on HaikuPo Lu2022-08-011-44/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/ftcrfont.c (ftcrfont_draw): * src/haikufns.c (haiku_set_background_color): * src/haikuterm.c (haiku_clip_to_string): (haiku_clip_to_string_exactly): (haiku_clear_frame_area): (haiku_clear_frame): (haiku_draw_box_rect): (haiku_draw_relief_rect): (haiku_draw_underwave): (haiku_draw_text_decoration): (haiku_draw_plain_background): (haiku_draw_stipple_background): (haiku_draw_glyph_string_foreground): (haiku_draw_glyphless_glyph_string_foreground): (haiku_draw_stretch_glyph_string): (haiku_start_clip): (haiku_end_clip): (haiku_clip_to_row): (haiku_draw_composite_glyph_string_foreground): (haiku_draw_image_glyph_string): (haiku_draw_glyph_string): (haiku_after_update_window_line): (haiku_draw_hollow_cursor): (haiku_draw_bar_cursor): (haiku_draw_vertical_window_border): (haiku_draw_window_divider): (haiku_scroll_bar_create): (haiku_set_horizontal_scroll_bar): (haiku_set_vertical_scroll_bar): (haiku_draw_fringe_bitmap): (haiku_scroll_run): (haiku_read_socket): (haiku_flash): (haiku_clear_under_internal_border): (haiku_scroll_bar_remove): * src/haikuterm.h (MAKE_FRAME_DIRTY): (FRAME_CR_CONTEXT): Don't dirty frames if not necessary.
* Fix mouse face handling during frame reentry on HaikuPo Lu2022-07-251-0/+4
| | | | | * src/haikuterm.c (haiku_read_socket): Clear last_mouse_glyph_frame like on X.
* Implement wheel movement during DND on HaikuPo Lu2022-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-wheel-count): New defvar. (haiku-note-wheel-click, haiku-handle-drag-wheel): New functions. * src/haiku_support.cc (EmacsWindow): Get rid of window ID logic. (MessageReceived, MouseMoved, be_drag_message): Use thread ID to identify windows instead of window ID. * src/haikuselect.c (Fhaiku_drag_message): Record whether or not the DND frame is a valid drop target. (haiku_note_drag_wheel): New function. (syms_of_haikuselect): New defvar. * src/haikuterm.c (haiku_read_socket): Call `haiku_note_drag_wheel' when appropriate. * src/haikuterm.h: Update prototypes.
* Port `x-lost-selection-functions' to HaikuPo Lu2022-07-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Fix infinite looping around Haiku menusPo Lu2022-07-061-0/+6
| | | | | | | * src/haikumenu.c (haiku_menu_show): Block SIGIO around menu event loop. * src/haikuterm.c (haiku_read_socket): Flush tooltip frames after resize.
* Use correct background for image mask color on HaikuPo Lu2022-06-271-1/+1
| | | | | * src/haikuterm.c (haiku_draw_image_glyph_string): Use adjusted background for image mask.
* Implement stipples for images on HaikuPo Lu2022-06-271-18/+29
| | | | | | | | | | | * 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/+2
| | | | | | | | | * 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-24/+50
| | | | | | | | | | | | | | | | | | | | * 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.
* Remove unnecessary clearing of internal border on HaikuPo Lu2022-06-181-9/+10
| | | | * src/haikuterm.c (haiku_new_font): Don't clear internal border.
* Fix handling of scroll bar clicks on HaikuPo Lu2022-06-121-18/+52
| | | | | | | | | | | | | | | | | | | * 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.
* Use BASE_EQ when comparing with QunboundMattias EngdegÄrd2022-06-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qunbound is uninterned and can therefore never be EQ to any symbol with position. * src/buffer.c (Fbuffer_local_value, buffer_lisp_local_variables) (buffer_local_variables_1): * src/bytecode.c (exec_byte_code): * src/comp.c (compile_function, Fcomp__compile_ctxt_to_file): * src/composite.c (composition_gstring_cache_clear_font): * src/data.c (Fboundp, Fsymbol_value, set_internal) (Fdefault_boundp, Fdefault_value, Fmake_variable_buffer_local): * src/emacs-module.c (module_global_reference_p): * src/eval.c (Fdefault_toplevel_value, defvar) (run_hook_with_args): * src/fns.c (hash_put, Fmaphash): * src/font.c (font_put_extra): * src/frame.c (gui_set_frame_parameters) (gui_frame_get_and_record_arg, gui_default_parameter) (gui_figure_window_size): * src/haikufns.c (get_geometry_from_preferences) (haiku_create_frame, haiku_create_tip_frame): * src/haikuterm.c (haiku_draw_text_decoration) (haiku_default_font_parameter): * src/json.c (lisp_to_json_nonscalar_1): * src/keymap.c (access_keymap_1, access_keymap, current_minor_maps): * src/lread.c (readevalloop, define_symbol): * src/minibuf.c (read_minibuf, Ftry_completion): (Fall_completions, Ftest_completion): * src/pgtkfns.c (pgtk_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/pgtkselect.c (Fpgtk_own_selection_internal): * src/print.c (print): * src/profiler.c (evict_lower_half, record_backtrace): * src/terminal.c (create_terminal): * src/textprop.c (set_properties): * src/w32fns.c (my_create_window, w32_icon) (w32_default_font_parameter, Fx_create_frame) (w32_create_tip_frame): * src/w32term.c (w32_draw_glyph_string): * src/xdisp.c (handle_single_display_spec) (cursor_row_fully_visible_p, calc_pixel_width_or_height): * src/xfns.c (x_default_scroll_bar_color_parameter, x_icon_verify) (x_icon, x_default_font_parameter, Fx_create_frame) (x_create_tip_frame): * src/xselect.c (x_handle_selection_request): * src/xterm.c (x_draw_glyph_string, x_term_init): Use BASE_EQ instead of EQ when comparing with Qunbound.
* Implement `follow-tooltip' for DND on HaikuPo Lu2022-06-091-2/+7
| | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (x-begin-drag): Implement `follow-tooltip'. * src/haikufns.c (Fx_show_tip): Record last dx and dy. (syms_of_haikufns): New staticpros. * src/haikuselect.c (haiku_unwind_drag_message): Clear new flag. (Fhaiku_drag_message): New argument `follow-tooltip'. Set new flag. (haiku_dnd_compute_tip_xy): New function. (haiku_note_drag_motion): Move tooltip if flag is true. * src/haikuterm.c (haiku_read_socket): Don't generate help event if mouse moves onto a tooltip during DND. * src/haikuterm.h: Update prototypes.
* 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.
* Fix flickering tooltips with mouse DND without interprogram dragPo Lu2022-06-021-2/+4
| | | | | | | | * src/haikuterm.c (haiku_read_socket): * src/nsterm.m (ns_mouse_position): * src/xterm.c (XTmouse_position, handle_one_xevent): Apply special tooltip treatment to `dropping' as well as `drag-source'.
* Fix flicker during mouse DND on Haiku as wellPo Lu2022-06-021-2/+6
| | | | | | * src/haikuterm.c (haiku_read_socket): Don't clear tooltips on crossing if track-mouse is drag-source and the display is grabbed.
* Fix pending window changes in haiku_set_window_sizePo Lu2022-05-291-1/+14
| | | | | | * src/haikuterm.c (haiku_set_window_size): Wait for FRAME_RESIZED events, then call `do_pending_window_change'. (haiku_read_socket): Allow waiting for FRAME_RESIZED events.
* Minor fixes to cursor color handling on HaikuPo Lu2022-05-241-1/+1
| | | | | | | | | | | * src/haikufns.c (haiku_decode_color): New function. (haiku_set_foreground_color, haiku_set_background_color) (haiku_set_cursor_color, haiku_set_mouse_color): Use that function to decode colors instead. Also set cursor GC foreground when setting background color. * src/haikuterm.c (haiku_merge_cursor_foreground): Fix color equality test.
* Implement monitor change functions on HaikuPo Lu2022-05-231-0/+9
| | | | | | | | | | | | | | | | * 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.
* Clean up Haiku codePo Lu2022-05-221-12/+11
| | | | | | | | | | | | * src/haiku_support.cc (movement_locker, class EmacsWindow) (MouseMoved): Delete `movement_locker' and associated hack, since it's superseeded by some code in haiku_read_socket. (key_map, key_chars, dpy_color_space, popup_track_message) (alert_popup_value, grab_view, grab_view_locker) (drag_and_drop_in_progress): Write comments and fix initializers. * src/haikuterm.c (haiku_read_socket): Update comment.
* Fix focus redirection to/from surrogate minibuffer frames on HaikuPo Lu2022-05-221-0/+16
| | | | | * src/haikuterm.c (haiku_get_focus_frame): New function. (haiku_create_terminal): Register new hook.
* Fix race conditions processing zoom events on HaikuPo Lu2022-05-201-4/+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.
* Fix race conditions processing frame fullscreen state on HaikuPo Lu2022-05-191-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* Implement gamma-correction on HaikuPo Lu2022-05-181-1/+8
| | | | | | | | * src/dispextern.h: Add `gamma_correct' prototype on Haiku as well. * src/haikufns.c (gamma_correct): New function. * src/haikuterm.c (haiku_defined_color): Gamma-correct colors if their pixels are being allocated.
* Don't allow moving fullscreen frames on HaikuPo Lu2022-05-181-1/+17
| | | | | | * src/haikuterm.c (haiku_set_window_size): Fix typo in comment. (haiku_set_offset): Prevent offset from changing in fullboth frames.
* Avoid race conditions when computing real frame positions on HaikuPo Lu2022-05-171-7/+3
| | | | | | | | | | | | | | | | * 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-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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'.
* Make Haiku stipple display slightly fasterPo Lu2022-05-151-2/+1
| | | | | * src/haikuterm.c (haiku_draw_stipple_background): Draw tiled bitmap to end of stipple instead of the end of the frame.
* ; Fix typosStefan Kangas2022-05-151-1/+1
|
* Simplify Haiku cursor management codePo Lu2022-05-151-28/+18
| | | | | | | | | | | | | * 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-5/+2
| | | | | | | | | | | | | | | | | | | * 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.
* Remove unused RIF methodPo Lu2022-05-121-10/+3
| | | | | * src/haikuterm.c (haiku_update_window_end): Delete function. (haiku_redisplay_interface): Remove RIF method.
* Make cursor display on Haiku consistent with XPo Lu2022-05-121-110/+196
| | | | | | | | | * src/haikuterm.c (haiku_draw_image_glyph_string): Merge cursor foregrounds correctly. (haiku_draw_hollow_cursor, haiku_draw_bar_cursor): New functions. Port code from X. (haiku_draw_window_cursor): Port code from X so bar cursors on top of images are treated right.
* Make Haiku event buffer non-staticPo Lu2022-05-111-1/+1
| | | | | * src/haikuterm.c (haiku_read_socket): Don't make `buf' static in case thread yielding happens inside.
* Fix event memory leak on HaikuPo Lu2022-05-111-3/+2
| | | | | * src/haikuterm.c (haiku_read_socket): Allocate event buffer on the stack.
* Fix frame invalidation on HaikuPo Lu2022-05-111-1/+12
| | | | | | | | | * src/haiku_support.cc (FlipBuffers): Only set view bitmap if it actually changed. * src/haikuterm.c (haiku_clip_to_string_exactly) (haiku_draw_window_cursor, haiku_draw_fringe_bitmap): Fix region invalidation.
* Make reliefs on Haiku more like XPo Lu2022-05-111-1/+1
| | | | | * src/haikuterm.c (haiku_draw_relief_rect): Use frame background (normal GC) for corners.
* Improve relief rect handling on HaikuPo Lu2022-05-101-19/+30
| | | | | | | | * haikuterm.c (haiku_calculate_relief_colors): Calculate backgrounds for image glyphs like on X. (haiku_draw_relief_rect): Remove extra parameter. (haiku_draw_string_box, haiku_draw_image_relief): Adjust accordingly.
* * src/haikuterm.c (haiku_draw_fringe_bitmap): Set stipple flag.Po Lu2022-05-091-0/+2
|
* ; * src/haikuterm.c (haiku_draw_underwave): Fix default scale.Po Lu2022-05-091-2/+2
|
* Respect display scale factor drawing underwaves on HaikuPo Lu2022-05-091-3/+26
| | | | | * src/haikuterm.c (haiku_get_scale_factor): New function. (haiku_draw_underwave): Apply said factor.
* Fix display of fringes with stipples on HaikuPo Lu2022-05-081-9/+33
| | | | | | | * haikuterm.c (haiku_after_update_window_line): Fix coding style. (haiku_draw_fringe_bitmap): Handle display of stipples if present.
* Set stipple flags on Haiku as wellPo Lu2022-05-081-0/+13
| | | | | * src/haikuterm.c (haiku_draw_glyph_string): Set stipple flag where stipples are actually drawn. (This is different from X.)