aboutsummaryrefslogtreecommitdiffstats
path: root/src/xwidget.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Allow gap before first non-Lisp pseudovec memberPaul Eggert2019-04-081-4/+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.
* 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)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Shrink pseudovectors a bitPaul Eggert2018-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sizeof (struct Lisp_Marker) was 32 on x86, where 24 would do. Problem noted by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2018-09/msg00165.html * src/bignum.h (struct Lisp_Bignum): * src/frame.h (struct frame): * src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector) (struct Lisp_Char_Table, struct Lisp_Hash_Table) (struct Lisp_Marker, struct Lisp_Overlay) (struct Lisp_Misc_Ptr, struct Lisp_User_Ptr) (struct Lisp_Finalizer, struct Lisp_Float) (struct Lisp_Module_Function): * src/process.h (struct Lisp_Process): * src/termhooks.h (struct terminal): * src/thread.h (struct thread_state, struct Lisp_Mutex) (struct Lisp_CondVar): * src/window.c (struct save_window_data): * src/window.h (struct window): * src/xterm.h (struct scroll_bar): * src/xwidget.h (struct xwidget, struct xwidget_view): Add GCALIGNED_STRUCT attribute. * src/lisp.h (GCALIGNED_UNION_MEMBER): Renamed from GCALIGNED_UNION. All uses changed. (GCALIGNED_STRUCT_MEMBER, GCALIGNED_STRUCT, GCALIGNED): New macros. All uses of open-coded GCALIGNED changed to use GCALIGNED. (union vectorlike_header): No longer GC-aligned. (PSEUDOVECSIZE): Yield 0 for pseudovectors without Lisp objects that place a member before where the first Lisp object member would be.
* | Use native alignment to access Lisp object dataPaul Eggert2018-06-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to tell GCC that P has alignment 8, use (T *) P where T is the type of the pointed-to object, to tell GCC that P has native alignment. This is simpler, matches the intent better, and should help simplify future improvements. Some of these changes are to pacify gcc -Wnull-dereference, since GCC is smarter about pointers now that Emacs no longer uses __builtin_assume_aligned; these minor changes should improve code efficiency slightly. On Fedora 28 x86-64 with default optimization this patch shrinks the size of the Emacs text segment by 0.36%. * src/conf_post.h (__has_builtin, __builtin_assume_aligned): Remove; no longer used. * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE): Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE and XCDR instead of CDR_SAFE when this is safe. * src/fileio.c (Fexpand_file_name): * src/font.c (clear_font_cache): Pacify -Wnull-dereference by removing unnecessary NILP test. * src/keyboard.c (xevent_start): New function. (read_char, read_key_sequence): Pacify -Wnull-dereference by using xevent_start instead of EVENT_START. * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro now, since it can no longer be implemented as a function. (XUNTAG): New third argument CTYPE. All uses changed. Cast result to CTYPE * instead of using __builtin_assume_aligned. Simplify by using LISP_WORD_TAG. (LISP_WORD_TAG): New macro. (TAG_PTR): Use it. * src/menu.c (x_popup_menu_1): Pacify -Wnull-dereference by using XCAR instead of Fcar and XCDR instead of Fcdr where this is safe.
* | Make xwidget-webkit-execute-script safe against GC (Bug#31545)Andreas Schwab2018-05-211-0/+3
|/ | | | | | | | | | | * src/xwidget.h (struct xwidget): Add script_callbacks. * src/xwidget.c (save_script_callback): New function. (Fxwidget_webkit_execute_script): Use it. Encode script before passing to execution engine. Always use a callback. (webkit_javascript_finished_cb): Deallocate script. (kill_buffer_xwidgets): Deallocate remaining scripts. (Fxwidget_webkit_zoom): Doc fix. (Fxwidget_resize): Doc fix.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Change vectorlike from struct to unionPaul Eggert2017-11-131-2/+2
| | | | | | | * src/lisp.h (vectorlike_headed): Change from struct to union. All uses changed. Since it has only one member, this does not change semantics. This is designed to simplify future changes needed to fix bugs like Bug#29040. All uses changed.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Remove scrolled window container around WebKit widgetRicardo Wurmus2016-10-251-3/+0
|/ | | | | | | | | | | | | | The WebKit widget can scroll on its own and does not need to wrapped with a scrolled window container. * src/xwidget.h: Remove struct member widgetscrolledwindow_osr. * src/xwidget.c: Remove widgetscrolledwindow_osr. (xwidget-set-adjustment): Remove. (xwidget-resize): Resize Webkit widget last. * lisp/xwidget.el (xwidget-set-adjustment): Remove. (xwidget-webkit-scroll-up, xwidget-webkit-scroll-down, xwidget-webkit-scroll-forward, xwidget-webkit-scroll-backward): Implement scrolling via JavaScript.
* Rework C source files to avoid ^(Paul Eggert2016-03-101-2/+2
| | | | | | | | Work around Bug#22884 by rewording comments and strings to avoid ‘(’ at the start of a line unless it starts a function. This change is a short-term hack; in the longer run we plan to fix cc-mode’s performance for C files that have ‘(’ at the start of a line in a comment or string.
* xwidgets style cleanupPaul Eggert2016-01-221-57/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust the newly-added Xwidgets code so that it uses a more-typical Emacs style. This should not affect behavior, except that in a few places it adds runtime checks that Lisp arguments are of the proper type, and in one place it uses more-precise arithmetic. * src/buffer.c, src/dispnew.c, src/emacs.c, src/emacsgtkfixed.c: * src/emacs.c, src/print.c, src/window.c, src/xdisp.c, src/xterm.c: Include xwidget.h unconditionally. * src/buffer.c (Fkill_buffer): * src/dispnew.c (update_window): * src/emacs.c (main): * src/print.c (print_object): * src/window.c (Fdelete_window_internal): * src/xdisp.c (handle_single_display_spec, push_it, pop_it) (get_next_element, set_iterator_to_next, next_element_from_xwidget) (dump_glyph, calc_pixel_width_or_height, BUILD_GLYPH_STRINGS_XW) (BUILD_GLYPH_STRINGS, x_produce_glyphs, get_window_cursor_type): * src/xterm.c (x_draw_glyph_string, x_draw_bar_cursor): Call xwidget functions and macros without worrying about HAVE_XWIDGETS when the code is a no-op on non-xwidget platforms. * src/dispextern.h (XWIDGET_GLYPH, struct glyph_string.xwidget) (IT_XWIDGET, GET_FROM_XWIDGET, struct it.u.xwidget) (struct it.xwidget): * src/lisp.h (PVEC_XWIDGET, PVEC_XWIDGET_VIEW): Always define. * src/emacsgtkfixed.h: Omit unnecessary comment. * src/keyboard.c: Fix spacing. * src/xdisp.c (BUILD_XWIDGET_GLYPH_STRING, produce_xwidget_glyph): Define to be a no-op if not HAVE_XWIDGETS. * src/xwidget.c: Include xwidget.h first (after config.h) to make sure that it can stand by itself. (Fmake_xwidget, Fxwidget_webkit_execute_script): Fix typo in doc string. (Fmake_xwidget): Check type of args. (Fmake_xwidget, offscreen_damage_event) (webkit_document_load_finished_cb, webkit_download_cb) (webkit_new_window_policy_decision_requested_cb) (webkit_navigation_policy_decision_requested_cb) (xwidget_osr_draw_cb, xwidget_osr_event_forward) (xwidget_osr_event_set_embedder, xwidget_init_view): Omit unnecessary casts. * src/xwidget.c (Fmake_xwidget, xwidget_hidden) (xwidget_show_view, xwidget_hide_view) (x_draw_xwidget_glyph_string, xwidget_start_redisplay, xwidget_touch) (xwidget_touched): * src/xwidget.h (struct xwidget.kill_without_query) (struct xwidget_view.redisplayed, struct xwidget_view.hidden): Use bool for boolean. * src/xwidget.c (store_xwidget_event_string, Fxwidget_size_request): Simplify by using list functions. (WEBKIT_FN_INIT): Omit unnecessary test for nil. (Fxwidget_resize): Check type of integer args before doing any work. Check that they are nonnegative. (Fxwidget_set_adjustment): Check type of integer arg. Avoid redundant call to gtk_scrolled_window_get_vadjustment. Simplify. Use double, not float. (Fxwidget_info, Fxwidget_view_info): Simplify by using CALLN. (valid_xwidget_spec_p): Simplify. (xwidget_spec_value): Omit unused arg FOUND. All callers changed. * src/xwidget.h: Include lisp.h first, so that includers do not need to worry about doing that before including this file. Make this .h file safe to include even on non-HAVE_XWIDGETS configurations, to simplify the includers. (x_draw_xwidget_glyph_string, syms_of_xwidget, valid_xwidget_spec_p) (xwidget_end_redisplay, lookup_xwidget) (xwidget_view_delete_all_in_window, kill_buffer_xwidgets): Now a no-op if !HAVE_XWIDGETS, to simplify callers. (struct glyph_matrix, struct glyph_string, struct xwidget) (struct xwidget_view, struct window): New forward or incomplete decls, so that includers need not assume the corresponding .h files are already included, or that HAVE_XWIDGETS is defined. (struct xwidget_type, xwidget_from_id): Remove; unused.
* Don’t export C symbols not used elsewherePaul Eggert2016-01-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | | These were recently added, mostly as part of xwidget code. * src/emacsgtkfixed.c (emacs_fixed_get_type): Now static. (EMACS_FIXED, EMACS_FIXED_GET_CLASS): Now static functions here, not macros in emacsgtkfixed.h. * src/emacsgtkfixed.h (EMACS_TYPE_FIXED): Remove. All uses replaced by definiens. (EMACS_FIXED, EMACS_FIXED_GET_CLASS): Remove; these are now static functions in emacsgtkfixed.c. (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS): Remove; unused. (emacs_fixed_get_type): Remove decl; no longer extern. * src/xwidget.c (offscreen_damage_event) (webkit_mime_type_policy_typedecision_requested_cb) (webkit_new_window_policy_decision_requested_cb) (webkit_navigation_policy_decision_requested_cb) (xwidget_spec_value, xwidget_view_lookup) (xwidget_start_redisplay, xwidget_touch): Now static. * src/xwidget.h (xwidget_start_redisplay, xwidget_touch): Remove decls.
* ; Add 2016 to copyright years of new files.Glenn Morris2016-01-191-1/+1
|
* Support for the new Xwidget feature.Joakim Verona2016-01-191-0/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: (HAVE_XWIDGETS, WIDGET_OBJ, EMACS_CONFIG_FEATURES): * xterm.c (x_draw_glyph_string, x_draw_bar_cursor): * xdisp.c: (handle_display_spec, handle_single_display_spec, push_it) (pop_it, set_iterator_to_next, dump_glyph) (calc_pixel_width_or_height, fill_xwidget_glyph_string) (BUILD_XWIDGET_GLYPH_STRING, BUILD_GLYPH_STRINGS) (produce_xwidget_glyph, x_produce_glyphs) (get_window_cursor_type): * window.c (Fdelete_window_internal): * termhooks.h (e): * print.c (print_object): * lisp.h (ptrdiff_t): * keyboard.c (kbd_buffer_get_event, make_lispy_event) (syms_of_keyboard): * emacs.c (main): * dispnew.c (update_window, scrolling_window): * dispextern.h (g, i): * Makefile.in (XWIDGETS_OBJ, WEBKIT_CFLAGS, WEBKIT_LIBS) (GIR_LIBS, ALL_CFLAGS, base_obj, LIBES): * keyboard.c (kbd_buffer_get_event): * emacsgtkfixed.c (emacs_fixed_gtk_widget_size_allocate) (emacs_fixed_class_init): Add case for an xwidget view. * xwidget.c, xwidget.h, xwidget.el: New files for xwidgets Co-authored-by: Grégoire Jadi <daimrod@gmail.com> Various improvements to the Xwidget feature. * xwidgets.c: * emacsgtkfixed.c: * xwidget.el:
* Revert changes installed by xwidgets mergePaul Eggert2015-02-011-115/+0
|
* Implement native scrolling of the webkit xwidgetJoakim Verona2015-01-201-0/+2
| | | | | | It is now possible to use native scrolling with the webkit view. There is also a new function xwidget-set-adjustment, which can manipulate the viewport.
* Update to new DEFSYM strategyJoakim Verona2015-01-111-1/+1
| | | | Update to new DEFSYM strategy which was slightly tricky.
* whitespace cleanupjave2009-01-011-6/+6
|
* Always store GTK Widget as GtkWidget*.Grégoire Jadi2013-07-251-3/+3
| | | | | | | * src/xwidget.h (struct xwidget): GtkContainer -> GtkWidget for widgetwindow_osr. (struct xwidget_view): GtkContainer -> GtkWidget for widgetwindow and emacswindow.
* * src/xwidget.h (xwidget): Remove old todo.Grégoire Jadi2013-07-181-4/+0
|
* * src/xwidget.c: Add a `query-on-exit' flag to determine whether we canGrégoire Jadi2013-07-161-0/+2
| | | | | | | | | | | | | kill xwidget when the buffer is killed without confirmation. (Fset_xwidget_query_on_exit_flag): New function to set the `query-on-exit' flag. (Fxwidget_query_on_exit_flag): New function to retrieve the value of the `query-on-exit' flag. (Fmake_xwidget): Set the `query-on-exit' flag to t by default. * src/xwidget.h (xwidget): Add new field `kill_without_query'. * lisp/xwidget.el (xwidget-kill-buffer-query-function): Ask for confirmation before killing the buffer if a xwidget is present only if its `query-on-exit' flag is enabled.
* * src/xwidget.h src/xwidget.c (valid_xwidget_spec_p): RenamedGrégoire Jadi2013-07-161-9/+11
| | | | | | | | | | | `valid_xwidget_p' to `valid_xwidget_p'. (XWIDGETP): Rename `XXWIDGETP' to `XWIDGETP' and `XXWIDGET_VIEW_P' to `XWIDGET_VIEW_P'. The old `XWIDGETP' is now implemented solely in `valid_xwidget_spec_p'. (CHECK_XWIDGET): New macro to check whether the argument is a xwidget. (CHECK_XWIDGET_VIEW): New macro to check whether the argument is a xwidget_view. * src/print.c src/xdisp.c: Take into account the new names.
* * src/xwidget.c: Replace xwidget_views by Vxwidget_view_list.Grégoire Jadi2013-06-281-2/+0
| | | | | | | | | | | xwidget_views was an hardcoded array of fixed lenght of `struct xwidget_view', Vxwidget_view_list is a list of Lisp_Object. * src/xwidget.h (xwidget_view): Remove member `initialized'. This field was only used to determine whether a given xwidget_view was initialized or not in `xwidget_views'. Now only initialized xwidget_view are stored in Vxwidget_view_list.
* * src/xwidget.c: Fix access to w in xwidget_view (now a Lisp_Object)Grégoire Jadi2013-06-281-4/+1
| | | | * src/xwidget.h (xwidget_view): Convert member `w' to Lisp_Object.
* * src/xwidget.h (XXWIDGET, XXWIDGET_VIEW): Use XUNTAG instead of XPNTRGrégoire Jadi2013-06-281-2/+4
| | | | (copied from XBUFFER and friends).
* * src/xwidget.h (xwidget_view): Convert member `model' to Lisp_Object.Grégoire Jadi2013-06-281-2/+6
| | | | | (XXWIDGET_VIEW_P, XXWIDGET_VIEW): Add standard macros to manipulate xwidget_view. * src/xwidget.c: Fix access to model in xwidget_view (now a Lisp_Object).
* Handle xwidgets like processes and delete them when their buffer is killed.Grégoire Jadi2013-06-241-0/+2
| | | | | | | | | | | | * lisp/xwidget.el (xwidget-kill-buffer-query-function): New function to query a user before killing a buffer with xwidgets in it. This function is stored in `kill-buffer-query-functions' and called from `kill-buffer'. * src/buffer.c (Fkill_buffer): Call `kill_buffer_xwidgets'. * src/xwidget.c (kill_buffer_xwidgets): Delete xwidgets attached to the specified buffer. * src/xwidget.h (kill_buffer_xwidgets): Add definition.
* * src/xwidget.h (XXWIDGET): XXWIDGET expects a PSEUDOVECTOR not a displayGrégoire Jadi2013-06-241-1/+1
| | | | spec.
* * src/xwidget.c src/xwidget.h: Add comments to indicate to which #ifdef some ↵Grégoire Jadi2013-06-041-1/+1
| | | | #endif are associated when it's not obvious.
* GLYPH_DEBUG fixJoakim Verona2011-08-081-0/+4
|
* cleanup xv init test, and introduce PVEC_XWIDGETJoakim Verona2011-07-181-0/+2
|
* cleanupsJoakim Verona2011-07-181-1/+1
|
* xw title conversion to lisp objectJoakim Verona2011-07-151-1/+2
|
* begin moving xwidget storage to lisp. button test shows again since tag 0.1, ↵Joakim Verona2011-07-141-16/+32
| | | | so its not a completely useless version, but since the xwidget identity concept now changed from int to pointer, lots of code was commented out and needs rework
* more configure support and cleanups. the gtk2 webkit support removed because ↵Joakim Verona2011-07-121-1/+0
| | | | offscreen rendering is too quirky there
* tweak to improve deletion of xwviews when emacs windows are closedJoakim Verona2011-07-051-0/+1
|
* work on clipleft. not fantastic yetJoakim Verona2011-07-051-1/+1
|
* work on cliptop. this rev is worse in some regards than the previous, but ↵Joakim Verona2011-07-041-1/+1
| | | | its the first where cliptop works at all.
* first working clipping for gtk3.Joakim Verona2011-07-011-0/+2
|
* added an offscreen rendered webkit variant. the on-screen view shows up ↵Joakim Verona2011-06-301-0/+6
| | | | sometimes so the principle is validated
* first working example of mvc. multiple views of a slider are kept in syncJoakim Verona2011-06-261-0/+2
|
* cleanups + small step towards better lisp interface. use syms rather than ↵Joakim Verona2011-06-251-3/+5
| | | | ints for xwidget types
* trying to revert the composition code and mowe to mvc. now compiles but far ↵Joakim Verona2011-06-221-17/+30
| | | | from functional. dont bother trying yet.
* still doesnt work, but good enough to showcase a little bit what might be ↵Joakim Verona2010-09-171-0/+1
| | | | possible if we get off-screen rendering working properly. some improved docs also.
* fixed breakage after merge from trunkJoakim Verona2010-08-271-2/+2
|
* initial move from git to bzrJoakim Verona2010-06-181-0/+61