summaryrefslogtreecommitdiff
path: root/src/xwidget.c
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fix hang when displaying xwidget script dialogPo Lu2021-11-081-0/+66
| | | | | | | | | | | | | | | * src/xwidget.c (webkit_script_dialog_cb): New function. (Fmake_xwidget): Attach script callback signal (bug#51674).
| * | Free find text in correct procedurePo Lu2021-11-071-6/+6
| | | | | | | | | | | | | | | | | | * src/xwidget.c (Fxwidget_webkit_previous_result): Don't free find text. (Fxwidget_webkit_finish_search): Free find text here instead.
| * | Fix xwidget-webkit-goto-historyPo Lu2021-11-071-5/+18
| | | | | | | | | | | | | | | * src/xwidget.c (xwidget-webkit-goto-history): Use WebKitBackForwardList and XFIXNUM instead of XFIXNAT (bug#51651).
| * | Handle WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION appropriatelyPo Lu2021-11-071-0/+27
| | | | | | | | | | | | | | | * src/xwidget.c (webkit_decide_policy_cb): Send an xwidget display event when a webpage asks to create a new window.
| * | Fix documentation and coding style in recent xwidget commitsEli Zaretskii2021-11-071-65/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (Fmake_xwidget, find_widget) (xwidget_motion_or_crossing, xwidget_button_1, xwidget_button): Fix style in comments. (Fxwidget_perform_lispy_event): Doc fix. * src/xwidget.c (set_widget_if_text_view, kill_frame_xwidget_views): * src/keyboard.c (make_lispy_event): Fix style of braces. * lisp/xwidget.el (xwidget-webkit-isearch-mode): Fix keys in doc string. * doc/lispref/commands.texi (Xwidget Events): Fix markup and wording. * doc/lispref/display.texi (Xwidgets): Fix wording and markup. * doc/emacs/misc.texi (Embedded WebKit Widgets): Fix wording. * etc/NEWS: Fix wording and punctuation.
| * | Fix build on nextstepPo Lu2021-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.h: Make some prototypes conditional to X-Windows. (struct xwidget): Move find_text field out of GTK conditional. * src/xwidget.c (Fmake_xwidget): Move find_text out of GTK conditional. * src/print.c (print_vectorlike): Print correct pointer on macOS.
| * | Fix web inspectorPo Lu2021-11-071-3/+4
| | | | | | | | | | | | * src/xwidget.c (Fmake_xwidget): Move developer extra initialization.
| * | Default to creating new related sessionsPo Lu2021-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/display.texi: * etc/NEWS: Document changes. * lisp/xwidget.el (xwidget-insert): Accept an extra RELATED argument. (xwidget-webkit-new-session): Pass current session as RELATED if present. * src/xwidget.c (Fmake_xwidget): Make RELATED argument public.
| * | Rationalize creation decisionsPo Lu2021-11-071-6/+3
| | | | | | | | | | | | | | | * src/xwidget.c (webkit_create_cb): Only create a new widget if type is OTHER.
| * | Make "open in new window" from an xwidget's context menu workPo Lu2021-11-071-20/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/commands.texi (Xwidget Events): Document new event type. * doc/lisprefdisplay.texi (Xwidgets): Document new argument to make-xwidget, and new function. * etc/NEWS: Document changes. * lisp/xwidget.el: Bind xwidget-display-event to xwidget-webkit-display-event. (xwidget-webkit-import-widget): New function. (xwidget-webkit-display-event): New command. * src/keyboard.c (kbd_buffer_get_event): New event type. (make_lispy_event): Handle XWIDGET_DISPLAY_EVENTs. (syms_f_keyboard): Define new symbol. * src/termhooks.h (enum event_kind): New enum XWIDGET_DISPLAY_EVENT. * src/xwidget.c (webkit_create_cb) (store_xwidget_display_event) (webkit_ready_to_show) (webkit_create_cb_1, webkit_create_cb) (Fset_xwidget_buffer): New functions. (Fmake_xwidget): Add internal argument RELATED and connect create signal. (syms_of_xwidget): Define now subrs.
| * | Add functions for performing searches on xwidgetsPo Lu2021-11-071-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: * doc/lispref/display.texi: Document changes. * src/xwidget.c (Fxwidget_webkit_search) (Fxwidget_webkit_next_result) (Fxwidget_webkit_previous_result) (Fxwidget_wenkit_finish_search): New functions. (syms_of_xwidget): Define new built-ins. (kill_buffer_xwidgets): Free search query if present. * src/xwidget.h (struct xwidget): Add field for search query.
| * | Make it safe to have non-xwidget views in xwidget-view-listPo Lu2021-11-071-9/+15
| | | | | | | | | | | | | | | * src/xwidget.c (define_cursors, offscreen_damage_event): Check XWIDGET_VIEW_P before XXWIDGET_VIEW.
| * | Fix cursor for new widget viewsPo Lu2021-11-071-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (Fmake_xwidget): Clear hit result. (cursor_for_hit): Use integer hit result. (define_cursors): Set hit result appropriately. (widget_init_view): Set cursor to the existing hit result. * src/xwidget.h (struct xwidget): Add hit result field.
| * | Add support for cursors in xwidget viewsPo Lu2021-11-071-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (mouse_target_changed): New function. (Fmake_xwidget): Attach mouse target changed signal. (cursor_for_hit, define_cursors, mouse_target_changed): New functions. (xwidget_init_view): Set default cursor to nontext cursor. (x_draw_xwidget_glyph_string): Define cursor. * src/xwidget.h (struct xwidget_view): Add cursor field.
| * | Improve detail of load-changed xwidget eventsPo Lu2021-11-071-8/+15
| | | | | | | | | | | | | | | | | | | | | * src/xwidget.c (webkit_view_load_changed_cb): Improve event detail. * etc/NEWS: Document changes. * doc/lispref/commands.texi: Document Xwidget events. * doc/lispref/display.texi (Xwidgets): Add reference to Xwidget events.
| * | Make the WebKit inspector availablePo Lu2021-11-071-11/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: Document changes. * src/xwidget.c (find_widget_at_pos) (find_widget) (find_widget_cb): New functions. (struct widget_search_data): New structure. (Fmake_xwidget): Enable web inspector for WebKit widgets. (Fxwidget_perform_lispy_event): Use current focus instead of hard-coded widget. (xwidget_button_1, xwidget_button, xwidget_motion_or_crossing): Use window at event position instead of the default widget.
| * | Redisplay xwidget view windows instead of just setting their sizePo Lu2021-11-071-11/+3
| | | | | | | | | | | | | | | * src/xwidget.c (Fxwidget_resize): Mark windows as needing redisplay and redisplay instead.
| * | Fix special events in xwidgetsPo Lu2021-11-071-5/+72
| | | | | | | | | | | | | | | * src/xwidget.c (set_widget_if_text_view): New function. (Fxwidget_perform_lispy_event): Fix for webkit widgets.
| * | Fix drag on xwidget motion eventsPo Lu2021-11-071-0/+1
| | | | | | | | | | | | * src/xwidget.c (xwidget_motion_or_crossing): Set state.
| * | Handle crossing events on xwidget windows correctlyPo Lu2021-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xterm.c (handle_one_xevent): Clear help and mouse face when handling xwidget entry events. * src/xwidget.c (xwidget_motion_or_crossing): Add device to crossing events. (x_draw_xwidget_glyph_string): Add EnterWindowMask and LeaveWindowMask.
| * | Draw offscreen surfacePo Lu2021-11-071-3/+11
| | | | | | | | | | | | * src/xwidget.c (xv_do_draw): Draw offscreen surface.
| * | Implement function for sending events to widgetsPo Lu2021-11-071-1/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Xwidgets): Document changes. * src/keyboard.c (lispy_function_keys): Make non-static on X. * src/keyboard.h (lispy_function_keys): Expose lispy_function_keys on X. * src/xterm.c (x_emacs_to_x_modifiers): Export function. * src/xterm.h (x_emacs_to_x_modifiers): Likewise. * src/xwidget.c (Fxwidget_perform_lispy_event) (find_suitable_keyboard): New functions. (syms_of_xwidget): Define new subr.
| * | Use gtk_widget_queue_draw instead of xv_do_drawPo Lu2021-11-071-1/+1
| | | | | | | | | | | | | | | * src/xwidget.c (x_draw_xwidget_glyph_string): Call gtk_widget_queue_draw.
| * | Prefer XMoveResizeWindow to XMoveWindow for resizing xwidgetsPo Lu2021-11-071-2/+6
| | | | | | | | | | | | | | | * src/xwidget.c (x_draw_xwidget_glyph_string): Prefer XMoveResizeWindow to avoid extra expose events.
| * | Allow xwidgets to accept motion and button eventsPo Lu2021-11-071-2/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xterm.c (handle_one_xevent): Pass through some events to xwidgets. * src/xwidget.c (synthesize_focus_in_event) (find_suitable_pointer, xwidget_button_1) (xwidget_button, xwidget_motion_or_crossing): New functions. (xwidget_view_from_window): Draw offscreen window instead of the widget. (x_draw_xwidget_glyph_string): Set appropriate event masks. * src/xwidget.h (xwidget_button, xwidget_motion_or_crossing): New functions.
| * | Destroy xwidgets when destroying framesPo Lu2021-11-071-16/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xterm.c (x_free_frame_resources): Make sure to kill xwidget views. * src/xwidget.c (Fmake_xwidget): Attach damage event signal. (offscreen_damage_event): Operate on xwidgets and not individual views. (xwidget_init_view): Don't attach damage event signal here. (Fdelete_xwidget_view): Destroy window correctly and stop removing damage event signal. (kill_frame_xwidget_views): New function. * src/xwidget.c (kill_frame_xwidget_views): New function.
| * | Enable scrolling optimization for xwidgetsPo Lu2021-11-071-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct glyph): Store xwidget ID instead of a reference. * src/dispnew.c (scrolling_window): Enable scrolling optimization on xwidget builds. * src/xdisp.c (fill_xwidget_glyph_string, produce_xwidget_glyph): Obtain xwidget from ID. * src/xterm.c (x_scroll_run): Scroll xwidget windows. * src/xwidget.c (id_to_xwidget_map, xwidget_counter): New xwidget variables. (Fmake_xwidget): Assign each xwidget a unique ID, and keep track of that ID. (xwidget_from_id): New function. (syms_of_xwidget): Initialize id_to_xwidget_map. (xwidget_end_redisplay): Lookup xwidgets via ID. * src/xwidget.h (struct xwidget): Add ID field. (xwidget_from_id): New function.
| * | Use an X window to display xwidgets on X11Po Lu2021-11-071-133/+144
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Emacs draws using X11 primitives, Emacs drawing operations can erase the GtkDrawingArea used to draw the offscreen widget, which leads to unpleasant flickering effects, all of which can be prevented by creating a native X window and drawing to that instead. * src/xterm.c (x_window_to_frame): Return xwidget window if appropriate. (handle_one_xevent): Handle xwidget expose events. * src/xwidget.c (x_window_to_xvw_map): New variable. (xwidget_view_from_window): New function. (xwidget_show_view, xwidget_hide_view) (offscreen_damage_event): Move to drawing xwidgets with X windows. (xv_do_draw) (xwidget_expose): New function. (xwidget_osr_draw_cb, xwidget_osr_event_forward) (xwidget_osr_event_set_embedder): Removed. (xwidget_init_view): Replace use of GtkDrawingArea with that of an X window. (x_draw_xwidget_glyph_string): Prevent xwidget views from constantly generating expose events, and use an X window instead of a GtkDrawingArea. (syms_of_xwidget): Initialize x_window_to_xwv_map. src/xwidget.h (struct xwidget_view): Replace GTK widgets with X-related fields. (xwidget_view_from_window, xwidget_expose): New functions.
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2021-01-031-1/+1
|\|
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
* | Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtkYuuki Harano2020-12-271-1/+2
|\|
| * Inhibit buffer hooks in temporary buffersBasil L. Contovounesios2020-12-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test.
* | Don't use gtk_window_resize to resize offscreen windowYuuki Harano2020-11-241-0/+8
| | | | | | | | | | | | | | | | | | | | * src/xwidget.c (Fmake_xwidget): Use gtk_container_check_resize instead. (Fxwidget_resize): Use gtk_container_check_resize instead. ; Gtk+3 document says: ; > Applications should not use any API specific to GtkWindow ; > to operate on this object. It should be treated as a GtkBin ; > that has no parent widget.
* | Avoid gtk warnings on XYuuki Harano2020-11-241-0/+4
| | | | | | | | * src/xwidget.c (xwidget_osr_draw_cb): Call it to avoid alloc_needes.
* | Fix mouse cursor doesn't appear on motion events on xwidgetsYuuki Harano2020-11-241-0/+5
|/ | | | * src/xwidget.c (xwidget_osr_event_forward): Propagate motion notify.
* Fix xwidget's webkitgtk widget overriding of Emacs SIGCHLD handlerAkira Kyle2020-11-091-0/+10
| | | | | | * src/xwidget.c (make-xwidget): Save and restore Emacs SIGCHLD signal handler since glib doesn't (but should) do this. Copyright-paperwork-exempt: yes
* Merge from origin/emacs-27Glenn Morris2020-10-271-1/+8
|\ | | | | | | | | | | | | | | | | | | | | e0de9f3295 (origin/emacs-27) Don't skip empty lines when fitting mini... a4ec03fa9b ; * etc/tutorials/TUTORIAL.de: Fix grammar (Bug#44246) 20c02e628c Improve documentation of display-fill-column-indicator e2005f1f2a * INSTALL: Mention efaq.texi for installation of intlfonts. 71661b2872 Use WebKit sandboxing # Conflicts: # etc/NEWS
| * Use WebKit sandboxingPaul Eggert2020-10-241-1/+8
| | | | | | | | | | | | | | * src/xwidget.c (Fmake_xwidget): Enable sandboxing if WebKit 2.26 or later. Do this early, as required for sandboxing (Bug#43071). Co-authored-by: Qiantan Hong <qhong@mit.edu> Copyright-paperwork-exempt: yes
* | Fix segfault in xwidget when there is no titleJeff Walsh2020-10-151-1/+3
| | | | | | | | | | * src/xwidget.c (Fxwidget_webkit_title): Pass emptry string when no title is returned (bug#43989).
* | Fix GC bugs related to uninitialized vectorsPaul Eggert2020-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid problems if GC occurs while initializing a vector. Problem with Fdelete reported by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html I looked for similar problems elsewhere and found quite a few. * src/coding.c (make_subsidiaries): * src/composite.c (syms_of_composite): * src/font.c (build_style_table, Ffont_get_glyphs): * src/nsselect.m (clean_local_selection_data): * src/nsxwidget.m (js_to_lisp): * src/syntax.c (init_syntax_once): * src/window.c (Fcurrent_window_configuration): * src/xselect.c (selection_data_to_lisp_data) (clean_local_selection_data): Use make_nil_vector instead of make_uninit_vector. * src/fns.c (Fdelete): * src/xwidget.c (webkit_js_to_lisp): Use allocate_nil_vector instead of allocate_vector. * src/search.c (Fnewline_cache_check): Use make_vector instead of make_uninit_vector.
* | Add utility functions and new xwidget commandsSungbin Jo2020-08-121-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Jaesup Kwak <veshboo@gmail.com> * lisp/xwidget.el (xwidget-webkit-callback): Add case for 'response-callback' event. (xwidget-webkit-download-dir): New variable. (xwidget-webkit-save-as-file): New function. * src/nsxwidget.m (XwWebView::decidePolicyForNavigationResponse): Store download event. * src/xwidget.c src/xwidget.h (store_xwidget_download_callback_event): New function.
* | Add utility functions and new xwidget commandsSungbin Jo2020-08-121-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Jaesup Kwak <veshboo@gmail.com> * etc/NEWS: Announce new functions and options. * lisp/xwidget.el (xwidget): New defgroup. (xwidget-webkit-mode-map): Add new keybindings. (xwidget-webkit-scroll-up, xwidget-webkit-scroll-down) (xwidget-webkit-scroll-forward, xwidget-webkit-scroll-backward): Add optional argument to specify specific amounts to scroll down. (xwidget-webkit-scroll-up-line, xwidget-webkit-scroll-down-line): New functions. (xwidget-webkit-scroll-bottom): Fix function to scroll to the bottom of the document. (xwidget-webkit-callback): Use new function to update buffer title even when Javascript is disabled. (xwidget-webkit-bookmark-jump-new-session): New variable. (xwidget-webkit-bookmark-make-record): Modify to use xwidget-webkit to open bookmark that is created in xwidget-webkit. (xwidget-webkit-insert-string): Fix Javascript snippet to not throw Javsscript exceptions. (xwidget-webkit-inside-pixel-width) (xwidget-window-inside-pixel-height): New functions. (xwidget-webkit-adjust-size-to-window): Use new functions. (xwidget-webkit-new-session): Insert invisible URL instead of an empty string to achieve better default behavior. (xwidget-webkit-back, xwidget-webkit-forward, xwidget-webkit-reload) (xwidget-webkit-current-url): Use new functions to enable scrolling even when Javascript is disabled. (xwidget-webkit-copy-selection-as-kill): Remove unnecessary lambda. * src/nsxwidget.h src/nsxwidget.m (nsxwidget_webkit_uri) (nsxwidget_webkit_title, nsxwidget_webkit_goto_history): Add new functions. * src/xwidget.c (Fxwidget_webkit_uri, Fxwidget_webkit_title) (Fxwidget_webkit_goto_history): Add new functions. (syms_of_xwidget): Define new functions.
* | Add xwidget support for macOSSungbin Jo2020-08-121-15/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Jaesup Kwak <veshboo@gmail.com> * configure.ac: Allow '--with-xwidgets' for "${NS_IMPL_COCOA}". * etc/NEWS: Mention new feature. * etc/TODO: Remove done TODO to implement xwidget in NeXTstep port. * lisp/xwidget.el (xwidget-webkit-clone-and-split-below) (xwidget-webkit-clone-and-split-right): New procedures. (xwidget-webkit-callback): Remove call to 'xwidget-webkit-adjust-size-to-window' as adjusting xwidget size is handled in 'x_draw_xwidget_glyph_string'. (xwidget-webkit-enable-plugins): New variable. * nextstep/templates/Info.plist.in: Add 'NSAppTransportSecurity'. * src/Makefile.in: Add nsxwidget.o for compilation. * src/emacs.c (main): Move conditional call to 'syms_of_xwidget'. * src/nsterm.m (ns_draw_glyph_string): Add case for 'XWIDGET_GLYPH'. (note_mouse_movement mouseMoved): Make it easy to resize window by dragging mode-line or vertical separator adjacent to large glyph. * src/nsxwidget.h src/nsxwidget.m: Newly added files, xwidget webkit backend for macOS Cocoa. * src/xwidget.c (Fmake_xwidget, xwidget_init_view) (x_draw_xwidget_glyph_string, xwidget_is_web_view) (Fxwidget_webkit_goto_uri, Fxwidget_webkit_zoom, Fxwidget_resize) (Fxwidget_size_request, Fdelete_xwidget_view, xwidget_end_redisplay) (kill_buffer_xwidgets): Add macOS Cocoa specific functions and code with 'NS_IMPL_COCOA' and guard GTK specific functions and code with 'USE_GTK'. (x_draw_xwidget_glyph_string): Handle adjusting xwidget size. * src/xwidget.h (xwidget, xwidget_view): Add macOS Cocoa specific fields with 'NS_IMPL_COCOA' and guard GTK specific fields with USE_GTK.
* | Improve integer range checkingPaul Eggert2020-04-051-4/+2
|/ | | | | | | | | | | | | | | | | | * src/bignum.c (check_integer_range, check_uinteger_max) (check_int_nonnegative): New functions. * src/frame.c (check_frame_pixels): New function. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it. * src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): Remove these macros. Unless otherwise specified, all callers replaced by calls to check_integer_range, check_uinteger_range, check_int_nonnegative. * src/frame.c (gui_set_right_divider_width) (gui_set_bottom_divider_width): * src/nsfns.m (ns_set_internal_border_width): * src/xfns.c (x_set_internal_border_width): Using check_int_nonnegative means these functions no longer incorrectly reject negative bignums; they treat them as 0, just like negative fixnums.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Substituted deprecated WebKitGTK+ api.Jimmy Aguilar Mena2019-09-171-127/+92
| | | | | * src/xwidget.c : Substituted WebKitGTK+ API calls and use JavaScriptCore GLib API instead.
* Use fewer locks when accessing stdioPaul Eggert2019-07-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c, src/bidi.c, src/emacs-module.c, src/pdumper.c: * src/regex-emacs.c, src/unexhp9k800.c, src/unexmacosx.c: * src/widget.c, src/xdisp.c, src/xselect.c, src/xterm.c: Include sysstdio.h instead of stdio.h, to avoid locking stdio streams in many cases. * src/alloc.c (test_setjmp): * src/bidi.c (bidi_dump_cached_states): * src/cm.c (calccost): * src/dispnew.c (init_display_interactive): * src/emacs.c (main): * src/image.c (convert_mono_to_color_image): * src/minibuf.c (read_minibuf_noninteractive): * src/nsfont.m (ns_descriptor_to_entity) (ns_dump_glyphstring): * src/nsterm.h (NSTRACE_MSG_NO_DASHES): * src/nsterm.m (ns_mouse_position) (sendEvent:, keyDown:, performDragOperation:): * src/pdumper.c (dump_fingerprint, print_paths_to_root_1): * src/print.c (debug_print): * src/regex-emacs.c (debug_putchar, print_fastmap) (print_partial_compiled_pattern, print_compiled_pattern) (print_double_string, regex_compile): * src/term.c (vfatal): * src/unexhp9k800.c (read_header): * src/unexmacosx.c (unexec_error): * src/widget.c (EmacsFrameInitialize): * src/xdisp.c (message_to_stderr, vmessage, dump_glyph_row) (Fdump_glyph_matrix, Fdump_frame_glyph_matrix, dump_glyph_string): * src/xfaces.c (Fdump_colors, Fdump_face): * src/xselect.c (x_clipboard_manager_error_2): * src/xterm.c (x_initialize): * src/xwidget.c (WEBKIT_FN_INIT): Prefer unlocked calls like fputs to locked calls like fprintf. * src/charset.c (read_hex): * src/cm.c (cmputc, cmcheckmagic): * src/dispnew.c (update_frame, update_frame_with_menu) (update_frame_1, Fsend_string_to_terminal, Fding) (bitch_at_user): * src/emacs.c (main, Fdump_emacs): * src/emacs-module.c (module_abort): * src/fileio.c (Fdo_auto_save): * src/image.c (slurp_file) (png_read_from_file, png_load_body, our_stdio_fill_input_buffer): * src/keyboard.c (record_char, kbd_buffer_get_event) (handle_interrupt): * src/lread.c (readbyte_from_stdio, read1): * src/minibuf.c (read_minibuf_noninteractive): * src/print.c (printchar_to_stream, strout) (Fredirect_debugging_output): * src/sysdep.c (reset_sys_modes, close_output_streams) (procfs_ttyname, procfs_get_total_memory): * src/term.c (tty_ring_bell, tty_send_additional_strings) (tty_set_terminal_modes, tty_reset_terminal_modes) (tty_update_end, tty_clear_end_of_line, tty_write_glyphs) (tty_write_glyphs_with_face, tty_insert_glyphs) (tty_menu_activate): * src/xfaces.c (Fx_load_color_file): Simplify by using ordinary calls like putc to explicitly-unlocked calls like putc_unlocked, since the ordinary calls are now unlocked anyway. * src/emacs.c (main, Fdump_emacs): * src/pdumper.c (Fdump_emacs_portable): Coalesce adjacent printfs. * src/nsterm.h: Include sysstdio.h as this file’s macros rely on it. * src/regex-emacs.c (print_compiled_pattern): Omit redundant fflush. * src/sysstdio.h: Include unlocked-io.h. (clearerr_unlocked, feof_unlocked, ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked) (fputs_unlocked, fread_unlocked, fwrite_unlocked) (getc_unlocked, getchar_unlocked, putc_unlocked) (putchar_unlocked): Remove these macros; now done by unlocked-io.h. * src/xwidget.c: Include sysstdio.h.
* Allow gap before first non-Lisp pseudovec memberPaul Eggert2019-04-081-3/+2
| | | | | | | | | | | | | Problem reported by Keith David Bershatsky in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00259.html Solution suggested by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00282.html * src/buffer.h (BUFFER_LISP_SIZE): Simplify by using PSEUDOVECSIZE. (BUFFER_REST_SIZE): Simplify by using VECSIZE and BUFFER_LISP_SIZE. * src/lisp.h (PSEUDOVECSIZE): Base it on the last Lisp field, not the first non-Lisp field. All callers changed. Callers without Lisp fields changed to use ALLOCATE_PLAIN_PSEUDOVECTOR. (ALLOCATE_PLAIN_PSEUDOVECTOR): New macro.
* Simplify list creation in C codePaul Eggert2019-03-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main new thing here is that C code can now say ‘list (a, b, c, d, e, f)’ instead of ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’, thus relieving callers of the responsibility of counting arguments (plus, the code feels more like Lisp). The old list1 ... list5 functions remain, as they’re probably a bit faster for small lists. * src/alloc.c (cons_listn, pure_listn): New functions. (listn): Omit enum argument. All callers changed to use either new ‘list’ or ‘pure_list’ macros. * src/charset.c (Fdefine_charset_internal): * src/coding.c (detect_coding_system) (Fset_terminal_coding_system_internal): * src/frame.c (frame_size_history_add, adjust_frame_size): * src/gtkutil.c (xg_frame_set_char_size): * src/keyboard.c (command_loop_1): * src/nsfns.m (frame_geometry): * src/widget.c (set_frame_size): * src/xfaces.c (Fcolor_distance): * src/xfns.c (frame_geometry): * src/xterm.c (x_set_window_size_1): * src/xwidget.c (Fxwidget_size_request): Prefer list1i, list2i, etc. to open-coding them. * src/charset.c (Fset_charset_priority): * src/nsterm.m (append2): * src/window.c (window_list): * src/xfaces.c (Fx_list_fonts): Use nconc2 instead of open-coding it. * src/eval.c (eval_sub, backtrace_frame_apply): * src/kqueue.c (kqueue_generate_event): * src/nsterm.m (performDragOperation:): * src/pdumper.c (Fpdumper_stats): * src/w32.c (init_environment): Prefer list1, list2, etc. to open-coding them. * src/font.c (font_list_entities): Parenthesize to avoid expanding new ‘list’ macro. * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP to get lines to fit. Move outside the ‘list’ call, since it’s now a macro. * src/keymap.c (Fmake_keymap): Simplify. * src/lisp.h (list, pure_list): New macros. (list1i): New function.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)