~ubuntu-branches/ubuntu/trusty/xterm/trusty

« back to all changes in this revision

Viewing changes to ptyx.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2013-10-28 22:15:39 UTC
  • mfrom: (1.4.15) (11.1.37 sid)
  • Revision ID: package-import@ubuntu.com-20131028221539-hkfkjoqjk7i2djqz
Tags: 297-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - debian/patches/950_ubuntu_charclass_highlight.diff: Enable URL
    highlighting.
  - debian/patches/Add 951_uxterm_utf8_title.diff: Set utf8Titles to true
    by default when using uxterm, so that it displays utf8 directories in
    titles properly.  May cause issues with apps that use control
    sequences for updating the xterm titlebar - users should use xterm or
    set utf8Title to false in this case.
  - debian/gbp.conf: Use "Ubuntu" in "debian-branch" directly.
  - Use autotools-dev's debhelper integration to update
    config.guess/config.sub for each build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XTermId: ptyx.h,v 1.720 2012/01/05 23:58:19 tom Exp $ */
 
1
/* $XTermId: ptyx.h,v 1.788 2013/09/10 18:10:00 tom Exp $ */
2
2
 
3
3
/*
4
 
 * Copyright 1999-2010,2011 by Thomas E. Dickey
 
4
 * Copyright 1999-2012,2013 by Thomas E. Dickey
5
5
 *
6
6
 *                         All Rights Reserved
7
7
 *
67
67
#include <X11/Shell.h>          /* for XtNdieCallback, etc. */
68
68
#include <X11/StringDefs.h>     /* for standard resource names */
69
69
#include <X11/Xmu/Misc.h>       /* For Max() and Min(). */
 
70
 
 
71
#undef bcopy
 
72
#undef bzero
70
73
#include <X11/Xfuncs.h>
 
74
 
71
75
#include <X11/Xosdefs.h>
72
76
#include <X11/Xmu/Converters.h>
73
77
#ifdef XRENDERFONT
227
231
#ifdef __hpux
228
232
#define PTYCHAR1        "zyxwvutsrqp"
229
233
#else   /* !__hpux */
230
 
#ifdef __UNIXOS2__
231
 
#define PTYCHAR1        "pq"
232
 
#else
233
234
#define PTYCHAR1        "pqrstuvwxyzPQRSTUVWXYZ"
234
 
#endif  /* !__UNIXOS2__ */
235
235
#endif  /* !__hpux */
236
236
#endif  /* !PTYCHAR1 */
237
237
 
316
316
 
317
317
#define IsEmpty(s) ((s) == 0 || *(s) == '\0')
318
318
 
319
 
#define CharOf(n) ((unsigned char)(n))
 
319
#define CharOf(n) ((Char)(n))
320
320
 
321
321
typedef struct {
322
322
    int row;
361
361
#define ANSI_APC        0x9F
362
362
 
363
363
#define MIN_DECID  52                   /* can emulate VT52 */
364
 
#define MAX_DECID 420                   /* ...through VT420 */
 
364
#define MAX_DECID 525                   /* ...through VT525 */
365
365
 
366
366
#ifndef DFT_DECID
367
 
#define DFT_DECID "vt100"               /* default VT100 */
 
367
#define DFT_DECID "vt420"               /* default VT420 */
368
368
#endif
369
369
 
370
370
#ifndef DFT_KBD_DIALECT
387
387
        String desc;
388
388
} OptionHelp;
389
389
 
 
390
typedef struct {
 
391
        int     count;                  /* number of values in params[] */
 
392
        int     has_subparams;          /* true if there are any sub's  */
 
393
        int     is_sub[NPARAM];         /* true for subparam            */
 
394
        int     params[NPARAM];         /* parameter value              */
 
395
} PARAMS;
 
396
 
390
397
typedef short ParmType;
391
398
 
392
399
typedef struct {
393
400
        Char            a_type;         /* CSI, etc., see unparseq()    */
394
401
        Char            a_pintro;       /* private-mode char, if any    */
 
402
        const char *    a_delim;        /* between parameters (;)       */
395
403
        Char            a_inters;       /* special (before final-char)  */
396
404
        Char            a_final;        /* final-char                   */
397
405
        ParmType        a_nparam;       /* # of parameters              */
398
406
        ParmType        a_param[NPARAM]; /* Parameters                  */
 
407
        Char            a_radix[NPARAM]; /* Parameters                  */
399
408
} ANSI;
400
409
 
401
410
#define TEK_FONT_LARGE 0
460
469
#define OPT_BOX_CHARS   1 /* true if xterm can simulate box-characters */
461
470
#endif
462
471
 
 
472
#ifndef OPT_BUILTIN_XPMS
 
473
#define OPT_BUILTIN_XPMS 0 /* true if all xpm data is compiled-in */
 
474
#endif
 
475
 
463
476
#ifndef OPT_BROKEN_OSC
464
477
#ifdef linux
465
478
#define OPT_BROKEN_OSC  1 /* man console_codes, 1st paragraph - cf: ECMA-48 */
504
517
#define OPT_DEC_RECTOPS 0 /* true if xterm is configured for VT420 rectangles */
505
518
#endif
506
519
 
 
520
#ifndef OPT_SIXEL_GRAPHICS
 
521
#define OPT_SIXEL_GRAPHICS 0 /* true if xterm supports VT220-style sixel graphics */
 
522
#endif
 
523
 
