Mercurial > hg > xemacs-beta
comparison src/frame.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 | 42375619fa45 |
children | 79c6ff3eef26 |
comparison
equal
deleted
inserted
replaced
866:613552a02607 | 867:804517e16990 |
---|---|
123 int *char_width, int *char_height, | 123 int *char_width, int *char_height, |
124 int real_face); | 124 int real_face); |
125 static struct display_line title_string_display_line; | 125 static struct display_line title_string_display_line; |
126 /* Used by generate_title_string. Global because they get used so much that | 126 /* Used by generate_title_string. Global because they get used so much that |
127 the dynamic allocation time adds up. */ | 127 the dynamic allocation time adds up. */ |
128 static Emchar_dynarr *title_string_emchar_dynarr; | 128 static Ichar_dynarr *title_string_ichar_dynarr; |
129 | 129 |
130 | 130 |
131 static Lisp_Object | 131 static Lisp_Object |
132 mark_frame (Lisp_Object obj) | 132 mark_frame (Lisp_Object obj) |
133 { | 133 { |
232 Lisp_Object buf; | 232 Lisp_Object buf; |
233 | 233 |
234 buf = Fcurrent_buffer (); | 234 buf = Fcurrent_buffer (); |
235 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | 235 /* If buf is a 'hidden' buffer (i.e. one whose name starts with |
236 a space), try to find another one. */ | 236 a space), try to find another one. */ |
237 if (string_emchar (Fbuffer_name (buf), 0) == ' ') | 237 if (string_ichar (Fbuffer_name (buf), 0) == ' ') |
238 buf = Fother_buffer (buf, Qnil, Qnil); | 238 buf = Fother_buffer (buf, Qnil, Qnil); |
239 Fset_window_buffer (root_window, buf, Qnil); | 239 Fset_window_buffer (root_window, buf, Qnil); |
240 } | 240 } |
241 | 241 |
242 return f; | 242 return f; |
409 else if (STRINGP (Vdefault_frame_name)) | 409 else if (STRINGP (Vdefault_frame_name)) |
410 name = Vdefault_frame_name; | 410 name = Vdefault_frame_name; |
411 else | 411 else |
412 name = build_string ("emacs"); | 412 name = build_string ("emacs"); |
413 | 413 |
414 if (!NILP (Fstring_match (make_string ((const Intbyte *) "\\.", 2), name, | 414 if (!NILP (Fstring_match (make_string ((const Ibyte *) "\\.", 2), name, |
415 Qnil, Qnil))) | 415 Qnil, Qnil))) |
416 syntax_error (". not allowed in frame names", name); | 416 syntax_error (". not allowed in frame names", name); |
417 | 417 |
418 f = allocate_frame_core (device); | 418 f = allocate_frame_core (device); |
419 frame = wrap_frame (f); | 419 frame = wrap_frame (f); |
3215 change_frame_size_1 (f, newheight, newwidth); | 3215 change_frame_size_1 (f, newheight, newwidth); |
3216 } | 3216 } |
3217 | 3217 |
3218 | 3218 |
3219 /* The caller is responsible for freeing the returned string. */ | 3219 /* The caller is responsible for freeing the returned string. */ |
3220 static Intbyte * | 3220 static Ibyte * |
3221 generate_title_string (struct window *w, Lisp_Object format_str, | 3221 generate_title_string (struct window *w, Lisp_Object format_str, |
3222 face_index findex, int type) | 3222 face_index findex, int type) |
3223 { | 3223 { |
3224 struct display_line *dl; | 3224 struct display_line *dl; |
3225 struct display_block *db; | 3225 struct display_block *db; |
3230 Dynarr_reset (db->runes); | 3230 Dynarr_reset (db->runes); |
3231 | 3231 |
3232 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0, | 3232 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0, |
3233 -1, type); | 3233 -1, type); |
3234 | 3234 |
3235 Dynarr_reset (title_string_emchar_dynarr); | 3235 Dynarr_reset (title_string_ichar_dynarr); |
3236 while (elt < Dynarr_length (db->runes)) | 3236 while (elt < Dynarr_length (db->runes)) |
3237 { | 3237 { |
3238 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) | 3238 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) |
3239 Dynarr_add (title_string_emchar_dynarr, | 3239 Dynarr_add (title_string_ichar_dynarr, |
3240 Dynarr_atp (db->runes, elt)->object.chr.ch); | 3240 Dynarr_atp (db->runes, elt)->object.chr.ch); |
3241 elt++; | 3241 elt++; |
3242 } | 3242 } |
3243 | 3243 |
3244 return | 3244 return |
3245 convert_emchar_string_into_malloced_string | 3245 convert_ichar_string_into_malloced_string |
3246 (Dynarr_atp (title_string_emchar_dynarr, 0), | 3246 (Dynarr_atp (title_string_ichar_dynarr, 0), |
3247 Dynarr_length (title_string_emchar_dynarr), 0); | 3247 Dynarr_length (title_string_ichar_dynarr), 0); |
3248 } | 3248 } |
3249 | 3249 |
3250 void | 3250 void |
3251 update_frame_title (struct frame *f) | 3251 update_frame_title (struct frame *f) |
3252 { | 3252 { |
3253 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); | 3253 struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); |
3254 Lisp_Object title_format; | 3254 Lisp_Object title_format; |
3255 Lisp_Object icon_format; | 3255 Lisp_Object icon_format; |
3256 Intbyte *title; | 3256 Ibyte *title; |
3257 | 3257 |
3258 /* We don't change the title for the minibuffer unless the frame | 3258 /* We don't change the title for the minibuffer unless the frame |
3259 only has a minibuffer. */ | 3259 only has a minibuffer. */ |
3260 if (MINI_WINDOW_P (w) && !FRAME_MINIBUF_ONLY_P (f)) | 3260 if (MINI_WINDOW_P (w) && !FRAME_MINIBUF_ONLY_P (f)) |
3261 return; | 3261 return; |
3266 | 3266 |
3267 title = NULL; | 3267 title = NULL; |
3268 title_format = symbol_value_in_buffer (Qframe_title_format, w->buffer); | 3268 title_format = symbol_value_in_buffer (Qframe_title_format, w->buffer); |
3269 icon_format = symbol_value_in_buffer (Qframe_icon_title_format, w->buffer); | 3269 icon_format = symbol_value_in_buffer (Qframe_icon_title_format, w->buffer); |
3270 | 3270 |
3271 if (HAS_FRAMEMETH_P (f, set_title_from_intbyte)) | 3271 if (HAS_FRAMEMETH_P (f, set_title_from_ibyte)) |
3272 { | 3272 { |
3273 title = generate_title_string (w, title_format, | 3273 title = generate_title_string (w, title_format, |
3274 DEFAULT_INDEX, CURRENT_DISP); | 3274 DEFAULT_INDEX, CURRENT_DISP); |
3275 FRAMEMETH (f, set_title_from_intbyte, (f, title)); | 3275 FRAMEMETH (f, set_title_from_ibyte, (f, title)); |
3276 } | 3276 } |
3277 | 3277 |
3278 if (HAS_FRAMEMETH_P (f, set_icon_name_from_intbyte)) | 3278 if (HAS_FRAMEMETH_P (f, set_icon_name_from_ibyte)) |
3279 { | 3279 { |
3280 if (!EQ (icon_format, title_format) || !title) | 3280 if (!EQ (icon_format, title_format) || !title) |
3281 { | 3281 { |
3282 if (title) | 3282 if (title) |
3283 xfree (title); | 3283 xfree (title); |
3284 | 3284 |
3285 title = generate_title_string (w, icon_format, | 3285 title = generate_title_string (w, icon_format, |
3286 DEFAULT_INDEX, CURRENT_DISP); | 3286 DEFAULT_INDEX, CURRENT_DISP); |
3287 } | 3287 } |
3288 FRAMEMETH (f, set_icon_name_from_intbyte, (f, title)); | 3288 FRAMEMETH (f, set_icon_name_from_ibyte, (f, title)); |
3289 } | 3289 } |
3290 | 3290 |
3291 if (title) | 3291 if (title) |
3292 xfree (title); | 3292 xfree (title); |
3293 } | 3293 } |
3353 { | 3353 { |
3354 #ifndef PDUMP | 3354 #ifndef PDUMP |
3355 if (!initialized) | 3355 if (!initialized) |
3356 #endif | 3356 #endif |
3357 { | 3357 { |
3358 title_string_emchar_dynarr = Dynarr_new (Emchar); | 3358 title_string_ichar_dynarr = Dynarr_new (Ichar); |
3359 xzero (title_string_display_line); | 3359 xzero (title_string_display_line); |
3360 } | 3360 } |
3361 } | 3361 } |
3362 | 3362 |
3363 void | 3363 void |