cursesui.cpp
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 #include <cursesui.h>
00021 #include <stdcolor.h>
00022
00023
00024
00025
00026 namespace stdui {
00027
00028 cursesui::cursesui()
00029 {
00030 }
00031
00032
00033 cursesui::~cursesui()
00034 {
00035 }
00036
00037
00038 }
00039
00040
00044 bool stdui::cursesui::startncurses()
00045 {
00046 if(! initscr() ) return false;
00047 int sw,sh;
00048 raw();
00049 noecho();
00050 curs_set(0);
00051 keypad(stdscr,true);
00052 meta(stdscr, true);
00053 halfdelay(1);
00054 mousemask(ALL_MOUSE_EVENTS|REPORT_MOUSE_POSITION, NULL);
00055 getmaxyx(stdscr, sh, sw);
00056 _termgeometry.assign(0,0, sw, sh);
00057 stdcolor::init();
00058 }
00059
00060
00064 void stdui::cursesui::endncurses()
00065 {
00066 endwin();
00067 }
00068
00069
00073 void stdui::cursesui::eventsloop()
00074 {
00075 int kevent;
00076 bool meta = false;
00077 for(;;) {
00078 meta = false;
00079 kevent = getch();
00080 if( kevent == 27 ) {
00081 kevent = getch();
00082 if(kevent != 27 ) meta = true;
00083 }
00084
00085 }
00086 }
00087
API Documentation Generated by:
1.4.0
About the author |

Site started with trial version of DreamWeaver MX 2004 |
Finalizing with

|
Contact | ©2005, Serge Lussier ( Bretzel )