507
524
#ifndef OPT_DEC_SOFTFONT
508
525
#define OPT_DEC_SOFTFONT 0 /* true if xterm is configured for VT220 softfonts */
509
526
#endif
510
527
 
 
528
#ifndef OPT_DOUBLE_BUFFER
 
529
#define OPT_DOUBLE_BUFFER 0 /* true if using double-buffering */
 
530
#endif
 
531
 
511
532
#ifndef OPT_EBCDIC
512
533
#ifdef __MVS__
513
534
#define OPT_EBCDIC 1
845
866
    , MOUSE_FG                  /* mouse foreground */
846
867
    , MOUSE_BG                  /* mouse background */
847
868
#if OPT_TEK4014
848
 
    , TEK_FG                    /* tektronix foreground */
 
869
    , TEK_FG = 5                /* tektronix foreground */
849
870
    , TEK_BG                    /* tektronix background */
850
 
    , TEK_CURSOR                /* tektronix cursor */
851
 
#endif
852
 
#if OPT_HIGHLIGHT_COLOR
853
 
    , HIGHLIGHT_BG              /* highlight background */
854
 
    , HIGHLIGHT_FG              /* highlight foreground */
 
871
#endif
 
872
#if OPT_HIGHLIGHT_COLOR
 
873
    , HIGHLIGHT_BG = 7          /* highlight background */
 
874
#endif
 
875
#if OPT_TEK4014
 
876
    , TEK_CURSOR = 8            /* tektronix cursor */
 
877
#endif
 
878
#if OPT_HIGHLIGHT_COLOR
 
879
    , HIGHLIGHT_FG = 9          /* highlight foreground */
855
880
#endif
856
881
    , NCOLORS                   /* total number of colors */
857
882
} TermColors;
870
895
 
871
896
#define IsTitleMode(xw,mode) (((xw)->screen.title_modes & mode) != 0)
872
897
 
 
898
#include <xcharmouse.h>
 
899
 
 
900
/*
 
901
 * For readability...
 
902
 */
 
903
#define nrc_percent   100
 
904
#define nrc_dquote    200
 
905
#define nrc_ampersand 300
 
906
typedef enum {
 
907
    nrc_ASCII = 0
 
908
    ,nrc_British                /* vt100 */
 
909
    ,nrc_British_Latin_1        /* vt3xx */
 
910
    ,nrc_Cyrillic               /* vt5xx */
 
911
    ,nrc_DEC_Spec_Graphic       /* vt100 */
 
912
    ,nrc_DEC_Alt_Chars          /* vt100 */
 
913
    ,nrc_DEC_Alt_Graphics       /* vt100 */
 
914
    ,nrc_DEC_Supp               /* vt2xx */
 
915
    ,nrc_DEC_Supp_Graphic       /* vt3xx */
 
916
    ,nrc_DEC_Technical          /* vt3xx */
 
917
    ,nrc_Dutch                  /* vt2xx */
 
918
    ,nrc_Finnish                /* vt2xx */
 
919
    ,nrc_Finnish2               /* vt2xx */
 
920
    ,nrc_French                 /* vt2xx */
 
921
    ,nrc_French2                /* vt2xx */
 
922
    ,nrc_French_Canadian        /* vt2xx */
 
923
    ,nrc_French_Canadian2       /* vt3xx */
 
924
    ,nrc_German                 /* vt2xx */
 
925
    ,nrc_Greek                  /* vt5xx */
 
926
    ,nrc_Greek_Supp             /* vt5xx */
 
927
    ,nrc_Hebrew                 /* vt5xx */
 
928
    ,nrc_Hebrew2                /* vt5xx */
 
929
    ,nrc_Hebrew_Supp            /* vt5xx */
 
930
    ,nrc_Italian                /* vt2xx */
 
931
    ,nrc_Latin_5_Supp           /* vt5xx */
 
932
    ,nrc_Latin_Cyrillic         /* vt5xx */
 
933
    ,nrc_Norwegian_Danish       /* vt3xx */
 
934
    ,nrc_Norwegian_Danish2      /* vt2xx */
 
935
    ,nrc_Norwegian_Danish3      /* vt2xx */
 
936
    ,nrc_Portugese              /* vt3xx */
 
937
    ,nrc_Russian                /* vt5xx */
 
938
    ,nrc_SCS_NRCS               /* vt5xx - probably Serbo/Croatian */
 
939
    ,nrc_Spanish                /* vt2xx */
 
940
    ,nrc_Swedish                /* vt2xx */
 
941
    ,nrc_Swedish2               /* vt2xx */
 
942
    ,nrc_Swiss                  /* vt2xx */
 
943
    ,nrc_Turkish                /* vt5xx */
 
944
    ,nrc_Turkish2               /* vt5xx */
 
945
    ,nrc_Unknown
 
946
} DECNRCM_codes;
 
947
 
 
948
/*
 
949
 * Use this enumerated type to check consistency among dpmodes(), savemodes()
 
950
 * restoremodes() and do_decrpm().
 
951
 */
 
