Project stdui: "Simple Type Dialog User-Interface"

|
Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

cursesui.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Serge Lussier,,,   *
00003  *   serge.lussier@videotron.ca   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #include <cursesui.h>
00021 #include <stdcolor.h>
00022 //#include <stdapp.h>
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();     // want all inputs now;
00049    noecho();  // .... no comments :-)
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 ) { // meta key candiate...
00081          kevent = getch();
00082          if(kevent != 27 ) meta = true;
00083       }
00084       //stdapp::signal_keyevent(kevent,true);
00085     }
00086 }
00087 

API Documentation Generated by:  doxygen 1.4.0
About the author | Site started with trial version of DreamWeaver MX 2004 | Finalizing with  | Contact | ©2005, Serge Lussier ( Bretzel )