ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/include/ndk/menu.hh
Revision: 1.1
Committed: Sun Oct 24 20:31:43 2010 UTC (15 years, 11 months ago) by sf-pippijn
Branch: MAIN
CVS Tags: HEAD
Log Message:
use EV and plain sockets instead of asio

File Contents

# User Rev Content
1 sf-pippijn 1.1 #pragma once
2    
3     #include <ndk/events.hh>
4     #include <ndk/panel.hh>
5    
6     #include <menu.h>
7    
8     #include <memory>
9     #include <vector>
10    
11     namespace ndk
12     {
13     struct menu
14     : panel
15     {
16     menu (panel *parent = 0);
17     ~menu ();
18    
19     void add_item (char const *name, char const *description);
20    
21     private:
22     virtual void draw ();
23    
24     event::result at_keyboard (keyboard const &ev);
25    
26     struct item
27     {
28     item (item const &other) = delete;
29     item &operator = (item const &rhs) = delete;
30    
31     item ();
32     item (char const *name, char const *description);
33    
34     item (item &&other);
35     item &operator = (item &&rhs);
36     ~item ();
37    
38     ITEM *item_;
39     };
40    
41     std::unique_ptr<MENU, int (*)(MENU *)> menu_;
42     std::vector<item> items_;
43     };
44     }