952
typedef enum {
 
953
    srm_DECCKM = 1
 
954
    ,srm_DECANM = 2
 
955
    ,srm_DECCOLM = 3
 
956
    ,srm_DECSCLM = 4
 
957
    ,srm_DECSCNM = 5
 
958
    ,srm_DECOM = 6
 
959
    ,srm_DECAWM = 7
 
960
    ,srm_DECARM = 8
 
961
    ,srm_X10_MOUSE = SET_X10_MOUSE
 
962
#if OPT_TOOLBAR
 
963
    ,srm_RXVT_TOOLBAR = 10
 
964
#endif
 
965
#if OPT_BLINK_CURS
 
966
    ,srm_ATT610_BLINK = 12
 
967
#endif
 
968
    ,srm_DECPFF = 18
 
969
    ,srm_DECPEX = 19
 
970
    ,srm_DECTCEM = 25
 
971
    ,srm_RXVT_SCROLLBAR = 30
 
972
#if OPT_SHIFT_FONTS
 
973
    ,srm_RXVT_FONTSIZE = 35
 
974
#endif
 
975
#if OPT_TEK4014
 
976
    ,srm_DECTEK = 38
 
977
#endif
 
978
    ,srm_132COLS = 40
 
979
    ,srm_CURSES_HACK = 41
 
980
    ,srm_DECNRCM = 42
 
981
    ,srm_MARGIN_BELL = 44
 
982
    ,srm_REVERSEWRAP = 45
 
983
#ifdef ALLOWLOGGING
 
984
    ,srm_ALLOWLOGGING = 46
 
985
#endif
 
986
    ,srm_OPT_ALTBUF_CURSOR = 1049
 
987
    ,srm_OPT_ALTBUF = 1047
 
988
    ,srm_ALTBUF = 47
 
989
    ,srm_DECNKM = 66
 
990
    ,srm_DECBKM = 67
 
991
    ,srm_DECLRMM = 69
 
992
#if OPT_SIXEL_GRAPHICS
 
993
    ,srm_DECSDM = 80            /* Sixel Display Mode */
 
994
#endif
 
995
    ,srm_DECNCSM = 95
 
996
    ,srm_VT200_MOUSE = SET_VT200_MOUSE
 
997
    ,srm_VT200_HIGHLIGHT_MOUSE = SET_VT200_HIGHLIGHT_MOUSE
 
998
    ,srm_BTN_EVENT_MOUSE = SET_BTN_EVENT_MOUSE
 
999
    ,srm_ANY_EVENT_MOUSE = SET_ANY_EVENT_MOUSE
 
1000
#if OPT_FOCUS_EVENT
 
1001
    ,srm_FOCUS_EVENT_MOUSE = SET_FOCUS_EVENT_MOUSE
 
1002
#endif
 
1003
    ,srm_EXT_MODE_MOUSE = SET_EXT_MODE_MOUSE
 
1004
    ,srm_SGR_EXT_MODE_MOUSE = SET_SGR_EXT_MODE_MOUSE
 
1005
    ,srm_URXVT_EXT_MODE_MOUSE = SET_URXVT_EXT_MODE_MOUSE
 
1006
    ,srm_ALTERNATE_SCROLL = SET_ALTERNATE_SCROLL
 
1007
    ,srm_RXVT_SCROLL_TTY_OUTPUT = 1010
 
1008
    ,srm_RXVT_SCROLL_TTY_KEYPRESS = 1011
 
1009
    ,srm_EIGHT_BIT_META = 1034
 
1010
#if OPT_NUM_LOCK
 
1011
    ,srm_REAL_NUMLOCK = 1035
 
1012
    ,srm_META_SENDS_ESC = 1036
 
1013
#endif
 
1014
    ,srm_DELETE_IS_DEL = 1037
 
1015
#if OPT_NUM_LOCK
 
1016
    ,srm_ALT_SENDS_ESC = 1039
 
1017
#endif
 
1018
    ,srm_KEEP_SELECTION = 1040
 
1019
    ,srm_SELECT_TO_CLIPBOARD = 1041
 
1020
    ,srm_BELL_IS_URGENT = 1042
 
1021
    ,srm_POP_ON_BELL = 1043
 
1022
    ,srm_TITE_INHIBIT = 1048
 
1023
#if OPT_TCAP_FKEYS
 
1024
    ,srm_TCAP_FKEYS = 1050
 
1025
#endif
 
1026
#if OPT_SUN_FUNC_KEYS
 
1027
    ,srm_SUN_FKEYS = 1051
 
1028
#endif
 
1029
#if OPT_HP_FUNC_KEYS
 
1030
    ,srm_HP_FKEYS = 1052
 
1031
#endif
 
1032
#if OPT_SCO_FUNC_KEYS
 
1033
    ,srm_SCO_FKEYS = 1053
 
1034
#endif
 
1035
    ,srm_LEGACY_FKEYS = 1060
 
1036
#if OPT_SUNPC_KBD
 
1037
    ,srm_VT220_FKEYS = 1061
 
1038
#endif
 
1039
#if OPT_SIXEL_GRAPHICS
 
1040
    ,srm_PRIVATE_COLOR_REGISTERS = 1070
 
1041
#endif
 
1042
#if OPT_READLINE
 
1043
    ,srm_BUTTON1_MOVE_POINT = SET_BUTTON1_MOVE_POINT
 
1044
    ,srm_BUTTON2_MOVE_POINT = SET_BUTTON2_MOVE_POINT
 
1045
    ,srm_DBUTTON3_DELETE = SET_DBUTTON3_DELETE
 
1046
    ,srm_PASTE_IN_BRACKET = SET_PASTE_IN_BRACKET
 
1047
    ,srm_PASTE_QUOTE = SET_PASTE_QUOTE
 
1048
    ,srm_PASTE_LITERAL_NL = SET_PASTE_LITERAL_NL
 
1049
#endif                          /* OPT_READLINE */
 
1050
} DECSET_codes;
 
1051
 
