annotate src/redisplay-xlike-inc.c @ 5927:b58b74274fa2 cygwin

changes from long ago, never committed...
author Henry Thompson <ht@markup.co.uk>
date Wed, 15 Dec 2021 19:02:33 +0000
parents 81fee4aee9b6
children cb65bfaf7110 574f0cded429
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
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5239
diff changeset
10 XEmacs is free software: you can redistribute it and/or modify it
4881
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
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5239
diff changeset
12 Free Software Foundation, either version 3 of the License, or (at your
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5239
diff changeset
13 option) any later version.
4881
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
5402
308d34e9f07d Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents: 5239
diff changeset
21 along with XEmacs. If not, see <http://www.gnu.org/licenses/>. */
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
22
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
23 /* 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
24
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
25 /* 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
26 /* 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
27 /* 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
28
eab9498ecc0e merge most 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 /* 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
30
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
31 /* 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
32 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
33
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
34 #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
35 #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
36
eab9498ecc0e merge most 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 "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
38 #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
39 #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
40 #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
41 #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
42 #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
43 #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
44 #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
45 #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
46 #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
47
eab9498ecc0e merge most 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 #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
49 #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
50 #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
51 #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
52
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
53 #define NEED_GCCACHE_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
54 #define NEED_GLYPHS_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
55 #define NEED_OBJECTS_IMPL_H
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
56 #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
57
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
58 #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
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 #ifdef THIS_IS_X
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
61 #include "EmacsFrame.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
62 #include "EmacsFrameP.h"
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
63
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
64 #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
65 #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
66
eab9498ecc0e merge most 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 #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
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 /* 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
70
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
71 #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
72 #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
73 #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
74 #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
75 #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
76 #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
77 #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
78 #define XLIKE_flash XFUN (flash)
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
79 #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
80 #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
81 #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
82 #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
83 #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
84 #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
85 #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
86
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
87 /* 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
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 #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
90 #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
91 #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
92 #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
93
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
94 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
95 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
96 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
97 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
98 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
99 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
100 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
101 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
102 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
103 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
104 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
105 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
106 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
107 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
108 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
109 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
110
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
111 #ifdef THIS_IS_X
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
112 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
113 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
114 #endif /* THIS_IS_X */
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
115
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
116
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
117 /****************************************************************************/
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
118 /* */
eab9498ecc0e merge most 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 /* 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
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 /****************************************************************************/
eab9498ecc0e merge most 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
4881
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
124 /* 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
125 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
126 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
127 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
128 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
129 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
130 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
131 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
132
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
133 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
134 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
135 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
136 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
137 effort.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
138 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
139
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
140 struct textual_run
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 Lisp_Object charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
143 unsigned char *ptr;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
144 int len;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
145 int dimension;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
146 };
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
147
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
148 /* 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
149 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
150 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
151 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
152 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
153 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
154 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
155 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
156 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
157 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
158 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
159 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
160 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
161
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
162 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
163
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
164 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
165
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
166 /* 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
167
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
168 - 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
169 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
170 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
171 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
172 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
173 - 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
174 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
175 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
176 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
177
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
178 #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
179 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
180 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
181 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
182 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
183 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
184 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
185 if (!len)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
186 return 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
187
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
188 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
189 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
190 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
191 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
192
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
193 while (len--)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
194 *text_storage++ = *str++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
195 return 1;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
196 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
197 #endif
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 #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
200 /*
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
201 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
202 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
203 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
204 of punning.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
205 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
206 UCS-2.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
207 #### 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
208 */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
209 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
210 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
211 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
212 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
213 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
214 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
215 int i;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
216 if (!len)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
217 return 0;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
218
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
219 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
220 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
221 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
222 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
223
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
224 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
225 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
226 *(XftChar16 *)text_storage = str[i];
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
227 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
228 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
229 return 1;
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 #endif
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 #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
234 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
235 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
236 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
237 const Ichar *str, Charcount len,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
238 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
239 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
240 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
241 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
242
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
243 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
244 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
245 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
246 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
247
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
248 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
249 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
250 Ichar ch = str[i];
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
251 Lisp_Object charset = ichar_charset (ch);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
252 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
253
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
254 /* 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
255 REPLACMENT CHARACTER. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
256 /* 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
257 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
258
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
259 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
260 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
261 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
262 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
263 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
264 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
265 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
266 prev_charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
267 runs_so_far++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
268 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
269
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
270 *(XftChar16 *)text_storage = ucs;
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
271 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
272 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
273
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
274 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
275 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
276 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
277 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
278 #endif
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 #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
281 /*
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
282 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
283 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
284 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
285 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
286 (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
287 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
288 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
289 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
290 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
291 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
292 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
293 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
294 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
295 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
296 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
297 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
298 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
299 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
300 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
301 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
302 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
303
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
304 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
305
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
306 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
307 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
308 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
309 Lisp_Object charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
310 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
311 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
312 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
313
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
314 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
315 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
316 /* 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
317 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
318 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
319 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
320 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
321 /* 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
322 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
323 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
324 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
325 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
326
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
327 /* 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
328 First, classify font.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
329 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
330 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
331 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
332 set `graphic'.
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
333 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
334 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
335 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
336 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
337 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
338 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
339 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
340 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
341 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
342 dimension = 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 else
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 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
347
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
348 /* 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
349 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
350 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
351 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
352 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
353 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
354 fixed replacement character. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
355 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
356 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
357 && (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
358 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
359 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
360 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
361 else
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 /* 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
364 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
365 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
366 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
367 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
368 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
369 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
370 }
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 /* 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
373 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
374 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
375 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
376
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
377 /* Update loop variables. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
378 prev_charset = charset;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
379 runs_so_far++;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
380 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
381
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
382 /* 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
383 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
384 {
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
385 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
386 /* 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
387 REPLACMENT CHARACTER. */
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
388 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
389
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
390 byte1 = ucs >> 8;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
391 byte2 = ucs;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
392 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
393 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
394 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
395 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
396 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
397 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
398 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
399 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
400 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
401 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
402 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
403 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
404 byte1 &= 0x7F;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
405 byte2 &= 0x7F;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
406 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
407 else
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 byte1 |= 0x80;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
410 byte2 |= 0x80;
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
411 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
412
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
413 *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
414
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
415 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
416 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
417
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
418 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
419 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
420 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
421 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
422 /* 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
423 if (2 == dimension)
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
424 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
425 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
426
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
427 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
428 }
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
429 #endif
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 static int
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
432 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
433 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
434 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
435 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
436 {
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
437 #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
438 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
439 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
440 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
441 #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
442 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
443 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
444 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
445 #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
446 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
447 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
448 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
449 #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
450 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
451 str, len, cachel);
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
452 #endif
a4322ac49e37 break out common separate-into-runs routines into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents:
diff changeset
453 }
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
454
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
455 /****************************************************************************/
eab9498ecc0e merge most 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 /* 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
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 /****************************************************************************/
eab9498ecc0e merge most 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 static int
5627
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
462 XLIKE_text_width_single_run (XLIKE_DISPLAY USED_IF_XFT (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
463 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
464 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
465 {
eab9498ecc0e merge most 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 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
467 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
468
eab9498ecc0e merge most 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 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
470 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
471 #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
472 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
473 {
eab9498ecc0e merge most 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 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
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 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
477 {
eab9498ecc0e merge most 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 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
479 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
480 (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
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 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
483 {
eab9498ecc0e merge most 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 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
485 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
486 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
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
eab9498ecc0e merge most 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 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
490 }
eab9498ecc0e merge most 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 #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
492 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
493 {
eab9498ecc0e merge most 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 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
495 {
eab9498ecc0e merge most 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 /* 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
497 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
498 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
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 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
501 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
502 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
503 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
504 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
506 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
507 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
508 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
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
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
511
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
512 /*
eab9498ecc0e merge most 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 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
514
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
515 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
516 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
517 */
eab9498ecc0e merge most 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
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
519 static int
5628
81fee4aee9b6 text_width methods interface cleanup.
Didier Verna <didier@xemacs.org>
parents: 5627
diff changeset
520 XLIKE_text_width (struct frame *f, 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
521 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
522 {
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
523 /* !!#### 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
524 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
525 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
526 struct textual_run *runs = alloca_array (struct textual_run, len);
5628
81fee4aee9b6 text_width methods interface cleanup.
Didier Verna <didier@xemacs.org>
parents: 5627
diff changeset
527 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (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
528 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
529 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
530
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
531 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
532 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
533
eab9498ecc0e merge most 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 for (i = 0; i < nruns; i++)
5627
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
535 width_so_far += XLIKE_text_width_single_run (dpy, 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
536
eab9498ecc0e merge most 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 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
538 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
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 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
544 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
545
eab9498ecc0e merge most 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 #### 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
547 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
548 ****************************************************************************/
eab9498ecc0e merge most 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 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
550 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
551 {
eab9498ecc0e merge most 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 #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
553 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
554 #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
555 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
556 #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
557 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 /*****************************************************************************
eab9498ecc0e merge most 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 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
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 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
563 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
564 ****************************************************************************/
eab9498ecc0e merge most 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 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
566 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
567 {
eab9498ecc0e merge most 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 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
569 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
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 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
575 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
576 ****************************************************************************/
eab9498ecc0e merge most 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 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
578 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
579 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
580 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
581 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
582 {
eab9498ecc0e merge most 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 #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
584 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
585 #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
586 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
587 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
588
eab9498ecc0e merge most 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 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
590 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
591 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
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 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
594 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
595 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
596 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
597 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
598
eab9498ecc0e merge most 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 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
600 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
601
eab9498ecc0e merge most 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 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
603 /* 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
604 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
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 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
607 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
608 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
609 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
610
eab9498ecc0e merge most 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 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
612 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
613 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
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 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
616 {
eab9498ecc0e merge most 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 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
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 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
620 && 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
621 && 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
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 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
624 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
625 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
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 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
628 {
eab9498ecc0e merge most 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 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
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 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
632 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
633 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
634 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
635 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
636 }
eab9498ecc0e merge most 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 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
638 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
639
eab9498ecc0e merge most 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 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
641 {
eab9498ecc0e merge most 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 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
643 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
644 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
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 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
647 {
eab9498ecc0e merge most 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 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
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 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
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 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
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 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
655 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
656 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
657 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
658 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
659 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
660 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
663 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
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 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
666 {
eab9498ecc0e merge most 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 /* 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
668 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
669 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
670 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
671 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
672 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
673 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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 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
676 {
eab9498ecc0e merge most 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 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
678 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
679 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
680 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
681 {
eab9498ecc0e merge most 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 /* #### 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
683 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
684 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
685 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
686 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
687 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
688 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
689 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
690 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
691 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
694 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
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 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
697
eab9498ecc0e merge most 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 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
699 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
700 }
eab9498ecc0e merge most 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 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
703 {
eab9498ecc0e merge most 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 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
705 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
706 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
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 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
709 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
710 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
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 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
713 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
714 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
715 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
716
eab9498ecc0e merge most 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 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
718 {
eab9498ecc0e merge most 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 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
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 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
722 #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
723 {
eab9498ecc0e merge most 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 /* !!#### 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
725 /* #### 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
726 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
727 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
728 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
729 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
730 (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
731 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
732
eab9498ecc0e merge most 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 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
734 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
735 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
736 (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
737 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
738 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
739 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
740 }
eab9498ecc0e merge most 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 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
742 #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
743 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
744 #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
745 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
746 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
747 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
748 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
749 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
750 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
751 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
752
eab9498ecc0e merge most 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 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
754 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
755 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
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 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
758 &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
759 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
760 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
761 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
762 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
765 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
766 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
767 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
768 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
769
eab9498ecc0e merge most 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 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
771 /* 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
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_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
775 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
776 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
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 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
779 (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
780 }
eab9498ecc0e merge most 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 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
783 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
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 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
786 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
787 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
791 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
792 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
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 (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
795 && !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
796 #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
797 /* 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
798 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
799 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
800 && (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
801 || 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
802 || 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
803 #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
804 )
eab9498ecc0e merge most 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 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
806
eab9498ecc0e merge most 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 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
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
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
810 /* 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
811
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
812 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
813 Lisp_Object fg, Lisp_Object bg,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
814 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
815 Lisp_Object lwidth);
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
816
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
817 /*****************************************************************************
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
818 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
819
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
820 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
821 ****************************************************************************/
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
822 XLIKE_GC
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
823 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
824 Lisp_Object fg, Lisp_Object bg,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
825 Lisp_Object bg_pixmap, Lisp_Object bg_placement,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
826 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
827 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
828 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
829 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
830 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
831
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
832 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
833 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
834 /* 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
835 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
836 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
837 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
838 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
839 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
840 mask = XLIKE_GC_EXPOSURES
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
841 | 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
842 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
843
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
844 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
845 #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
846 /* 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
847 /* 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
848 && !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
849 #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
850 )
eab9498ecc0e merge most 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 {
eab9498ecc0e merge most 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 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
853 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
854 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
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
eab9498ecc0e merge most 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 /* evil kludge! */
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
858 if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !FIXNUMP (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
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 /* #### 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
861 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
862 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
863 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
864 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
865 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
868 {
eab9498ecc0e merge most 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 if (COLOR_INSTANCEP (fg))
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
870 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
871 else
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
872 XLIKE_SET_GC_PIXEL (gcv.foreground, XFIXNUM (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
873 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
874 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
876 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
877 {
eab9498ecc0e merge most 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 if (COLOR_INSTANCEP (bg))
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
879 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
880 else
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
881 XLIKE_SET_GC_PIXEL (gcv.background, XFIXNUM (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
882 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
883 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
885 /* 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
886 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
887 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
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 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
890
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
891 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
892 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
893 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
894 }
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
895 else if (IMAGE_INSTANCEP (bg_pixmap)
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
896 && 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
897 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
898 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
899 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
900 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
901 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
902 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
903 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
904 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
905 {
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
906 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
907 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
908 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
909 }
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
910 if (EQ (bg_placement, Qabsolute))
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
911 {
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
912 #ifdef THIS_IS_GTK
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
913 /* #### WARNING: this does not currently work. -- dvl
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
914 gcv.ts_x_origin = - FRAME_GTK_X (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
915 gcv.ts_y_origin = - FRAME_GTK_Y (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
916 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
917 */
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
918 #else
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
919 gcv.ts_x_origin = - FRAME_X_X (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
920 gcv.ts_y_origin = - FRAME_X_Y (f);
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
921 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
922 #endif
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
923 }
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
924 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
925
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
926 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
927 {
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
928 gcv.line_width = XFIXNUM (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
929 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
930 }
eab9498ecc0e merge most 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 #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
933 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
934 #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
935 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
936 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 /*****************************************************************************
eab9498ecc0e merge most 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 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
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 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
942 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
943 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
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 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
946
eab9498ecc0e merge most 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 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
948 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
949 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
950 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
951 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
952 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
953 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
954 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
955 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
956 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
957 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
958 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
959 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
960 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
961 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
962 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
963 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
964 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
965 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
966 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
967
eab9498ecc0e merge most 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 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
969 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
970 ****************************************************************************/
eab9498ecc0e merge most 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 #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
972 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
973 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
974 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
975 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
976 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
977 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
978 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
979 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
980
eab9498ecc0e merge most 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 #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
982 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
983 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
984 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
985 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
986 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
987 {
eab9498ecc0e merge most 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 /* 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
989 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
990 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
991 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
992 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
993 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
994
eab9498ecc0e merge most 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 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
996
eab9498ecc0e merge most 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 /* 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
998 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
999 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
1000 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
1001 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
1002 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
1003
eab9498ecc0e merge most 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 /* 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
1005 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
1006 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
1007 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
1008 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
1009 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
1010 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
1011 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
1012 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
1013 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
1014 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
1015
eab9498ecc0e merge most 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 #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
1017 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
1018 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
1019 #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
1020 #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
1021 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
1022 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
1023 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
1024 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
1025
eab9498ecc0e merge most 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 /* Lazily initialize frame's xftDraw member. */
5239
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1027 if (!FRAME_X_XFTDRAW (f)) {
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1028 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
1029 }
5239
f19e6bc25969 Backed out changeset 6466bc9ebf15
Mike Sperber <sperber@deinprogramm.de>
parents: 5237
diff changeset
1030 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
1031
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1032 /* #### 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
1033 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
1034 #### 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
1035 #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
1036 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
1037 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
1038 #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
1039
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1040 if (width < 0)
5628
81fee4aee9b6 text_width methods interface cleanup.
Didier Verna <didier@xemacs.org>
parents: 5627
diff changeset
1041 width = XLIKE_text_width (f, 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
1042 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
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 /* 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
1045
eab9498ecc0e merge most 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 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
1047 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
1048 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
1049 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
1050 /* 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
1051 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
1052
eab9498ecc0e merge most 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 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
1054
eab9498ecc0e merge most 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 /* 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
1056 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
1057 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
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 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
1060 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
1061
eab9498ecc0e merge most 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 /* 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
1063 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
1064 && (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
1065 || 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
1066 || (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
1067 && (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
1068 && !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
1069 {
eab9498ecc0e merge most 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 /* 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
1071 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
1072 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
1073 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
1074
eab9498ecc0e merge most 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 /* 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
1076 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
1077 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
1078 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
1079 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 #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
1082 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
1083 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
1084 #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
1085
eab9498ecc0e merge most 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 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
1087 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
1088 || !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
1089 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
1090
eab9498ecc0e merge most 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 ((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
1092 && !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
1093 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
1094 else
5624
c39052c921b5 New "foreback" face property.
Didier Verna <didier@xemacs.org>
parents: 5623
diff changeset
1095 bgc = XLIKE_get_gc
c39052c921b5 New "foreback" face property.
Didier Verna <didier@xemacs.org>
parents: 5623
diff changeset
1096 (f, Qnil, NILP (bg_pmap) ? cachel->foreground : cachel->foreback,
c39052c921b5 New "foreback" face property.
Didier Verna <didier@xemacs.org>
parents: 5623
diff changeset
1097 cachel->background, 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
1098
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1099 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
1100 {
eab9498ecc0e merge most 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 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
1102 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
1103 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
1104 }
eab9498ecc0e merge most 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
4967
0d4c9d0f6a8d rewrite dynarr code
Ben Wing <ben@xemacs.org>
parents: 4962
diff changeset
1106 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
1107 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
1108
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1109 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
1110 {
eab9498ecc0e merge most 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 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
1112 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
1113 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
1114 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
1115
eab9498ecc0e merge most 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 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
1117 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
1118
5627
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
1119 this_width = XLIKE_text_width_single_run (dpy, 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
1120 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
1121 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
1122
eab9498ecc0e merge most 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 /* 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
1124 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
1125 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
1126 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
1127 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
1128 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
1129 {
eab9498ecc0e merge most 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 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
1131 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
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 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
1134 {
eab9498ecc0e merge most 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 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
1136
eab9498ecc0e merge most 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 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
1138 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
1139 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
1140 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
1141
eab9498ecc0e merge most 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 /* 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
1143 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
1144 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
1145 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
1146 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
1147 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
1148
eab9498ecc0e merge most 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 (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
1150 {
eab9498ecc0e merge most 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 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
1152 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
1153 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
1154 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
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 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
1159 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
1160 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
1161 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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 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
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 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
1166 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
1167 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
1168 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
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 #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
1174 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
1175 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
1176 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1177 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
1178 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
1179 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1180 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
1181 {
eab9498ecc0e merge most 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 /* 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
1183 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
1184 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
1185 #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
1186 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
1187 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
1188 #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
1189 /* #### 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
1190 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
1191 #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
1192 ;
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 /* 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
1195 #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
1196 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
1197 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
1198 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1199 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
1200 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
1201 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1202 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
1203 {
eab9498ecc0e merge most 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 #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
1205 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
1206 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
1207 #endif
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1208 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
1209 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
1210 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1211 #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
1212 {
eab9498ecc0e merge most 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 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
1214
eab9498ecc0e merge most 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 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
1216 {
eab9498ecc0e merge most 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 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
1218 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
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 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
1221 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
1222 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
1223
eab9498ecc0e merge most 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 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1225 XftDrawSetClip (xftDraw, clip_reg);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1226 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
1227 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1228
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1229 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
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 /* #### 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
1232 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
1233 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
1234 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
1235 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
1236 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
1237 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
1238 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
1239 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
1240 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
1241 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
1242 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
1243 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
1244 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
1245 struct textual_run *run = &runs[i];
5627
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
1246 int rect_width
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
1247 = XLIKE_text_width_single_run (dpy, cachel, 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
1248 #ifndef USE_XFTTEXTENTS_TO_AVOID_FONT_DROPPINGS
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1249 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1250 + 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
1251 #else
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1252 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1253 + 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
1254 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
1255 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
1256 XftTextExtents16 (dpy,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1257 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
1258 (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
1259 } 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
1260 XftTextExtents8 (dpy,
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1261 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
1262 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
1263 }
eab9498ecc0e merge most 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 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
1265 ? 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
1266 #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
1267
eab9498ecc0e merge most 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 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
1269 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
1270 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 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
1273 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
1274 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
1275 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
1276 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
1277 (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
1278 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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 #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
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 #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
1283 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
1284 #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
1285 {
eab9498ecc0e merge most 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 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
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 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
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 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
1291 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
1292 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
1293 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
1294
eab9498ecc0e merge most 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 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
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
eab9498ecc0e merge most 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 #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
1299 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
1300 (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
1301 (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
1302 (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
1303 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
1304 (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
1305 (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
1306 (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
1307 #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
1308
eab9498ecc0e merge most 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 /* 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
1310 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
1311 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
1312
eab9498ecc0e merge most 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 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
1314 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
1315 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
1316 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
1317 */
eab9498ecc0e merge most 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 (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
1319 (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
1320 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
1321 #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
1322 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 /* 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
1325 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
1326 {
eab9498ecc0e merge most 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 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
1328 #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
1329 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
1330 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
1331 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
1332 /* #### 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
1333 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
1334 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
1335 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
1336 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
1337 #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
1338 /* 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
1339 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
1340 #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
1341 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
1342 #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
1343 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
1344 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
1345 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
1346 #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
1347 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
1348 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
1349 {
eab9498ecc0e merge most 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 + 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
1351 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
1352
eab9498ecc0e merge most 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 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
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 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
1356 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
1357 }
eab9498ecc0e merge most 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 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
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 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
1361 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
1362 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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 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
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 #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
1369 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
1370 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
1371 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
1372 #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
1373 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
1374 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
1375 #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
1376
eab9498ecc0e merge most 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 #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
1378 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
1379 {
eab9498ecc0e merge most 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 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
1381 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
1382 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
1383 }
eab9498ecc0e merge most 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 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
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 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
1387 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
1388 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
1389 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
1390 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
1391 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
1392 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
1393 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
1394 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
1395 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
1396 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
1397 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
1398 }
eab9498ecc0e merge most 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 #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
1400 /* 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
1401 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
1402
eab9498ecc0e merge most 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 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
1404 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
1405 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
1406 #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
1407
eab9498ecc0e merge most 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 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
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 /* 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
1411 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
1412 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
1413 {
eab9498ecc0e merge most 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 + 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
1415 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
1416
eab9498ecc0e merge most 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 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
1418 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
1419 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
1420 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
1421 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
1422 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
1423 }
eab9498ecc0e merge most 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 }
eab9498ecc0e merge most 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 /* 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
1427 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
1428 {
eab9498ecc0e merge most 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 #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
1430 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
1431 {
eab9498ecc0e merge most 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 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
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 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
1435 #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
1436 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
1437 }
eab9498ecc0e merge most 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
eab9498ecc0e merge most 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 /* 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
1440 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
1441 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
1442 {
eab9498ecc0e merge most 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 #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
1444 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
1445 {
eab9498ecc0e merge most 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 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
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 { /* 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
1449 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
1450 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
1451 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
1452
eab9498ecc0e merge most 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 XUnionRectWithRegion (&clip_box, clip_reg, clip_reg);
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1454 XftDrawSetClip (xftDraw, clip_reg);
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1455 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
1456 }
eab9498ecc0e merge most of rest of redisplay-x.c and redisplay-gtk.c into redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4881
diff changeset
1457 { /* draw background rectangle & draw text */
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1458 int rect_height = FONT_INSTANCE_ASCENT (fi)
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1459 + FONT_INSTANCE_DESCENT (fi);
5627
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
1460 int rect_width
37fb945697f5 text_width_single_run cleanup.
Didier Verna <didier@xemacs.org>
parents: 5624
diff changeset
1461 = XLIKE_text_width_single_run (dpy, 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
1462 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
1463
eab9498ecc0e merge most 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 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
1465 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
1466 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
1467
eab9498ecc0e merge most 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 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
1469 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
1470 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
1471 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
1472 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
1473 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
1474 (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
1475 }
eab9498ecc0e merge most 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
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1477 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
1478 }
eab9498ecc0e merge most 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 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
1480 #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
1481 {
eab9498ecc0e merge most 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 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
1483 XLIKE_GC cgc;
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1484 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
1485 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
1486
eab9498ecc0e merge most 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 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
1488 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
1489 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
1490 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
1491
eab9498ecc0e merge most 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 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
1493 &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
1494 #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
1495 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
1496 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
1497 (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
1498 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
1499 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
1500 (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
1501 #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
1502 /* 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
1503 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
1504 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
1505
eab9498ecc0e merge most 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 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
1507 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
1508 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
1509 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
1510 */
eab9498ecc0e merge most 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 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
1512 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
1513 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
1514 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
1515 #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
1516
eab9498ecc0e merge most 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 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
1518 }
eab9498ecc0e merge most 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 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
1522 }
eab9498ecc0e merge most 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 /* 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
1525 /* 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
1526 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
1527 && ((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
1528 || (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
1529 && (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
1530 && !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
1531 {
eab9498ecc0e merge most 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 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
1533 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
1534 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
1535 || 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
1536
eab9498ecc0e merge most 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 /* #### 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
1538 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
1539 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
1540 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
1541
eab9498ecc0e merge most 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 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
1543 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
1544 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
1545 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
1546 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
1547 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
1548 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
1549 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
1550 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
1551 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
1552 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
1553
eab9498ecc0e merge most 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 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
1555 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1556 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
1557 Qnil, Qnil,
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
1558 make_fixnum (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
1559 }
eab9498ecc0e merge most 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 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
1561 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1562 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
1563 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
1564 }
eab9498ecc0e merge most 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 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
1567 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
1568 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
1569 {
eab9498ecc0e merge most 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 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
1571 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
1572 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
1573 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
1574 }
eab9498ecc0e merge most 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 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
1577 {
eab9498ecc0e merge most 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 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
1579 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
1580 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
1581 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
1582 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
1583 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
1584 }
eab9498ecc0e merge most 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 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
1587 {
eab9498ecc0e merge most 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 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
1589 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
1590 }
eab9498ecc0e merge most 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 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
1592 {
eab9498ecc0e merge most 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 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
1594 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
1595 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
1596 }
eab9498ecc0e merge most 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 /* 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
1599 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
1600 {
eab9498ecc0e merge most 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 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
1602 }
eab9498ecc0e merge most 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 #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
1606 #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
1607 #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
1608 }
eab9498ecc0e merge most 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 #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
1611 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
1612 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
1613 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
1614 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
1615 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
1616 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
1617 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
1618 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
1619 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
1620 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
1621 #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
1622
eab9498ecc0e merge most 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
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1624 static void
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1625 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
1626 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
1627 int width, int height,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1628 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
1629 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
1630 {
eab9498ecc0e merge most 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 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
1632 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
1633 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
1634 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
1635 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
1636 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
1637
eab9498ecc0e merge most 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 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
1639 {
eab9498ecc0e merge most 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 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
1641 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
1642 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
1643 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
1644 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
1645
eab9498ecc0e merge most 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 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
1647 {
eab9498ecc0e merge most 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 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
1649 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
1650 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
1651 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
1652 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
1653 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
1654 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
1655 /* 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
1656 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
1657 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
1658 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
1659 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
1660 - 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
1661 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
1662 */
eab9498ecc0e merge most 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 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
1666 }
eab9498ecc0e merge most 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 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
1668 {
eab9498ecc0e merge most 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 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
1670 /* 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
1671 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
1672 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
1673 }
eab9498ecc0e merge most 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 #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
1676 /* 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
1677 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
1678 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
1679 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
1680 #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
1681 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
1682 {
eab9498ecc0e merge most 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 #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
1684 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
1685 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
1686 (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
1687 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
1688 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
1689 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1690 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
1691 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
1692 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
1693 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
1694 #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
1695 }
eab9498ecc0e merge most 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 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
1697 {
eab9498ecc0e merge most 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 #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
1699 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
1700 (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
1701 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
1702 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1703 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
1704 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
1705 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
1706 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
1707 #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
1708 }
eab9498ecc0e merge most 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 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
1712 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
1713 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
1714 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
1715 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
1716 {
eab9498ecc0e merge most 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 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
1718 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
1719 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
1720 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
1721 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
1722
eab9498ecc0e merge most 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 /* 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
1724 {
eab9498ecc0e merge most 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 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
1726 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
1727
eab9498ecc0e merge most 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 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
1729 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
1730 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
1731 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
1732
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1733 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
1734 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
1735 dga->width, dga->height,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1736 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
1737 }
eab9498ecc0e merge most 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 /* 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
1740 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
1741 && !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
1742 && (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
1743 {
eab9498ecc0e merge most 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 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
1745 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
1746 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
1747 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
1748 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
1749 (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
1750
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1751 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
1752 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
1753
eab9498ecc0e merge most 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 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
1755 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
eab9498ecc0e merge most 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 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
1758 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
1759 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
1760 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
1761 {
eab9498ecc0e merge most 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 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
1763 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
1764 }
eab9498ecc0e merge most 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 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
1770
eab9498ecc0e merge most 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 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
1772 ****************************************************************************/
eab9498ecc0e merge most 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 static void
5198
bc3ede8f29a8 fix spacing in some files
Ben Wing <ben@xemacs.org>
parents: 5090
diff changeset
1774 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
1775 {
eab9498ecc0e merge most 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 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
1777 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
1778
eab9498ecc0e merge most 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 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
1780 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
1781 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
1782 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
1783 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
1784 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
1785 unsigned long mask;
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1786 int x, ytop, ybottom, width, shadow_thickness, spacing, line_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
1787 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
1788 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
1789
eab9498ecc0e merge most 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 width = window_divider_width (w);
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
1791 shadow_thickness = XFIXNUM (w->vertical_divider_shadow_thickness);
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
1792 spacing = XFIXNUM (w->vertical_divider_spacing);
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
1793 line_width = XFIXNUM (w->vertical_divider_line_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
1794 x = WINDOW_RIGHT (w) - width;
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1795 ytop = WINDOW_TOP (w);
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1796 ybottom = WINDOW_BOTTOM (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
1797
eab9498ecc0e merge most 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 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
1799
eab9498ecc0e merge most 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 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
1801
eab9498ecc0e merge most 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 /* 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
1803 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
1804 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
1805 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
1806 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
1807
eab9498ecc0e merge most 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 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
1809
eab9498ecc0e merge most 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 /* 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
1811 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
1812 #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
1813 if (clear)
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1814 XClearArea (dpy, x_win, x, ytop, width, ybottom - ytop, False);
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
1815 #else /* THIS_IS_GTK */
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1816 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
1817 /* 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
1818 gdk_draw_rectangle (GDK_DRAWABLE (x_win), background_gc, TRUE,
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1819 x, ytop, width, ybottom - ytop);
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
1820 #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
1821
eab9498ecc0e merge most 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 #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
1823 /* #### 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
1824 /* 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
1825 XLIKE_FILL_RECTANGLE (dpy, x_win, background_gc,
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1826 x + spacing + shadow_thickness, ytop,
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1827 line_width, ybottom - ytop);
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1828 #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
1829
eab9498ecc0e merge most 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 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
1831 {
eab9498ecc0e merge most 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 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
1833 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
1834 }
eab9498ecc0e merge most 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 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
1836 {
eab9498ecc0e merge most 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 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
1838 }
eab9498ecc0e merge most 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 /* Draw the shadows around the divider line */
5538
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1841 XLIKE_bevel_area (w, div_face, x + spacing, ytop,
580ef98f2beb Suppress a "shadowed global" warning.
Stephen J. Turnbull <stephen@xemacs.org>
parents: 5515
diff changeset
1842 width - 2 * spacing, ybottom - ytop,
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
1843 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
1844 }
eab9498ecc0e merge most 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 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
1848
5623
444713e89160 Fix XLIKE_output_blank comment typo.
Didier Verna <didier@xemacs.org>
parents: 5581
diff changeset
1849 Output a blank by clearing the area it covers in the background color
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
1850 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
1851 ****************************************************************************/
eab9498ecc0e merge most 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 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
1853 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
1854 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
1855 {
eab9498ecc0e merge most 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 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
1857 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
1858
eab9498ecc0e merge most 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 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
1860 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
1861 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
1862 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
1863 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
1864 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
1865 (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
1866 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
1867 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
1868 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
1869 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
1870
eab9498ecc0e merge most 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 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
1872 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
1873 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
1874 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
1875
eab9498ecc0e merge most 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 /* 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
1877 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
1878
eab9498ecc0e merge most 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 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
1880 {
eab9498ecc0e merge most 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 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
1882 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
1883 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
1884 {
eab9498ecc0e merge most 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 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
1886 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
1887 }
eab9498ecc0e merge most 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 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
1891 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
1892 || !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
1893 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
1894
eab9498ecc0e merge most 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 if (NILP (bg_pmap))
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1896 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
1897 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
1898 else
5624
c39052c921b5 New "foreback" face property.
Didier Verna <didier@xemacs.org>
parents: 5623
diff changeset
1899 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREBACK (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1900 WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1901 bg_pmap,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1902 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
1903 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
1904
eab9498ecc0e merge most 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 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
1906
eab9498ecc0e merge most 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 /* 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
1908 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
1909 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
1910 && (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
1911 || (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
1912 && (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
1913 && 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
1914 {
eab9498ecc0e merge most 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 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
1916 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
1917 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
1918
eab9498ecc0e merge most 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 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
1920 (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
1921 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
1922
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1923 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
1924 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
1925
eab9498ecc0e merge most 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 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
1927 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
1928 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
1929 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
1930
eab9498ecc0e merge most 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 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
1932 {
eab9498ecc0e merge most 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 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
1934 {
eab9498ecc0e merge most 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 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
1936 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
1937 }
eab9498ecc0e merge most 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 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
1939 {
eab9498ecc0e merge most 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 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
1941
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1942 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
1943 Qnil, Qnil, Qnil,
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
1944 make_fixnum (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
1945 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
1946 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
1947 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
1948 }
eab9498ecc0e merge most 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 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
1951 {
eab9498ecc0e merge most 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 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
1953 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
1954 }
eab9498ecc0e merge most 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 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
1960
eab9498ecc0e merge most 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 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
1962 ****************************************************************************/
eab9498ecc0e merge most 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 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
1964 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
1965 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
1966 {
eab9498ecc0e merge most 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 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
1968 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
1969
eab9498ecc0e merge most 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 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
1971 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
1972 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
1973
eab9498ecc0e merge most 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 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
1975 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
1976 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
1977 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
1978
eab9498ecc0e merge most 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 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
1980 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
1981 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
1982 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
1983
eab9498ecc0e merge most 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 /* 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
1985 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
1986 {
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
1987 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
1988 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
1989 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
1990
eab9498ecc0e merge most 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 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
1992 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
1993 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
1994 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
1995 }
eab9498ecc0e merge most 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 #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
1998 {
eab9498ecc0e merge most 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 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
2000 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
2001 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
2002 }
eab9498ecc0e merge most 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 #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
2004 /* Now draw the line. */
5074
8af6a32b170d Modify XLIKE_get_gc's prototype
Didier Verna <didier@lrde.epita.fr>
parents: 5047
diff changeset
2005 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
2006 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
2007
eab9498ecc0e merge most 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 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
2009 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 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
2011 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
eab9498ecc0e merge most 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 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
2014 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
2015 #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
2016 }
eab9498ecc0e merge most 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 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
2020
eab9498ecc0e merge most 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 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
2022 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
2023 ****************************************************************************/
eab9498ecc0e merge most 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 static void
5515
f87be7ddd60d Simplify clear_region interface.
Didier Verna <didier@lrde.epita.fr>
parents: 5402
diff changeset
2025 XLIKE_clear_region (Lisp_Object UNUSED (locale), struct frame* f,
f87be7ddd60d Simplify clear_region interface.
Didier Verna <didier@lrde.epita.fr>
parents: 5402
diff changeset
2026 face_index UNUSED (findex),
f87be7ddd60d Simplify clear_region interface.
Didier Verna <didier@lrde.epita.fr>
parents: 5402
diff changeset
2027 int x, int y, int width, int height,
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2028 Lisp_Object fcolor, Lisp_Object bcolor,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2029 Lisp_Object background_pixmap,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2030 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
2031 {
5515
f87be7ddd60d Simplify clear_region interface.
Didier Verna <didier@lrde.epita.fr>
parents: 5402
diff changeset
2032 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (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
2033 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
2034 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
2035
eab9498ecc0e merge most 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 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
2037 {
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2038 gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor,
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2039 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
2040 }
eab9498ecc0e merge most 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 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
2043 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
2044 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
2045 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
2046 }
eab9498ecc0e merge most 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 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
2050
eab9498ecc0e merge most 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 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
2052 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
2053 ****************************************************************************/
eab9498ecc0e merge most 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 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
2055 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
2056 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
2057 {
eab9498ecc0e merge most 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 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
2059 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
2060 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
2061
eab9498ecc0e merge most 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 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
2063 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
2064 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
2065 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
2066 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
2067
eab9498ecc0e merge most 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 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
2069 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
2070 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
2071
eab9498ecc0e merge most 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 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
2073 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
2074 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
2075 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
2076 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
2077 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
2078
eab9498ecc0e merge most 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 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
2080 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
2081
eab9498ecc0e merge most 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 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
2083 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
2084
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2085 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
2086 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
2087
5047
07dcc7000bbf put width before height consistently, fix a real bug found in the process
Ben Wing <ben@xemacs.org>
parents: 4967
diff changeset
2088 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
2089
eab9498ecc0e merge most 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 /* 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
2091 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
2092 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
2093 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
2094
eab9498ecc0e merge most 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 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
2096 {
eab9498ecc0e merge most 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 #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
2098 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
2099 #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
2100
eab9498ecc0e merge most 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 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
2102 {
eab9498ecc0e merge most 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 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
2104 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
2105 }
eab9498ecc0e merge most 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 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
2107 {
eab9498ecc0e merge most 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 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
2109
5080
5502045ec510 The background-placement face property.
Didier Verna <didier@lrde.epita.fr>
parents: 5074
diff changeset
2110 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
2111 Qnil, Qnil,
5581
56144c8593a8 Mechanically change INT to FIXNUM in our sources.
Aidan Kehoe <kehoea@parhasard.net>
parents: 5538
diff changeset
2112 make_fixnum (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
2113 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
2114 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
2115 }
eab9498ecc0e merge most 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 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
2118 {
eab9498ecc0e merge most 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 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
2120 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
2121 }
eab9498ecc0e merge most 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 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
2125 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
2126 {
eab9498ecc0e merge most 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 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
2128
eab9498ecc0e merge most 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 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
2130 {
eab9498ecc0e merge most 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 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
2132 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
2133 }
eab9498ecc0e merge most 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 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
2136 {
eab9498ecc0e merge most 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 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
2138 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
2139 }
eab9498ecc0e merge most 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 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
2142 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
2143 }
eab9498ecc0e merge most 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 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
2146 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
2147 {
eab9498ecc0e merge most 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 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
2149 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
2150 }
eab9498ecc0e merge most 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 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
2153 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
2154 {
eab9498ecc0e merge most 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 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
2156 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
2157 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
2158 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
2159
5090
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2160 /* #### GEOM! This clears the internal border and gutter (and scrollbars)
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2161 but not the toolbar. Correct? */
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2162 x = FRAME_LEFT_INTERNAL_BORDER_START (f);
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2163 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
2164 /* #### 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
2165 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
2166 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
2167 redisplay_clear_top_of_window(). */
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2168 y = FRAME_TOP_INTERNAL_BORDER_START (f) - 1;
0ca81354c4c7 Further frame-geometry cleanups
Ben Wing <ben@xemacs.org>
parents: 5080
diff changeset
2169 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
2170
eab9498ecc0e merge most 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 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
2172
eab9498ecc0e merge most 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 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
2174
eab9498ecc0e merge most 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 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
2176 || !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
2177 || !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
2178 {
eab9498ecc0e merge most 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 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
2180 }
eab9498ecc0e merge most 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 #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
2182 {
eab9498ecc0e merge most 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 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
2184 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
2185 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
2186 }
eab9498ecc0e merge most 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 #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
2188 }
eab9498ecc0e merge most 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 /* 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
2191 */
eab9498ecc0e merge most 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 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
2194 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
2195 {
eab9498ecc0e merge most 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 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
2197 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
2198 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
2199 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
2200 XLIKE_GCVALUES gcv;
4908
b3ce27ca7647 various fixes related to gtk, redisplay-xlike-inc.c
Ben Wing <ben@xemacs.org>
parents: 4882
diff changeset
2201 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
2202 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
2203 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
2204 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
2205
eab9498ecc0e merge most 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 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
2207
eab9498ecc0e merge most 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 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
2209 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
2210 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
2211 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
2212 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
2213 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
2214 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
2215 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
2216 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
2217 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
2218 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
2219
eab9498ecc0e merge most 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 /* 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
2221 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
2222 {
eab9498ecc0e merge most 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 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
2224 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
2225 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
2226 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
2227 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
2228 }
eab9498ecc0e merge most 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 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
2230 /* 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
2231 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
2232 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
2233
eab9498ecc0e merge most 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 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
2235
eab9498ecc0e merge most 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 #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
2237 {
eab9498ecc0e merge most 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 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
2239 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
2240 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
2241 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
2242 /* 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
2243 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
2244 }
eab9498ecc0e merge most 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 #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
2246 #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
2247 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
2248 #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
2249 #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
2250 #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
2251 #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
2252
eab9498ecc0e merge most 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 /* 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
2254 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
2255 {
eab9498ecc0e merge most 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 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
2257 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
2258 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
2259 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
2260 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
2261 }
eab9498ecc0e merge most 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 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
2263 /* 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
2264 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
2265 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
2266
eab9498ecc0e merge most 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 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
2268
eab9498ecc0e merge most 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 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
2270 }
eab9498ecc0e merge most 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 /* 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
2275 /************************************************************************/
eab9498ecc0e merge most 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 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
2278 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
2279 {
eab9498ecc0e merge most 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 /* 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
2281 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
2282 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
2283 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
2284 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
2285 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
2286 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
2287 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
2288 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
2289 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
2290 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
2291 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
2292 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
2293
eab9498ecc0e merge most 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 #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
2295 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
2296 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
2297 #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
2298 }