| 1 |
sf-pippijn |
1.1 |
/* application.hh |
| 2 |
|
|
* This file is part of ndk library |
| 3 |
|
|
* Copyright (c) 2003,2004 by Stanislav Ievlev |
| 4 |
|
|
* |
| 5 |
|
|
* This file is covered by the GNU Library General Public License, |
| 6 |
|
|
* which should be included with libndk as the file COPYING. |
| 7 |
|
|
*/ |
| 8 |
|
|
#pragma once |
| 9 |
|
|
|
| 10 |
|
|
#include <ndk/application.hh> |
| 11 |
|
|
|
| 12 |
|
|
#include <ndk/support.hh> |
| 13 |
|
|
#include <ndk/transport.hh> |
| 14 |
|
|
|
| 15 |
|
|
namespace ndk |
| 16 |
|
|
{ |
| 17 |
|
|
struct panel; |
| 18 |
|
|
|
| 19 |
|
|
/** |
| 20 |
|
|
* setup default NDK engine settings, setup palete with default colors |
| 21 |
|
|
* application also a head of all Event Transport subsystem |
| 22 |
|
|
*/ |
| 23 |
|
|
struct application |
| 24 |
|
|
{ |
| 25 |
|
|
application (); |
| 26 |
|
|
~application (); |
| 27 |
|
|
|
| 28 |
|
|
void init_palette (); |
| 29 |
|
|
|
| 30 |
|
|
int width () const; /**< width of the screen */ |
| 31 |
|
|
int height () const; /**< height of the screen */ |
| 32 |
|
|
void cursor_on (); /**< turn on cursor */ |
| 33 |
|
|
void cursor_off (); /**< turn off cursor */ |
| 34 |
|
|
|
| 35 |
|
|
engine *events (); |
| 36 |
|
|
void update (); |
| 37 |
|
|
void process (int ch); |
| 38 |
|
|
void in_focus (panel &); |
| 39 |
|
|
|
| 40 |
|
|
bool has_colors () const { return has_colors_; } |
| 41 |
|
|
|
| 42 |
|
|
static void enable_keypad (WINDOW *win); /* initialise advanced keycodes for this window */ |
| 43 |
|
|
|
| 44 |
|
|
private: |
| 45 |
|
|
SCREEN *screen_; /**< main ncurses screen */ |
| 46 |
|
|
engine events_; /**< entry point to event's roadway */ |
| 47 |
|
|
bool has_colors_; |
| 48 |
|
|
}; |
| 49 |
|
|
|
| 50 |
|
|
extern application *app; |
| 51 |
|
|
} |