ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/src/backend/ndk/application.cpp
Revision: 1.3
Committed: Mon Oct 18 16:38:03 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
Changes since 1.2: +0 -2 lines
Log Message:
support msg colours

File Contents

# User Rev Content
1 sf-pippijn 1.1 /* application.cc
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    
9     #include <ndk++/application.hh>
10    
11     #include <ndk++/color.hh>
12     #include <ndk++/keymap.hh>
13     #include <ndk++/palette.hh>
14     #include <ndk++/panel.hh>
15    
16     #include <clocale>
17    
18     using ndk::application;
19    
20     application &
21     ndk::app ()
22     {
23     static application *instance;
24    
25     setlocale (LC_ALL, "");
26     if (!instance)
27     instance = new application;
28     return *instance;
29     }
30    
31     application::application ()
32     : ncurses::application ()
33     {
34     if (!has_keymap ())
35 sf-pippijn 1.2 return_unless (keypad (stdscr, true) == OK);
36 sf-pippijn 1.1
37     palette::obj_type &p = palette::instance ();
38    
39     p[colors::button_default]
40     = p[colors::label]
41     = p[colors::panel] = { COLOR_WHITE, COLOR_BLACK };
42    
43     p[colors::title]
44     = p[colors::frame1] = { COLOR_WHITE, COLOR_BLUE, WA_BOLD };
45     p[colors::frame2] = { COLOR_WHITE, COLOR_BLACK };
46    
47     p[colors::button_focused] = { COLOR_BLACK, COLOR_WHITE };
48     p[colors::button_selected] = { COLOR_WHITE, COLOR_WHITE, WA_BOLD };
49     p[colors::minibutton] = { COLOR_WHITE, COLOR_BLACK };
50    
51     p[colors::edit_active] = { COLOR_WHITE, COLOR_BLACK, WA_BOLD };
52     p[colors::edit_inactive] = { COLOR_WHITE, COLOR_BLACK };
53     }
54    
55     ndk::engine *
56     application::events ()
57     {
58     return &events_;
59     }
60    
61     void
62     application::update ()
63     {
64     events_.update ();
65     }
66    
67     void
68     application::process (int ch)
69     {
70     events_.process (ch);
71     }
72    
73     void
74     application::in_focus (panel &other)
75     {
76     events_.in_focus (other.events ());
77     }