1
/* $XTermId: os2main.c,v 1.265 2010/06/20 21:27:07 tom Exp $ */
1
/* $XTermId: os2main.c,v 1.269 2011/04/23 00:02:03 tom Exp $ */
3
3
/* removed all foreign stuff to get the code more clear (hv)
4
4
* and did some rewrite for the obscure OS/2 environment
263
263
static XtResource application_resources[] =
265
Sres("name", "Name", xterm_name, DFT_TERMTYPE),
266
265
Sres("iconGeometry", "IconGeometry", icon_geometry, NULL),
267
266
Sres(XtNtitle, XtCTitle, title, NULL),
268
267
Sres(XtNiconName, XtCIconName, icon_name, NULL),
274
273
Bres("messages", "Messages", messages, True),
275
274
Ires("minBufSize", "MinBufSize", minBufSize, 4096),
276
275
Ires("maxBufSize", "MaxBufSize", maxBufSize, 32768),
277
Sres("menuLocale", "MenuLocale", menuLocale, ""),
276
Sres("menuLocale", "MenuLocale", menuLocale, DEF_MENU_LOCALE),
277
Sres("omitTranslation", "OmitTranslation", omitTranslation, NULL),
278
278
Sres("keyboardType", "KeyboardType", keyboardType, "unknown"),
279
#if OPT_PRINT_ON_EXIT
280
Ires("printModeOnXError", "PrintModeOnXError", printModeOnXError, 0),
281
Sres("printFileOnXError", "PrintFileOnXError", printFileOnXError, NULL),
279
283
#if OPT_SUNPC_KBD
280
284
Bres("sunKeyboard", "SunKeyboard", sunKeyboard, False),
317
321
Bres(XtNmaximized, XtCMaximized, maximized, False),
322
Sres(XtNfullscreen, XtCFullscreen, fullscreen_s, "off"),
321
326
static String fallback_resources[] =
323
331
"*SimpleMenu*menuLabel.vertSpace: 100",
324
332
"*SimpleMenu*HorizontalMargins: 16",
325
333
"*SimpleMenu*Sme.height: 16",
512
520
{"-maximized", "*maximized", XrmoptionNoArg, (XPointer) "on"},
513
521
{"+maximized", "*maximized", XrmoptionNoArg, (XPointer) "off"},
522
{"-fullscreen", "*fullscreen", XrmoptionNoArg, (XPointer) "on"},
523
{"+fullscreen", "*fullscreen", XrmoptionNoArg, (XPointer) "off"},
515
525
/* options that we process ourselves */
516
526
{"-help", NULL, XrmoptionSkipNArgs, (XPointer) NULL},
743
753
#if defined(_PC_VDISABLE)
744
754
if (value == -1) {
745
value = fpathconf(0, _PC_VDISABLE);
755
value = (int) fpathconf(0, _PC_VDISABLE);
746
756
if (value == -1) {
748
758
break; /* skip this (error) */
764
774
} else if (termcap && (*string == '\\')) {
766
int temp = strtol(string + 1, &d, 8);
776
int temp = (int) strtol(string + 1, &d, 8);
767
777
if (temp > 0 && d != string) {
966
977
} else if (abbrev(argv[n], "-help", unique)) {
968
} else if (abbrev(argv[n], "-class", 3)) {
979
} else if (abbrev(argv[n], "-class", (size_t) 3)) {
969
980
if ((my_class = argv[++n]) == 0) {
977
if (abbrev(argv[n], "-reverse", 2)
978
|| !strcmp("-rv", argv[n])) {
980
} else if (!strcmp("+rv", argv[n])) {
1050
1053
application_resources,
1051
1054
XtNumber(application_resources), NULL, 0);
1057
resource.fullscreen = extendedBoolean(resource.fullscreen_s,
1059
XtNumber(tblFullscreen));
1055
1063
* ICCCM delete_window.
1077
1085
#endif /* OPT_ZICONBEEP */
1078
1086
hold_screen = resource.hold_screen ? 1 : 0;
1079
xterm_name = resource.xterm_name;
1080
if (strcmp(xterm_name, "-") == 0)
1081
xterm_name = DFT_TERMTYPE;
1082
1087
if (resource.icon_geometry != NULL) {
1261
1266
for (n = 0, c = command_to_exec; *c; n++, c++) ;
1262
c = TypeMallocN(char *, n + 3 + u);
1267
c = TypeMallocN(char *, (unsigned) (n + 3 + u));
1264
1269
SysError(ERROR_LUMALLOC);
1265
memcpy(c + 2 + u, command_to_exec, (n + 1) * sizeof(char *));
1270
memcpy(c + 2 + u, command_to_exec, (unsigned) (n + 1) * sizeof(char *));
1266
1271
c[0] = term->misc.localefilter;
1268
1273
c[1] = "-encoding";
1365
1370
winToEmbedInto, 0, 0);
1367
1372
#if OPT_COLOR_RES
1368
TRACE(("checking resource values rv %s fg %s, bg %s\n",
1369
BtoS(term->misc.re_verse0),
1373
TRACE(("checking reverseVideo before rv %s fg %s, bg %s\n",
1374
term->misc.re_verse0 ? "reverse" : "normal",
1370
1375
NonNull(TScreenOf(term)->Tcolors[TEXT_FG].resource),
1371
1376
NonNull(TScreenOf(term)->Tcolors[TEXT_BG].resource)));
1373
if ((reversed && term->misc.re_verse0)
1374
&& ((TScreenOf(term)->Tcolors[TEXT_FG].resource
1375
&& !isDefaultForeground(TScreenOf(term)->Tcolors[TEXT_FG].resource))
1376
|| (TScreenOf(term)->Tcolors[TEXT_BG].resource
1377
&& !isDefaultBackground(TScreenOf(term)->Tcolors[TEXT_BG].resource))
1378
if (term->misc.re_verse0) {
1379
if (isDefaultForeground(TScreenOf(term)->Tcolors[TEXT_FG].resource)
1380
&& isDefaultBackground(TScreenOf(term)->Tcolors[TEXT_BG].resource)) {
1381
TScreenOf(term)->Tcolors[TEXT_FG].resource = x_strdup(XtDefaultBackground);
1382
TScreenOf(term)->Tcolors[TEXT_BG].resource = x_strdup(XtDefaultForeground);
1386
term->misc.re_verse = True;
1387
update_reversevideo();
1388
TRACE(("updated reverseVideo after rv %s fg %s, bg %s\n",
1389
term->misc.re_verse ? "reverse" : "normal",
1390
NonNull(TScreenOf(term)->Tcolors[TEXT_FG].resource),
1391
NonNull(TScreenOf(term)->Tcolors[TEXT_BG].resource)));
1380
1393
#endif /* OPT_COLOR_RES */
1382
1395
#if OPT_MAXIMIZE
1688
1701
* entry is not found.
1690
1703
ok_termcap = True;
1691
if (!get_termcap(TermName = resource.term_name)) {
1704
if (!get_termcap(xw, TermName = resource.term_name)) {
1705
const char *last = NULL;
1708
TermName = x_strdup(*envnew);
1694
1709
ok_termcap = False;
1695
1710
while (*envnew != NULL) {
1696
if ((last == NULL || strcmp(last, *envnew))
1697
&& get_termcap(*envnew)) {
1711
if (last == NULL || strcmp(last, *envnew)) {
1712
next = x_strdup(*envnew);
1713
if (get_termcap(xw, next)) {
1702
1722
last = *envnew;
1706
1726
if (ok_termcap) {
1727
resource.term_name = TermName;
1707
1728
resize_termcap(xw);
1847
1868
handshake.rows, handshake.cols));
1848
1869
set_max_row(screen, handshake.rows);
1849
1870
set_max_col(screen, handshake.cols);
1850
TTYSIZE_ROWS(ts) = MaxRows(screen);
1851
TTYSIZE_COLS(ts) = MaxCols(screen);
1852
ts.ws_xpixel = FullWidth(screen);
1853
ts.ws_ypixel = FullHeight(screen);
1871
TTYSIZE_ROWS(ts) = (ttySize_t) MaxRows(screen);
1872
TTYSIZE_COLS(ts) = (ttySize_t) MaxCols(screen);
1873
ts.ws_xpixel = (ttySize_t) FullWidth(screen);
1874
ts.ws_ypixel = (ttySize_t) FullHeight(screen);
1856
1877
sprintf(numbuf, "%d", MaxCols(screen));