Mercurial > emacs
annotate src/cm.h @ 94938:5752d7154afc
Throughout the file, delete all USE_FONT_BACKEND
conditionals. Don't check enable_font_backend. Delete all codes
used only when USE_FONT_BACKEND is not defined. Use
FONT_XXX_NAME_NUMERIC instead of face_numeric_xxx.
(QCfoundry, QCadstyle, QCregistry, QCspacing, QCsize, QCavgwidth)
(Qp): Extern them.
(clear_font_table, load_face_font, xlfd_lookup_field_contents):
Deleted.
(struct font_name): Deleted.
(xlfd_numeric_value, xlfd_symbolic_value): Deleted.
(compare_fonts_by_sort_order): New function.
(xlfd_numeric_slant, xlfd_symbolic_slant, xlfd_numeric_weight)
(xlfd_symbolic_weight, xlfd_numeric_swidth, xlfd_symbolic_swidth):
Deleted.
(Fx_family_fonts): Use font_list_entities, and sort fonts by
compare_fonts_by_sort_order.
(Fx_font_family_list): Call Ffont_family_list.
(face_numeric_value, face_numeric_weight, face_numeric_slant)
(face_numeric_swidth, face_symbolic_value, face_symbolic_weight)
(face_symbolic_slant, face_symbolic_swidth)
(split_font_name_into_vector, build_font_name_from_vector)
(xlfd_fixed_p, xlfd_point_size, pixel_point_size)
(font_rescale_ratio, split_font_name, build_font_name)
(free_font_names, sort_fonts, x_face_list_fonts)
(face_font_available_p, sorted_font_list, cmp_font_names)
(font_list_1, concat_font_list, font_list, remove_duplicates):
Deleted.
(Fx_list_fonts): Use Ffont_list.
(LFACE_AVGWIDTH): Deleted.
(check_lface_attrs): Don't check LFACE_AVGWIDTH. Check LFACE_FONT
by FONTP.
(lface_fully_specified_p): Don't check LFACE_AVGWIDTH.
(set_lface_from_font_name): Delete it.
(set_lface_from_font): Renamed from
set_lface_from_font_and_fontset. Caller changed. Don't set
LFACE_AVGWIDTH. Use FONT_XXX_FOR_FACE to get a symbol suitable
for face.
(merge_face_vectors): Copy font-spec if necessary. Clear
properties of the font-spec if necessary.
(merge_face_ref): Clear properties of the font-spec if necessary.
(Finternal_set_lisp_face_attribute): Likewise.
(set_font_frame_param): Use font_load_for_lface to load a
font-object, and call Fmodify_frame_parameters with it.
(x_update_menu_appearance): Don't check LFACE_AVGWIDTH. Get XLFD
font name by Ffont_xlfd_name.
(Finternal_lisp_face_attribute_values): Don't check QCweight,
QCslant, and QCwidth.
(Fface_font): Get a font name from font->props[FONT_NAME_INDEX].
(lface_same_font_attributes_p): Don't check LFACE_AVGWIDTH.
Compare fonts by EQ.
(lookup_non_ascii_face): Deleted.
(face_for_font): The 2nd argument changed.
(x_supports_face_attributes_p): Don't check LFACE_AVGWIDTH. Check
atomic font properties by case insensitive.
(realize_non_ascii_face): Set face->overstrike correctly.
(realize_x_face): Likewise. Check if LFACE_FONT is a font_object.
(dump_realized_face): Get font name from
font->props[FONT_NAME_INDEX]. Don't print font_info_id.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Wed, 14 May 2008 01:41:52 +0000 |
parents | 107ccd98fa12 |
children | 606f2d163a64 29adfc9354e7 |
rev | line source |
---|---|
486 | 1 /* Cursor motion calculation definitions for GNU Emacs |
75227
e90d04cd455a
Update copyright for years from Emacs 21 to present (mainly adding
Glenn Morris <rgm@gnu.org>
parents:
68651
diff
changeset
|
2 Copyright (C) 1985, 1989, 2001, 2002, 2003, 2004, |
79759 | 3 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
486 | 4 |
5 This file is part of GNU Emacs. | |
6 | |
7 GNU Emacs is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
78260
922696f363b0
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75227
diff
changeset
|
9 the Free Software Foundation; either version 3, or (at your option) |
486 | 10 any later version. |
11 | |
12 GNU Emacs is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GNU Emacs; see the file COPYING. If not, write to | |
64084 | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 Boston, MA 02110-1301, USA. */ | |
486 | 21 |
22 /* Holds the minimum and maximum costs for the parametrized capabilities. */ | |
23 struct parmcap | |
24 { | |
25 int mincost, maxcost; | |
26 }; | |
27 | |
28 /* This structure holds everything needed to do cursor motion except the pad | |
29 character (PC) and the output speed of the terminal (ospeed), which | |
30 termcap wants in global variables. */ | |
31 | |
32 struct cm | |
33 { | |
34 /* Cursor position. -1 in *both* variables means the cursor | |
35 position is unknown, in order to force absolute cursor motion. */ | |
36 | |
37 int cm_curY; /* Current row */ | |
38 int cm_curX; /* Current column */ | |
39 | |
40 /* Capabilities from termcap */ | |
41 char *cm_up; /* up (up) */ | |
42 char *cm_down; /* down (do) */ | |
43 char *cm_left; /* left (le) */ | |
44 char *cm_right; /* right (nd) */ | |
45 char *cm_home; /* home (ho) */ | |
46 char *cm_cr; /* carriage return (cr) */ | |
47 char *cm_ll; /* last line (ll) */ | |
48 char *cm_tab; /* tab (ta) */ | |
49 char *cm_backtab; /* backtab (bt) */ | |
50 char *cm_abs; /* absolute (cm) */ | |
51 char *cm_habs; /* horizontal absolute (ch) */ | |
52 char *cm_vabs; /* vertical absolute (cv) */ | |
53 #if 0 | |
54 char *cm_ds; /* "don't send" string (ds) */ | |
55 #endif | |
56 char *cm_multiup; /* multiple up (UP) */ | |
57 char *cm_multidown; /* multiple down (DO) */ | |
58 char *cm_multileft; /* multiple left (LE) */ | |
59 char *cm_multiright; /* multiple right (RI) */ | |
60 int cm_cols; /* number of cols on screen (co) */ | |
61 int cm_rows; /* number of rows on screen (li) */ | |
62 int cm_tabwidth; /* tab width (it) */ | |
63 unsigned int cm_autowrap:1; /* autowrap flag (am) */ | |
64 unsigned int cm_magicwrap:1; /* VT-100: cursor stays in last col but | |
65 will cm_wrap if next char is | |
66 printing (xn) */ | |
67 unsigned int cm_usetabs:1; /* if set, use tabs */ | |
68 unsigned int cm_losewrap:1; /* if reach right margin, forget cursor | |
69 location */ | |
70 unsigned int cm_autolf:1; /* \r performs a \r\n (rn) */ | |
71 | |
72 /* Parametrized capabilities. This needs to be a struct since | |
73 the costs are accessed through pointers. */ | |
74 | |
75 #if 0 | |
76 struct parmcap cc_abs; /* absolute (cm) */ | |
77 struct parmcap cc_habs; /* horizontal absolute (ch) */ | |
78 struct parmcap cc_vabs; /* vertical absolute (cv) */ | |
79 struct parmcap cc_multiup; /* multiple up (UP) */ | |
80 struct parmcap cc_multidown; /* multiple down (DO) */ | |
81 struct parmcap cc_multileft; /* multiple left (LE) */ | |
82 struct parmcap cc_multiright; /* multiple right (RI) */ | |
83 #endif | |
84 | |
85 /* Costs for the non-parametrized capabilities */ | |
86 int cc_up; /* cost for up */ | |
87 int cc_down; /* etc. */ | |
88 int cc_left; | |
89 int cc_right; | |
90 int cc_home; | |
91 int cc_cr; | |
92 int cc_ll; | |
93 int cc_tab; | |
94 int cc_backtab; | |
95 /* These are temporary, until the code is installed to use the | |
96 struct parmcap fields above. */ | |
97 int cc_abs; | |
98 int cc_habs; | |
99 int cc_vabs; | |
100 }; | |
101 | |
102 extern char PC; /* Pad character */ | |
18659
b6ced5dad84b
(ospeed): Declare as short unless HAVE_TERMIOS_H and LINUX.
Richard M. Stallman <rms@gnu.org>
parents:
18473
diff
changeset
|
103 |
486 | 104 /* Shorthand */ |
105 #ifndef NoCMShortHand | |
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
106 #define curY(tty) (tty)->Wcm->cm_curY |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
107 #define curX(tty) (tty)->Wcm->cm_curX |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
108 #define Up(tty) (tty)->Wcm->cm_up |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
109 #define Down(tty) (tty)->Wcm->cm_down |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
110 #define Left(tty) (tty)->Wcm->cm_left |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
111 #define Right(tty) (tty)->Wcm->cm_right |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
112 #define Tab(tty) (tty)->Wcm->cm_tab |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
113 #define BackTab(tty) (tty)->Wcm->cm_backtab |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
114 #define TabWidth(tty) (tty)->Wcm->cm_tabwidth |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
115 #define CR(tty) (tty)->Wcm->cm_cr |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
116 #define Home(tty) (tty)->Wcm->cm_home |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
117 #define LastLine(tty) (tty)->Wcm->cm_ll |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
118 #define AbsPosition(tty) (tty)->Wcm->cm_abs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
119 #define ColPosition(tty) (tty)->Wcm->cm_habs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
120 #define RowPosition(tty) (tty)->Wcm->cm_vabs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
121 #define MultiUp(tty) (tty)->Wcm->cm_multiup |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
122 #define MultiDown(tty) (tty)->Wcm->cm_multidown |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
123 #define MultiLeft(tty) (tty)->Wcm->cm_multileft |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
124 #define MultiRight(tty) (tty)->Wcm->cm_multiright |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
125 #define AutoWrap(tty) (tty)->Wcm->cm_autowrap |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
126 #define MagicWrap(tty) (tty)->Wcm->cm_magicwrap |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
127 #define UseTabs(tty) (tty)->Wcm->cm_usetabs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
128 #define FrameRows(tty) (tty)->Wcm->cm_rows |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
129 #define FrameCols(tty) (tty)->Wcm->cm_cols |
486 | 130 |
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
131 #define UpCost(tty) (tty)->Wcm->cc_up |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
132 #define DownCost(tty) (tty)->Wcm->cc_down |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
133 #define LeftCost(tty) (tty)->Wcm->cc_left |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
134 #define RightCost(tty) (tty)->Wcm->cc_right |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
135 #define HomeCost(tty) (tty)->Wcm->cc_home |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
136 #define CRCost(tty) (tty)->Wcm->cc_cr |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
137 #define LastLineCost(tty) (tty)->Wcm->cc_ll |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
138 #define TabCost(tty) (tty)->Wcm->cc_tab |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
139 #define BackTabCost(tty) (tty)->Wcm->cc_backtab |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
140 #define AbsPositionCost(tty) (tty)->Wcm->cc_abs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
141 #define ColPositionCost(tty) (tty)->Wcm->cc_habs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
142 #define RowPositionCost(tty) (tty)->Wcm->cc_vabs |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
143 #define MultiUpCost(tty) (tty)->Wcm->cc_multiup |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
144 #define MultiDownCost(tty) (tty)->Wcm->cc_multidown |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
145 #define MultiLeftCost(tty) (tty)->Wcm->cc_multileft |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
146 #define MultiRightCost(tty) (tty)->Wcm->cc_multiright |
486 | 147 #endif |
148 | |
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
149 #define cmat(tty,row,col) (curY(tty) = (row), curX(tty) = (col)) |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
150 #define cmplus(tty,n) \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
151 { \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
152 if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
153 { \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
154 if ((tty)->Wcm->cm_losewrap) losecursor (tty); \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
155 else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++; \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
156 else curX (tty)--; \ |
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
157 } \ |
486 | 158 } |
159 | |
53232
22aaf1e5fbe6
Full support for multiple terminal I/O (with some rough edges).
Karoly Lorentey <lorentey@elte.hu>
parents:
53226
diff
changeset
|
160 #define losecursor(tty) (curX(tty) = -1, curY(tty) = -1) |
486 | 161 |
162 extern int cost; | |
163 extern int evalcost (); | |
164 | |
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
165 #define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc)) |
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
166 |
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
167 extern struct tty_display_info *current_tty; |
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
168 extern void cmcheckmagic P_ ((struct tty_display_info *)); |
53226
dd3018b4785b
Implemented multiple tty support.
Karoly Lorentey <lorentey@elte.hu>
parents:
52401
diff
changeset
|
169 extern int cmputc P_ ((int)); |
82989
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
170 extern void cmcostinit P_ ((struct tty_display_info *)); |
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
171 extern void cmgoto P_ ((struct tty_display_info *, int, int)); |
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
172 extern void Wcm_clear P_ ((struct tty_display_info *)); |
f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
Karoly Lorentey <lorentey@elte.hu>
parents:
53340
diff
changeset
|
173 extern int Wcm_init P_ ((struct tty_display_info *)); |
52401 | 174 |
175 /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b | |
176 (do not change this comment) */ |