diff options
| author | Paul Eggert | 2016-01-22 11:15:05 -0800 |
|---|---|---|
| committer | Paul Eggert | 2016-01-22 11:15:31 -0800 |
| commit | 7c3d742c357dd6480e813f067435b324dba2b325 (patch) | |
| tree | 6b393225ad885e16e829a96d070cd94ab0171ac9 /src/xterm.c | |
| parent | 7bf54d01159eb09bae3c9cd86f2af0812d9afdf6 (diff) | |
| download | emacs-7c3d742c357dd6480e813f067435b324dba2b325.tar.gz emacs-7c3d742c357dd6480e813f067435b324dba2b325.zip | |
xwidgets style cleanup
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.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 44eed22d2ec..6a38d24c636 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -62,9 +62,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 62 | #include "composite.h" | 62 | #include "composite.h" |
| 63 | #include "frame.h" | 63 | #include "frame.h" |
| 64 | #include "dispextern.h" | 64 | #include "dispextern.h" |
| 65 | #ifdef HAVE_XWIDGETS | 65 | #include "xwidget.h" |
| 66 | # include "xwidget.h" | ||
| 67 | #endif | ||
| 68 | #include "fontset.h" | 66 | #include "fontset.h" |
| 69 | #include "termhooks.h" | 67 | #include "termhooks.h" |
| 70 | #include "termopts.h" | 68 | #include "termopts.h" |
| @@ -3514,11 +3512,9 @@ x_draw_glyph_string (struct glyph_string *s) | |||
| 3514 | x_draw_image_glyph_string (s); | 3512 | x_draw_image_glyph_string (s); |
| 3515 | break; | 3513 | break; |
| 3516 | 3514 | ||
| 3517 | #ifdef HAVE_XWIDGETS | ||
| 3518 | case XWIDGET_GLYPH: | 3515 | case XWIDGET_GLYPH: |
| 3519 | x_draw_xwidget_glyph_string (s); | 3516 | x_draw_xwidget_glyph_string (s); |
| 3520 | break; | 3517 | break; |
| 3521 | #endif | ||
| 3522 | 3518 | ||
| 3523 | case STRETCH_GLYPH: | 3519 | case STRETCH_GLYPH: |
| 3524 | x_draw_stretch_glyph_string (s); | 3520 | x_draw_stretch_glyph_string (s); |
| @@ -8929,10 +8925,9 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text | |||
| 8929 | if (cursor_glyph == NULL) | 8925 | if (cursor_glyph == NULL) |
| 8930 | return; | 8926 | return; |
| 8931 | 8927 | ||
| 8932 | #ifdef HAVE_XWIDGETS | 8928 | /* Experimental avoidance of cursor on xwidget. */ |
| 8933 | if (cursor_glyph->type == XWIDGET_GLYPH) | 8929 | if (cursor_glyph->type == XWIDGET_GLYPH) |
| 8934 | return; // Experimental avoidance of cursor on xwidget. | 8930 | return; |
| 8935 | #endif | ||
| 8936 | 8931 | ||
| 8937 | /* If on an image, draw like a normal cursor. That's usually better | 8932 | /* If on an image, draw like a normal cursor. That's usually better |
| 8938 | visible than drawing a bar, esp. if the image is large so that | 8933 | visible than drawing a bar, esp. if the image is large so that |