1 | /******************************************************************************
|
---|
2 | *
|
---|
3 | * Copyright (c) 1998,99 by Mindbright Technology AB, Stockholm, Sweden.
|
---|
4 | * www.mindbright.se, [email protected]
|
---|
5 | *
|
---|
6 | * This program is free software; you can redistribute it and/or modify
|
---|
7 | * it under the terms of the GNU General Public License as published by
|
---|
8 | * the Free Software Foundation; either version 2 of the License, or
|
---|
9 | * (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This program is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | * GNU General Public License for more details.
|
---|
15 | *
|
---|
16 | *****************************************************************************
|
---|
17 | * $Author: mats $
|
---|
18 | * $Date: 2000/03/07 16:44:36 $
|
---|
19 | * $Name: rel1-2-1 $
|
---|
20 | *****************************************************************************/
|
---|
21 | package mindbright.terminal;
|
---|
22 |
|
---|
23 | import java.io.IOException;
|
---|
24 | import java.util.Properties;
|
---|
25 | import java.util.NoSuchElementException;
|
---|
26 |
|
---|
27 | public interface Terminal {
|
---|
28 |
|
---|
29 | public final static int ATTR_BOLD = 0x0001;
|
---|
30 | public final static int ATTR_LOWINTENSITY = 0x0002;
|
---|
31 | public final static int ATTR_UNDERLINE = 0x0004;
|
---|
32 | public final static int ATTR_BLINKING = 0x0008;
|
---|
33 | public final static int ATTR_INVERSE = 0x0010;
|
---|
34 | public final static int ATTR_INVISIBLE = 0x0020;
|
---|
35 | public final static int ATTR_FGCOLOR = 0x0040;
|
---|
36 | public final static int ATTR_BGCOLOR = 0x0080;
|
---|
37 |
|
---|
38 | final static int OPT_REV_VIDEO = 0;
|
---|
39 | final static int OPT_AUTO_WRAP = 1;
|
---|
40 | final static int OPT_REV_WRAP = 2;
|
---|
41 | final static int OPT_INSERTMODE = 3;
|
---|
42 | final static int OPT_AUTO_LF = 4;
|
---|
43 | final static int OPT_SCROLL_SK = 5;
|
---|
44 | final static int OPT_SCROLL_SI = 6;
|
---|
45 | final static int OPT_LOCAL_PGKEYS = 7;
|
---|
46 | final static int OPT_COPY_CRNL = 8;
|
---|
47 | final static int OPT_VIS_CURSOR = 9;
|
---|
48 | final static int OPT_ASCII_LDC = 10;
|
---|
49 | final static int OPT_LOCAL_ECHO = 11;
|
---|
50 | final static int OPT_SCALE_FONT = 12;
|
---|
51 | final static int OPT_VIS_BELL = 13;
|
---|
52 | final static int OPT_MAP_CTRLSP = 14;
|
---|
53 | final static int OPT_DECCOLM = 15;
|
---|
54 | final static int OPT_DEC132COLS = 16;
|
---|
55 | final static int OPT_COPY_SEL = 17;
|
---|
56 | final static int OPT_LAST_OPT = 18;
|
---|
57 |
|
---|
58 | public String terminalType();
|
---|
59 | public int rows();
|
---|
60 | public int cols();
|
---|
61 | public int vpixels();
|
---|
62 | public int hpixels();
|
---|
63 |
|
---|
64 | public void write(char c);
|
---|
65 | public void write(char[] c, int off, int len);
|
---|
66 | public void write(String str);
|
---|
67 | public void writeLineDrawChar(char c);
|
---|
68 |
|
---|
69 | public void addTerminalListener(TerminalListener listener);
|
---|
70 |
|
---|
71 | public void sendBytes(byte[] b);
|
---|
72 |
|
---|
73 | public void doBell();
|
---|
74 | public void doBS();
|
---|
75 | public void doTab();
|
---|
76 | public void doTabs(int n);
|
---|
77 | public void doBackTabs(int n);
|
---|
78 | public void setTab(int col);
|
---|
79 | public void clearTab(int col);
|
---|
80 | public void resetTabs();
|
---|
81 | public void clearAllTabs();
|
---|
82 | public void doCR();
|
---|
83 | public void doLF();
|
---|
84 |
|
---|
85 | public void resetInterpreter();
|
---|
86 | public void resetWindow();
|
---|
87 | public void setWindow(int top, int bottom);
|
---|
88 | public void setWindow(int top, int right, int bottom, int left);
|
---|
89 | public int getWindowTop();
|
---|
90 | public int getWindowBottom();
|
---|
91 | public int getWindowLeft();
|
---|
92 | public int getWindowRight();
|
---|
93 |
|
---|
94 | public int getCursorV();
|
---|
95 | public int getCursorH();
|
---|
96 |
|
---|
97 | public void cursorSetPos(int v, int h, boolean relative);
|
---|
98 | public void cursorUp(int n);
|
---|
99 | public void cursorDown(int n);
|
---|
100 | public void cursorForward(int n);
|
---|
101 | public void cursorBackward(int n);
|
---|
102 | public void cursorIndex(int n);
|
---|
103 | public void cursorIndexRev(int n);
|
---|
104 |
|
---|
105 | public void cursorSave();
|
---|
106 | public void cursorRestore();
|
---|
107 |
|
---|
108 | public void scrollUp(int n);
|
---|
109 | public void scrollDown(int n);
|
---|
110 |
|
---|
111 | public void clearBelow();
|
---|
112 | public void clearAbove();
|
---|
113 | public void clearScreen();
|
---|
114 | public void clearRight();
|
---|
115 | public void clearLeft();
|
---|
116 | public void clearLine();
|
---|
117 |
|
---|
118 | public void eraseChars(int n);
|
---|
119 | public void insertChars(int n);
|
---|
120 | public void insertLines(int n);
|
---|
121 | public void deleteChars(int n);
|
---|
122 | public void deleteLines(int n);
|
---|
123 |
|
---|
124 | public void setOption(int opt, boolean val);
|
---|
125 | public boolean getOption(int opt);
|
---|
126 |
|
---|
127 | public void setAttribute(int attr, boolean val);
|
---|
128 | public boolean getAttribute(int attr);
|
---|
129 | public void setForegroundColor(int c);
|
---|
130 | public void setBackgroundColor(int c);
|
---|
131 | public void clearAllAttributes();
|
---|
132 |
|
---|
133 | public void setProperties(Properties newProps, boolean merge) throws IllegalArgumentException,
|
---|
134 | NoSuchElementException;
|
---|
135 | public Properties getProperties();
|
---|
136 | public boolean getPropsChanged();
|
---|
137 | public void setPropsChanged(boolean value);
|
---|
138 |
|
---|
139 |
|
---|
140 |
|
---|
141 | }
|
---|