annotate src/redisplay-xlike-inc.c @ 5239:f19e6bc25969

Backed out changeset 6466bc9ebf15 This would leave all but the first frame blank.
author Mike Sperber <sperber@deinprogramm.de>
date Tue, 13 Jul 2010 10:19:33 +0200
parents 6466bc9ebf15
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1 /* Common code between X and GTK -- redisplay-related.
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
3 Copyright (C) 1994 Lucid, Inc.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
5 Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing.
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
6 Copyright (C) 2010 Didier Verna
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
7
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
8 This file is part of XEmacs.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
9
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
10 XEmacs is free software; you can redistribute it and/or modify it
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
11 under the terms of the GNU General Public License as published by the
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
12 Free Software Foundation; either version 2, or (at your option) any
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
13 later version.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
14
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
15 XEmacs is distributed in the hope that it will be useful, but WITHOUT
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
18 for more details.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
19
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
20 You should have received a copy of the GNU General Public License
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
21 along with XEmacs; see the file COPYING. If not, write to
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
22 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
23 Boston, MA 02111-1307, USA. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
24
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
25 /* Synched up with: Not in FSF. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
26
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
27 /* Author: Chuck Thompson */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
28 /* Gtk flavor by William Perry */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
29 /* X and GTK code merged by Ben Wing, 1-10 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
30
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
31 /* Lots of work done by Ben Wing for Mule */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
32
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
33 /* Before including this file, you need to define either THIS_IS_X or
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
34 THIS_IS_GTK. See comments in console-xlike-inc.h. */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
35
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
36 #include <config.h>
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
37 #include "lisp.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
38
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
39 #include "buffer.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
40 #include "debug.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
41 #include "device-impl.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
42 #include "faces.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
43 #include "file-coding.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
44 #include "frame-impl.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
45 #include "gutter.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
46 #include "redisplay.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
47 #include "sysdep.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
48 #include "window.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
49
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
50 #ifdef MULE
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
51 #include "mule-ccl.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
52 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
53 #include "charset.h"
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
54
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
55 #define NEED_GCCACHE_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
56 #define NEED_GLYPHS_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
57 #define NEED_OBJECTS_IMPL_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
58 #include "console-xlike-inc.h"
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
59
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
60 #include "sysproc.h" /* for select() */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
61
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
62 #ifdef THIS_IS_X
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
63 #include "EmacsFrame.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
64 #include "EmacsFrameP.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
65
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
66 #include <X11/bitmaps/gray>
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
67 #endif /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
68
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
69 #define EOL_CURSOR_WIDTH 5
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
70
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
71 /* Device methods */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
72
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
73 #define XLIKE_text_width XFUN (text_width)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
74 #define XLIKE_output_display_block XFUN (output_display_block)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
75 #define XLIKE_divider_height XFUN (divider_height)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
76 #define XLIKE_eol_cursor_width XFUN (eol_cursor_width)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
77 #define XLIKE_output_vertical_divider XFUN (output_vertical_divider)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
78 #define XLIKE_clear_region XFUN (clear_region)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
79 #define XLIKE_clear_frame XFUN (clear_frame)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
80 #define XLIKE_flash XFUN (flash)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
81 #define XLIKE_ring_bell XFUN (ring_bell)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
82 #define XLIKE_bevel_area XFUN (bevel_area)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
83 #define XLIKE_output_string XFUN (output_string)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
84 #define XLIKE_output_pixmap XFUN (output_pixmap)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
85 #define XLIKE_output_xlike_pixmap XFUN (output_xlike_pixmap)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
86 #define XLIKE_window_output_begin XFUN (window_output_begin)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
87 #define XLIKE_window_output_end XFUN (window_output_end)
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
88
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
89 /* Miscellaneous split functions */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
90
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
91 #define console_type_create_redisplay_XLIKE XLIKE_PASTE (console_type_create_redisplay, XLIKE_NAME)
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
92 #define XLIKE_get_gc XFUN (get_gc)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
93 #define XLIKE_output_blank XFUN (output_blank)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
94 #define XLIKE_text_width_single_run XFUN (text_width_single_run)
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
95
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
96 static void XLIKE_output_blank (struct window *w, struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
97 struct rune *rb, int start_pixpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
98 int cursor_start, int cursor_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
99 static void XLIKE_output_horizontal_line (struct window *w,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
100 struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
101 struct rune *rb);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
102 static void XLIKE_output_eol_cursor (struct window *w,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
103 struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
104 int xpos, face_index findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
105 static void XLIKE_clear_frame_windows (Lisp_Object window);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
106 static void XLIKE_bevel_area (struct window *w, face_index findex,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
107 int x, int y, int width, int height,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
108 int shadow_thickness, int edges,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
109 enum edge_style style);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
110 static void XLIKE_ring_bell (struct device *d, int volume, int pitch,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
111 int duration);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
112
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
113 #ifdef THIS_IS_X
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
114 static void XLIKE_window_output_begin (struct window *UNUSED (w));
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
115 static void XLIKE_window_output_end (struct window *w);
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
116 #endif /* THIS_IS_X */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
117
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
118
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
119 /****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
120 /* */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
121 /* Separate textual runs */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
122 /* */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
123 /****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
124
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
125
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
126 /* Note: We do not use the Xmb*() functions and XFontSets, nor the
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
127 Motif XFontLists and CompoundStrings.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
128 Those functions are generally losing for a number of reasons.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
129 Most important, they only support one locale (e.g. you could
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
130 display Japanese and ASCII text, but not mixed Japanese/Chinese
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
131 text). You could maybe call setlocale() frequently to try to deal
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
132 with this, but that would generally fail because an XFontSet is
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
133 tied to one locale and won't have the other character sets in it.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
134
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
135 fontconfig (the font database for Xft) has some specifier-like
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
136 properties, but it's not sufficient (witness the existence of
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
137 Pango). Pango might do the trick, but it's not a cross-platform
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
138 solution; it would need significant advantages to be worth the
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
139 effort.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
140 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
141
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
142 struct textual_run
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
143 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
144 Lisp_Object charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
145 unsigned char *ptr;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
146 int len;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
147 int dimension;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
148 };
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
149
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
150 /* Separate out the text in STR (an array of Ichars, not a string
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
151 representation) of length LEN into a series of runs, stored in
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
152 RUN_STORAGE. RUN_STORAGE is guaranteed to hold enough space for all
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
153 runs that could be generated from this text. Each run points to the a
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
154 stretch of text given simply by the position codes TEXT_STORAGE into a
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
155 series of textual runs of a particular charset. Also convert the
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
156 characters as necessary into the format needed by XDrawImageString(),
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
157 XDrawImageString16(), et al. This means converting to one or two byte
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
158 format, possibly tweaking the high bits, and possibly running a CCL
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
159 program. You must pre-allocate the space used and pass it in. (This is
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
160 done so you can ALLOCA () the space.) (2 * len) bytes must be allocated
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
161 for TEXT_STORAGE and (len * sizeof (struct textual_run)) bytes of
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
162 RUN_STORAGE, where LEN is the length of the dynarr.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
163
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
164 bufchar might not be fixed width (in the case of UTF-8).
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
165
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
166 Returns the number of runs actually used. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
167
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
168 /* Notes on Xft implementation
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
169
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
170 - With Unicode, we're no longer going to have repertoires reified as
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
171 charsets. (Not that we ever really did, what with corporate variants,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
172 and so on.) So we really should be querying the face for the desired
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
173 font, rather than the character for the charset, and that's what would
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
174 determine the separation into runs.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
175 - The widechar versions of fontconfig (and therefore Xft) functions
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
176 seem to be just bigendian Unicode. So there's actually no need to use
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
177 the 8-bit versions in computing runs and runes, it would seem.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
178 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
179
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
180 #if !defined(USE_XFT) && !defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
181 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
182 separate_textual_runs_nomule (unsigned char *text_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
183 struct textual_run *run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
184 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
185 struct face_cachel *UNUSED (cachel))
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
186 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
187 if (!len)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
188 return 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
189
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
190 run_storage[0].ptr = text_storage;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
191 run_storage[0].len = len;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
192 run_storage[0].dimension = 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
193 run_storage[0].charset = Qnil;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
194
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
195 while (len--)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
196 *text_storage++ = *str++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
197 return 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
198 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
199 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
200
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
201 #if defined(USE_XFT) && !defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
202 /*
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
203 Note that in this configuration the "Croatian hack" of using an 8-bit,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
204 non-Latin-1 font to get localized display without Mule simply isn't
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
205 available. That's by design -- Unicode does not aid or abet that kind
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
206 of punning.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
207 This means that the cast to XftChar16 gives the correct "conversion" to
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
208 UCS-2.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
209 #### Is there an alignment issue with text_storage?
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
210 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
211 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
212 separate_textual_runs_xft_nomule (unsigned char *text_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
213 struct textual_run *run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
214 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
215 struct face_cachel *UNUSED (cachel))
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
216 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
217 int i;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
218 if (!len)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
219 return 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
220
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
221 run_storage[0].ptr = text_storage;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
222 run_storage[0].len = len;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
223 run_storage[0].dimension = 2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
224 run_storage[0].charset = Qnil;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
225
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
226 for (i = 0; i < len; i++)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
227 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
228 *(XftChar16 *)text_storage = str[i];
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
229 text_storage += sizeof (XftChar16);
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
230 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
231 return 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
232 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
233 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
234
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
235 #if defined(USE_XFT) && defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
236 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
237 separate_textual_runs_xft_mule (unsigned char *text_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
238 struct textual_run *run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
239 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
240 struct face_cachel *UNUSED (cachel))
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
241 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
242 Lisp_Object prev_charset = Qunbound;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
243 int runs_so_far = 0, i;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
244
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
245 run_storage[0].ptr = text_storage;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
246 run_storage[0].len = len;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
247 run_storage[0].dimension = 2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
248 run_storage[0].charset = Qnil;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
249
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
250 for (i = 0; i < len; i++)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
251 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
252 Ichar ch = str[i];
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
253 Lisp_Object charset = ichar_charset (ch);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
254 int ucs = ichar_to_unicode (ch);
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
255
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
256 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
257 REPLACMENT CHARACTER. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
258 /* That means we can't handle characters outside of the BMP for now */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
259 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
260
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
261 if (!EQ (charset, prev_charset))
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
262 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
263 if (runs_so_far)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
264 run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
265 run_storage[runs_so_far].ptr = text_storage;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
266 run_storage[runs_so_far].dimension = 2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
267 run_storage[runs_so_far].charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
268 prev_charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
269 runs_so_far++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
270 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
271
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
272 *(XftChar16 *)text_storage = ucs;
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
273 text_storage += sizeof (XftChar16);
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
274 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
275
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
276 if (runs_so_far)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
277 run_storage[runs_so_far-1].len = (text_storage - run_storage[runs_so_far-1].ptr) >> 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
278 return runs_so_far;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
279 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
280 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
281
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
282 #if !defined(USE_XFT) && defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
283 /*
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
284 This is the most complex function of this group, due to the various
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
285 indexing schemes used by different fonts. For our purposes, they
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
286 fall into three classes. Some fonts are indexed compatibly with ISO
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
287 2022; those fonts just use the Mule internal representation directly
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
288 (typically the high bit must be reset; this is determined by the `graphic'
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
289 flag). Some fonts are indexed by Unicode, specifically by UCS-2. These
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
290 are all translated using `ichar_to_unicode'. Finally some fonts have
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
291 irregular indexes, and must be translated ad hoc. In XEmacs ad hoc
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
292 translations are accomplished with CCL programs. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
293 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
294 separate_textual_runs_mule (unsigned char *text_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
295 struct textual_run *run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
296 const Ichar *str, Charcount len,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
297 struct face_cachel *cachel)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
298 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
299 Lisp_Object prev_charset = Qunbound;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
300 int runs_so_far = 0, i;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
301 Ibyte charset_leading_byte = LEADING_BYTE_ASCII;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
302 int dimension = 1, graphic = 0, need_ccl_conversion = 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
303 Lisp_Object ccl_prog;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
304 struct ccl_program char_converter;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
305
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
306 int translate_to_ucs_2 = 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
307
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
308 for (i = 0; i < len; i++)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
309 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
310 Ichar ch = str[i];
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
311 Lisp_Object charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
312 int byte1, byte2; /* BREAKUP_ICHAR dereferences the addresses
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
313 of its arguments as pointer to int. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
314 BREAKUP_ICHAR (ch, charset, byte1, byte2);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
315
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
316 if (!EQ (charset, prev_charset))
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
317 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
318 /* At this point, dimension' and `prev_charset' refer to just-
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
319 completed run. `runs_so_far' and `text_storage' refer to the
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
320 run about to start. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
321 if (runs_so_far)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
322 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
323 /* Update metadata for previous run. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
324 run_storage[runs_so_far - 1].len =
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
325 text_storage - run_storage[runs_so_far - 1].ptr;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
326 if (2 == dimension) run_storage[runs_so_far - 1].len >>= 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
327 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
328
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
329 /* Compute metadata for current run.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
330 First, classify font.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
331 If the font is indexed by UCS-2, set `translate_to_ucs_2'.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
332 Else if the charset has a CCL program, set `need_ccl_conversion'.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
333 Else if the font is indexed by an ISO 2022 "graphic register",
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
334 set `graphic'.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
335 These flags are almost mutually exclusive, but we're sloppy
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
336 about resetting "shadowed" flags. So the flags must be checked
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
337 in the proper order in computing byte1 and byte2, below. */
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
338 charset_leading_byte = XCHARSET_LEADING_BYTE (charset);
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
339 translate_to_ucs_2 =
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
340 bit_vector_bit (FACE_CACHEL_FONT_FINAL_STAGE (cachel),
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
341 charset_leading_byte - MIN_LEADING_BYTE);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
342 if (translate_to_ucs_2)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
343 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
344 dimension = 2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
345 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
346 else
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
347 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
348 dimension = XCHARSET_DIMENSION (charset);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
349
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
350 /* Check for CCL charset.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
351 If setup_ccl_program fails, we'll get a garbaged display.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
352 This should never happen, and even if it does, it should
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
353 be harmless (unless the X server has buggy handling of
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
354 characters undefined in the font). It may be marginally
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
355 more useful to users and debuggers than substituting a
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
356 fixed replacement character. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
357 ccl_prog = XCHARSET_CCL_PROGRAM (charset);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
358 if ((!NILP (ccl_prog))
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
359 && (setup_ccl_program (&char_converter, ccl_prog) >= 0))
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
360 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
361 need_ccl_conversion = 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
362 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
363 else
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
364 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
365 /* The charset must have an ISO 2022-compatible font index.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
366 There are 2 "registers" (what such fonts use as index).
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
367 GL (graphic == 0) has the high bit of each octet reset,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
368 GR (graphic == 1) has it set. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
369 graphic = XCHARSET_GRAPHIC (charset);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
370 need_ccl_conversion = 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
371 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
372 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
373
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
374 /* Initialize metadata for current run. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
375 run_storage[runs_so_far].ptr = text_storage;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
376 run_storage[runs_so_far].charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
377 run_storage[runs_so_far].dimension = dimension;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
378
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
379 /* Update loop variables. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
380 prev_charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
381 runs_so_far++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
382 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
383
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
384 /* Must check flags in this order. See comment above. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
385 if (translate_to_ucs_2)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
386 {
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
387 int ucs = ichar_to_unicode (ch);
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
388 /* If UCS is less than zero or greater than 0xFFFF, set ucs2 to
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
389 REPLACMENT CHARACTER. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
390 ucs = (ucs & ~0xFFFF) ? 0xFFFD : ucs;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
391
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
392 byte1 = ucs >> 8;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
393 byte2 = ucs;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
394 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
395 else if (need_ccl_conversion)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
396 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
397 char_converter.reg[0] = charset_leading_byte;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
398 char_converter.reg[1] = byte1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
399 char_converter.reg[2] = byte2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
400 ccl_driver (&char_converter, 0, 0, 0, 0, CCL_MODE_ENCODING);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
401 byte1 = char_converter.reg[1];
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
402 byte2 = char_converter.reg[2];
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
403 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
404 else if (graphic == 0)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
405 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
406 byte1 &= 0x7F;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
407 byte2 &= 0x7F;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
408 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
409 else
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
410 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
411 byte1 |= 0x80;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
412 byte2 |= 0x80;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
413 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
414
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
415 *text_storage++ = (unsigned char)byte1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
416
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
417 if (2 == dimension) *text_storage++ = (unsigned char)byte2;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
418 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
419
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
420 if (runs_so_far)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
421 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
422 run_storage[runs_so_far - 1].len =
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
423 text_storage - run_storage[runs_so_far - 1].ptr;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
424 /* Dimension retains the relevant value for the run before it. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
425 if (2 == dimension)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
426 run_storage[runs_so_far - 1].len >>= 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
427 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
428
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
429 return runs_so_far;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
430 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
431 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
432
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
433 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
434 separate_textual_runs (unsigned char *text_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
435 struct textual_run *run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
436 const Ichar *str, Charcount len,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
437 struct face_cachel *cachel)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
438 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
439 #if defined(USE_XFT) && defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
440 return separate_textual_runs_xft_mule (text_storage, run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
441 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
442 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
443 #if defined(USE_XFT) && !defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
444 return separate_textual_runs_xft_nomule (text_storage, run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
445 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
446 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
447 #if !defined(USE_XFT) && defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
448 return separate_textual_runs_mule (text_storage, run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
449 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
450 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
451 #if !defined(USE_XFT) && !defined(MULE)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
452 return separate_textual_runs_nomule (text_storage, run_storage,
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
453 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
454 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
455 }
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
456
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
457 /****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
458 /* */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
459 /* Xlike output routines */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
460 /* */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
461 /****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
462
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
463 static int
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
464 XLIKE_text_width_single_run (struct frame * USED_IF_XFT (f),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
465 struct face_cachel *cachel,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
466 struct textual_run *run)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
467 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
468 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
469 Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
470
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
471 if (!fi->proportional_p)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
472 return fi->width * run->len;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
473 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
474 else if (FONT_INSTANCE_X_XFTFONT (fi))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
475 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
476 static XGlyphInfo glyphinfo;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
477 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
478 Display *dpy = DEVICE_X_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
479
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
480 if (run->dimension == 2)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
481 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
482 XftTextExtents16 (dpy,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
483 FONT_INSTANCE_X_XFTFONT (fi),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
484 (XftChar16 *) run->ptr, run->len, &glyphinfo);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
485 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
486 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
487 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
488 XftTextExtents8 (dpy,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
489 FONT_INSTANCE_X_XFTFONT (fi),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
490 run->ptr, run->len, &glyphinfo);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
491 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
492
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
493 return glyphinfo.xOff;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
494 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
495 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
496 else if (FONT_INSTANCE_XLIKE_FONT (fi))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
497 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
498 if (run->dimension == 2)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
499 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
500 /* stderr_out ("Measuring wide characters\n"); */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
501 return XLIKE_TEXT_WIDTH_WIDE (FONT_INSTANCE_XLIKE_FONT (fi),
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
502 run->ptr, run->len);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
503 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
504 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
505 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
506 return XLIKE_TEXT_WIDTH (FONT_INSTANCE_XLIKE_FONT (fi),
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
507 run->ptr, run->len);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
508 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
509 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
510 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
511 abort();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
512 return 0; /* shut up GCC */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
513 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
514
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
515
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
516 /*
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
517 XLIKE_text_width
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
518
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
519 Given a string and a merged face, return the string's length in pixels
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
520 when displayed in the fonts associated with the face.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
521 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
522
4928
ea701c23ed84 change text_width method to take a window, in preparation for unicode-internal changes
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
523 static int
ea701c23ed84 change text_width method to take a window, in preparation for unicode-internal changes
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
524 XLIKE_text_width (struct window *w, struct face_cachel *cachel,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
525 const Ichar *str, Charcount len)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
526 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
527 /* !!#### Needs review */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
528 int width_so_far = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
529 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
530 struct textual_run *runs = alloca_array (struct textual_run, len);
4928
ea701c23ed84 change text_width method to take a window, in preparation for unicode-internal changes
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
531 struct frame *f = WINDOW_XFRAME (w);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
532 int nruns;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
533 int i;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
534
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
535 nruns = separate_textual_runs (text_storage, runs, str, len,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
536 cachel);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
537
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
538 for (i = 0; i < nruns; i++)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
539 width_so_far += XLIKE_text_width_single_run (f, cachel, runs + i);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
540
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
541 return width_so_far;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
542 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
543
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
544 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
545 XLIKE_divider_height
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
546
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
547 Return the height of the horizontal divider. This is a function because
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
548 divider_height is a device method.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
549
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
550 #### If we add etched horizontal divider lines this will have to get
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
551 smarter.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
552 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
553 static int
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
554 XLIKE_divider_height (void)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
555 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
556 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
557 return 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
558 #else /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
559 return 2;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
560 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
561 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
562
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
563 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
564 XLIKE_eol_cursor_width
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
565
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
566 Return the width of the end-of-line cursor. This is a function
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
567 because eol_cursor_width is a device method.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
568 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
569 static int
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
570 XLIKE_eol_cursor_width (void)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
571 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
572 return EOL_CURSOR_WIDTH;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
573 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
574
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
575 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
576 XLIKE_output_display_block
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
577
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
578 Given a display line, a block number for that start line, output all
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
579 runes between start and end in the specified display block.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
580 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
581 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
582 XLIKE_output_display_block (struct window *w, struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
583 int block, int start, int end, int start_pixpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
584 int cursor_start, int cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
585 int cursor_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
586 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
587 #ifndef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
588 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
589 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
590 Ichar_dynarr *buf;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
591 Lisp_Object window;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
592
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
593 struct display_block *db = Dynarr_atp (dl->display_blocks, block);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
594 rune_dynarr *rba = db->runes;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
595 struct rune *rb;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
596
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
597 int elt = start;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
598 face_index findex;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
599 int xpos, width = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
600 Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
601 MULE is not defined */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
602
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
603 window = wrap_window (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
604 rb = Dynarr_atp (rba, start);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
605
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
606 if (!rb)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
607 /* Nothing to do so don't do anything. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
608 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
609
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
610 findex = rb->findex;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
611 xpos = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
612 if (rb->type == RUNE_CHAR)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
613 charset = ichar_charset (rb->object.chr.ch);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
614
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
615 if (end < 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
616 end = Dynarr_length (rba);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
617 buf = Dynarr_new (Ichar);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
618
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
619 while (elt < end)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
620 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
621 rb = Dynarr_atp (rba, elt);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
622
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
623 if (rb->findex == findex && rb->type == RUNE_CHAR
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
624 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
625 && EQ (charset, ichar_charset (rb->object.chr.ch)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
626 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
627 Dynarr_add (buf, rb->object.chr.ch);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
628 width += rb->width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
629 elt++;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
630 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
631 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
632 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
633 if (Dynarr_length (buf))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
634 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
635 XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos, width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
636 findex, 0, cursor_start, cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
637 cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
638 xpos = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
639 width = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
640 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
641 Dynarr_reset (buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
642 width = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
643
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
644 if (rb->type == RUNE_CHAR)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
645 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
646 findex = rb->findex;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
647 xpos = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
648 charset = ichar_charset (rb->object.chr.ch);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
649
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
650 if (rb->cursor_type == CURSOR_ON)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
651 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
652 if (rb->object.chr.ch == '\n')
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
653 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
654 XLIKE_output_eol_cursor (w, dl, xpos, findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
655 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
656 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
657 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
658 Dynarr_add (buf, rb->object.chr.ch);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
659 XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
660 rb->width, findex, 1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
661 cursor_start, cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
662 cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
663 Dynarr_reset (buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
664 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
665
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
666 xpos += rb->width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
667 elt++;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
668 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
669 else if (rb->object.chr.ch == '\n')
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
670 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
671 /* Clear in case a cursor was formerly here. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
672 redisplay_clear_region (window, findex, xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
673 XLIKE_DISPLAY_LINE_YPOS (dl),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
674 rb->width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
675 XLIKE_DISPLAY_LINE_HEIGHT (dl));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
676 elt++;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
677 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
678 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
679 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
680 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
681 if (rb->type == RUNE_BLANK)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
682 XLIKE_output_blank (w, dl, rb, start_pixpos, cursor_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
683 cursor_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
684 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
685 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
686 /* #### Our flagging of when we need to redraw the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
687 modeline shadows sucks. Since RUNE_HLINE is only used
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
688 by the modeline at the moment it is a good bet
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
689 that if it gets redrawn then we should also
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
690 redraw the shadows. This won't be true forever.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
691 We borrow the shadow_thickness_changed flag for
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
692 now. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
693 w->shadow_thickness_changed = 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
694 XLIKE_output_horizontal_line (w, dl, rb);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
695 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
696
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
697 elt++;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
698 if (elt < end)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
699 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
700 rb = Dynarr_atp (rba, elt);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
701
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
702 findex = rb->findex;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
703 xpos = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
704 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
705 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
706 else if (rb->type == RUNE_DGLYPH)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
707 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
708 Lisp_Object instance;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
709 struct display_box dbox;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
710 struct display_glyph_area dga;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
711
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
712 redisplay_calculate_display_boxes (dl, rb->xpos, rb->object.dglyph.xoffset,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
713 rb->object.dglyph.yoffset, start_pixpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
714 rb->width, &dbox, &dga);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
715
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
716 window = wrap_window (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
717 instance = glyph_image_instance (rb->object.dglyph.glyph,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
718 window, ERROR_ME_DEBUG_WARN, 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
719 findex = rb->findex;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
720
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
721 if (IMAGE_INSTANCEP (instance))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
722 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
723 switch (XIMAGE_INSTANCE_TYPE (instance))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
724 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
725 case IMAGE_TEXT:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
726 #ifdef THIS_IS_GTK
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
727 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
728 /* !!#### Examine for Mule-izing */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
729 /* #### This is way losing. See the comment in
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
730 add_glyph_rune(). */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
731 Lisp_Object string =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
732 XIMAGE_INSTANCE_TEXT_STRING (instance);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
733 convert_ibyte_string_into_ichar_dynarr
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
734 (XSTRING_DATA (string), XSTRING_LENGTH (string),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
735 buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
736
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
737 gtk_output_string (w, dl, buf, xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
738 rb->object.dglyph.xoffset,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
739 start_pixpos, -1, findex,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
740 (rb->cursor_type == CURSOR_ON),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
741 cursor_start, cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
742 cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
743 Dynarr_reset (buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
744 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
745 break;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
746 #else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
747 ABORT ();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
748 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
749 case IMAGE_MONO_PIXMAP:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
750 case IMAGE_COLOR_PIXMAP:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
751 redisplay_output_pixmap (w, instance, &dbox, &dga,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
752 findex, cursor_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
753 cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
754 cursor_height, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
755 break;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
756
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
757 case IMAGE_WIDGET:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
758 if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
759 Qlayout))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
760 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
761 redisplay_output_layout (window, instance, &dbox,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
762 &dga, findex,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
763 cursor_start, cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
764 cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
765 break;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
766 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
767
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
768 case IMAGE_SUBWINDOW:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
769 redisplay_output_subwindow (w, instance, &dbox, &dga,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
770 findex, cursor_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
771 cursor_width, cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
772 break;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
773
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
774 case IMAGE_NOTHING:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
775 /* nothing is as nothing does */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
776 break;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
777
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
778 case IMAGE_POINTER:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
779 default:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
780 ABORT ();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
781 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
782 IMAGE_INSTANCE_OPTIMIZE_OUTPUT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
783 (XIMAGE_INSTANCE (instance)) = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
784 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
785
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
786 xpos += rb->width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
787 elt++;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
788 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
789 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
790 ABORT ();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
791 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
792 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
793
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
794 if (Dynarr_length (buf))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
795 XLIKE_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
796 0, cursor_start, cursor_width, cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
797
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
798 if (dl->modeline
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
799 && !EQ (Qzero, w->modeline_shadow_thickness)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
800 #ifndef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
801 /* This optimization doesn't work right with some Xft fonts, which
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
802 leave antialiasing turds at the boundary. I don't know if this
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
803 is an Xft bug or not, but I think it is. See x_output_string. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
804 && (f->clear
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
805 || f->windows_structure_changed
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
806 || w->shadow_thickness_changed)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
807 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
808 )
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
809 bevel_modeline (w, dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
810
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
811 Dynarr_free (buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
812 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
813
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
814 /* Called as gtk_get_gc from gtk-glue.c */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
815
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
816 XLIKE_GC XLIKE_get_gc (struct frame *f, Lisp_Object font,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
817 Lisp_Object fg, Lisp_Object bg,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
818 Lisp_Object bg_pixmap, Lisp_Object bg_placement,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
819 Lisp_Object lwidth);
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
820
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
821 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
822 XLIKE_get_gc
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
823
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
824 Given a number of parameters return a GC with those properties.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
825 ****************************************************************************/
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
826 XLIKE_GC
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
827 XLIKE_get_gc (struct frame *f, Lisp_Object font,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
828 Lisp_Object fg, Lisp_Object bg,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
829 Lisp_Object bg_pixmap, Lisp_Object bg_placement,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
830 Lisp_Object lwidth)
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
831 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
832 struct device *d = XDEVICE (f->device);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
833 XLIKE_GCVALUES gcv;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
834 unsigned long mask;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
835
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
836 memset (&gcv, ~0, sizeof (gcv));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
837 gcv.graphics_exposures = XLIKE_FALSE;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
838 /* Make absolutely sure that we don't pick up a clipping region in
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
839 the GC returned by this function. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
840 gcv.clip_mask = XLIKE_NONE;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
841 gcv.clip_x_origin = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
842 gcv.clip_y_origin = 0;
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
843 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID);
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
844 mask = XLIKE_GC_EXPOSURES
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
845 | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN;
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
846 mask |= XLIKE_GC_FILL;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
847
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
848 if (!NILP (font)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
849 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
850 /* Only set the font if it's a core font */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
851 /* the renderfont will be set elsewhere (not part of gc) */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
852 && !FONT_INSTANCE_X_XFTFONT (XFONT_INSTANCE (font))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
853 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
854 )
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
855 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
856 gcv.font =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
857 XLIKE_FONT_NUM (FONT_INSTANCE_XLIKE_FONT (XFONT_INSTANCE (font)));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
858 mask |= XLIKE_GC_FONT;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
859 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
860
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
861 /* evil kludge! */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
862 if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
863 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
864 /* #### I fixed one case where this was getting hit. It was a
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
865 bad macro expansion (compiler bug). */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
866 stderr_out ("Help! x_get_gc got a bogus fg value! fg = ");
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
867 debug_print (fg);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
868 fg = Qnil;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
869 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
870
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
871 if (!NILP (fg))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
872 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
873 if (COLOR_INSTANCEP (fg))
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
874 XLIKE_SET_GC_COLOR (gcv.foreground, XCOLOR_INSTANCE_XLIKE_COLOR (fg));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
875 else
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
876 XLIKE_SET_GC_PIXEL (gcv.foreground, XINT (fg));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
877 mask |= XLIKE_GC_FOREGROUND;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
878 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
879
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
880 if (!NILP (bg))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
881 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
882 if (COLOR_INSTANCEP (bg))
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
883 XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (bg));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
884 else
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
885 XLIKE_SET_GC_PIXEL (gcv.background, XINT (bg));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
886 mask |= XLIKE_GC_BACKGROUND;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
887 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
888
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
889 /* This special case comes from a request to draw text with a face which has
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
890 the dim property. We'll use a stippled foreground GC. */
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
891 if (EQ (bg_pixmap, Qdim))
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
892 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
893 assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
894
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
895 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
896 gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
897 mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
898 }
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
899 else if (IMAGE_INSTANCEP (bg_pixmap)
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
900 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pixmap)))
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
901 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
902 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pixmap) == 0)
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
903 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
904 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED);
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
905 gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
906 mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
907 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
908 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
909 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
910 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED);
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
911 gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
912 mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
913 }
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
914 if (EQ (bg_placement, Qabsolute))
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
915 {
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
916 #ifdef THIS_IS_GTK
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
917 /* #### WARNING: this does not currently work. -- dvl
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
918 gcv.ts_x_origin = - FRAME_GTK_X (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
919 gcv.ts_y_origin = - FRAME_GTK_Y (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
920 mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
921 */
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
922 #else
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
923 gcv.ts_x_origin = - FRAME_X_X (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
924 gcv.ts_y_origin = - FRAME_X_Y (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
925 mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
926 #endif
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
927 }
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
928 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
929
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
930 if (!NILP (lwidth))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
931 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
932 gcv.line_width = XINT (lwidth);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
933 mask |= XLIKE_GC_LINE_WIDTH;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
934 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
935
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
936 #if 0
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
937 debug_out ("\nx_get_gc: calling gc_cache_lookup\n");
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
938 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
939 return gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
940 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
941
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
942 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
943 XLIKE_output_string
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
944
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
945 Given a string and a starting position, output that string in the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
946 given face. If cursor is true, draw a cursor around the string.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
947 Correctly handles multiple charsets in the string.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
948
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
949 The meaning of the parameters is something like this:
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
950
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
951 W Window that the text is to be displayed in.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
952 DL Display line that this text is on. The values in the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
953 structure are used to determine the vertical position and
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
954 clipping range of the text.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
955 BUF Dynamic array of Ichars specifying what is actually to be
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
956 drawn.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
957 XPOS X position in pixels where the text should start being drawn.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
958 XOFFSET Number of pixels to be chopped off the left side of the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
959 text. The effect is as if the text were shifted to the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
960 left this many pixels and clipped at XPOS.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
961 CLIP_START Clip everything left of this X position.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
962 WIDTH Clip everything right of XPOS + WIDTH.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
963 FINDEX Index for the face cache element describing how to display
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
964 the text.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
965 CURSOR #### I don't understand this. There's something
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
966 strange and overcomplexified with this variable.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
967 Chuck, explain please?
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
968 CURSOR_START Starting X position of cursor.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
969 CURSOR_WIDTH Width of cursor in pixels.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
970 CURSOR_HEIGHT Height of cursor in pixels.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
971
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
972 Starting Y position of cursor is the top of the text line.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
973 The cursor is drawn sometimes whether or not CURSOR is set. ???
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
974 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
975 #ifdef THIS_IS_GTK
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
976 static
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
977 void gdk_draw_text_image (GdkDrawable *drawable,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
978 GdkFont *font,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
979 GdkGC *gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
980 gint x,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
981 gint y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
982 const gchar *text,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
983 gint text_length);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
984
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
985 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
986 void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
987 XLIKE_output_string (struct window *w, struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
988 Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
989 int width, face_index findex, int cursor,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
990 int cursor_start, int cursor_width, int cursor_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
991 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
992 /* General variables */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
993 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
994 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
995 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
996 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
997 Lisp_Object window = wrap_window (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
998
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
999 int clip_end;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1000
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1001 /* Cursor-related variables */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1002 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1003 int cursor_clip;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1004 Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1005 WINDOW_BUFFER (w));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1006 struct face_cachel *cursor_cachel = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1007
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1008 /* Text-related variables */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1009 Lisp_Object bg_pmap;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1010 XLIKE_GC bgc, gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1011 int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1012 int ypos = XLIKE_DISPLAY_LINE_YPOS (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1013 int len = Dynarr_length (buf);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1014 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1015 struct textual_run *runs = alloca_array (struct textual_run, len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1016 int nruns;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1017 int i;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1018 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1019
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1020 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1021 int use_x_font = 1; /* #### bogus!!
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1022 The logic of this function needs review! */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1023 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1024 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1025 Colormap cmap = DEVICE_X_COLORMAP (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1026 Visual *visual = DEVICE_X_VISUAL (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1027 static XftColor fg, bg;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1028 XftDraw *xftDraw;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1029
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1030 /* Lazily initialize frame's xftDraw member. */
5239
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1031 if (!FRAME_X_XFTDRAW (f)) {
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1032 FRAME_X_XFTDRAW (f) = XftDrawCreate (dpy, x_win, visual, cmap);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1033 }
5239
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1034 xftDraw = FRAME_X_XFTDRAW (f);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1035
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1036 /* #### This will probably cause asserts when passed a Lisp integer for a
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1037 color. See ca. line 759 this file.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1038 #### Maybe xft_convert_color should take an XColor, not a pixel. */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1039 #define XFT_FROB_LISP_COLOR(color, dim) \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1040 xft_convert_color (dpy, cmap, visual, \
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1041 XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim))
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1042 #endif /* USE_XFT */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1043
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1044 if (width < 0)
4967
0d4c9d0f6a8d rewrite dynarr code
Ben Wing <ben@xemacs.org>
parents: 4962
diff changeset
1045 width = XLIKE_text_width (w, cachel, Dynarr_begin (buf),
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1046 Dynarr_length (buf));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1047
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1048 /* Regularize the variables passed in. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1049
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1050 if (clip_start < xpos)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1051 clip_start = xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1052 clip_end = xpos + width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1053 if (clip_start >= clip_end)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1054 /* It's all clipped out. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1055 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1056
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1057 xpos -= xoffset;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1058
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1059 /* make sure the area we are about to display is subwindow free. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1060 redisplay_unmap_subwindows_maybe (f, clip_start, ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1061 clip_end - clip_start, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1062
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1063 cursor_clip = (cursor_start >= clip_start &&
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1064 cursor_start < clip_end);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1065
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1066 /* This cursor code is really a mess. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1067 if (!NILP (w->text_cursor_visible_p)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1068 && (cursor
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1069 || cursor_clip
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1070 || (cursor_width
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1071 && (cursor_start + cursor_width >= clip_start)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1072 && !NILP (bar_cursor_value))))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1073 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1074 /* These have to be in separate statements in order to avoid a
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1075 compiler bug. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1076 face_index sucks = get_builtin_face_cache_index (w, Vtext_cursor_face);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1077 cursor_cachel = WINDOW_FACE_CACHEL (w, sucks);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1078
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1079 /* We have to reset this since any call to WINDOW_FACE_CACHEL
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1080 may cause the cache to resize and any pointers to it to
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1081 become invalid. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1082 cachel = WINDOW_FACE_CACHEL (w, findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1083 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1084
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1085 #ifdef HAVE_XIM
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1086 if (cursor && focus && (cursor_start == clip_start) && cursor_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1087 XIM_SetSpotLocation (f, xpos - 2, dl->ypos + dl->descent - 2);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1088 #endif /* HAVE_XIM */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1089
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1090 bg_pmap = cachel->background_pixmap;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1091 if (!IMAGE_INSTANCEP (bg_pmap)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1092 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1093 bg_pmap = Qnil;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1094
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1095 if ((cursor && focus && NILP (bar_cursor_value)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1096 && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1097 bgc = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1098 else
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1099 bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1100 bg_pmap, cachel->background_placement, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1101
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1102 if (bgc)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1103 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1104 XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1105 ypos, clip_end - clip_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1106 height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1107 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1108
4967
0d4c9d0f6a8d rewrite dynarr code
Ben Wing <ben@xemacs.org>
parents: 4962
diff changeset
1109 nruns = separate_textual_runs (text_storage, runs, Dynarr_begin (buf),
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1110 Dynarr_length (buf), cachel);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1111
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1112 for (i = 0; i < nruns; i++)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1113 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1114 Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1115 Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1116 int this_width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1117 int need_clipping;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1118
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1119 if (EQ (font, Vthe_null_font_instance))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1120 continue;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1121
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1122 this_width = XLIKE_text_width_single_run (f, cachel, runs + i);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1123 need_clipping = (dl->clip || clip_start > xpos ||
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1124 clip_end < xpos + this_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1125
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1126 /* XDrawImageString only clears the area equal to the height of
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1127 the given font. It is possible that a font is being displayed
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1128 on a line taller than it is, so this would cause us to fail to
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1129 clear some areas. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1130 if ((int) fi->height < (int) (height + dl->clip +
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1131 XLIKE_DISPLAY_LINE_TOP_CLIP (dl)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1132 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1133 int clear_start = max (xpos, clip_start);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1134 int clear_end = min (xpos + this_width, clip_end);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1135
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1136 if (cursor)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1137 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1138 int ypos1_line, ypos1_string, ypos2_line, ypos2_string;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1139
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1140 ypos1_string = dl->ypos - fi->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1141 ypos2_string = dl->ypos + fi->descent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1142 ypos1_line = ypos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1143 ypos2_line = ypos1_line + height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1144
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1145 /* Make sure we don't clear below the real bottom of the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1146 line. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1147 if (ypos1_string > ypos2_line)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1148 ypos1_string = ypos2_line;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1149 if (ypos2_string > ypos2_line)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1150 ypos2_string = ypos2_line;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1151
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1152 if (ypos1_line < ypos1_string)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1153 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1154 redisplay_clear_region (window, findex, clear_start, ypos1_line,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1155 clear_end - clear_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1156 ypos1_string - ypos1_line);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1157 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1158
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1159 if (ypos2_line > ypos2_string)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1160 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1161 redisplay_clear_region (window, findex, clear_start, ypos2_string,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1162 clear_end - clear_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1163 ypos2_line - ypos2_string);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1164 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1165 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1166 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1167 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1168 redisplay_clear_region (window, findex, clear_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1169 ypos, clear_end - clear_start,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1170 height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1171 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1172 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1173
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1174 if (cursor && cursor_cachel && focus && NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1175 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1176 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1177 fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1178 bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1179 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1180 gc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1181 cursor_cachel->background, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1182 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1183 else if (cachel->dim)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1184 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1185 /* Ensure the gray bitmap exists */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1186 if (DEVICE_XLIKE_GRAY_PIXMAP (d) == XLIKE_NONE)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1187 DEVICE_XLIKE_GRAY_PIXMAP (d) =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1188 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1189 XCreateBitmapFromData (dpy, x_win, (char *)gray_bits,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1190 gray_width, gray_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1191 #else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1192 /* #### FIXME! Implement me! */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1193 XLIKE_NONE
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1194 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1195 ;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1196
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1197 /* Request a GC with the gray stipple pixmap to draw dimmed text */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1198 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1199 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1200 bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1201 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1202 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1203 Qdim, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1204 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1205 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1206 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1207 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1208 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1209 bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1210 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1211 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1212 Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1213 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1214 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1215 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1216 XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1217
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1218 if (rf)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1219 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1220 use_x_font = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1221 if (need_clipping)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1222 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1223 Region clip_reg = XCreateRegion();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1224 XRectangle clip_box = { clip_start, ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1225 clip_end - clip_start, height };
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1226
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1227 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1228 XftDrawSetClip (xftDraw, clip_reg);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1229 XDestroyRegion (clip_reg);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1230 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1231
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1232 if (!bgc)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1233 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1234 /* #### Neither rect_height nor XftTextExtents as computed
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1235 below handles the vertical space taken up by antialiasing,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1236 which for some fonts (eg, Bitstream Vera Sans Mono-16 on
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1237 my Mac PowerBook G4) leaves behind orphaned dots on
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1238 insertion or deletion earlier in the line, especially in
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1239 the case of the underscore character.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1240 Interestingly, insertion or deletion of a single character
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1241 immediately after a refresh does not leave any droppings,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1242 but any further insertions or deletions do.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1243 While adding a pixel to rect_height (mostly) takes care of
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1244 this, it trashes aggressively laid-out elements like the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1245 modeline (overwriting part of the bevel).
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1246 OK, unconditionally redraw the bevel, and increment
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1247 rect_height by 1. See x_output_display_block. -- sjt */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1248 struct textual_run *run = &runs[i];
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1249 int rect_width = x_text_width_single_run (f, cachel, run);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1250 #ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1251 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1252 + FONT_INSTANCE_DESCENT (fi) + 1;
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1253 #else
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1254 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1255 + FONT_INSTANCE_DESCENT (fi);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1256 XGlyphInfo gi;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1257 if (run->dimension == 2) {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1258 XftTextExtents16 (dpy,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1259 FONT_INSTANCE_X_XFTFONT (fi),
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1260 (XftChar16 *) run->ptr, run->len, &gi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1261 } else {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1262 XftTextExtents8 (dpy,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1263 FONT_INSTANCE_X_XFTFONT (fi),
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1264 run->ptr, run->len, &gi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1265 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1266 rect_height = rect_height > gi.height
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1267 ? rect_height : gi.height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1268 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1269
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1270 XftDrawRect (xftDraw, &bg,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1271 xpos, ypos, rect_width, rect_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1272 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1273
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1274 if (runs[i].dimension == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1275 XftDrawString8 (xftDraw, &fg, rf, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1276 runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1277 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1278 XftDrawString16 (xftDraw, &fg, rf, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1279 (XftChar16 *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1280 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1281 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1282 #endif /* USE_XFT */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1283
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1284 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1285 if (use_x_font)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1286 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1287 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1288 if (need_clipping)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1289 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1290 XLIKE_RECTANGLE clip_box;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1291
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1292 clip_box.x = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1293 clip_box.y = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1294 clip_box.width = clip_end - clip_start;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1295 clip_box.height = height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1296
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1297 XLIKE_SET_CLIP_RECTANGLE (dpy, gc, clip_start, ypos, &clip_box);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1298 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1299
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1300 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1301 if (runs[i].dimension == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1302 (bgc ? XDrawString : XDrawImageString)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1303 (dpy, x_win, gc, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1304 (char *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1305 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1306 (bgc ? XDrawString16 : XDrawImageString16)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1307 (dpy, x_win, gc, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1308 (XChar2b *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1309 #else /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1310
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1311 /* The X specific called different functions (XDraw*String
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1312 vs. XDraw*String16), but apparently gdk_draw_text takes care
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1313 of that for us.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1314
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1315 BUT, gdk_draw_text also does too much, by dividing the length
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1316 by 2. So we fake them out my multiplying the length by the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1317 dimension of the text. This will do the right thing for
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1318 single-dimension runs as well of course.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1319 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1320 (bgc ? gdk_draw_text : gdk_draw_text_image)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1321 (GDK_DRAWABLE (x_win), FONT_INSTANCE_GTK_FONT (fi), gc, xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1322 dl->ypos, (char *) runs[i].ptr, runs[i].len * runs[i].dimension);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1323 #endif /* (not) THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1324 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1325
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1326 /* We draw underlines in the same color as the text. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1327 if (cachel->underline)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1328 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1329 int upos, uthick;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1330 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1331 unsigned long upos_ext, uthick_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1332 XFontStruct *fs =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1333 use_x_font ? FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)) : 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1334 /* #### the logic of the next two may be suboptimal: we may want
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1335 to use the POSITION and/or THICKNESS information with Xft */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1336 if (fs && XGetFontProperty (fs, XA_UNDERLINE_POSITION, &upos_ext))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1337 upos = (int) upos_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1338 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1339 #else /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1340 /* Cannot get at font properties in Gtk, so we resort to
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1341 guessing */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1342 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1343 upos = dl->descent / 2;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1344 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1345 if (fs && XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1346 uthick = (int) uthick_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1347 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1348 #endif /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1349 uthick = 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1350 if (dl->ypos + upos < dl->ypos + dl->descent - dl->clip)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1351 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1352 if (dl->ypos + upos + uthick > dl->ypos + dl->descent - dl->clip)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1353 uthick = dl->descent - dl->clip - upos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1354
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1355 if (uthick == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1356 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1357 XLIKE_DRAW_LINE (dpy, x_win, gc, xpos, dl->ypos + upos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1358 xpos + this_width, dl->ypos + upos);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1359 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1360 else if (uthick > 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1361 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1362 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1363 dl->ypos + upos, this_width, uthick);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1364 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1365 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1366 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1367
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1368 if (cachel->strikethru)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1369 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1370 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1371 int ascent, descent, upos, uthick;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1372 unsigned long ascent_ext, descent_ext, uthick_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1373 XFontStruct *fs = FONT_INSTANCE_X_FONT (fi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1374 #else /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1375 gint ascent, descent, upos, uthick;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1376 GdkFont *gfont = FONT_INSTANCE_GTK_FONT (fi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1377 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1378
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1379 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1380 if (!use_x_font)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1381 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1382 ascent = dl->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1383 descent = dl->descent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1384 uthick = 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1385 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1386 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1387 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1388 if (!XGetFontProperty (fs, XA_STRIKEOUT_ASCENT, &ascent_ext))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1389 ascent = fs->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1390 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1391 ascent = (int) ascent_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1392 if (!XGetFontProperty (fs, XA_STRIKEOUT_DESCENT, &descent_ext))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1393 descent = fs->descent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1394 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1395 descent = (int) descent_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1396 if (!XGetFontProperty (fs, XA_UNDERLINE_THICKNESS, &uthick_ext))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1397 uthick = 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1398 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1399 uthick = (int) uthick_ext;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1400 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1401 #else /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1402 /* Cannot get at font properties in Gtk, so we resort to
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1403 guessing */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1404
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1405 ascent = gfont->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1406 descent = gfont->descent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1407 uthick = 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1408 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1409
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1410 upos = ascent - ((ascent + descent) / 2) + 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1411
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1412 /* Generally, upos will be positive (above the baseline),so
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1413 subtract */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1414 if (dl->ypos - upos < dl->ypos + dl->descent - dl->clip)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1415 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1416 if (dl->ypos - upos + uthick > dl->ypos + dl->descent - dl->clip)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1417 uthick = dl->descent - dl->clip + upos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1418
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1419 if (uthick == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1420 XLIKE_DRAW_LINE (dpy, x_win, gc, xpos, dl->ypos - upos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1421 xpos + this_width, dl->ypos - upos);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1422 else if (uthick > 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1423 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, xpos, dl->ypos + upos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1424 this_width, uthick);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1425 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1426 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1427
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1428 /* Restore the GC */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1429 if (need_clipping)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1430 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1431 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1432 if (!use_x_font)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1433 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1434 XftDrawSetClip (xftDraw, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1435 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1436 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1437 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1438 XLIKE_CLEAR_CLIP_MASK (dpy, gc);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1439 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1440
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1441 /* If we are actually superimposing the cursor then redraw with just
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1442 the appropriate section highlighted. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1443 if (cursor_clip && !cursor && focus && cursor_cachel)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1444 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1445 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1446 if (!use_x_font) /* Xft */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1447 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1448 XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1449
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1450 { /* set up clipping */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1451 Region clip_reg = XCreateRegion();
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1452 XRectangle clip_box = { cursor_start, ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1453 cursor_width, height };
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1454
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1455 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1456 XftDrawSetClip (xftDraw, clip_reg);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1457 XDestroyRegion (clip_reg);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1458 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1459 { /* draw background rectangle & draw text */
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1460 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1461 + FONT_INSTANCE_DESCENT (fi);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1462 int rect_width = x_text_width_single_run (f, cachel, &runs[i]);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1463 XftColor xft_color;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1464
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1465 xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1466 XftDrawRect (xftDraw, &xft_color,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1467 xpos, ypos, rect_width, rect_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1468
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1469 xft_color = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1470 if (runs[i].dimension == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1471 XftDrawString8 (xftDraw, &xft_color, rf, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1472 runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1473 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1474 XftDrawString16 (xftDraw, &xft_color, rf, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1475 (XftChar16 *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1476 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1477
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1478 XftDrawSetClip (xftDraw, 0);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1479 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1480 else /* core font, not Xft */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1481 #endif /* USE_XFT */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1482 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1483 XLIKE_RECTANGLE clip_box;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1484 XLIKE_GC cgc;
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1485 cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1486 cursor_cachel->background, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1487
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1488 clip_box.x = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1489 clip_box.y = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1490 clip_box.width = cursor_width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1491 clip_box.height = height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1492
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1493 XLIKE_SET_CLIP_RECTANGLE (dpy, cgc, cursor_start, ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1494 &clip_box);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1495 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1496 if (runs[i].dimension == 1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1497 XDrawImageString (dpy, x_win, cgc, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1498 (char *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1499 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1500 XDrawImageString16 (dpy, x_win, cgc, xpos, dl->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1501 (XChar2b *) runs[i].ptr, runs[i].len);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1502 #else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1503 /* The X specific called different functions (XDraw*String
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1504 vs. XDraw*String16), but apparently gdk_draw_text takes care
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1505 of that for us.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1506
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1507 BUT, gdk_draw_text also does too much, by dividing the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1508 length by 2. So we fake them out my multiplying the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1509 length by the dimension of the text. This will do the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1510 right thing for single-dimension runs as well of course.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1511 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1512 gdk_draw_text_image (GDK_DRAWABLE (x_win),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1513 FONT_INSTANCE_GTK_FONT (fi), cgc, xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1514 dl->ypos, (char *) runs[i].ptr,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1515 runs[i].len * runs[i].dimension);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1516 #endif /* (not) THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1517
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1518 XLIKE_CLEAR_CLIP_MASK (dpy, cgc);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1519 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1520 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1521
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1522 xpos += this_width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1523 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1524
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1525 /* Draw the non-focus box or bar-cursor as needed. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1526 /* Can't this logic be simplified? */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1527 if (cursor_cachel
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1528 && ((cursor && !focus && NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1529 || (cursor_width
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1530 && (cursor_start + cursor_width >= clip_start)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1531 && !NILP (bar_cursor_value))))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1532 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1533 int tmp_height, tmp_y;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1534 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1535 int need_clipping = (cursor_start < clip_start
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1536 || clip_end < cursor_start + cursor_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1537
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1538 /* #### This value is correct (as far as I know) because
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1539 all of the times we need to draw this cursor, we will
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1540 be called with exactly one character, so we know we
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1541 can always use runs[0].
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1542
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1543 This is bogus as all hell, however. The cursor handling in
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1544 this function is way bogus and desperately needs to be
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1545 cleaned up. (In particular, the drawing of the cursor should
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1546 really really be separated out of this function. This may be
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1547 a bit tricky now because this function itself does way too
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1548 much stuff, a lot of which needs to be moved into
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1549 redisplay.c.) This is the only way to be able to easily add
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1550 new cursor types or (e.g.) make the bar cursor be able to
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1551 span two characters instead of overlaying just one. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1552 int bogusly_obtained_ascent_value =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1553 XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1554
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1555 if (!NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1556 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1557 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1558 Qnil, Qnil,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1559 make_int (bar_width));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1560 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1561 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1562 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1563 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1564 Qnil, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1565 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1566
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1567 tmp_y = dl->ypos - bogusly_obtained_ascent_value;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1568 tmp_height = cursor_height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1569 if (tmp_y + tmp_height > (int) (ypos + height))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1570 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1571 tmp_y = ypos + height - tmp_height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1572 if (tmp_y < (int) ypos)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1573 tmp_y = ypos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1574 tmp_height = ypos + height - tmp_y;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1575 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1576
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1577 if (need_clipping)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1578 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1579 XLIKE_RECTANGLE clip_box;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1580 clip_box.x = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1581 clip_box.y = 0;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1582 clip_box.width = clip_end - clip_start;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1583 clip_box.height = tmp_height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1584 XLIKE_SET_CLIP_RECTANGLE (dpy, gc, clip_start, tmp_y, &clip_box);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1585 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1586
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1587 if (!focus && NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1588 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1589 XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, tmp_y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1590 cursor_width - 1, tmp_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1591 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1592 else if (focus && !NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1593 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1594 XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1, tmp_y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1595 cursor_start + bar_width - 1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1596 tmp_y + tmp_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1597 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1598
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1599 /* Restore the GC */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1600 if (need_clipping)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1601 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1602 XLIKE_CLEAR_CLIP_MASK (dpy, gc);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1603 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1604 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1605
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1606 #ifdef USE_XFT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1607 #undef XFT_FROB_LISP_COLOR
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1608 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1609 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1610
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1611 #ifdef THIS_IS_GTK
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1612 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1613 our_draw_bitmap (GdkDrawable *drawable,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1614 GdkGC *gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1615 GdkPixmap *src,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1616 gint xsrc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1617 gint ysrc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1618 gint xdest,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1619 gint ydest,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1620 gint width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1621 gint height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1622 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1623
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1624
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1625 static void
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1626 XLIKE_output_xlike_pixmap (struct frame *f, Lisp_Image_Instance *p, int x,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1627 int y, int xoffset, int yoffset,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1628 int width, int height,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1629 XLIKE_COLOR fg, XLIKE_COLOR bg,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1630 XLIKE_GC override_gc)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1631 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1632 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1633 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1634 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1635 XLIKE_GC gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1636 XLIKE_GCVALUES gcv;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1637 unsigned long pixmap_mask;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1638
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1639 if (!override_gc)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1640 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1641 memset (&gcv, ~0, sizeof (gcv));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1642 gcv.graphics_exposures = XLIKE_FALSE;
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1643 XLIKE_SET_GC_COLOR (gcv.foreground, fg);
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1644 XLIKE_SET_GC_COLOR (gcv.background, bg);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1645 pixmap_mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1646
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1647 if (IMAGE_INSTANCE_XLIKE_MASK (p))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1648 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1649 gcv.function = XLIKE_GX_COPY;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1650 gcv.clip_mask = IMAGE_INSTANCE_XLIKE_MASK (p);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1651 gcv.clip_x_origin = x - xoffset;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1652 gcv.clip_y_origin = y - yoffset;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1653 pixmap_mask |= (XLIKE_GC_FUNCTION | XLIKE_GC_CLIP_MASK |
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1654 XLIKE_GC_CLIP_X_ORIGIN |
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1655 XLIKE_GC_CLIP_Y_ORIGIN);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1656 /* Can't set a clip rectangle below because we already have a mask.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1657 We could conceivably create a new clipmask by zeroing out
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1658 everything outside the clip region. Is it worth it?
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1659 Is it possible to get an equivalent effect by changing the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1660 args to XCopyArea below rather than messing with a clip box?
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1661 - dkindred@cs.cmu.edu
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1662 Yes. We don't clip at all now - andy@xemacs.org
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1663 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1664 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1665
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1666 gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, pixmap_mask);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1667 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1668 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1669 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1670 gc = override_gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1671 /* override_gc might have a mask already--we don't want to nuke it.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1672 Maybe we can insist that override_gc have no mask, or use
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1673 one of the suggestions above. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1674 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1675
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1676 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1677 /* depth of 0 means it's a bitmap, not a pixmap, and we should use
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1678 XCopyPlane (1 = current foreground color, 0 = background) instead
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1679 of XCopyArea, which means that the bits in the pixmap are actual
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1680 pixel values, instead of symbolic of fg/bg. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1681 #endif /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1682 if (IMAGE_INSTANCE_PIXMAP_DEPTH (p) > 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1683 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1684 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1685 XCopyArea (dpy,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1686 IMAGE_INSTANCE_X_PIXMAP_SLICE
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1687 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc, xoffset,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1688 yoffset, width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1689 height, x, y);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1690 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1691 USED (dpy);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1692 gdk_draw_pixmap (GDK_DRAWABLE (x_win), gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1693 IMAGE_INSTANCE_GTK_PIXMAP (p),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1694 xoffset, yoffset, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1695 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1696 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1697 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1698 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1699 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1700 XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1701 (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1702 xoffset, yoffset, width, height, x, y, 1L);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1703 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1704 USED (dpy);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1705 our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1706 IMAGE_INSTANCE_GTK_PIXMAP (p),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1707 xoffset, yoffset, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1708 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1709 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1710 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1711
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1712 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1713 XLIKE_output_pixmap (struct window *w, Lisp_Object image_instance,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1714 struct display_box *db, struct display_glyph_area *dga,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1715 face_index findex, int cursor_start, int cursor_width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1716 int cursor_height, int UNUSED (bg_pixmap))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1717 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1718 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1719 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1720 Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1721 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1722 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1723
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1724 /* Output the pixmap. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1725 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1726 Lisp_Object tmp_pixel;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1727 XLIKE_COLOR tmp_bcolor, tmp_fcolor;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1728
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1729 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1730 tmp_fcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1731 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1732 tmp_bcolor = XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1733
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1734 XLIKE_output_xlike_pixmap (f, p, db->xpos, db->ypos,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1735 dga->xoffset, dga->yoffset,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1736 dga->width, dga->height,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1737 tmp_fcolor, tmp_bcolor, 0);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1738 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1739
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1740 /* Draw a cursor over top of the pixmap. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1741 if (cursor_width && cursor_height && (cursor_start >= db->xpos)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1742 && !NILP (w->text_cursor_visible_p)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1743 && (cursor_start < db->xpos + dga->width))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1744 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1745 XLIKE_GC gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1746 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1747 struct face_cachel *cursor_cachel =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1748 WINDOW_FACE_CACHEL (w,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1749 get_builtin_face_cache_index
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1750 (w, Vtext_cursor_face));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1751
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1752 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1753 Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1754
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1755 if (cursor_width > db->xpos + dga->width - cursor_start)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1756 cursor_width = db->xpos + dga->width - cursor_start;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1757
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1758 if (focus)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1759 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1760 cursor_width, cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1761 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1762 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1763 XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, db->ypos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1764 cursor_width, cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1765 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1766 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1767 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1768
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1769 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1770 XLIKE_output_vertical_divider
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1771
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1772 Draw a vertical divider down the right side of the given window.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1773 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1774 static void
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1775 XLIKE_output_vertical_divider (struct window *w, int USED_IF_X (clear))
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1776 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1777 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1778 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1779
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1780 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1781 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1782 Lisp_Object tmp_pixel;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1783 XLIKE_GCVALUES gcv;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1784 XLIKE_GC background_gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1785 enum edge_style style;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1786 unsigned long mask;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1787 int x, y1, y2, width, shadow_thickness, spacing, line_width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1788 face_index div_face =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1789 get_builtin_face_cache_index (w, Vvertical_divider_face);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1790
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1791 width = window_divider_width (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1792 shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1793 spacing = XINT (w->vertical_divider_spacing);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1794 line_width = XINT (w->vertical_divider_line_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1795 x = WINDOW_RIGHT (w) - width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1796 y1 = WINDOW_TOP (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1797 y2 = WINDOW_BOTTOM (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1798
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1799 memset (&gcv, ~0, sizeof (gcv));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1800
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1801 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1802
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1803 /* First, get the GC's. */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1804 XLIKE_SET_GC_COLOR (gcv.background, XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1805 gcv.foreground = gcv.background;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1806 gcv.graphics_exposures = XLIKE_FALSE;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1807 mask = XLIKE_GC_FOREGROUND | XLIKE_GC_BACKGROUND | XLIKE_GC_EXPOSURES;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1808
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1809 background_gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (d), &gcv, mask);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1810
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1811 /* Clear the divider area first. This needs to be done when a
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1812 window split occurs. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1813 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1814 if (clear)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1815 XClearArea (dpy, x_win, x, y1, width, y2 - y1, False);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1816 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1817 USED (dpy);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1818 /* if (clear) */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1819 gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1820 x, y1, width, y2 - y1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1821 #endif /* THIS_IS_GTK */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1822
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1823 #ifndef THIS_IS_GTK
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1824 /* #### FIXME Why not? Formerly '#if 0' in the GDK code */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1825 /* Draw the divider line. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1826 XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1827 x + spacing + shadow_thickness, y1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1828 line_width, y2 - y1);
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1829 #endif /* not THIS_IS_GTK */
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1830
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1831 if (shadow_thickness < 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1832 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1833 shadow_thickness = -shadow_thickness;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1834 style = EDGE_BEVEL_IN;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1835 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1836 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1837 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1838 style = EDGE_BEVEL_OUT;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1839 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1840
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1841 /* Draw the shadows around the divider line */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1842 XLIKE_bevel_area (w, div_face, x + spacing, y1,
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1843 width - 2 * spacing, y2 - y1,
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1844 shadow_thickness, EDGE_ALL, style);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1845 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1846
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1847 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1848 XLIKE_output_blank
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1849
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1850 Output a blank by clearing the area it covers in the foreground color
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1851 of its face.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1852 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1853 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1854 XLIKE_output_blank (struct window *w, struct display_line *dl, struct rune *rb,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1855 int start_pixpos, int cursor_start, int cursor_width)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1856 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1857 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1858 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1859
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1860 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1861 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1862 XLIKE_GC gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1863 struct face_cachel *cursor_cachel =
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1864 WINDOW_FACE_CACHEL (w,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1865 get_builtin_face_cache_index
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1866 (w, Vtext_cursor_face));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1867 Lisp_Object bg_pmap;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1868 Lisp_Object buffer = WINDOW_BUFFER (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1869 Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1870 buffer);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1871
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1872 int x = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1873 int y = XLIKE_DISPLAY_LINE_YPOS (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1874 int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1875 int width = rb->width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1876
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1877 /* Unmap all subwindows in the area we are going to blank. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1878 redisplay_unmap_subwindows_maybe (f, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1879
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1880 if (start_pixpos > x)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1881 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1882 if (start_pixpos >= (x + width))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1883 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1884 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1885 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1886 width -= (start_pixpos - x);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1887 x = start_pixpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1888 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1889 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1890
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1891 bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1892 if (!IMAGE_INSTANCEP (bg_pmap)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1893 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1894 bg_pmap = Qnil;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1895
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1896 if (NILP (bg_pmap))
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1897 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1898 Qnil, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1899 else
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1900 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1901 WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1902 bg_pmap,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1903 WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT (w, rb->findex),
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1904 Qnil);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1905
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1906 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1907
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1908 /* If this rune is marked as having the cursor, then it is actually
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1909 representing a tab. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1910 if (!NILP (w->text_cursor_visible_p)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1911 && (rb->cursor_type == CURSOR_ON
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1912 || (cursor_width
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1913 && (cursor_start + cursor_width > x)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1914 && cursor_start < (x + width))))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1915 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1916 int cursor_height, cursor_y;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1917 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1918 Lisp_Font_Instance *fi;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1919
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1920 fi = XFONT_INSTANCE (FACE_CACHEL_FONT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1921 (WINDOW_FACE_CACHEL (w, rb->findex),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1922 Vcharset_ascii));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1923
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1924 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1925 Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1926
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1927 cursor_y = dl->ypos - fi->ascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1928 cursor_height = fi->height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1929 if (cursor_y + cursor_height > y + height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1930 cursor_height = y + height - cursor_y;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1931
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1932 if (focus)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1933 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1934 if (NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1935 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1936 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1937 fi->width, cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1938 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1939 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1940 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1941 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1942
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1943 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1944 Qnil, Qnil, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1945 make_int (bar_width));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1946 XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1947 cursor_y, cursor_start + bar_width - 1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1948 cursor_y + cursor_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1949 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1950 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1951 else if (NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1952 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1953 XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, cursor_start, cursor_y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1954 fi->width - 1, cursor_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1955 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1956 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1957 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1958
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1959 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1960 XLIKE_output_horizontal_line
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1961
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1962 Output a horizontal line in the foreground of its face.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1963 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1964 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1965 XLIKE_output_horizontal_line (struct window *w, struct display_line *dl,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1966 struct rune *rb)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1967 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1968 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1969 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1970
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1971 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1972 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1973 XLIKE_GC gc;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1974
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1975 int x = rb->xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1976 int width = rb->width;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1977 int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1978 int ypos1, ypos2, ypos3, ypos4;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1979
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1980 ypos1 = XLIKE_DISPLAY_LINE_YPOS (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1981 ypos2 = ypos1 + rb->object.hline.yoffset;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1982 ypos3 = ypos2 + rb->object.hline.thickness;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1983 ypos4 = dl->ypos + dl->descent - dl->clip;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1984
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1985 /* First clear the area not covered by the line. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1986 if (height - rb->object.hline.thickness > 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1987 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1988 gc = XLIKE_get_gc (f, Qnil,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1989 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1990 Qnil, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1991
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1992 if (ypos2 - ypos1 > 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1993 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1994 if (ypos4 - ypos3 > 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1995 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1996 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1997
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1998 #ifdef THIS_IS_GTK
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1999 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2000 GtkStyle *style = FRAME_GTK_TEXT_WIDGET (f)->style;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2001 gtk_paint_hline (style, x_win, GTK_STATE_NORMAL, NULL,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2002 FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width, ypos2);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2003 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2004 #else /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2005 /* Now draw the line. */
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
2006 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2007 Qnil, Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2008
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2009 if (ypos2 < ypos1)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2010 ypos2 = ypos1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2011 if (ypos3 > ypos4)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2012 ypos3 = ypos4;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2013
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2014 if (ypos3 - ypos2 > 0)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2015 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos2, width, ypos3 - ypos2);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2016 #endif /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2017 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2018
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2019 /****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2020 XLIKE_clear_region
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2021
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2022 Clear the area in the box defined by the given parameters using the
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2023 given face.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2024 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2025 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2026 XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2027 struct frame* f, face_index UNUSED (findex), int x, int y,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2028 int width, int height,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2029 Lisp_Object fcolor, Lisp_Object bcolor,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2030 Lisp_Object background_pixmap,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2031 Lisp_Object background_placement)
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2032 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2033 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2034 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2035 XLIKE_GC gc = NULL;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2036
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2037 if (!UNBOUNDP (background_pixmap))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2038 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2039 gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2040 background_pixmap, background_placement, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2041 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2042
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2043 if (gc)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2044 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2045 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2046 XLIKE_CLEAR_AREA (dpy, x_win, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2047 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2048
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2049 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2050 xlike_output_eol_cursor
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2051
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2052 Draw a cursor at the end of a line. The end-of-line cursor is
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2053 narrower than the normal cursor.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2054 ****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2055 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2056 XLIKE_output_eol_cursor (struct window *w, struct display_line *dl, int xpos,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2057 face_index findex)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2058 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2059 struct frame *f = XFRAME (w->frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2060 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2061 Lisp_Object window;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2062
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2063 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2064 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2065 XLIKE_GC gc = NULL;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2066 face_index elt = get_builtin_face_cache_index (w, Vtext_cursor_face);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2067 struct face_cachel *cursor_cachel = WINDOW_FACE_CACHEL (w, elt);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2068
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2069 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2070 Lisp_Object bar_cursor_value = symbol_value_in_buffer (Qbar_cursor,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2071 WINDOW_BUFFER (w));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2072
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2073 int x = xpos;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2074 int y = XLIKE_DISPLAY_LINE_YPOS (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2075 int width = EOL_CURSOR_WIDTH;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2076 int height = XLIKE_DISPLAY_LINE_HEIGHT (dl);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2077 int cursor_height, cursor_y;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2078 int defheight, defascent;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2079
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2080 window = wrap_window (w);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2081 redisplay_clear_region (window, findex, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2082
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2083 if (NILP (w->text_cursor_visible_p))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2084 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2085
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2086 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2087 Qnil, Qnil, Qnil);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2088
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
2089 default_face_font_info (window, &defascent, 0, 0, &defheight, 0);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2090
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2091 /* make sure the cursor is entirely contained between y and y+height */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2092 cursor_height = min (defheight, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2093 cursor_y = max (y, min (y + height - cursor_height,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2094 dl->ypos - defascent));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2095
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2096 if (focus)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2097 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2098 #ifdef HAVE_XIM
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2099 XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2100 #endif /* HAVE_XIM */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2101
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2102 if (NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2103 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2104 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, cursor_y, width,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2105 cursor_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2106 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2107 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2108 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2109 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2110
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2111 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2112 Qnil, Qnil,
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2113 make_int (bar_width));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2114 XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2115 x + bar_width - 1, cursor_y + cursor_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2116 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2117 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2118 else if (NILP (bar_cursor_value))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2119 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2120 XLIKE_DRAW_RECTANGLE (dpy, x_win, gc, x, cursor_y, width - 1,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2121 cursor_height - 1);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2122 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2123 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2124
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2125 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2126 XLIKE_clear_frame_window (Lisp_Object window)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2127 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2128 struct window *w = XWINDOW (window);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2129
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2130 if (!NILP (w->vchild))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2131 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2132 XLIKE_clear_frame_windows (w->vchild);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2133 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2134 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2135
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2136 if (!NILP (w->hchild))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2137 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2138 XLIKE_clear_frame_windows (w->hchild);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2139 return;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2140 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2141
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2142 redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w),
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2143 WINDOW_TEXT_BOTTOM (w));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2144 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2145
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2146 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2147 XLIKE_clear_frame_windows (Lisp_Object window)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2148 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2149 for (; !NILP (window); window = XWINDOW (window)->next)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2150 XLIKE_clear_frame_window (window);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2151 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2152
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2153 static void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2154 XLIKE_clear_frame (struct frame *f)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2155 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2156 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (XDEVICE (f->device));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2157 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2158 int x, y, width, height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2159 Lisp_Object frame;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2160
5090
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2161 /* #### GEOM! This clears the internal border and gutter (and scrollbars)
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2162 but not the toolbar. Correct? */
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2163 x = FRAME_LEFT_INTERNAL_BORDER_START (f);
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2164 width = (FRAME_RIGHT_INTERNAL_BORDER_END (f) - x);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2165 /* #### This adjustment by 1 should be being done in the macros.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2166 There is some small differences between when the menubar is on
5090
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2167 and off that we still need to deal with. The adjustment also occurs in
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2168 redisplay_clear_top_of_window(). */
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2169 y = FRAME_TOP_INTERNAL_BORDER_START (f) - 1;
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2170 height = (FRAME_BOTTOM_INTERNAL_BORDER_END (f) - y);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2171
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2172 XLIKE_CLEAR_AREA (dpy, x_win, x, y, width, height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2173
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2174 frame = wrap_frame (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2175
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2176 if (!UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vdefault_face, frame))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2177 || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vleft_margin_face, frame))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2178 || !UNBOUNDP (FACE_BACKGROUND_PIXMAP (Vright_margin_face, frame)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2179 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2180 XLIKE_clear_frame_windows (f->root_window);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2181 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2182 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2183 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2184 struct device *d = XDEVICE (f->device);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2185 if (!(check_if_pending_expose_event (d)))
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2186 XFlush (DEVICE_X_DISPLAY (d));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2187 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2188 #endif /* THIS_IS_X */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2189 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2190
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2191 /* briefly swap the foreground and background colors.
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2192 */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2193
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2194 static int
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2195 XLIKE_flash (struct device *d)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2196 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2197 struct frame *f = device_selected_frame (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2198 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2199 XLIKE_WINDOW win = GET_XLIKE_WINDOW (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2200 XLIKE_GC gc = NULL;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2201 XLIKE_GCVALUES gcv;
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
2202 XLIKE_PIXEL tmp_fcolor, tmp_bcolor;
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2203 Lisp_Object tmp_pixel, frame;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2204 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2205 int flash_height;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2206
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2207 frame = wrap_frame (f);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2208
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2209 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
2210 tmp_fcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2211 tmp_pixel = FACE_BACKGROUND (Vdefault_face, frame);
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
2212 tmp_bcolor = XLIKE_COLOR_TO_PIXEL (XCOLOR_INSTANCE_XLIKE_COLOR (tmp_pixel));
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2213 memset (&gcv, ~0, sizeof (gcv)); /* initialize all slots to ~0 */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
2214 XLIKE_SET_GC_PIXEL (gcv.foreground, tmp_fcolor ^ tmp_bcolor);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2215 gcv.function = XLIKE_GX_XOR;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2216 gcv.graphics_exposures = XLIKE_FALSE;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2217 gc = gc_cache_lookup (DEVICE_XLIKE_GC_CACHE (XDEVICE (f->device)), &gcv,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2218 XLIKE_GC_FOREGROUND | XLIKE_GC_FUNCTION | XLIKE_GC_EXPOSURES);
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
2219 default_face_width_and_height (frame, 0, &flash_height);
4882
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2220
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2221 /* If window is tall, flash top and bottom line. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2222 if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2223 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2224 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2225 w->pixel_width, flash_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2226 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2227 w->pixel_top + w->pixel_height - flash_height,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2228 w->pixel_width, flash_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2229 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2230 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2231 /* If it is short, flash it all. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2232 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2233 w->pixel_width, w->pixel_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2234
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2235 XLIKE_FLUSH (dpy);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2236
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2237 #ifdef HAVE_SELECT
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2238 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2239 int usecs = 100000;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2240 struct timeval tv;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2241 tv.tv_sec = usecs / 1000000L;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2242 tv.tv_usec = usecs % 1000000L;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2243 /* I'm sure someone is going to complain about this... */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2244 select (0, 0, 0, 0, &tv);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2245 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2246 #else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2247 #ifdef HAVE_POLL
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2248 poll (0, 0, 100);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2249 #else /* !HAVE_POLL */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2250 #error bite me
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2251 #endif /* HAVE_POLL */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2252 #endif /* HAVE_SELECT */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2253
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2254 /* If window is tall, flash top and bottom line. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2255 if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2256 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2257 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2258 w->pixel_width, flash_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2259 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2260 w->pixel_top + w->pixel_height - flash_height,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2261 w->pixel_width, flash_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2262 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2263 else
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2264 /* If it is short, flash it all. */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2265 XLIKE_FILL_RECTANGLE (dpy, win, gc, w->pixel_left, w->pixel_top,
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2266 w->pixel_width, w->pixel_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2267
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2268 XLIKE_FLUSH (dpy);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2269
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2270 return 1;
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2271 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2272
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2273
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2274 /************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2275 /* initialization */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2276 /************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2277
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2278 void
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2279 console_type_create_redisplay_XLIKE (void)
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2280 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2281 /* redisplay methods */
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2282 XLIKE_CONSOLE_HAS_METHOD (text_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2283 XLIKE_CONSOLE_HAS_METHOD (output_display_block);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2284 XLIKE_CONSOLE_HAS_METHOD (divider_height);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2285 XLIKE_CONSOLE_HAS_METHOD (eol_cursor_width);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2286 XLIKE_CONSOLE_HAS_METHOD (output_vertical_divider);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2287 XLIKE_CONSOLE_HAS_METHOD (clear_region);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2288 XLIKE_CONSOLE_HAS_METHOD (clear_frame);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2289 XLIKE_CONSOLE_HAS_METHOD (flash);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2290 XLIKE_CONSOLE_HAS_METHOD (ring_bell);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2291 XLIKE_CONSOLE_HAS_METHOD (bevel_area);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2292 XLIKE_CONSOLE_HAS_METHOD (output_string);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2293 XLIKE_CONSOLE_HAS_METHOD (output_pixmap);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2294
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2295 #ifdef THIS_IS_X
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2296 XLIKE_CONSOLE_HAS_METHOD (window_output_begin);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2297 XLIKE_CONSOLE_HAS_METHOD (window_output_end);
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2298 #endif
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
2299 }