curses_stub.cxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00034
00035 #include <iostream>
00036
00037 #include <cxxtls/cursesinterface.h>
00038
00039 using namespace std;
00040 using namespace cxxtls;
00041
00042 namespace cxxtls
00043 {
00044
00045 namespace CursesInterface
00046 {
00047 bool winch_occurred = false;
00048 bool resize_requested = false;
00049
00050 int row;
00051 int col;
00052
00053 int att;
00054
00055 void openCursesTerminal()
00056 {
00057 std::cout << "opening terminal" << std::endl;
00058 }
00059
00060 void closeCursesTerminal()
00061 {
00062 std::cout << "closing terminal" << std::endl;
00063 }
00064
00065 int mapCursesKey(int curses_key)
00066 {
00067 return curses_key;
00068 }
00069
00070 void getCursesCursor(int *row, int *col)
00071 {
00072 *row = CursesInterface::row;
00073 *col = CursesInterface::col;
00074 }
00075
00076 void getCursesScreenSize(int *row, int *col)
00077 {
00078 *row = 25;
00079 *col = 80;
00080 }
00081
00082
00083 void setCursesAttributes( int a )
00084 {
00085 CursesInterface::att = a;
00086 }
00087
00088
00089 void paintCharString(char const *r, int count, int a, int row, int col)
00090 {
00091 std::cout << "paintCharString(\"";
00092
00093 std::cout.write(r, count);
00094
00095 std::cout << "\", " << count << ", " << a << ", " << row << ", " << col << ")" << std::endl;
00096
00097 setCursesAttributes(a);
00098
00099 moveCursesCursor(row,col);
00100
00101 while(count--)
00102 {
00103 ++CursesInterface::row;
00104 ++r;
00105 }
00106 }
00107
00108 void paintCharString(long c, int count, int a, int row, int col)
00109 {
00110 std::cout << "paintCharString('" << (char)(c) ;
00111 std::cout << "', " << count << ", " << a << ", " << row << ", " << col << ")" << std::endl;
00112
00113 setCursesAttributes(a);
00114
00115 moveCursesCursor(row,col);
00116
00117 while(count--)
00118 {
00119 ++CursesInterface::col;
00120 }
00121 }
00122
00123
00124
00125 void refreshCursesWindow()
00126 {
00127 }
00128
00129 void beepCursesTerminal()
00130 {
00131 }
00132
00133
00134 void moveCursesCursor(int row, int col)
00135 {
00136 CursesInterface::row = row;
00137 CursesInterface::col = col;
00138
00139 std::cout << "moveCursesCursor(" << row << ", " << col << ")" << std::endl;
00140 }
00141
00142
00143 void make_xterm_terminfo_file(FileName const &dir)
00144 {
00145 }
00146
00147 void create_key_sequences_map()
00148 {
00149 }
00150
00151
00152 int alarm_occurred=0;
00153
00154 int read_key_char()
00155
00156
00157 {
00158 return ' ';
00159 }
00160
00161
00162 int read_mapped_key(CursorWindow &w)
00163
00164
00165
00166 {
00167 static int eof_counter=0;
00168
00169 if(std::cin.eof())
00170 {
00171
00172
00173
00174
00175
00176 ++eof_counter;
00177
00178 if(eof_counter & 1)
00179 return ' ';
00180 else
00181 return 0x1b;
00182 }
00183
00184 return std::cin.get();
00185
00186 }
00187
00188 long line_chars[lcCOUNT];
00189 mouse_info read_mouse_info() { return mouse_info(0,0,0); }
00190
00191 };
00192
00193 }