From: Joakim Verona Date: Fri, 13 Feb 2015 12:26:52 +0000 (+0100) Subject: Merge branch 'master' into xwidget_mvp X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1ced7a25815cbe12cd15b0e6e16fb0ac5de751ce;p=emacs.git Merge branch 'master' into xwidget_mvp Conflicts: src/xdisp.c --- 1ced7a25815cbe12cd15b0e6e16fb0ac5de751ce diff --cc src/xdisp.c index d3cbd257c39,57a5631c0e3..0808b02c629 --- a/src/xdisp.c +++ b/src/xdisp.c @@@ -831,30 -795,20 +798,23 @@@ static int display_string (const char * ptrdiff_t, ptrdiff_t, struct it *, int, int, int, int); static void compute_line_metrics (struct it *); static void run_redisplay_end_trigger_hook (struct it *); - static int get_overlay_strings (struct it *, ptrdiff_t); - static int get_overlay_strings_1 (struct it *, ptrdiff_t, int); + static bool get_overlay_strings (struct it *, ptrdiff_t); + static bool get_overlay_strings_1 (struct it *, ptrdiff_t, bool); static void next_overlay_string (struct it *); - static void reseat (struct it *, struct text_pos, int); - static void reseat_1 (struct it *, struct text_pos, int); - static void back_to_previous_visible_line_start (struct it *); - static void reseat_at_next_visible_line_start (struct it *, int); - static int next_element_from_ellipsis (struct it *); - static int next_element_from_display_vector (struct it *); - static int next_element_from_string (struct it *); - static int next_element_from_c_string (struct it *); - static int next_element_from_buffer (struct it *); - static int next_element_from_composition (struct it *); - static int next_element_from_image (struct it *); + static void reseat (struct it *, struct text_pos, bool); + static void reseat_1 (struct it *, struct text_pos, bool); + static bool next_element_from_display_vector (struct it *); + static bool next_element_from_string (struct it *); + static bool next_element_from_c_string (struct it *); + static bool next_element_from_buffer (struct it *); + static bool next_element_from_composition (struct it *); + static bool next_element_from_image (struct it *); + static bool next_element_from_stretch (struct it *); +#ifdef HAVE_XWIDGETS - static int next_element_from_xwidget (struct it *); ++static bool next_element_from_xwidget (struct it *); +#endif - static int next_element_from_stretch (struct it *); static void load_overlay_strings (struct it *, ptrdiff_t); - static int init_from_display_pos (struct it *, struct window *, - struct display_pos *); - static void reseat_to_string (struct it *, const char *, - Lisp_Object, ptrdiff_t, ptrdiff_t, int, int); - static int get_next_display_element (struct it *); + static bool get_next_display_element (struct it *); static enum move_it_result move_it_in_display_line_to (struct it *, ptrdiff_t, int, enum move_operation_enum); @@@ -5128,19 -5037,14 +5046,19 @@@ handle_single_display_spec (struct it * LOCATION specifies where to display: `left-margin', `right-margin' or nil. */ - valid_p = (STRINGP (value) + bool valid_p = (STRINGP (value) #ifdef HAVE_WINDOW_SYSTEM - || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p) - && valid_image_p (value)) + || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p) + && valid_image_p (value)) #endif /* not HAVE_WINDOW_SYSTEM */ - || (CONSP (value) && EQ (XCAR (value), Qspace))); + || (CONSP (value) && EQ (XCAR (value), Qspace)) +#ifdef HAVE_XWIDGETS + || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p) + && valid_xwidget_spec_p (value)) +#endif + ); - if (valid_p && !display_replaced_p) + if (valid_p && display_replaced == 0) { int retval = 1; @@@ -8035,20 -7916,10 +7958,19 @@@ static boo next_element_from_image (struct it *it) { it->what = IT_IMAGE; - it->ignore_overlay_strings_at_pos_p = 0; - return 1; + it->ignore_overlay_strings_at_pos_p = false; + return true; } +#ifdef HAVE_XWIDGETS - /* I'm not sure about this. FIXME JAVE */ - static int ++static bool +next_element_from_xwidget (struct it *it) +{ + it->what = IT_XWIDGET; - return 1; ++ return true; +} +#endif + /* Fill iterator IT with next display element from a stretch glyph property. IT->object is the value of the text property. Value is @@@ -24934,22 -24757,8 +24849,22 @@@ compute_overhangs_and_x (struct glyph_s ++START; \ s->x = (X); \ } \ - while (0) + while (false) +#ifdef HAVE_XWIDGETS +#define BUILD_XWIDGET_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \ + do \ + { \ + s = alloca (sizeof *s); \ + INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ + fill_xwidget_glyph_string (s); \ + append_glyph_string (&(HEAD), &(TAIL), s); \ + ++(START); \ + s->x = (X); \ + } \ + while (false) +#endif + /* Add a glyph string for a sequence of character glyphs to the list of strings between HEAD and TAIL. START is the index of the first @@@ -25128,21 -24928,9 +25043,21 @@@ (X) += s->width; \ } \ } \ - } while (0) + } while (false) +#ifdef HAVE_XWIDGETS +# define BUILD_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X) \ + BUILD_GLYPH_STRINGS_1(START, END, HEAD, TAIL, HL, X, LAST_X) \ + BUILD_GLYPH_STRINGS_XW(START, END, HEAD, TAIL, HL, X, LAST_X) \ + BUILD_GLYPH_STRINGS_2(START, END, HEAD, TAIL, HL, X, LAST_X) +#else +# define BUILD_GLYPH_STRINGS(START, END, HEAD, TAIL, HL, X, LAST_X) \ + BUILD_GLYPH_STRINGS_1(START, END, HEAD, TAIL, HL, X, LAST_X) \ + BUILD_GLYPH_STRINGS_2(START, END, HEAD, TAIL, HL, X, LAST_X) +#endif + + /* Draw glyphs between START and END in AREA of ROW on window W, starting at x-position X. X is relative to AREA in W. HL is a face-override with the following meaning: