Mercurial > hg > xemacs-beta
comparison src/redisplay-msw.c @ 867:804517e16990
[xemacs-hg @ 2002-06-05 09:54:39 by ben]
Textual renaming: text/char names
abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, callint.c, casefiddle.c, casetab.c, charset.h, chartab.c, chartab.h, cmds.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-tty.c, console-x.c, console-x.h, console.h, data.c, device-msw.c, device-x.c, dialog-msw.c, dired-msw.c, dired.c, doc.c, doprnt.c, editfns.c, eldap.c, emodules.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-unixoid.c, events.c, events.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, font-lock.c, frame-gtk.c, frame-msw.c, frame-x.c, frame.c, glyphs-eimage.c, glyphs-msw.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gui-x.c, gui-x.h, gui.c, gui.h, hpplay.c, indent.c, insdel.c, insdel.h, intl-win32.c, keymap.c, line-number.c, line-number.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, md5.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-ccl.c, mule-charset.c, mule-coding.c, mule-wnnfns.c, ndir.h, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, postgresql.c, print.c, process-nt.c, process-unix.c, process.c, procimpl.h, realpath.c, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, regex.c, search.c, select-common.h, select-gtk.c, select-x.c, sound.h, symbols.c, syntax.c, syntax.h, sysdep.c, sysdep.h, sysdir.h, sysfile.h, sysproc.h, syspwd.h, systime.h, syswindows.h, termcap.c, tests.c, text.c, text.h, toolbar-common.c, tooltalk.c, ui-gtk.c, unexnt.c, unicode.c, win32.c: Text/char naming rationalization.
[a] distinguish between "charptr" when it refers to operations on
the pointer itself and when it refers to operations on text; and
[b] use consistent naming for everything referring to internal
format, i.e.
Itext == text in internal format
Ibyte == a byte in such text
Ichar == a char as represented in internal character format
thus e.g.
set_charptr_emchar -> set_itext_ichar
The pre and post tags on either side of this change are:
pre-internal-format-textual-renaming
post-internal-format-textual-renaming
See the Internals Manual for details of exactly how this was done,
how to handle the change in your workspace, etc.
author | ben |
---|---|
date | Wed, 05 Jun 2002 09:58:45 +0000 |
parents | 6728e641994e |
children | 79c6ff3eef26 |
comparison
equal
deleted
inserted
replaced
866:613552a02607 | 867:804517e16990 |
---|---|
82 particular charset. Returns the number of runs actually used. | 82 particular charset. Returns the number of runs actually used. |
83 Returns the textual runs (STATICALLY ALLOCATED!) in RUN_STORAGE_PTR. */ | 83 Returns the textual runs (STATICALLY ALLOCATED!) in RUN_STORAGE_PTR. */ |
84 | 84 |
85 static int | 85 static int |
86 separate_textual_runs (textual_run **run_storage_ptr, | 86 separate_textual_runs (textual_run **run_storage_ptr, |
87 const Emchar *str, Charcount len) | 87 const Ichar *str, Charcount len) |
88 { | 88 { |
89 static WCHAR *ext_storage; | 89 static WCHAR *ext_storage; |
90 static int ext_storage_size; /* in WCHARS! */ | 90 static int ext_storage_size; /* in WCHARS! */ |
91 static textual_run *run_storage; | 91 static textual_run *run_storage; |
92 static int run_storage_size; | 92 static int run_storage_size; |
97 Lisp_Object prev_charset; | 97 Lisp_Object prev_charset; |
98 | 98 |
99 if (len == 0) | 99 if (len == 0) |
100 return 0; | 100 return 0; |
101 | 101 |
102 prev_charset = emchar_charset (str[0]); | 102 prev_charset = ichar_charset (str[0]); |
103 | 103 |
104 for (i = 1; i <= len; i++) | 104 for (i = 1; i <= len; i++) |
105 { | 105 { |
106 if (i == len || !EQ (emchar_charset (str[i]), prev_charset)) | 106 if (i == len || !EQ (ichar_charset (str[i]), prev_charset)) |
107 { | 107 { |
108 int j; | 108 int j; |
109 Intbyte *int_storage = | 109 Ibyte *int_storage = |
110 alloca_intbytes (MAX_EMCHAR_LEN * (i - runbegin)); | 110 alloca_ibytes (MAX_ICHAR_LEN * (i - runbegin)); |
111 int int_storage_ptr = 0; | 111 int int_storage_ptr = 0; |
112 Extbyte *alloca_ext_storage; | 112 Extbyte *alloca_ext_storage; |
113 int nchars; | 113 int nchars; |
114 | 114 |
115 int_storage_ptr = 0; | 115 int_storage_ptr = 0; |
116 for (j = runbegin; j < i; j++) | 116 for (j = runbegin; j < i; j++) |
117 int_storage_ptr += | 117 int_storage_ptr += |
118 set_charptr_emchar (int_storage + int_storage_ptr, str[j]); | 118 set_itext_ichar (int_storage + int_storage_ptr, str[j]); |
119 TO_EXTERNAL_FORMAT (DATA, (int_storage, int_storage_ptr), | 119 TO_EXTERNAL_FORMAT (DATA, (int_storage, int_storage_ptr), |
120 ALLOCA, (alloca_ext_storage, nchars), | 120 ALLOCA, (alloca_ext_storage, nchars), |
121 Qmswindows_unicode); | 121 Qmswindows_unicode); |
122 nchars /= sizeof (WCHAR); /* Tricky ... */ | 122 nchars /= sizeof (WCHAR); /* Tricky ... */ |
123 DO_REALLOC (ext_storage, ext_storage_size, total_nchars + nchars, | 123 DO_REALLOC (ext_storage, ext_storage_size, total_nchars + nchars, |
132 run_storage[runs_so_far].nchars = i - runbegin; | 132 run_storage[runs_so_far].nchars = i - runbegin; |
133 total_nchars += nchars; | 133 total_nchars += nchars; |
134 runs_so_far++; | 134 runs_so_far++; |
135 runbegin = i; | 135 runbegin = i; |
136 if (i < len) | 136 if (i < len) |
137 prev_charset = emchar_charset (str[i]); | 137 prev_charset = ichar_charset (str[i]); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 *run_storage_ptr = run_storage; | 141 *run_storage_ptr = run_storage; |
142 return runs_so_far; | 142 return runs_so_far; |
305 Draw a normal or end-of-line cursor. The end-of-line cursor is | 305 Draw a normal or end-of-line cursor. The end-of-line cursor is |
306 narrower than the normal cursor. | 306 narrower than the normal cursor. |
307 ****************************************************************************/ | 307 ****************************************************************************/ |
308 static void | 308 static void |
309 mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, | 309 mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos, |
310 int width, face_index findex, Emchar ch, int image_p) | 310 int width, face_index findex, Ichar ch, int image_p) |
311 { | 311 { |
312 struct frame *f = XFRAME (w->frame); | 312 struct frame *f = XFRAME (w->frame); |
313 struct device *d = XDEVICE (f->device); | 313 struct device *d = XDEVICE (f->device); |
314 Lisp_Object font = Qnil; | 314 Lisp_Object font = Qnil; |
315 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); | 315 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d)); |
423 | 423 |
424 W Window that the text is to be displayed in. | 424 W Window that the text is to be displayed in. |
425 DL Display line that this text is on. The values in the | 425 DL Display line that this text is on. The values in the |
426 structure are used to determine the vertical position and | 426 structure are used to determine the vertical position and |
427 clipping range of the text. | 427 clipping range of the text. |
428 BUF Dynamic array of Emchars specifying what is actually to be | 428 BUF Dynamic array of Ichars specifying what is actually to be |
429 drawn. | 429 drawn. |
430 XPOS X position in pixels where the text should start being drawn. | 430 XPOS X position in pixels where the text should start being drawn. |
431 XOFFSET Number of pixels to be chopped off the left side of the | 431 XOFFSET Number of pixels to be chopped off the left side of the |
432 text. The effect is as if the text were shifted to the | 432 text. The effect is as if the text were shifted to the |
433 left this many pixels and clipped at XPOS. | 433 left this many pixels and clipped at XPOS. |
436 FINDEX Index for the face cache element describing how to display | 436 FINDEX Index for the face cache element describing how to display |
437 the text. | 437 the text. |
438 ****************************************************************************/ | 438 ****************************************************************************/ |
439 static void | 439 static void |
440 mswindows_output_string (struct window *w, struct display_line *dl, | 440 mswindows_output_string (struct window *w, struct display_line *dl, |
441 Emchar_dynarr *buf, int xpos, int xoffset, int clip_start, | 441 Ichar_dynarr *buf, int xpos, int xoffset, int clip_start, |
442 int width, face_index findex, | 442 int width, face_index findex, |
443 int cursor, int cursor_start, int cursor_width, | 443 int cursor, int cursor_start, int cursor_width, |
444 int cursor_height) | 444 int cursor_height) |
445 { | 445 { |
446 struct frame *f = XFRAME (w->frame); | 446 struct frame *f = XFRAME (w->frame); |
1022 int block, int start, int end, | 1022 int block, int start, int end, |
1023 int start_pixpos, int cursor_start, | 1023 int start_pixpos, int cursor_start, |
1024 int cursor_width, int cursor_height) | 1024 int cursor_width, int cursor_height) |
1025 { | 1025 { |
1026 struct frame *f = XFRAME (w->frame); | 1026 struct frame *f = XFRAME (w->frame); |
1027 Emchar_dynarr *buf = Dynarr_new (Emchar); | 1027 Ichar_dynarr *buf = Dynarr_new (Ichar); |
1028 Lisp_Object window; | 1028 Lisp_Object window; |
1029 | 1029 |
1030 struct display_block *db = Dynarr_atp (dl->display_blocks, block); | 1030 struct display_block *db = Dynarr_atp (dl->display_blocks, block); |
1031 rune_dynarr *rba = db->runes; | 1031 rune_dynarr *rba = db->runes; |
1032 struct rune *rb; | 1032 struct rune *rb; |
1045 | 1045 |
1046 findex = rb->findex; | 1046 findex = rb->findex; |
1047 xpos = rb->xpos; | 1047 xpos = rb->xpos; |
1048 width = 0; | 1048 width = 0; |
1049 if (rb->type == RUNE_CHAR) | 1049 if (rb->type == RUNE_CHAR) |
1050 charset = emchar_charset (rb->object.chr.ch); | 1050 charset = ichar_charset (rb->object.chr.ch); |
1051 | 1051 |
1052 if (end < 0) | 1052 if (end < 0) |
1053 end = Dynarr_length (rba); | 1053 end = Dynarr_length (rba); |
1054 Dynarr_reset (buf); | 1054 Dynarr_reset (buf); |
1055 | 1055 |
1057 { | 1057 { |
1058 rb = Dynarr_atp (rba, elt); | 1058 rb = Dynarr_atp (rba, elt); |
1059 | 1059 |
1060 if (rb->findex == findex && rb->type == RUNE_CHAR | 1060 if (rb->findex == findex && rb->type == RUNE_CHAR |
1061 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON | 1061 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON |
1062 && EQ (charset, emchar_charset (rb->object.chr.ch))) | 1062 && EQ (charset, ichar_charset (rb->object.chr.ch))) |
1063 { | 1063 { |
1064 Dynarr_add (buf, rb->object.chr.ch); | 1064 Dynarr_add (buf, rb->object.chr.ch); |
1065 width += rb->width; | 1065 width += rb->width; |
1066 elt++; | 1066 elt++; |
1067 } | 1067 } |
1079 | 1079 |
1080 if (rb->type == RUNE_CHAR) | 1080 if (rb->type == RUNE_CHAR) |
1081 { | 1081 { |
1082 findex = rb->findex; | 1082 findex = rb->findex; |
1083 xpos = rb->xpos; | 1083 xpos = rb->xpos; |
1084 charset = emchar_charset (rb->object.chr.ch); | 1084 charset = ichar_charset (rb->object.chr.ch); |
1085 | 1085 |
1086 if (rb->cursor_type == CURSOR_ON) | 1086 if (rb->cursor_type == CURSOR_ON) |
1087 { | 1087 { |
1088 if (rb->object.chr.ch == '\n') | 1088 if (rb->object.chr.ch == '\n') |
1089 { | 1089 { |
1288 Given a string and a face, return the string's length in pixels when | 1288 Given a string and a face, return the string's length in pixels when |
1289 displayed in the font associated with the face. | 1289 displayed in the font associated with the face. |
1290 ****************************************************************************/ | 1290 ****************************************************************************/ |
1291 static int | 1291 static int |
1292 mswindows_text_width (struct frame *f, struct face_cachel *cachel, | 1292 mswindows_text_width (struct frame *f, struct face_cachel *cachel, |
1293 const Emchar *str, Charcount len) | 1293 const Ichar *str, Charcount len) |
1294 { | 1294 { |
1295 HDC hdc = get_frame_dc (f, 0); | 1295 HDC hdc = get_frame_dc (f, 0); |
1296 int width_so_far = 0; | 1296 int width_so_far = 0; |
1297 textual_run *runs; | 1297 textual_run *runs; |
1298 int nruns; | 1298 int nruns; |