diff options
| author | Eli Zaretskii | 2013-09-26 10:37:16 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-09-26 10:37:16 +0300 |
| commit | b87c4ff2817e71ca71b028792200b1e069a95e04 (patch) | |
| tree | bfe00c0655fa02078a9ab2c633ea06d90c4a2064 /src/dispextern.h | |
| parent | bbc108377873aa6ed7cf21c731770103096eea39 (diff) | |
| parent | ba355de014b75ed104da4777f909db70d62f2357 (diff) | |
| download | emacs-b87c4ff2817e71ca71b028792200b1e069a95e04.tar.gz emacs-b87c4ff2817e71ca71b028792200b1e069a95e04.zip | |
Merge from trunk.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 111 |
1 files changed, 53 insertions, 58 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index f70b1f8092e..af9efe660d9 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -49,18 +49,16 @@ typedef struct { | |||
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | INLINE_HEADER_BEGIN | 51 | INLINE_HEADER_BEGIN |
| 52 | #ifndef DISPEXTERN_INLINE | ||
| 53 | # define DISPEXTERN_INLINE INLINE | ||
| 54 | #endif | ||
| 55 | 52 | ||
| 56 | #include <c-strcase.h> | 53 | #include <c-strcase.h> |
| 57 | DISPEXTERN_INLINE int | 54 | INLINE int |
| 58 | xstrcasecmp (char const *a, char const *b) | 55 | xstrcasecmp (char const *a, char const *b) |
| 59 | { | 56 | { |
| 60 | return c_strcasecmp (a, b); | 57 | return c_strcasecmp (a, b); |
| 61 | } | 58 | } |
| 62 | 59 | ||
| 63 | #ifdef HAVE_X_WINDOWS | 60 | #ifdef HAVE_X_WINDOWS |
| 61 | #include <X11/Xresource.h> /* for XrmDatabase */ | ||
| 64 | typedef struct x_display_info Display_Info; | 62 | typedef struct x_display_info Display_Info; |
| 65 | typedef XImage * XImagePtr; | 63 | typedef XImage * XImagePtr; |
| 66 | typedef XImagePtr XImagePtr_or_DC; | 64 | typedef XImagePtr XImagePtr_or_DC; |
| @@ -288,10 +286,10 @@ typedef struct { | |||
| 288 | } GLYPH; | 286 | } GLYPH; |
| 289 | 287 | ||
| 290 | /* Return a glyph's character code. */ | 288 | /* Return a glyph's character code. */ |
| 291 | DISPEXTERN_INLINE int GLYPH_CHAR (GLYPH glyph) { return glyph.ch; } | 289 | INLINE int GLYPH_CHAR (GLYPH glyph) { return glyph.ch; } |
| 292 | 290 | ||
| 293 | /* Return a glyph's face ID. */ | 291 | /* Return a glyph's face ID. */ |
| 294 | DISPEXTERN_INLINE int GLYPH_FACE (GLYPH glyph) { return glyph.face_id; } | 292 | INLINE int GLYPH_FACE (GLYPH glyph) { return glyph.face_id; } |
| 295 | 293 | ||
| 296 | #define SET_GLYPH_CHAR(glyph, char) ((glyph).ch = (char)) | 294 | #define SET_GLYPH_CHAR(glyph, char) ((glyph).ch = (char)) |
| 297 | #define SET_GLYPH_FACE(glyph, face) ((glyph).face_id = (face)) | 295 | #define SET_GLYPH_FACE(glyph, face) ((glyph).face_id = (face)) |
| @@ -300,7 +298,7 @@ DISPEXTERN_INLINE int GLYPH_FACE (GLYPH glyph) { return glyph.face_id; } | |||
| 300 | 298 | ||
| 301 | /* The following are valid only if GLYPH_CODE_P (gc). */ | 299 | /* The following are valid only if GLYPH_CODE_P (gc). */ |
| 302 | 300 | ||
| 303 | DISPEXTERN_INLINE int | 301 | INLINE int |
| 304 | GLYPH_CODE_CHAR (Lisp_Object gc) | 302 | GLYPH_CODE_CHAR (Lisp_Object gc) |
| 305 | { | 303 | { |
| 306 | return (CONSP (gc) | 304 | return (CONSP (gc) |
| @@ -308,7 +306,7 @@ GLYPH_CODE_CHAR (Lisp_Object gc) | |||
| 308 | : XINT (gc) & MAX_CHAR); | 306 | : XINT (gc) & MAX_CHAR); |
| 309 | } | 307 | } |
| 310 | 308 | ||
| 311 | DISPEXTERN_INLINE int | 309 | INLINE int |
| 312 | GLYPH_CODE_FACE (Lisp_Object gc) | 310 | GLYPH_CODE_FACE (Lisp_Object gc) |
| 313 | { | 311 | { |
| 314 | return CONSP (gc) ? XINT (XCDR (gc)) : XINT (gc) >> CHARACTERBITS; | 312 | return CONSP (gc) ? XINT (XCDR (gc)) : XINT (gc) >> CHARACTERBITS; |
| @@ -794,7 +792,10 @@ enum glyph_row_area | |||
| 794 | Rows in window matrices on frames having no frame matrices point to | 792 | Rows in window matrices on frames having no frame matrices point to |
| 795 | glyphs allocated from the heap via xmalloc; | 793 | glyphs allocated from the heap via xmalloc; |
| 796 | glyphs[LEFT_MARGIN_AREA] is the start address of the allocated | 794 | glyphs[LEFT_MARGIN_AREA] is the start address of the allocated |
| 797 | glyph structure array. */ | 795 | glyph structure array. |
| 796 | |||
| 797 | NOTE: layout of first four members of this structure is important, | ||
| 798 | see clear_glyph_row and copy_row_except_pointers to check why. */ | ||
| 798 | 799 | ||
| 799 | struct glyph_row | 800 | struct glyph_row |
| 800 | { | 801 | { |
| @@ -814,8 +815,13 @@ struct glyph_row | |||
| 814 | removed some day, so don't use it in new code. */ | 815 | removed some day, so don't use it in new code. */ |
| 815 | struct glyph *glyphs[1 + LAST_AREA]; | 816 | struct glyph *glyphs[1 + LAST_AREA]; |
| 816 | 817 | ||
| 817 | /* Number of glyphs actually filled in areas. */ | 818 | /* Number of glyphs actually filled in areas. This could have size |
| 818 | short used[LAST_AREA]; | 819 | LAST_AREA, but it's 1 + LAST_AREA to simplify offset calculations. */ |
| 820 | short used[1 + LAST_AREA]; | ||
| 821 | |||
| 822 | /* Hash code. This hash code is available as soon as the row | ||
| 823 | is constructed, i.e. after a call to display_line. */ | ||
| 824 | unsigned hash; | ||
| 819 | 825 | ||
| 820 | /* Window-relative x and y-position of the top-left corner of this | 826 | /* Window-relative x and y-position of the top-left corner of this |
| 821 | row. If y < 0, this means that eabs (y) pixels of the row are | 827 | row. If y < 0, this means that eabs (y) pixels of the row are |
| @@ -848,10 +854,6 @@ struct glyph_row | |||
| 848 | in last row when checking if row is fully visible. */ | 854 | in last row when checking if row is fully visible. */ |
| 849 | int extra_line_spacing; | 855 | int extra_line_spacing; |
| 850 | 856 | ||
| 851 | /* Hash code. This hash code is available as soon as the row | ||
| 852 | is constructed, i.e. after a call to display_line. */ | ||
| 853 | unsigned hash; | ||
| 854 | |||
| 855 | /* First position in this row. This is the text position, including | 857 | /* First position in this row. This is the text position, including |
| 856 | overlay position information etc, where the display of this row | 858 | overlay position information etc, where the display of this row |
| 857 | started, and can thus be less than the position of the first | 859 | started, and can thus be less than the position of the first |
| @@ -1195,12 +1197,6 @@ struct glyph_row *matrix_row (struct glyph_matrix *, int); | |||
| 1195 | ((ROW)->phys_height - (ROW)->phys_ascent \ | 1197 | ((ROW)->phys_height - (ROW)->phys_ascent \ |
| 1196 | > (ROW)->height - (ROW)->ascent) | 1198 | > (ROW)->height - (ROW)->ascent) |
| 1197 | 1199 | ||
| 1198 | /* True means that fonts have been loaded since the last glyph | ||
| 1199 | matrix adjustments. The function redisplay_internal adjusts glyph | ||
| 1200 | matrices when this flag is true. */ | ||
| 1201 | |||
| 1202 | extern bool fonts_changed_p; | ||
| 1203 | |||
| 1204 | /* A glyph for a space. */ | 1200 | /* A glyph for a space. */ |
| 1205 | 1201 | ||
| 1206 | extern struct glyph space_glyph; | 1202 | extern struct glyph space_glyph; |
| @@ -1428,31 +1424,31 @@ struct glyph_string | |||
| 1428 | #define CURRENT_MODE_LINE_FACE_ID(W) \ | 1424 | #define CURRENT_MODE_LINE_FACE_ID(W) \ |
| 1429 | (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W))) | 1425 | (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W))) |
| 1430 | 1426 | ||
| 1431 | /* Return the current height of the mode line of window W. If not | 1427 | /* Return the current height of the mode line of window W. If not known |
| 1432 | known from current_mode_line_height, look at W's current glyph | 1428 | from W->mode_line_height, look at W's current glyph matrix, or return |
| 1433 | matrix, or return a default based on the height of the font of the | 1429 | a default based on the height of the font of the face `mode-line'. */ |
| 1434 | face `mode-line'. */ | ||
| 1435 | 1430 | ||
| 1436 | #define CURRENT_MODE_LINE_HEIGHT(W) \ | 1431 | #define CURRENT_MODE_LINE_HEIGHT(W) \ |
| 1437 | (current_mode_line_height >= 0 \ | 1432 | (W->mode_line_height >= 0 \ |
| 1438 | ? current_mode_line_height \ | 1433 | ? W->mode_line_height \ |
| 1439 | : (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ | 1434 | : (W->mode_line_height \ |
| 1440 | ? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \ | 1435 | = (MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \ |
| 1441 | : estimate_mode_line_height (XFRAME ((W)->frame), \ | 1436 | ? MATRIX_MODE_LINE_HEIGHT (W->current_matrix) \ |
| 1442 | CURRENT_MODE_LINE_FACE_ID (W)))) | 1437 | : estimate_mode_line_height \ |
| 1438 | (XFRAME (W->frame), CURRENT_MODE_LINE_FACE_ID (W))))) | ||
| 1443 | 1439 | ||
| 1444 | /* Return the current height of the header line of window W. If not | 1440 | /* Return the current height of the header line of window W. If not known |
| 1445 | known from current_header_line_height, look at W's current glyph | 1441 | from W->header_line_height, look at W's current glyph matrix, or return |
| 1446 | matrix, or return an estimation based on the height of the font of | 1442 | an estimation based on the height of the font of the face `header-line'. */ |
| 1447 | the face `header-line'. */ | ||
| 1448 | 1443 | ||
| 1449 | #define CURRENT_HEADER_LINE_HEIGHT(W) \ | 1444 | #define CURRENT_HEADER_LINE_HEIGHT(W) \ |
| 1450 | (current_header_line_height >= 0 \ | 1445 | (W->header_line_height >= 0 \ |
| 1451 | ? current_header_line_height \ | 1446 | ? W->header_line_height \ |
| 1452 | : (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ | 1447 | : (W->header_line_height \ |
| 1453 | ? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \ | 1448 | = (MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \ |
| 1454 | : estimate_mode_line_height (XFRAME ((W)->frame), \ | 1449 | ? MATRIX_HEADER_LINE_HEIGHT (W->current_matrix) \ |
| 1455 | HEADER_LINE_FACE_ID))) | 1450 | : estimate_mode_line_height \ |
| 1451 | (XFRAME (W->frame), HEADER_LINE_FACE_ID)))) | ||
| 1456 | 1452 | ||
| 1457 | /* Return the height of the desired mode line of window W. */ | 1453 | /* Return the height of the desired mode line of window W. */ |
| 1458 | 1454 | ||
| @@ -1829,7 +1825,7 @@ struct face_cache | |||
| 1829 | #endif /* not HAVE_WINDOW_SYSTEM */ | 1825 | #endif /* not HAVE_WINDOW_SYSTEM */ |
| 1830 | 1826 | ||
| 1831 | /* Return true if G contains a valid character code. */ | 1827 | /* Return true if G contains a valid character code. */ |
| 1832 | DISPEXTERN_INLINE bool | 1828 | INLINE bool |
| 1833 | GLYPH_CHAR_VALID_P (GLYPH g) | 1829 | GLYPH_CHAR_VALID_P (GLYPH g) |
| 1834 | { | 1830 | { |
| 1835 | return CHAR_VALID_P (GLYPH_CHAR (g)); | 1831 | return CHAR_VALID_P (GLYPH_CHAR (g)); |
| @@ -1839,7 +1835,7 @@ GLYPH_CHAR_VALID_P (GLYPH g) | |||
| 1839 | encodes a char code in the lower CHARACTERBITS bits and a (very small) | 1835 | encodes a char code in the lower CHARACTERBITS bits and a (very small) |
| 1840 | face-id in the upper bits, or it may be a cons (CHAR . FACE-ID). */ | 1836 | face-id in the upper bits, or it may be a cons (CHAR . FACE-ID). */ |
| 1841 | 1837 | ||
| 1842 | DISPEXTERN_INLINE bool | 1838 | INLINE bool |
| 1843 | GLYPH_CODE_P (Lisp_Object gc) | 1839 | GLYPH_CODE_P (Lisp_Object gc) |
| 1844 | { | 1840 | { |
| 1845 | return (CONSP (gc) | 1841 | return (CONSP (gc) |
| @@ -2710,7 +2706,7 @@ typedef struct { | |||
| 2710 | unsigned mouse_face_hidden : 1; | 2706 | unsigned mouse_face_hidden : 1; |
| 2711 | } Mouse_HLInfo; | 2707 | } Mouse_HLInfo; |
| 2712 | 2708 | ||
| 2713 | DISPEXTERN_INLINE void | 2709 | INLINE void |
| 2714 | reset_mouse_highlight (Mouse_HLInfo *hlinfo) | 2710 | reset_mouse_highlight (Mouse_HLInfo *hlinfo) |
| 2715 | { | 2711 | { |
| 2716 | 2712 | ||
| @@ -2802,11 +2798,6 @@ struct redisplay_interface | |||
| 2802 | /* Flush the display of frame F. For X, this is XFlush. */ | 2798 | /* Flush the display of frame F. For X, this is XFlush. */ |
| 2803 | void (*flush_display) (struct frame *f); | 2799 | void (*flush_display) (struct frame *f); |
| 2804 | 2800 | ||
| 2805 | /* Flush the display of frame F if non-NULL. This is called | ||
| 2806 | during redisplay, and should be NULL on systems which flush | ||
| 2807 | automatically before reading input. */ | ||
| 2808 | void (*flush_display_optional) (struct frame *f); | ||
| 2809 | |||
| 2810 | /* Clear the mouse highlight in window W, if there is any. */ | 2801 | /* Clear the mouse highlight in window W, if there is any. */ |
| 2811 | void (*clear_window_mouse_face) (struct window *w); | 2802 | void (*clear_window_mouse_face) (struct window *w); |
| 2812 | 2803 | ||
| @@ -3200,12 +3191,10 @@ int in_display_vector_p (struct it *); | |||
| 3200 | int frame_mode_line_height (struct frame *); | 3191 | int frame_mode_line_height (struct frame *); |
| 3201 | extern Lisp_Object Qtool_bar; | 3192 | extern Lisp_Object Qtool_bar; |
| 3202 | extern bool redisplaying_p; | 3193 | extern bool redisplaying_p; |
| 3203 | extern int help_echo_showing_p; | 3194 | extern bool help_echo_showing_p; |
| 3204 | extern int current_mode_line_height, current_header_line_height; | ||
| 3205 | extern Lisp_Object help_echo_string, help_echo_window; | 3195 | extern Lisp_Object help_echo_string, help_echo_window; |
| 3206 | extern Lisp_Object help_echo_object, previous_help_echo_string; | 3196 | extern Lisp_Object help_echo_object, previous_help_echo_string; |
| 3207 | extern ptrdiff_t help_echo_pos; | 3197 | extern ptrdiff_t help_echo_pos; |
| 3208 | extern struct frame *last_mouse_frame; | ||
| 3209 | extern int last_tool_bar_item; | 3198 | extern int last_tool_bar_item; |
| 3210 | extern void reseat_at_previous_visible_line_start (struct it *); | 3199 | extern void reseat_at_previous_visible_line_start (struct it *); |
| 3211 | extern Lisp_Object lookup_glyphless_char_display (int, struct it *); | 3200 | extern Lisp_Object lookup_glyphless_char_display (int, struct it *); |
| @@ -3215,6 +3204,7 @@ extern ptrdiff_t compute_display_string_pos (struct text_pos *, | |||
| 3215 | extern ptrdiff_t compute_display_string_end (ptrdiff_t, | 3204 | extern ptrdiff_t compute_display_string_end (ptrdiff_t, |
| 3216 | struct bidi_string_data *); | 3205 | struct bidi_string_data *); |
| 3217 | extern void produce_stretch_glyph (struct it *); | 3206 | extern void produce_stretch_glyph (struct it *); |
| 3207 | extern int merge_glyphless_glyph_face (struct it *); | ||
| 3218 | 3208 | ||
| 3219 | #ifdef HAVE_WINDOW_SYSTEM | 3209 | #ifdef HAVE_WINDOW_SYSTEM |
| 3220 | 3210 | ||
| @@ -3404,7 +3394,7 @@ extern frame_parm_handler x_frame_parm_handlers[]; | |||
| 3404 | 3394 | ||
| 3405 | extern void start_hourglass (void); | 3395 | extern void start_hourglass (void); |
| 3406 | extern void cancel_hourglass (void); | 3396 | extern void cancel_hourglass (void); |
| 3407 | extern int hourglass_shown_p; | 3397 | extern bool hourglass_shown_p; |
| 3408 | /* If non-null, an asynchronous timer that, when it expires, displays | 3398 | /* If non-null, an asynchronous timer that, when it expires, displays |
| 3409 | an hourglass cursor on all frames. */ | 3399 | an hourglass cursor on all frames. */ |
| 3410 | extern struct atimer *hourglass_atimer; | 3400 | extern struct atimer *hourglass_atimer; |
| @@ -3454,13 +3444,10 @@ extern Lisp_Object marginal_area_string (struct window *, enum window_part, | |||
| 3454 | Lisp_Object *, | 3444 | Lisp_Object *, |
| 3455 | int *, int *, int *, int *); | 3445 | int *, int *, int *, int *); |
| 3456 | extern void redraw_frame (struct frame *); | 3446 | extern void redraw_frame (struct frame *); |
| 3457 | extern void cancel_line (int, struct frame *); | ||
| 3458 | extern void init_desired_glyphs (struct frame *); | ||
| 3459 | extern bool update_frame (struct frame *, bool, bool); | 3447 | extern bool update_frame (struct frame *, bool, bool); |
| 3460 | extern void update_frame_with_menu (struct frame *); | 3448 | extern void update_frame_with_menu (struct frame *); |
| 3461 | extern void bitch_at_user (void); | 3449 | extern void bitch_at_user (void); |
| 3462 | void adjust_glyphs (struct frame *); | 3450 | extern void adjust_frame_glyphs (struct frame *); |
| 3463 | struct glyph_matrix *save_current_matrix (struct frame *); | ||
| 3464 | void free_glyphs (struct frame *); | 3451 | void free_glyphs (struct frame *); |
| 3465 | void free_window_matrices (struct window *); | 3452 | void free_window_matrices (struct window *); |
| 3466 | void check_glyph_memory (void); | 3453 | void check_glyph_memory (void); |
| @@ -3546,6 +3533,7 @@ enum resource_types | |||
| 3546 | RES_TYPE_BOOLEAN_NUMBER | 3533 | RES_TYPE_BOOLEAN_NUMBER |
| 3547 | }; | 3534 | }; |
| 3548 | 3535 | ||
| 3536 | extern Display_Info *check_x_display_info (Lisp_Object); | ||
| 3549 | extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object, | 3537 | extern Lisp_Object x_get_arg (Display_Info *, Lisp_Object, |
| 3550 | Lisp_Object, const char *, const char *class, | 3538 | Lisp_Object, const char *, const char *class, |
| 3551 | enum resource_types); | 3539 | enum resource_types); |
| @@ -3557,6 +3545,13 @@ extern Lisp_Object x_default_parameter (struct frame *, Lisp_Object, | |||
| 3557 | Lisp_Object, Lisp_Object, | 3545 | Lisp_Object, Lisp_Object, |
| 3558 | const char *, const char *, | 3546 | const char *, const char *, |
| 3559 | enum resource_types); | 3547 | enum resource_types); |
| 3548 | extern char *x_get_string_resource (XrmDatabase, const char *, | ||
| 3549 | const char *); | ||
| 3550 | |||
| 3551 | #ifndef HAVE_NS /* These both used on W32 and X only. */ | ||
| 3552 | extern bool x_mouse_grabbed (Display_Info *); | ||
| 3553 | extern void x_redo_mouse_highlight (Display_Info *); | ||
| 3554 | #endif /* HAVE_NS */ | ||
| 3560 | 3555 | ||
| 3561 | #endif /* HAVE_WINDOW_SYSTEM */ | 3556 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 3562 | 3557 | ||