"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "charproc.c" between
xterm-366.tgz and xterm-367.tgz

About: xterm is a terminal emulator for X with ISO/ANSI color and vt220 enhancements.

charproc.c  (xterm-366.tgz):charproc.c  (xterm-367.tgz)
/* $XTermId: charproc.c,v 1.1825 2021/02/10 00:49:52 tom Exp $ */ /* $XTermId: charproc.c,v 1.1830 2021/03/21 22:45:24 tom Exp $ */
/* /*
* Copyright 1999-2020,2021 by Thomas E. Dickey * Copyright 1999-2020,2021 by Thomas E. Dickey
* *
* All Rights Reserved * All Rights Reserved
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including * "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish, * without limitation the rights to use, copy, modify, merge, publish,
skipping to change at line 86 skipping to change at line 86
* SOFTWARE. * SOFTWARE.
*/ */
/* charproc.c */ /* charproc.c */
#include <version.h> #include <version.h>
#include <xterm.h> #include <xterm.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/Xmu/Atoms.h> #include <X11/Xmu/Atoms.h>
#include <X11/Xmu/CharSet.h> #include <X11/Xmu/CharSet.h>
#include <X11/Xmu/Converters.h> #include <X11/Xmu/Converters.h>
#if OPT_INPUT_METHOD #if OPT_INPUT_METHOD
#if defined(HAVE_LIB_XAW) #if defined(HAVE_LIB_XAW)
#include <X11/Xaw/XawImP.h> #include <X11/Xaw/XawImP.h>
#elif defined(HAVE_LIB_XAW3D) #elif defined(HAVE_LIB_XAW3D)
#include <X11/Xaw3d/XawImP.h> #include <X11/Xaw3d/XawImP.h>
skipping to change at line 484 skipping to change at line 483
Bres(XtNmarginBell, XtCMarginBell, screen.marginbell, False), Bres(XtNmarginBell, XtCMarginBell, screen.marginbell, False),
Bres(XtNmetaSendsEscape, XtCMetaSendsEscape, screen.meta_sends_esc, DEF_META _SENDS_ESC), Bres(XtNmetaSendsEscape, XtCMetaSendsEscape, screen.meta_sends_esc, DEF_META _SENDS_ESC),
Bres(XtNmultiScroll, XtCMultiScroll, screen.multiscroll, False), Bres(XtNmultiScroll, XtCMultiScroll, screen.multiscroll, False),
Bres(XtNoldXtermFKeys, XtCOldXtermFKeys, screen.old_fkeys, False), Bres(XtNoldXtermFKeys, XtCOldXtermFKeys, screen.old_fkeys, False),
Bres(XtNpopOnBell, XtCPopOnBell, screen.poponbell, False), Bres(XtNpopOnBell, XtCPopOnBell, screen.poponbell, False),
Bres(XtNprinterAutoClose, XtCPrinterAutoClose, SPS.printer_autoclose, False) , Bres(XtNprinterAutoClose, XtCPrinterAutoClose, SPS.printer_autoclose, False) ,
Bres(XtNprinterExtent, XtCPrinterExtent, SPS.printer_extent, False), Bres(XtNprinterExtent, XtCPrinterExtent, SPS.printer_extent, False),
Bres(XtNprinterFormFeed, XtCPrinterFormFeed, SPS.printer_formfeed, False), Bres(XtNprinterFormFeed, XtCPrinterFormFeed, SPS.printer_formfeed, False),
Bres(XtNprinterNewLine, XtCPrinterNewLine, SPS.printer_newline, True), Bres(XtNprinterNewLine, XtCPrinterNewLine, SPS.printer_newline, True),
Bres(XtNquietGrab, XtCQuietGrab, screen.quiet_grab, False), Bres(XtNquietGrab, XtCQuietGrab, screen.quiet_grab, False),
Bres(XtNresizeByPixel, XtCResizeByPixel, misc.resizeByPixel, False),
Bres(XtNreverseVideo, XtCReverseVideo, misc.re_verse, False), Bres(XtNreverseVideo, XtCReverseVideo, misc.re_verse, False),
Bres(XtNreverseWrap, XtCReverseWrap, misc.reverseWrap, False), Bres(XtNreverseWrap, XtCReverseWrap, misc.reverseWrap, False),
Bres(XtNscrollBar, XtCScrollBar, misc.scrollbar, False), Bres(XtNscrollBar, XtCScrollBar, misc.scrollbar, False),
Bres(XtNscrollKey, XtCScrollCond, screen.scrollkey, False), Bres(XtNscrollKey, XtCScrollCond, screen.scrollkey, False),
Bres(XtNscrollTtyOutput, XtCScrollCond, screen.scrollttyoutput, True), Bres(XtNscrollTtyOutput, XtCScrollCond, screen.scrollttyoutput, True),
Bres(XtNselectToClipboard, XtCSelectToClipboard, Bres(XtNselectToClipboard, XtCSelectToClipboard,
screen.selectToClipboard, False), screen.selectToClipboard, False),
Bres(XtNsignalInhibit, XtCSignalInhibit, misc.signalInhibit, False), Bres(XtNsignalInhibit, XtCSignalInhibit, misc.signalInhibit, False),
Bres(XtNtiteInhibit, XtCTiteInhibit, misc.titeInhibit, False), Bres(XtNtiteInhibit, XtCTiteInhibit, misc.titeInhibit, False),
Bres(XtNtiXtraScroll, XtCTiXtraScroll, misc.tiXtraScroll, False), Bres(XtNtiXtraScroll, XtCTiXtraScroll, misc.tiXtraScroll, False),
skipping to change at line 2834 skipping to change at line 2834
case CASE_ESC_IGNORE: case CASE_ESC_IGNORE:
/* unknown escape sequence */ /* unknown escape sequence */
sp->parsestate = eigtable; sp->parsestate = eigtable;
break; break;
case CASE_ESC_DIGIT: case CASE_ESC_DIGIT:
/* digit in csi or dec mode */ /* digit in csi or dec mode */
if (nparam > 0) { if (nparam > 0) {
value = zero_if_default(nparam - 1); value = zero_if_default(nparam - 1);
SetParam(nparam - 1, (10 * value) + ((int) c - '0')); SetParam(nparam - 1, (10 * value) + ((int) c - '0'));
if (GetParam(nparam - 1) > 65535) if (GetParam(nparam - 1) > MAX_I_PARAM)
SetParam(nparam - 1, 65535); SetParam(nparam - 1, MAX_I_PARAM);
if (sp->parsestate == csi_table) if (sp->parsestate == csi_table)
sp->parsestate = csi2_table; sp->parsestate = csi2_table;
} }
break; break;
case CASE_ESC_SEMI: case CASE_ESC_SEMI:
/* semicolon in csi or dec mode */ /* semicolon in csi or dec mode */
if (nparam < NPARAM) { if (nparam < NPARAM) {
parms.is_sub[nparam] = 0; parms.is_sub[nparam] = 0;
SetParam(nparam++, DEFAULT); SetParam(nparam++, DEFAULT);
skipping to change at line 8191 skipping to change at line 8191
static void static void
VTResize(Widget w) VTResize(Widget w)
{ {
if (XtIsRealized(w)) { if (XtIsRealized(w)) {
XtermWidget xw = (XtermWidget) w; XtermWidget xw = (XtermWidget) w;
ScreenResize(xw, xw->core.width, xw->core.height, &xw->flags); ScreenResize(xw, xw->core.width, xw->core.height, &xw->flags);
} }
} }
#define okDimension(src,dst) ((src <= 32767) \ #define okDimension(src,dst) ((src <= MAX_U_COORD) \
&& ((dst = (Dimension) src) == src)) && ((dst = (Dimension) src) == src))
static void static void
RequestResize(XtermWidget xw, int rows, int cols, Bool text) RequestResize(XtermWidget xw, int rows, int cols, Bool text)
{ {
TScreen *screen = TScreenOf(xw); TScreen *screen = TScreenOf(xw);
Dimension replyWidth, replyHeight; Dimension replyWidth, replyHeight;
Dimension askedWidth, askedHeight; Dimension askedWidth, askedHeight;
XtGeometryResult status; XtGeometryResult status;
XWindowAttributes attrs; XWindowAttributes attrs;
skipping to change at line 9506 skipping to change at line 9506
screen->allowWindowOps = screen->allowWindowOp0; screen->allowWindowOps = screen->allowWindowOp0;
#if OPT_SCROLL_LOCK #if OPT_SCROLL_LOCK
screen->allowScrollLock = screen->allowScrollLock0; screen->allowScrollLock = screen->allowScrollLock0;
#endif #endif
init_Bres(screen.quiet_grab); init_Bres(screen.quiet_grab);
#ifndef NO_ACTIVE_ICON #ifndef NO_ACTIVE_ICON
init_Sres(screen.icon_fontname); init_Sres(screen.icon_fontname);
getIconicFont(screen)->fs = XLoadQueryFont(screen->display, getIconicFont(screen)->fs = xtermLoadQueryFont(wnew,
screen->icon_fontname); screen->icon_fontname);
TRACE(("iconFont '%s' %sloaded successfully\n", TRACE(("iconFont '%s' %sloaded successfully\n",
screen->icon_fontname, screen->icon_fontname,
getIconicFont(screen)->fs ? "" : "NOT ")); getIconicFont(screen)->fs ? "" : "NOT "));
init_Sres(misc.active_icon_s); init_Sres(misc.active_icon_s);
wnew->work.active_icon = wnew->work.active_icon =
(Boolean) extendedBoolean(wnew->misc.active_icon_s, (Boolean) extendedBoolean(wnew->misc.active_icon_s,
tblAIconOps, eiLAST); tblAIconOps, eiLAST);
init_Ires(misc.icon_border_width); init_Ires(misc.icon_border_width);
wnew->misc.icon_border_pixel = request->misc.icon_border_pixel; wnew->misc.icon_border_pixel = request->misc.icon_border_pixel;
#endif /* NO_ACTIVE_ICON */ #endif /* NO_ACTIVE_ICON */
init_Bres(misc.signalInhibit); init_Bres(misc.signalInhibit);
init_Bres(misc.titeInhibit); init_Bres(misc.titeInhibit);
init_Bres(misc.tiXtraScroll); init_Bres(misc.tiXtraScroll);
init_Bres(misc.cdXtraScroll); init_Bres(misc.cdXtraScroll);
init_Bres(misc.color_inner_border); init_Bres(misc.color_inner_border);
init_Bres(misc.dynamicColors); init_Bres(misc.dynamicColors);
init_Bres(misc.resizeByPixel);
#if OPT_DEC_CHRSET #if OPT_DEC_CHRSET
for (i = 0; i < NUM_CHRSET; i++) { for (i = 0; i < NUM_CHRSET; i++) {
screen->double_fonts[i].warn = fwResource; screen->double_fonts[i].warn = fwResource;
} }
#endif #endif
for (i = fontMenu_font1; i <= fontMenu_lastBuiltin; i++) { for (i = fontMenu_font1; i <= fontMenu_lastBuiltin; i++) {
init_Sres2(screen.MenuFontName, i); init_Sres2(screen.MenuFontName, i);
} }
for (i = 0; i < fMAX; i++) { for (i = 0; i < fMAX; i++) {
skipping to change at line 10848 skipping to change at line 10849
filler, filler,
xw->misc.re_verse ? "reverse" : "normal")); xw->misc.re_verse ? "reverse" : "normal"));
setCgsFore(xw, win, gcFiller, filler); setCgsFore(xw, win, gcFiller, filler);
setCgsBack(xw, win, gcFiller, filler); setCgsBack(xw, win, gcFiller, filler);
win->filler_gc = getCgsGC(xw, win, gcFiller); win->filler_gc = getCgsGC(xw, win, gcFiller);
} }
#endif #endif
} }
/* adapted from <X11/cursorfont.h> */
static int
LookupCursorShape(const char *name)
{
#define DATA(name) { XC_##name, #name }
static struct {
int code;
const char name[25];
} table[] = {
DATA(X_cursor),
DATA(arrow),
DATA(based_arrow_down),
DATA(based_arrow_up),
DATA(boat),
DATA(bogosity),
DATA(bottom_left_corner),
DATA(bottom_right_corner),
DATA(bottom_side),
DATA(bottom_tee),
DATA(box_spiral),
DATA(center_ptr),
DATA(circle),
DATA(clock),
DATA(coffee_mug),
DATA(cross),
DATA(cross_reverse),
DATA(crosshair),
DATA(diamond_cross),
DATA(dot),
DATA(dotbox),
DATA(double_arrow),
DATA(draft_large),
DATA(draft_small),
DATA(draped_box),
DATA(exchange),
DATA(fleur),
DATA(gobbler),
DATA(gumby),
DATA(hand1),
DATA(hand2),
DATA(heart),
DATA(icon),
DATA(iron_cross),
DATA(left_ptr),
DATA(left_side),
DATA(left_tee),
DATA(leftbutton),
DATA(ll_angle),
DATA(lr_angle),
DATA(man),
DATA(middlebutton),
DATA(mouse),
DATA(pencil),
DATA(pirate),
DATA(plus),
DATA(question_arrow),
DATA(right_ptr),
DATA(right_side),
DATA(right_tee),
DATA(rightbutton),
DATA(rtl_logo),
DATA(sailboat),
DATA(sb_down_arrow),
DATA(sb_h_double_arrow),
DATA(sb_left_arrow),
DATA(sb_right_arrow),
DATA(sb_up_arrow),
DATA(sb_v_double_arrow),
DATA(shuttle),
DATA(sizing),
DATA(spider),
DATA(spraycan),
DATA(star),
DATA(target),
DATA(tcross),
DATA(top_left_arrow),
DATA(top_left_corner),
DATA(top_right_corner),
DATA(top_side),
DATA(top_tee),
DATA(trek),
DATA(ul_angle),
DATA(umbrella),
DATA(ur_angle),
DATA(watch),
DATA(xterm),
};
#undef DATA
Cardinal j;
int result = -1;
if (!IsEmpty(name)) {
for (j = 0; j < XtNumber(table); ++j) {
if (!strcmp(name, table[j].name)) {
result = table[j].code;
break;
}
}
}
return result;
}
#if USE_DOUBLE_BUFFER #if USE_DOUBLE_BUFFER
static Boolean static Boolean
allocateDbe(XtermWidget xw, VTwin *target) allocateDbe(XtermWidget xw, VTwin *target)
{ {
TScreen *screen = TScreenOf(xw); TScreen *screen = TScreenOf(xw);
Boolean result = False; Boolean result = False;
target->drawable = target->window; target->drawable = target->window;
if (resource.buffered) { if (resource.buffered) {
skipping to change at line 11043 skipping to change at line 10942
SetVTFont(xw, screen->menu_font_number, True, NULL); SetVTFont(xw, screen->menu_font_number, True, NULL);
/* we will not be able to switch to ISO-8859-1 */ /* we will not be able to switch to ISO-8859-1 */
if (!screen->mergedVTFonts) { if (!screen->mergedVTFonts) {
screen->utf8_fonts = uAlways; screen->utf8_fonts = uAlways;
update_font_utf8_fonts(); update_font_utf8_fonts();
} }
} }
} }
#endif #endif
/* making cursor */ xtermSetupPointer(xw, screen->pointer_shape);
if (screen->pointer_cursor == None) {
unsigned shape = XC_xterm;
int other = LookupCursorShape(screen->pointer_shape);
TRACE(("looked up shape index %d from shape name \"%s\"\n", other,
NonNull(screen->pointer_shape)));
if (other >= 0)
shape = (unsigned) other;
TRACE(("creating text pointer cursor from shape %d\n", shape));
screen->pointer_cursor =
make_colored_cursor(shape,
T_COLOR(screen, MOUSE_FG),
T_COLOR(screen, MOUSE_BG));
} else {
TRACE(("recoloring existing text pointer cursor\n"));
recolor_cursor(screen,
screen->pointer_cursor,
T_COLOR(screen, MOUSE_FG),
T_COLOR(screen, MOUSE_BG));
}
/* set defaults */ /* set defaults */
pos.x = 1; pos.x = 1;
pos.y = 1; pos.y = 1;
pos.w = 80; pos.w = 80;
pos.h = 24; pos.h = 24;
TRACE(("parsing geo_metry %s\n", NonNull(xw->misc.geo_metry))); TRACE(("parsing geo_metry %s\n", NonNull(xw->misc.geo_metry)));
pr = XParseXineramaGeometry(screen->display, xw->misc.geo_metry, &pos); pr = XParseXineramaGeometry(screen->display, xw->misc.geo_metry, &pos);
TRACE(("... position %d,%d size %dx%d\n", pos.y, pos.x, pos.h, pos.w)); TRACE(("... position %d,%d size %dx%d\n", pos.y, pos.x, pos.h, pos.w));
skipping to change at line 11213 skipping to change at line 11091
#ifndef NO_ACTIVE_ICON #ifndef NO_ACTIVE_ICON
/* /*
* Normally, the font-number for icon fonts does not correspond with any of * Normally, the font-number for icon fonts does not correspond with any of
* the menu-selectable fonts. If we cannot load the font given for the * the menu-selectable fonts. If we cannot load the font given for the
* iconFont resource, try with font1 aka "Unreadable". * iconFont resource, try with font1 aka "Unreadable".
*/ */
screen->icon_fontnum = -1; screen->icon_fontnum = -1;
if (getIconicFont(screen)->fs == 0) { if (getIconicFont(screen)->fs == 0) {
getIconicFont(screen)->fs = getIconicFont(screen)->fs =
XLoadQueryFont(screen->display, xtermLoadQueryFont(xw, screen->MenuFontName(fontMenu_font1));
screen->MenuFontName(fontMenu_font1));
ReportIcons(("%susing font1 '%s' as iconFont\n", ReportIcons(("%susing font1 '%s' as iconFont\n",
(getIconicFont(screen)->fs (getIconicFont(screen)->fs
? "" ? ""
: "NOT "), : "NOT "),
screen->MenuFontName(fontMenu_font1))); screen->MenuFontName(fontMenu_font1)));
} }
#if OPT_RENDERFONT #if OPT_RENDERFONT
/* /*
* If we still have no result from iconFont resource (perhaps because fonts * If we still have no result from iconFont resource (perhaps because fonts
* are missing) but are using Xft, try to use that instead. We prefer * are missing) but are using Xft, try to use that instead. We prefer
 End of changes. 10 change blocks. 
133 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)