873
1052
/* indices for mapping multiple clicks to selection types */
874
1053
typedef enum {
875
1054
    Select_CHAR=0
904
1083
    , esNever
905
1084
} FullscreenOps;
906
1085
 
 
1086
#ifndef NO_ACTIVE_ICON
 
1087
typedef enum {
 
1088
    eiFalse = 0
 
1089
    , eiTrue
 
1090
    , eiDefault
 
1091
    , eiLAST
 
1092
} AIconOps;
 
1093
#endif
 
1094
 
907
1095
typedef enum {
908
1096
    etSetTcap = 1
909
1097
    , etGetTcap
911
1099
} TcapOps;
912
1100
 
913
1101
typedef enum {
914
 
    /* 1-21 are chosen to be the same as the control-sequence coding */
 
1102
    /* 1-23 are chosen to be the same as the control-sequence coding */
915
1103
    ewRestoreWin = 1
916
1104
    , ewMinimizeWin = 2
917
1105
    , ewSetWinPosition = 3
1334
1522
         * of widths.
1335
1523
         */
1336
1524
typedef struct {
1337
 
        Bool            mixed;
 
1525
        Bool            mixed;
1338
1526
        Dimension       min_width;      /* nominal cell width for 0..255 */
1339
1527
        Dimension       max_width;      /* maximum cell width */
1340
1528
} FontMap;
1341
1529
 
 
1530
#define KNOWN_MISSING   256
 
1531
 
1342
1532
typedef struct {
1343
1533
        unsigned        chrset;
1344
1534
        unsigned        flags;
1345
1535
        XFontStruct *   fs;
1346
1536
        char *          fn;
1347
1537
        FontMap         map;
1348
 
        Char            known_missing[256];
 
1538
        Char            known_missing[KNOWN_MISSING];
1349
1539
} XTermFonts;
1350
1540
 
1351
1541
#if OPT_RENDERFONT
1357
1547
} RenderFont;
1358
1548
 
1359
1549
#define DefaultRenderFont(xw) \
1360
 
        if ((xw)->misc.render_font == erDefault) \
1361
 
            (xw)->misc.render_font = erFalse
 
1550
        if ((xw)->work.render_font == erDefault) \
 
1551
            (xw)->work.render_font = erFalse
1362
1552
 
1363
1553
typedef struct {
1364
1554
        XftFont *       font;
1375
1565
 
1376
1566
        /* indices into save_modes[] */
1377
1567
typedef enum {
 
1568
        DP_ALTERNATE_SCROLL,
 
1569
        DP_ALT_SENDS_ESC,
 
1570
        DP_BELL_IS_URGENT,
1378
1571
        DP_CRS_VISIBLE,
1379
1572
        DP_DECANM,
1380
1573
        DP_DECARM,
1382
1575
        DP_DECBKM,
1383
1576
        DP_DECCKM,
1384
1577
        DP_DECCOLM,     /* IN132COLUMNS */
 
1578
        DP_DECKPAM,
 
1579
        DP_DECNRCM,
1385
1580
        DP_DECOM,
1386
1581
        DP_DECPEX,
1387
1582
        DP_DECPFF,
1388
1583
        DP_DECSCLM,
1389
1584
        DP_DECSCNM,
1390
1585
        DP_DECTCEM,
1391
 
        DP_DECTEK,
 
1586
        DP_DELETE_IS_DEL,
 
1587
        DP_EIGHT_BIT_META,
 
1588
        DP_KEEP_SELECTION,
 
1589
        DP_KEYBOARD_TYPE,
 
1590
        DP_POP_ON_BELL,
1392
1591
        DP_PRN_EXTENT,
1393
1592
        DP_PRN_FORMFEED,
 
1593
        DP_RXVT_SCROLLBAR,
 
1594
        DP_RXVT_SCROLL_TTY_KEYPRESS,
 
1595
        DP_RXVT_SCROLL_TTY_OUTPUT,
 
1596
        DP_SELECT_TO_CLIPBOARD,
1394
1597
        DP_X_ALTSCRN,
1395
1598
        DP_X_DECCOLM,
 
1599
        DP_X_EXT_MOUSE,
1396
1600
        DP_X_LOGGING,
 
1601
        DP_X_LRMM,
1397
1602
        DP_X_MARGIN,
1398
1603
        DP_X_MORE,
1399
1604
        DP_X_MOUSE,
1400
 
        DP_X_EXT_MOUSE,
 
1605
        DP_X_NCSM,
1401
1606
        DP_X_REVWRAP,
1402
1607
        DP_X_X10MSE,
1403
1608
#if OPT_BLINK_CURS
1406
1611
#if OPT_FOCUS_EVENT
1407
1612
        DP_X_FOCUS,
1408
1613
#endif
 
1614
#if OPT_NUM_LOCK
 
1615
        DP_REAL_NUMLOCK,
 
1616
        DP_META_SENDS_ESC,
 
1617
#endif
 
1618
#if OPT_SHIFT_FONTS
 
1619
        DP_RXVT_FONTSIZE,
 
1620
#endif
 
1621
#if OPT_SIXEL_GRAPHICS
 
1622
        DP_DECSDM,
 
1623
#endif
 
1624
#if OPT_TEK4014
 
1625
        DP_DECTEK,
 
1626
#endif
1409
1627
#if OPT_TOOLBAR
1410
1628
        DP_TOOLBAR,
1411
1629
#endif
 
1630
        DP_X_PRIVATE_COLOR_REGISTERS,
1412
1631
        DP_LAST
1413
1632
} SaveModes;
1414
1633
 
1439
1658
typedef struct {
1440
1659
        String          resource;
1441
1660
        Pixel           value;
 
1661
        unsigned short red, green, blue;
1442
1662
        int             mode;           /* -1=invalid, 0=unset, 1=set   */
1443
1663
} ColorRes;
1444
1664
#else
1458
1678
        FILE *  fp;                     /* output file/pipe used        */
1459
1679
        Boolean isOpen;                 /* output was opened/tried      */
1460
1680
        Boolean toFile;                 /* true when directly to file   */
 
1681
        Boolean printer_checked;        /* printer_command is checked   */
1461
1682
        String  printer_command;        /* pipe/shell command string    */
1462
1683
        Boolean printer_autoclose;      /* close printer when offline   */
1463
1684
        Boolean printer_extent;         /* print complete page          */
1481
1702
        unsigned        flags;          /* VTxxx saves graphics rendition */
1482
1703
        Char            curgl;
1483
1704
        Char            curgr;
1484
 
        Char            gsets[4];
 
1705
        int             gsets[4];
1485
1706
#if OPT_ISO_COLORS
1486
1707
        int             cur_foreground; /* current foreground color     */
1487
1708
        int             cur_background; /* current background color     */
1492
1713
} SavedCursor;
1493
1714
 
