23
23
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24
24
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25
25
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
* Except as contained in this notice, the name(s) of the above copyright
28
28
* holders shall not be used in advertising or otherwise to promote the
29
29
* sale, use or other dealings in this Software without prior written
33
33
* Copyright 1988 The Open Group
35
35
* Permission to use, copy, modify, distribute, and sell this software and its
36
36
* documentation for any purpose is hereby granted without fee, provided that
37
37
* the above copyright notice appear in all copies and that both that
38
38
* copyright notice and this permission notice appear in supporting
41
41
* The above copyright notice and this permission notice shall be included in
42
42
* all copies or substantial portions of the Software.
44
44
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
45
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
46
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47
47
* OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
48
48
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
49
49
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
51
* Except as contained in this notice, the name of The Open Group shall not be
52
52
* used in advertising or otherwise to promote the sale, use or other dealings
53
53
* in this Software without prior written authorization from The Open Group.
57
57
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
219
214
static String _Font_Selected_ = "yes"; /* string is arbitrary */
221
static char defaultTranslations[] =
223
Shift <KeyPress> Prior:scroll-back(1,halfpage) \n\
224
Shift <KeyPress> Next:scroll-forw(1,halfpage) \n\
225
Shift <KeyPress> Select:select-cursor-start() select-cursor-end(SELECT, CUT_BUFFER0) \n\
226
Shift <KeyPress> Insert:insert-selection(SELECT, CUT_BUFFER0) \n\
230
Alt <Key>Return:fullscreen() \n\
235
<KeyRelease> Scroll_Lock:scroll-lock() \n\
240
Shift~Ctrl <KeyPress> KP_Add:larger-vt-font() \n\
241
Shift Ctrl <KeyPress> KP_Add:smaller-vt-font() \n\
242
Shift <KeyPress> KP_Subtract:smaller-vt-font() \n\
246
~Meta <KeyPress>:insert-seven-bit() \n\
247
Meta <KeyPress>:insert-eight-bit() \n\
248
!Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
249
!Lock Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
250
!Lock Ctrl @Num_Lock <Btn1Down>:popup-menu(mainMenu) \n\
251
! @Num_Lock Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
252
~Meta <Btn1Down>:select-start() \n\
253
~Meta <Btn1Motion>:select-extend() \n\
254
!Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
255
!Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
256
!Lock Ctrl @Num_Lock <Btn2Down>:popup-menu(vtMenu) \n\
257
! @Num_Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
258
~Ctrl ~Meta <Btn2Down>:ignore() \n\
259
Meta <Btn2Down>:clear-saved-lines() \n\
260
~Ctrl ~Meta <Btn2Up>:insert-selection(SELECT, CUT_BUFFER0) \n\
261
!Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
262
!Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
263
!Lock Ctrl @Num_Lock <Btn3Down>:popup-menu(fontMenu) \n\
264
! @Num_Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
265
~Ctrl ~Meta <Btn3Down>:start-extend() \n\
266
~Meta <Btn3Motion>:select-extend() \n\
267
Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
268
Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
269
Lock @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
270
@Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
271
<Btn4Down>:scroll-back(5,line,m) \n\
272
Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
273
Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
274
Lock @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
275
@Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
276
<Btn5Down>:scroll-forw(5,line,m) \n\
277
<BtnUp>:select-end(SELECT, CUT_BUFFER0) \n\
279
"; /* PROCURA added "Meta <Btn2Down>:clear-saved-lines()" */
216
static const char *defaultTranslations;
280
217
/* *INDENT-OFF* */
281
218
static XtActionsRec actionsList[] = {
282
219
{ "allow-send-events", HandleAllowSends },
436
374
Bres(XtNallowWindowOps, XtCAllowWindowOps, screen.allowWindowOp0, DEF_ALLOW_WINDOW),
437
375
Bres(XtNaltIsNotMeta, XtCAltIsNotMeta, screen.alt_is_not_meta, False),
438
376
Bres(XtNaltSendsEscape, XtCAltSendsEscape, screen.alt_sends_esc, False),
377
Bres(XtNallowBoldFonts, XtCAllowBoldFonts, screen.allowBoldFonts, True),
439
378
Bres(XtNalwaysBoldMode, XtCAlwaysBoldMode, screen.always_bold_mode, False),
440
379
Bres(XtNalwaysHighlight, XtCAlwaysHighlight, screen.always_highlight, False),
441
380
Bres(XtNappcursorDefault, XtCAppcursorDefault, misc.appcursorDefault, False),
719
658
Ires(XtNcombiningChars, XtCCombiningChars, screen.max_combining, 2),
720
659
Ires(XtNmkSamplePass, XtCMkSamplePass, misc.mk_samplepass, 256),
721
660
Ires(XtNmkSampleSize, XtCMkSampleSize, misc.mk_samplesize, 1024),
722
Ires(XtNutf8, XtCUtf8, screen.utf8_mode, uDefault),
661
Sres(XtNutf8, XtCUtf8, screen.utf8_mode_s, "default"),
662
Sres(XtNutf8Fonts, XtCUtf8Fonts, screen.utf8_fonts_s, "default"),
723
663
Sres(XtNwideBoldFont, XtCWideBoldFont, misc.default_font.f_wb, DEFWIDEBOLDFONT),
724
664
Sres(XtNwideFont, XtCWideFont, misc.default_font.f_w, DEFWIDEFONT),
725
665
Sres(XtNutf8SelectTypes, XtCUtf8SelectTypes, screen.utf8_select_types, NULL),
5958
* Extend a (normally) boolean resource value by checking for additional values
5959
* which will be mapped into true/false.
5963
extendedBoolean(const char *value, FlagList * table, Cardinal limit)
5970
if ((x_strcasecmp(value, "true") == 0)
5971
|| (x_strcasecmp(value, "yes") == 0)
5972
|| (x_strcasecmp(value, "on") == 0)) {
5974
} else if ((x_strcasecmp(value, "false") == 0)
5975
|| (x_strcasecmp(value, "no") == 0)
5976
|| (x_strcasecmp(value, "off") == 0)) {
5978
} else if ((check = strtol(value, &next, 0)) >= 0 && *next == '\0') {
5979
if (check >= (long) limit)
5981
result = (int) check;
5983
for (n = 0; n < limit; ++n) {
5984
if (x_strcasecmp(value, table[n].name) == 0) {
5985
result = table[n].code;
5992
fprintf(stderr, "Unrecognized keyword: %s\n", value);
5998
#endif /* OPT_RENDERFONT */
6002
5935
VTInitialize(Widget wrequest,
7041
6994
/* really screwed if we couldn't open default font */
7042
6995
if (!screen->fnts[fNorm].fs) {
7043
6996
fprintf(stderr, "%s: unable to locate a suitable font\n",
7047
7000
#if OPT_WIDE_CHARS
7048
if (TScreenOf(xw)->utf8_mode) {
7001
if (screen->utf8_mode) {
7049
7002
TRACE(("check if this is a wide font, if not try again\n"));
7050
if (xtermLoadWideFonts(xw, False))
7003
if (xtermLoadWideFonts(xw, False)) {
7051
7004
SetVTFont(xw, screen->menu_font_number, True, NULL);
7005
/* we will not be able to switch to ISO-8859-1 */
7006
if (!screen->mergedVTFonts) {
7007
screen->utf8_fonts = uAlways;
7008
update_font_utf8_fonts();
8829
8789
return changed;
8793
* Build up the default translations string, allowing the user to suppress
8794
* some of the features.
8797
VTInitTranslations(void)
8809
Shift <KeyPress> Prior:scroll-back(1,halfpage) \n\
8810
Shift <KeyPress> Next:scroll-forw(1,halfpage) \n\
8811
Shift <KeyPress> Select:select-cursor-start() select-cursor-end(SELECT, CUT_BUFFER0) \n\
8812
Shift <KeyPress> Insert:insert-selection(SELECT, CUT_BUFFER0) \n\
8820
Alt <Key>Return:fullscreen() \n\
8829
<KeyRelease> Scroll_Lock:scroll-lock() \n\
8838
Shift~Ctrl <KeyPress> KP_Add:larger-vt-font() \n\
8839
Shift Ctrl <KeyPress> KP_Add:smaller-vt-font() \n\
8840
Shift <KeyPress> KP_Subtract:smaller-vt-font() \n\
8844
/* PROCURA added "Meta <Btn2Down>:clear-saved-lines()" */
8849
~Meta <KeyPress>:insert-seven-bit() \n\
8850
Meta <KeyPress>:insert-eight-bit() \n\
8851
!Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
8852
!Lock Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
8853
!Lock Ctrl @Num_Lock <Btn1Down>:popup-menu(mainMenu) \n\
8854
! @Num_Lock Ctrl <Btn1Down>:popup-menu(mainMenu) \n\
8855
~Meta <Btn1Down>:select-start() \n\
8856
~Meta <Btn1Motion>:select-extend() \n\
8857
!Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
8858
!Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
8859
!Lock Ctrl @Num_Lock <Btn2Down>:popup-menu(vtMenu) \n\
8860
! @Num_Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \n\
8861
~Ctrl ~Meta <Btn2Down>:ignore() \n\
8862
Meta <Btn2Down>:clear-saved-lines() \n\
8863
~Ctrl ~Meta <Btn2Up>:insert-selection(SELECT, CUT_BUFFER0) \n\
8864
!Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
8865
!Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
8866
!Lock Ctrl @Num_Lock <Btn3Down>:popup-menu(fontMenu) \n\
8867
! @Num_Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \n\
8868
~Ctrl ~Meta <Btn3Down>:start-extend() \n\
8869
~Meta <Btn3Motion>:select-extend() \n\
8876
Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
8877
Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
8878
Lock @Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
8879
@Num_Lock Ctrl <Btn4Down>:scroll-back(1,halfpage,m) \n\
8880
<Btn4Down>:scroll-back(5,line,m) \n\
8881
Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
8882
Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
8883
Lock @Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
8884
@Num_Lock Ctrl <Btn5Down>:scroll-forw(1,halfpage,m) \n\
8885
<Btn5Down>:scroll-forw(5,line,m) \n\
8892
<BtnUp>:select-end(SELECT, CUT_BUFFER0) \n\
8893
<BtnDown>:ignore() \
8905
TRACE(("VTInitTranslations\n"));
8906
for (item = 0; item < XtNumber(table); ++item) {
8907
table[item].wanted = True;
8911
* As a special case, allow for disabling the alt-enter translation if
8912
* the resource settings prevent fullscreen from being used. We would
8913
* do the same for scroll-lock and shift-fonts if they were application
8914
* resources too, rather than in the widget.
8916
if (resource.fullscreen == esNever) {
8917
for (item = 0; item < XtNumber(table); ++item) {
8918
if (!strcmp(table[item].name, "fullscreen")) {
8919
table[item].wanted = False;
8920
TRACE(("omit(%s):\n%s\n", table[item].name, table[item].value));
8925
if (!IsEmpty(resource.omitTranslation)) {
8927
const char *source = resource.omitTranslation;
8929
while (*source != '\0' && (value = ParseList(&source)) != 0) {
8930
size_t len = strlen(value);
8932
TRACE(("parsed:%s\n", value));
8933
for (item = 0; item < XtNumber(table); ++item) {
8934
if (strlen(table[item].name) >= len
8935
&& x_strncasecmp(table[item].name,
8937
(unsigned) len) == 0) {
8938
table[item].wanted = False;
8939
TRACE(("omit(%s):\n%s\n", table[item].name, table[item].value));
8947
for (pass = 0; pass < 2; ++pass) {
8949
for (item = 0; item < XtNumber(table); ++item) {
8950
if (table[item].wanted) {
8952
strcat(result, table[item].value);
8954
needed += strlen(table[item].value) + 1;
8959
result = XtMalloc((Cardinal) needed);
8964
TRACE(("result:\n%s\n", result));
8966
defaultTranslations = result;
8967
xtermClassRec.core_class.tm_table = result;
8832
8970
#ifdef NO_LEAKS
8834
8972
noleaks_charproc(void)