summaryrefslogtreecommitdiff
path: root/lisp/term/haiku-win.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Implement wallpaper.el support for HaikuPo Lu2022-09-141-0/+39
| | | | | | | | | | | | | | | | * 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.
* Handle modifiers during Haiku DND wheel movementPo Lu2022-07-261-6/+56
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-modifier-mask) (haiku-dnd-wheel-modifier-type): New functions. (haiku-handle-drag-wheel): Use them. * lisp/x-dnd.el (x-dnd-modifier-mask): Remove outdated comment. * src/haikuselect.c (haiku_note_drag_wheel): Pass modifiers to wheel function. (syms_of_haikuselect): Update doc strings.
* Fix mouse wheel DND scroll direction on HaikuPo Lu2022-07-201-5/+15
| | | | | * lisp/term/haiku-win.el (haiku-handle-drag-wheel): Record the last wheel direction. If it differs, clear the click counter.
* Implement wheel movement during DND on HaikuPo Lu2022-07-201-1/+53
| | | | | | | | | | | | | | | | | | | | * 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.
* Use `ash` instead of `lsh`Mattias EngdegÄrd2022-07-191-1/+1
| | | | | | | | * lisp/files.el (file-modes-number-to-symbolic): * lisp/image/exif.el (exif--direct-ascii-value): * lisp/term/haiku-win.el (defun): * lisp/x-dnd.el (x-dnd-handle-xdnd, x-dnd-handle-motif): `lsh` is slower and has confusing semantics; avoid.
* Implement last change on Haiku as wellPo Lu2022-07-181-2/+1
| | | | | | | * lisp/term/haiku-win.el (haiku-dnd-drag-handler): Stop redisplaying here. * src/haikuselect.c (haiku_note_drag_motion): Use redisplay_preserve_echo_area.
* ; * lisp/term/haiku-win.el: Fix compiler warnings.Po Lu2022-07-131-0/+1
|
* Implement TIMESTAMP target for Haiku selectionsPo Lu2022-07-131-7/+14
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-selection-targets): Fix return values. (gui-backend-get-selection): Handle TIMESTAMP specially. * src/haiku_select.cc (be_get_clipboard_count): New function. * src/haikuselect.c (Fhaiku_selection_timestamp): New function. (syms_of_haikuselect): Add new defsubr. * src/haikuselect.h: Update prototypes.
* Clean up failable requests in more placesPo Lu2022-06-291-19/+20
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-get-numeric-enum): Fix build. * src/xterm.c (x_clean_failable_requests): Avoid redundant memcpy if first == last. (x_ignore_errors_for_next_request): Fix check for last request. (x_check_errors, x_had_errors_p): Clean up failable requests here.
* Handle be:actions field in Haiku DND messagesPo Lu2022-06-291-31/+71
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-get-numeric-enum): New function. (haiku-numeric-enum): New macro. (haiku-select-encode-xstring, haiku-select-encode-utf-8-string): Replace hard-coded numeric enumerators. (haiku-parse-drag-actions): New function. (haiku-drag-and-drop): Use action returned by that function. (x-begin-drag): Replace hard-coded enumerator.
* Re-fix build warnings about subr-x defsubstsLars Ingebrigtsen2022-06-251-0/+1
| | | | | | | | | | | | * lisp/term/haiku-win.el (require): * lisp/progmodes/elisp-mode.el (require): * lisp/isearch.el (require): Require subr-x at compile time, since these use defsubsts/macros from there. * lisp/emacs-lisp/subr-x.el (string-empty-p): Move from here... * lisp/simple.el (string-empty-p): ... to here. This is to help with a build problem where files.el is using the defsubst, but requiring subr-x.el at compile time leads to load errors.
* Revert "Fix some byte-compilation warnings about subr-x"Lars Ingebrigtsen2022-06-251-1/+0
| | | | | | This reverts commit cd479aa8bd498da4d7980a7fe7a37e238761482f. This led to build failures when doing bootstraps.
* Fix some byte-compilation warnings about subr-xLars Ingebrigtsen2022-06-241-0/+1
| | | | | | | | * lisp/term/haiku-win.el (require): * lisp/replace.el (require): * lisp/progmodes/elisp-mode.el (require): * lisp/isearch.el (require): * lisp/files.el (require): Require subr-x when compiling.
* Fix some drag-and-drop handling on HaikuPo Lu2022-06-111-2/+0
| | | | | | | | | | * lisp/term/haiku-win.el (haiku-drag-and-drop): Don't raise frame for some types of drags. * src/haikuselect.c (haiku_unwind_drag_message): Don't hide tooltip here. (Fhaiku_drag_message): Only clear grab and hide tooltip if the drag was successful.
* Implement `follow-tooltip' for DND on HaikuPo Lu2022-06-091-2/+3
| | | | | | | | | | | | | | | | | * 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.
* Also show mouse DND tooltip contents during interprogram drag-and-dropPo Lu2022-06-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new parameter to `x-begin-drag'. * lisp/mouse.el (mouse-drag-and-drop-region): Don't hide tooltip when initiating interprogram drag-and-drop. * lisp/term/haiku-win.el (x-begin-drag): * lisp/term/ns-win.el (x-begin-drag): Add stubs for new parameter. * src/xfns.c (Fx_begin_drag): New parameter `follow-tooltip'. (Fx_show_tip, syms_of_xfns): Add records of the last dx and dy given to `x-show-tip'. * src/xterm.c (x_clear_dnd_monitors): New function. (x_dnd_begin_drag_and_drop): Save monitor attributes list if appropriate. (x_dnd_compute_tip_xy, x_dnd_update_tooltip_position): New function. (x_dnd_update_state, handle_one_xevent): Update tooltip position during DND mouse movement. (syms_of_xterm): Update staticpros. * src/xterm.h: Update prototypes.
* Update Haiku drag-and-drop codePo Lu2022-06-071-1/+5
| | | | | | * lisp/term/haiku-win.el (haiku-drag-and-drop): Don't allow dropping on places other than the text area (it doesn't work). Also respect mouse-yank-at-point.
* Handle dragging multiple files on HaikuPo Lu2022-06-031-19/+36
| | | | | | * lisp/term/haiku-win.el (haiku-dnd-selection-converters) (haiku-dnd-convert-file-name, x-begin-drag): Handle vector values of selection data.
* Handle dropping text/uri-list on HaikuPo Lu2022-06-021-1/+5
| | | | | | * lisp/term/haiku-win.el (window-system-initialization): Remove extra whitespace. (haiku-drag-and-drop): Handle "text/uri-list".
* Adjust last change to Haiku as wellPo Lu2022-06-011-4/+23
| | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-selection-converters): Add text/uri-list. (haiku-dnd-convert-text-uri-list): New function. (x-begin-drag): Handle alternative data specified in selection local values.
* Convert FILE_NAME to refs on Haiku instead of text/uri-listPo Lu2022-05-311-2/+3
| | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-selection-converters): Use more appropriate target for file names. (haiku-dnd-convert-uri-list): Delete function. (haiku-dnd-convert-file-name): New function. Also handle remote file names.
* Add support for changing pointer types on HaikuPo Lu2022-05-111-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* ; Pacify some --without-x byte-compiler warnings.Basil L. Contovounesios2022-05-071-0/+1
|
* Clean up Haiku file panel codePo Lu2022-05-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | * 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 file name selection conversion on HaikuPo Lu2022-04-291-3/+10
| | | | | | * lisp/term/haiku-win.el (haiku-normal-selection-encoders): Register new encoder. (haiku-select-encode-file-name): New function.
* Fix quitting application from the Deskbar on HaikuPo Lu2022-04-271-1/+4
| | | | | * lisp/term/haiku-win.el (handle-save-session): Kill Emacs afterwards.
* Add simple session management support to HaikuPo Lu2022-04-271-0/+22
| | | | | | | | | | | | | | | | | | | | | | * 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.
* * lisp/term/haiku-win.el (x-colors): Also update with system colors.Po Lu2022-04-241-0/+3
|
* Allow looking up window system colors on HaikuPo Lu2022-04-241-0/+24
| | | | | | | | | | | | * lisp/help-fns.el (help-fns--editable-variable): Fix describing variables which don't have symbol values. * lisp/term/haiku-win.el (haiku-allowed-ui-colors): Set list of allowed UI colors. * src/haiku_support.cc (be_get_ui_color): New function. * src/haiku_support.h: Update prototypes. * src/haikufns.c (haiku_get_color): Look for defined UI color. (syms_of_haikufns): New defvar `haiku-allowed-ui-colors'. * src/haikuterm.c (haiku_term_init): Fix coding style.
* Improve safety of haiku-drag-messagePo Lu2022-04-061-2/+5
| | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (haiku-drag-and-drop): Ignore placeholder message. * src/frame.c (delete_frame): Prevent deleting drop source frame on Haiku. * src/haiku_support.cc (RELEASE_NOW, CANCEL_DROP): New message types. (class EmacsView, MessageReceived): Handle new message types. (be_drag_message): Drag CANCEL_DROP message on quit; also send RELEASE_NOW to view if quitting. * src/haikuselect.c (syms_of_haikuselect) (haiku_unwind_drag_message): Clear new frame variable. (Fhaiku_drag_message): Set new frame variable. * src/haikuterm.h: Update prototypes.
* ; * lisp/term/haiku-win.el: Fix compiler warning on X.Po Lu2022-04-051-0/+1
|
* Respect new DND options when dragging to ourselves on HaikuPo Lu2022-04-051-0/+15
| | | | | | | | | | | | | | | * lisp/mouse.el (mouse-drag-and-drop-region): Allow dragging to the current frame if we know `return-frame' doesn't work. * lisp/term/haiku-win.el (haiku-dnd-drag-handler): New function. * src/haiku_support.cc (MouseMoved): Don't send drag motion events for the drag frame. * src/haikuselect.c (haiku_note_drag_motion_1) (haiku_note_drag_motion_2, haiku_note_drag_motion): New functions. (syms_of_haikuselect): New variable `haiku-drag-track-function'. * src/haikuterm.c (haiku_read_socket): Note mouse motion in that case.q * src/haikuterm.h: Update prototypes.
* Implement new DND options on HaikuPo Lu2022-04-031-17/+20
| | | | | | | | | | * 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.
* Simplify Haiku drag-and-drop implementationPo Lu2022-04-011-0/+1
| | | | | | | | | | | * lisp/term/haiku-win.el (x-begin-drag): Bind `mouse-highlight' to nil. * src/haikuselect.c (haiku_unwind_drag_message) (Fhaiku_drag_message): * src/haikuterm.h (HAVE_CHAR_CACHE_MAX): * src/xdisp.c (note_mouse_highlight): Delete `haiku_dnd_in_progress' variable.
* Prevent signals when dragging nonexistent files on HaikuPo Lu2022-03-301-1/+3
| | | | | | | | | | * lisp/term/haiku-win.el (x-begin-drag): Bind `haiku-signal-invalid-refs' to nil. * src/haiku_support.cc (MouseMoved): Send motion events while dragging as well. * src/haikuselect.c (haiku_lisp_to_message): Respect new variable. (syms_of_haikuselect): New variable `haiku-signal-invalid-refs'.
* Minor fixes to Haiku selection supportPo Lu2022-03-281-3/+45
| | | | | | | | | * lisp/term/haiku-win.el (haiku-selection-bounds): New function. (haiku-dnd-convert-string, haiku-select-encode-xstring) (haiku-select-encode-utf-8-string): Handle position pairs correctly. (gui-backend-set-selection): Adjust for new airity. * src/haikuselect.c (Fhaiku_selection_put): Fix arity.
* Store latin-1 content into the Haiku clipboard as wellPo Lu2022-03-271-3/+35
| | | | | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (haiku-normal-selection-encoders): New variable. (haiku-select-encode-utf-8-string, haiku-select-encode-xstring): New functions. (gui-backend-set-selection): Use new selection encoder functions instead of hard-coding UTF-8. (haiku-dnd-handle-drag-n-drop-event): Rename to `haiku-drag-and-drop'. * src/haiku_select.cc (be_lock_clipboard_message): Accept new argument `clear'. (be_unlock_clipboard): Accept new argument `discard'. * src/haikuselect.c (Fhaiku_selection_data): Change calls to `be_lock_clipboard_message' and `be_unlock_clipboard'. (haiku_unwind_clipboard_lock): New function. (Fhaiku_selection_put): Accept new meaning of `name' which means to set the selection message. * src/haikuselect.h: Update prototypes.
* Implement new drag and drop parameter on HaikuPo Lu2022-03-251-2/+2
| | | | | | | | | | * 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'.
* Allow dragging files from dired to windows on the same framePo Lu2022-03-251-1/+1
| | | | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new parameter to `x-begin-drag'. * lisp/dired.el (dired-mouse-drag): Utilize new parameter. * lisp/term/haiku-win.el (x-begin-drag): Add new parameter. * src/xfns.c (Fx_begin_drag): New parameter `allow-current-frame'. Fix typo and update doc string. * src/xterm.c (x_dnd_get_window_proto): Respect `x_dnd_allow_current_frame'. (x_dnd_begin_drag_and_drop): New parameter `allow_current_frame'. * src/xterm.h: Update prototypes.
* Allow dragging and dropping multiple actionsPo Lu2022-03-241-1/+3
| | | | | | | | | | | | * doc/lispref/frames.texi (Drag and Drop): Document new meaning of `action'. * lisp/term/haiku-win.el (x-begin-drag): Correct for new meaning of `action'. * src/xfns.c (Fx_begin_drag): Handle new alist meaning of `action'. * src/xterm.c (x_dnd_begin_drag_and_drop): New parameters `ask_action_list', `ask_action_names' and `n_ask_actions'. * src/xterm.h: Update prototypes.
* Improvements to Haiku selection handlingPo Lu2022-03-231-1/+6
| | | | | | | | | | | | | | | | | | | | * lisp/term/haiku-win.el (haiku-selection-targets): Implement in Lisp. * src/haiku_select.cc (be_get_message_type): (be_set_message_type): (be_get_message_message): (be_add_message_message): New functions. * src/haiku_support.cc (MessageReceived): Fix typo. * src/haikuselect.c (haiku_selection_data_1) (Fhaiku_selection_targets): Delete functions. (haiku_message_to_lisp, lisp_to_type_code) (haiku_lisp_to_message): Correctly decode and encode nested messages, and fix encoding specially decoded types via numeric names. Also store and decode message types inside Lisp messages. (Fhaiku_drag_message): Update doc string. (syms_of_haikuselect): Update subrs. * src/haikuselect.h: Update prototypes.
* Implement drag-and-drop of files on HaikuPo Lu2022-03-181-5/+19
| | | | | | | | | | | * lisp/term/haiku-win.el (haiku-dnd-selection-converters): Add new selection converter. (haiku-dnd-convert-uri-list): New function. (x-begin-drag): Allow selection converters to change message field type. * src/haikuselect.c (haiku_lisp_to_message): Perform more error checking.
* ; * lisp/term/haiku-win.el (x-begin-drag): Fix compiler warning.Po Lu2022-03-171-1/+1
|
* * lisp/term/haiku-win.el (x-begin-drag): Fix type code of B_MIME_TYPE.Po Lu2022-03-171-1/+1
|
* Implement cross-program drag-and-drop on HaikuPo Lu2022-03-171-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Add support for dropping plain text on HaikuPo Lu2022-03-161-1/+10
| | | | | * haiku-win.el (haiku-dnd-handle-drag-n-drop-event): Handle `text/plain'.
* Redo Haiku DND supportPo Lu2022-03-161-3/+8
| | | | | | | | | | | | | | | | | | | | | * 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.
* Improve Haiku selection handlingPo Lu2022-02-141-1/+2
| | | | | | | | | | | | * lisp/select.el (gui--selection-value-internal): Use X types on Haiku as well. * lisp/term/haiku-win.el (haiku--selection-type-to-mime): Update types to correspond better with X. * src/haikuselect.c (Fhaiku_selection_data): (Fhaiku_selection_put): Remove a great deal of ad hoc code now handled by the regular selection machinery.