1494
1715
typedef struct _SaveTitle {
1495
 
        struct _SaveTitle *next;
 
1716
        struct _SaveTitle *next;
1496
1717
        char            *iconName;
1497
1718
        char            *windowName;
1498
1719
} SaveTitle;
1530
1751
        int             f_ascent;       /* ascent of font in pixels     */
1531
1752
        int             f_descent;      /* descent of font in pixels    */
1532
1753
        SbInfo          sb_info;
 
1754
#if OPT_DOUBLE_BUFFER
 
1755
        Drawable        drawable;       /* X drawable id                */
 
1756
#endif
1533
1757
#if OPT_TOOLBAR
1534
1758
        Boolean         active;         /* true if toolbars are used    */
1535
1759
        TbInfo          tb_info;        /* toolbar information          */
1568
1792
} TInput;
1569
1793
#endif
1570
1794
 
 
1795
typedef enum {
 
1796
        CURSOR_BLOCK = 2
 
1797
        , CURSOR_UNDERLINE = 4
 
1798
        , CURSOR_BAR = 6
 
1799
} XtCursorShape;
 
1800
 
 
1801
#define isCursorBlock(s)        ((s)->cursor_shape == CURSOR_BLOCK)
 
1802
#define isCursorUnderline(s)    ((s)->cursor_shape == CURSOR_UNDERLINE)
 
1803
#define isCursorBar(s)          ((s)->cursor_shape == CURSOR_BAR)
 
1804
 
 
1805
typedef enum {
 
1806
        DEFAULT_STYLE = 0
 
1807
        , BLINK_BLOCK
 
1808
        , STEADY_BLOCK
 
1809
        , BLINK_UNDERLINE
 
1810
        , STEADY_UNDERLINE
 
1811
        , BLINK_BAR
 
1812
        , STEADY_BAR
 
1813
} XtCursorStyle;
 
1814
 
