comparison src/redisplay-gtk.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 e7ee5f8bde58
children 79c6ff3eef26
comparison
equal deleted inserted replaced
866:613552a02607 867:804517e16990
112 Returns the number of runs actually used. */ 112 Returns the number of runs actually used. */
113 113
114 static int 114 static int
115 separate_textual_runs (unsigned char *text_storage, 115 separate_textual_runs (unsigned char *text_storage,
116 struct textual_run *run_storage, 116 struct textual_run *run_storage,
117 CONST Emchar *str, Charcount len) 117 CONST Ichar *str, Charcount len)
118 { 118 {
119 Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a 119 Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
120 possible valid charset when 120 possible valid charset when
121 MULE is not defined */ 121 MULE is not defined */
122 int runs_so_far = 0; 122 int runs_so_far = 0;
126 int need_ccl_conversion = 0; 126 int need_ccl_conversion = 0;
127 #endif 127 #endif
128 128
129 for (i = 0; i < len; i++) 129 for (i = 0; i < len; i++)
130 { 130 {
131 Emchar ch = str[i]; 131 Ichar ch = str[i];
132 Lisp_Object charset; 132 Lisp_Object charset;
133 int byte1, byte2; 133 int byte1, byte2;
134 int dimension; 134 int dimension;
135 int graphic; 135 int graphic;
136 136
137 BREAKUP_EMCHAR (ch, charset, byte1, byte2); 137 BREAKUP_ICHAR (ch, charset, byte1, byte2);
138 dimension = XCHARSET_DIMENSION (charset); 138 dimension = XCHARSET_DIMENSION (charset);
139 graphic = XCHARSET_GRAPHIC (charset); 139 graphic = XCHARSET_GRAPHIC (charset);
140 140
141 if (!EQ (charset, prev_charset)) 141 if (!EQ (charset, prev_charset))
142 { 142 {
238 Given a string and a face, return the string's length in pixels when 238 Given a string and a face, return the string's length in pixels when
239 displayed in the font associated with the face. 239 displayed in the font associated with the face.
240 */ 240 */
241 241
242 static int 242 static int
243 gtk_text_width (struct frame *f, struct face_cachel *cachel, CONST Emchar *str, 243 gtk_text_width (struct frame *f, struct face_cachel *cachel, CONST Ichar *str,
244 Charcount len) 244 Charcount len)
245 { 245 {
246 int width_so_far = 0; 246 int width_so_far = 0;
247 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); 247 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
248 struct textual_run *runs = alloca_array (struct textual_run, len); 248 struct textual_run *runs = alloca_array (struct textual_run, len);
294 gtk_output_display_block (struct window *w, struct display_line *dl, int block, 294 gtk_output_display_block (struct window *w, struct display_line *dl, int block,
295 int start, int end, int start_pixpos, int cursor_start, 295 int start, int end, int start_pixpos, int cursor_start,
296 int cursor_width, int cursor_height) 296 int cursor_width, int cursor_height)
297 { 297 {
298 struct frame *f = XFRAME (w->frame); 298 struct frame *f = XFRAME (w->frame);
299 Emchar_dynarr *buf = Dynarr_new (Emchar); 299 Ichar_dynarr *buf = Dynarr_new (Ichar);
300 Lisp_Object window; 300 Lisp_Object window;
301 301
302 struct display_block *db = Dynarr_atp (dl->display_blocks, block); 302 struct display_block *db = Dynarr_atp (dl->display_blocks, block);
303 rune_dynarr *rba = db->runes; 303 rune_dynarr *rba = db->runes;
304 struct rune *rb; 304 struct rune *rb;
321 { 321 {
322 findex = rb->findex; 322 findex = rb->findex;
323 xpos = rb->xpos; 323 xpos = rb->xpos;
324 width = 0; 324 width = 0;
325 if (rb->type == RUNE_CHAR) 325 if (rb->type == RUNE_CHAR)
326 charset = emchar_charset (rb->object.chr.ch); 326 charset = ichar_charset (rb->object.chr.ch);
327 } 327 }
328 328
329 if (end < 0) 329 if (end < 0)
330 end = Dynarr_length (rba); 330 end = Dynarr_length (rba);
331 Dynarr_reset (buf); 331 Dynarr_reset (buf);
334 { 334 {
335 rb = Dynarr_atp (rba, elt); 335 rb = Dynarr_atp (rba, elt);
336 336
337 if (rb->findex == findex && rb->type == RUNE_CHAR 337 if (rb->findex == findex && rb->type == RUNE_CHAR
338 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON 338 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
339 && EQ (charset, emchar_charset (rb->object.chr.ch))) 339 && EQ (charset, ichar_charset (rb->object.chr.ch)))
340 { 340 {
341 Dynarr_add (buf, rb->object.chr.ch); 341 Dynarr_add (buf, rb->object.chr.ch);
342 width += rb->width; 342 width += rb->width;
343 elt++; 343 elt++;
344 } 344 }
357 357
358 if (rb->type == RUNE_CHAR) 358 if (rb->type == RUNE_CHAR)
359 { 359 {
360 findex = rb->findex; 360 findex = rb->findex;
361 xpos = rb->xpos; 361 xpos = rb->xpos;
362 charset = emchar_charset (rb->object.chr.ch); 362 charset = ichar_charset (rb->object.chr.ch);
363 363
364 if (rb->cursor_type == CURSOR_ON) 364 if (rb->cursor_type == CURSOR_ON)
365 { 365 {
366 if (rb->object.chr.ch == '\n') 366 if (rb->object.chr.ch == '\n')
367 { 367 {
438 { 438 {
439 /* #### This is way losing. See the comment in 439 /* #### This is way losing. See the comment in
440 add_glyph_rune(). */ 440 add_glyph_rune(). */
441 Lisp_Object string = 441 Lisp_Object string =
442 XIMAGE_INSTANCE_TEXT_STRING (instance); 442 XIMAGE_INSTANCE_TEXT_STRING (instance);
443 convert_intbyte_string_into_emchar_dynarr 443 convert_ibyte_string_into_ichar_dynarr
444 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); 444 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
445 445
446 gtk_output_string (w, dl, buf, xpos, 446 gtk_output_string (w, dl, buf, xpos,
447 rb->object.dglyph.xoffset, 447 rb->object.dglyph.xoffset,
448 start_pixpos, -1, findex, 448 start_pixpos, -1, findex,
626 626
627 W Window that the text is to be displayed in. 627 W Window that the text is to be displayed in.
628 DL Display line that this text is on. The values in the 628 DL Display line that this text is on. The values in the
629 structure are used to determine the vertical position and 629 structure are used to determine the vertical position and
630 clipping range of the text. 630 clipping range of the text.
631 BUF Dynamic array of Emchars specifying what is actually to be 631 BUF Dynamic array of Ichars specifying what is actually to be
632 drawn. 632 drawn.
633 XPOS X position in pixels where the text should start being drawn. 633 XPOS X position in pixels where the text should start being drawn.
634 XOFFSET Number of pixels to be chopped off the left side of the 634 XOFFSET Number of pixels to be chopped off the left side of the
635 text. The effect is as if the text were shifted to the 635 text. The effect is as if the text were shifted to the
636 left this many pixels and clipped at XPOS. 636 left this many pixels and clipped at XPOS.
657 const gchar *text, 657 const gchar *text,
658 gint text_length); 658 gint text_length);
659 659
660 void 660 void
661 gtk_output_string (struct window *w, struct display_line *dl, 661 gtk_output_string (struct window *w, struct display_line *dl,
662 Emchar_dynarr *buf, int xpos, int xoffset, int clip_start, 662 Ichar_dynarr *buf, int xpos, int xoffset, int clip_start,
663 int width, face_index findex, int cursor, 663 int width, face_index findex, int cursor,
664 int cursor_start, int cursor_width, int cursor_height) 664 int cursor_start, int cursor_width, int cursor_height)
665 { 665 {
666 /* General variables */ 666 /* General variables */
667 struct frame *f = XFRAME (w->frame); 667 struct frame *f = XFRAME (w->frame);