• Paul Eggert's avatar
    xwidgets style cleanup · 7c3d742c
    Paul Eggert authored
    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.
    7c3d742c
xwidget.h 3.65 KB