1571
1815
typedef struct {
1572
1816
/* These parameters apply to both windows */
1573
1817
        Display         *display;       /* X display for screen         */
1617
1861
        Boolean         wide_chars;     /* true when 16-bit chars       */
1618
1862
        Boolean         vt100_graphics; /* true to allow vt100-graphics */
1619
1863
        Boolean         utf8_inparse;   /* true to enable UTF-8 parser  */
 
1864
        Boolean         normalized_c;   /* true to precompose to Form C */
1620
1865
        char *          utf8_mode_s;    /* use UTF-8 decode/encode      */
1621
1866
        char *          utf8_fonts_s;   /* use UTF-8 decode/encode      */
 
1867
        int             utf8_nrc_mode;  /* saved UTF-8 mode for DECNRCM */
1622
1868
        int             utf8_mode;      /* use UTF-8 decode/encode: 0-2 */
1623
1869
        int             utf8_fonts;     /* use UTF-8 decode/encode: 0-2 */
1624
1870
        int             max_combining;  /* maximum # of combining chars */
1628
1874
        int             unicode_font;   /* font uses unicode encoding   */
1629
1875
        int             utf_count;      /* state of utf_char            */
1630
1876
        IChar           utf_char;       /* in-progress character        */
 
1877
        Boolean         char_was_written;
1631
1878
        int             last_written_col;
1632
1879
        int             last_written_row;
1633
1880
        TypedBuffer(XChar2b);
1688
1935
        Boolean         visualbell;     /* visual bell mode             */
1689
1936
        Boolean         poponbell;      /* pop on bell mode             */
1690
1937
 
 
1938
        Boolean         allowPasteControls; /* PasteControls mode       */
1691
1939
        Boolean         allowColorOps;  /* ColorOps mode                */
1692
1940
        Boolean         allowFontOps;   /* FontOps mode                 */
1693
1941
        Boolean         allowSendEvents;/* SendEvent mode               */
1716
1964
 
1717
1965
        Boolean         awaitInput;     /* select-timeout mode          */
1718
1966
        Boolean         grabbedKbd;     /* keyboard is grabbed          */
1719
 
#if OPT_MAXIMIZE
1720
 
        Boolean         fullscreen;     /* window is fullscreen         */
1721
 
#endif
1722
1967
#ifdef ALLOWLOGGING
1723
1968
        int             logging;        /* logging mode                 */
1724
1969
        int             logfd;          /* file descriptor of log       */
1730
1975
/* VT window parameters */
1731
1976
        Boolean         Vshow;          /* VT window showing            */
1732
1977
        VTwin           fullVwin;
 
1978
        int             needSwap;
1733
1979
#ifndef NO_ACTIVE_ICON
1734
1980
        VTwin           iconVwin;
1735
1981
        VTwin           *whichVwin;
1752
1998
        Boolean         fnt_boxes;      /* true if font has box-chars   */
1753
1999
        Boolean         force_packed;   /* true to override proportional */
1754
2000
#if OPT_BOX_CHARS
1755
 
        Boolean         force_box_chars;/* true if we assume that       */
 
2001
        Boolean         force_box_chars;/* true if we assume no boxchars */
1756
2002
        Boolean         force_all_chars;/* true to outline missing chars */
 
2003
        Boolean         assume_all_chars;/* true to allow missing chars */
1757
2004
        Boolean         allow_packing;  /* true to allow packed-fonts   */
1758
2005
#endif
1759
2006
        Dimension       fnt_wide;
1773
2020
        int             cursor_state;   /* ON, OFF, or BLINKED_OFF      */
1774
2021
        int             cursor_busy;    /* do not redraw...             */
1775
2022
        Boolean         cursor_underline; /* true if cursor is in underline mode */
 
2023
        XtCursorShape   cursor_shape;
1776
2024
#if OPT_BLINK_CURS
1777
2025
        Boolean         cursor_blink;   /* cursor blink enable          */
1778
2026
        Boolean         cursor_blink_res; /* initial cursor blink value */
1799
2047
        int             max_row;        /* bottom row                   */
1800
2048
        int             top_marg;       /* top line of scrolling region */
1801
2049
        int             bot_marg;       /* bottom line of  "        "   */
 
2050
        int             lft_marg;       /* left column of "         "   */
 
2051
        int             rgt_marg;       /* right column of "        "   */
1802
2052
        Widget          scrollWidget;   /* pointer to scrollbar struct  */
1803
2053
        /*
1804
2054
         * Indices used to keep track of the top of the vt100 window and
1838
2088
        size_t          save_len;       /* ...and its length            */
1839
2089
 
1840
2090
        int             scrolllines;    /* number of lines to button scroll */
 
2091
        Boolean         alternateScroll; /* scroll-actions become keys */
1841
2092
        Boolean         scrollttyoutput; /* scroll to bottom on tty output */
1842
2093
        Boolean         scrollkey;      /* scroll to bottom on key      */
1843
2094
        Boolean         cursor_moved;   /* scrolling makes cursor move  */
1870
2121
        int             scrolls;        /* outstanding scroll count,
1871
2122
                                            used only with multiscroll  */
1872
2123
        SavedCursor     sc[SAVED_CURSORS]; /* data for restore cursor   */
1873
 
        unsigned        save_modes[DP_LAST]; /* save dec/xterm private modes */
 
2124
        unsigned int    save_modes[DP_LAST]; /* save dec/xterm private modes */
1874
2125
 
1875
2126
        int             title_modes;    /* control set/get of titles    */
1876
2127
        SaveTitle       *save_title;
1877
2128
 
1878
2129
        /* Improved VT100 emulation stuff.                              */
1879
2130
        String          keyboard_dialect; /* default keyboard dialect   */
1880
 
        Char            gsets[4];       /* G0 through G3.               */
 
2131
        int             gsets[4];       /* G0 through G3.               */
1881
2132
        Char            curgl;          /* Current GL setting.          */
1882
2133
        Char            curgr;          /* Current GR setting.          */
1883
2134
        Char            curss;          /* Current single shift.        */
1884
2135
        String          term_id;        /* resource for terminal_id     */
1885
2136
        int             terminal_id;    /* 100=vt100, 220=vt220, etc.   */
1886
2137
        int             vtXX_level;     /* 0=vt52, 1,2,3 = vt100 ... vt320 */
1887
 
        int             ansi_level;     /* levels 1,2,3                 */
 
2138
        int             ansi_level;     /* dpANSI levels 1,2,3          */
1888
2139
        int             protected_mode; /* 0=off, 1=DEC, 2=ISO          */
1889
2140
        Boolean         always_bold_mode; /* compare normal/bold font   */
1890
2141
        Boolean         always_highlight; /* whether to highlight cursor */
1910
2161
        Boolean         scroll_dirty;   /* scrolling makes screen dirty */
1911
2162
#endif
1912
2163
 
 
2164
#if OPT_SIXEL_GRAPHICS
 
2165
        Boolean         sixel_scrolling; /* sixel scrolling             */
 
2166
        Boolean         privatecolorregisters; /* private color registers for each graphic */
 
2167
#endif
 
2168
 
1913
2169
#if OPT_VT52_MODE
1914
 
        int             vt52_save_level; /* save-area for DECANM        */
1915
2170
        Char            vt52_save_curgl;
1916
2171
        Char            vt52_save_curgr;
1917
2172
        Char            vt52_save_curss;
1918
 
        Char            vt52_save_gsets[4];
 
2173
        int             vt52_save_gsets[4];
1919
2174
#endif
1920
2175
        /* Testing */
1921
2176
#if OPT_XMC_GLITCH
2101
2356
#define SCREEN_FLAG(screenp,f)          (0)
2102
2357
#endif
2103
2358
 
 
2359
/*
 
2360
 * After screen-updates, reset the flag that tells us we should do wrapping.
 
2361
 * Likewise, reset (in wide-character mode) the flag that tells us where the
 
2362
 * "previous" character was written.
 
2363
 */
 
2364
#if OPT_WIDE_CHARS
 
2365
#define ResetWrap(screen) \
 
2366
    (screen)->do_wrap = \
 
2367
    (screen)->char_was_written = False
 
2368
#else
 
2369
#define ResetWrap(screen) \
 
2370
    (screen)->do_wrap = False
 
2371
#endif
 
2372
 
2104
2373
/* meaning of bits in screen.select flag */
2105
2374
#define INWINDOW        01      /* the mouse is in one of the windows */
2106
2375
#define FOCUS           02      /* one of the windows is the focus window */
2129
2398
} xtermKeyboardType;
2130
2399
 
2131
2400
typedef enum {                  /* legal values for screen.pointer_mode */
2132
 
    pNever = 0,
2133
 
    pNoMouse = 1,
2134
 
    pAlways = 2
 
2401
    pNever = 0
 
2402
    , pNoMouse = 1
 
2403
    , pAlways = 2
 
2404
    , pFocused = 3
2135
2405
} pointerModeTypes;
2136
2406
 
2137
2407
typedef enum {                  /* legal values for screen.utf8_mode */
2194
2464
 
2195
2465
typedef struct
2196
2466
{
 
2467
    int allow_keys;             /* how to handle legacy/vt220 keyboard */
2197
2468
    int cursor_keys;            /* how to handle cursor-key modifiers */
2198
2469
    int function_keys;          /* how to handle function-key modifiers */
2199
2470
    int keypad_keys;            /* how to handle keypad key-modifiers */
2243
2514
    Boolean log_on;
2244
2515
#endif
2245
2516
    Boolean login_shell;
 
2517
    Boolean palette_changed;
2246
2518
    Boolean re_verse;
2247
2519
    Boolean re_verse0;          /* initial value of "-rv" */
2248
2520
    XtGravity resizeGravity;
2261
2533
    Boolean useRight;
2262
2534
#endif
2263
2535
    Boolean titeInhibit;
2264
 
    Boolean tiXtraScroll;
 
2536
    Boolean tiXtraScroll;       /* scroll on ti/te */
 
2537
    Boolean cdXtraScroll;       /* scroll on cd (clear-display) */
2265
2538
    Boolean appcursorDefault;
2266
2539
    Boolean appkeypadDefault;
2267
2540
#if OPT_INPUT_METHOD
2276
2549
    TInput inputs[NINPUTWIDGETS];
2277
2550
#endif
2278
2551
    Boolean dynamicColors;
2279
 
    Boolean shared_ic;
2280
2552
#ifndef NO_ACTIVE_ICON
2281
 
    Boolean active_icon;        /* use application icon window  */
 
2553
    char *active_icon_s;        /* use application icon window  */
2282
2554
    unsigned icon_border_width;
2283
2555
    Pixel icon_border_pixel;
2284
2556
#endif /* NO_ACTIVE_ICON */
2294
2566
#if OPT_NUM_LOCK
2295
2567
    Boolean real_NumLock;       /* true if we treat NumLock key specially */
2296
2568
    Boolean alwaysUseMods;      /* true if we always want f-key modifiers */
2297
 
    unsigned num_lock;          /* modifier for Num_Lock */
2298
 
    unsigned alt_mods;          /* modifier for Alt_L or Alt_R */
2299
 
    unsigned meta_mods;         /* modifier for Meta_L or Meta_R */
2300
 
    unsigned other_mods;        /* conflicting modifiers, e.g., Mode_Switch */
2301
2569
#endif
2302
2570
#if OPT_RENDERFONT
2303
2571
    char *face_name;
2304
2572
    char *face_wide_name;
2305
2573
    float face_size[NMENUFONTS];
2306
2574
    char *render_font_s;
 
2575
#endif
 
2576
} Misc;
 
2577
 
 
2578
typedef struct _Work {
 
2579
    int dummy;
 
2580
#ifndef NO_ACTIVE_ICON
 
2581
    int active_icon;            /* use application icon window  */
 
2582
#endif /* NO_ACTIVE_ICON */
 
2583
#if OPT_MAXIMIZE
 
2584
#define MAX_EWMH_MODE 3
 
2585
#define MAX_EWMH_DATA (1 + OPT_TEK4014)
 
2586
    struct {
 
2587
        int mode;               /* fullscreen, etc.             */
 
2588
        Boolean checked[MAX_EWMH_MODE];
 
2589
        Boolean allowed[MAX_EWMH_MODE];
 
2590
    } ewmh[MAX_EWMH_DATA];
 
2591
#endif
 
2592
#if OPT_NUM_LOCK
 
2593
    unsigned num_lock;          /* modifier for Num_Lock */
 
2594
    unsigned alt_mods;          /* modifier for Alt_L or Alt_R */
 
2595
    unsigned meta_mods;         /* modifier for Meta_L or Meta_R */
 
2596
#endif
 
2597
#if OPT_RENDERFONT
2307
2598
    Boolean render_font;
2308
2599
#endif
2309
 
} Misc;
 
2600
} Work;
2310
2601
 
2311
2602
typedef struct {int foo;} XtermClassPart, TekClassPart;
2312
2603
 
2332
2623
#endif
2333
2624
 
2334
2625
/* define masks for keyboard.flags */
2335
 
#define MODE_KAM        xBIT(0) /* keyboard action mode */
 
2626
#define MODE_KAM        xBIT(0) /* mode 2: keyboard action mode */
2336
2627
#define MODE_DECKPAM    xBIT(1) /* keypad application mode */
2337
 
#define MODE_DECCKM     xBIT(2) /* cursor keys */
2338
 
#define MODE_SRM        xBIT(3) /* send-receive mode */
2339
 
#define MODE_DECBKM     xBIT(4) /* backarrow */
 
2628
#define MODE_DECCKM     xBIT(2) /* private mode 1: cursor keys */
 
2629
#define MODE_SRM        xBIT(3) /* mode 12: send-receive mode */
 
2630
#define MODE_DECBKM     xBIT(4) /* private mode 67: backarrow */
 
2631
#define MODE_DECSDM     xBIT(5) /* private mode 80: sixel scrolling mode */
2340
2632
 
2341
2633
 
2342
2634
#define N_MARGINBELL    10
2369
2661
    unsigned    initflags;      /* initial mode flags           */
2370
2662
    Tabs        tabs;           /* tabstops of the terminal     */
2371
2663
    Misc        misc;           /* miscellaneous parameters     */
 
2664
    Work        work;           /* workspace (no resources)     */
2372
2665
} XtermWidgetRec, *XtermWidget;
2373
2666
 
2374
2667
#if OPT_TEK4014
2433
2726
#define IN132COLUMNS    MiscBIT(7)      /* true if in 132 column mode */
2434
2727
#define INVISIBLE       MiscBIT(8)      /* true if writing invisible text */
2435
2728
#define NATIONAL        MiscBIT(9)      /* true if writing national charset */
 
2729
#define LEFT_RIGHT      MiscBIT(10)     /* true if left/right margin mode */
 
2730
#define NOCLEAR_COLM    MiscBIT(11)     /* true if no clear on DECCOLM change */
2436
2731
 
2437
2732
/*
2438
2733
 * Groups of attributes
2507
2802
                    ((screen)->cursorp.col != (screen)->cur_col || \
2508
2803
                     (screen)->cursorp.row != (screen)->cur_row))
2509
2804
 
2510
 
#define CursorX(screen,col) ((col) * FontWidth(screen) + OriginX(screen))
2511
 
#define CursorY(screen,row) ((INX2ROW(screen, row) * FontHeight(screen)) \
2512
 
                        + screen->border)
 
2805
#define CursorX2(screen,col,fw) ((col) * (int)(fw) + OriginX(screen))
 
2806
#define CursorX(screen,col)     CursorX2(screen, col, FontWidth(screen))
 
2807
#define CursorY2(screen,row)    (((row) * FontHeight(screen)) + screen->border)
 
2808
#define CursorY(screen,row)     CursorY2(screen, INX2ROW(screen, row))
2513
2809
 
2514
2810
/*
2515
2811
 * These definitions depend on whether xterm supports active-icon.
2544
2840
/*
2545
2841
 * Macro to check if we are iconified; do not use render for that case.
2546
2842
 */
2547
 
#define UsingRenderFont(xw)     (((xw)->misc.render_font == True) && !IsIcon(TScreenOf(xw)))
 
2843
#define UsingRenderFont(xw)     (((xw)->work.render_font == True) && !IsIcon(TScreenOf(xw)))
2548
2844
 
2549
2845
/*
2550
2846
 * These definitions do not depend on whether xterm supports active-icon.
2554
2850
#define TWindow(screen)         WhichTWin(screen)->window
2555
2851
#define TShellWindow            XtWindow(SHELL_OF(tekWidget))
2556
2852
 
 
2853
#if OPT_DOUBLE_BUFFER
 
2854
#define VDrawable(screen)       (((screen)->needSwap=1), WhichVWin(screen)->drawable)
 
2855
#else
 
2856
#define VDrawable(screen)       VWindow(screen)
 
2857
#endif
 
2858
 
2557
2859
#define Width(screen)           WhichVWin(screen)->width
2558
2860
#define Height(screen)          WhichVWin(screen)->height
2559
2861
#define FullWidth(screen)       WhichVWin(screen)->fullwidth
2598
2900
 
2599
2901
#define AllowTitleOps(w)        AllowXtermOps(w, allowTitleOps)
2600
2902
 
 
2903
#define SpecialWindowOps(w,name) (!TScreenOf(w)->disallow_win_ops[name])
2601
2904
#define AllowWindowOps(w,name)  (AllowXtermOps(w, allowWindowOps) || \
2602
 
                                 !TScreenOf(w)->disallow_win_ops[name])
 
2905
                                 SpecialWindowOps(w,name))
2603
2906
 
2604
2907
#if OPT_TOOLBAR
2605
2908
#define ToolbarHeight(w)        ((resource.toolBar) \
2702
3005
#define TRACE2(p) /*nothing*/
2703
3006
#endif
2704
3007
 
 
3008
#if OPT_TRACE && !defined(DEBUG)
 
3009
#define DEBUG 1
 
3010
#endif
 
3011
 
 
3012
#ifdef DEBUG
 
3013
#define if_DEBUG(code) if(debug) code
 
3014
#else
 
3015
#define if_DEBUG(code) /*nothing*/
 
3016
#endif
 
3017
 
 
3018
#define DEBUG_MSG(text) if_DEBUG({ IGNORE_RC(write(2, text, sizeof(text) - 1)); })
 
3019
 
2705
3020
/* *INDENT-ON* */
2706
3021
 
2707
3022
#endif /* included_ptyx_h */