ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/include/ndk/pad.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 /* pad.hh
2     * This file is part of ncursesxx 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 libncursesxx as the file COPYING.
7     */
8     #ifndef NCURSESXX_PAD_HH__
9     #define NCURSESXX_PAD_HH__
10    
11     #include <ndk/support.hh>
12    
13     #include <curses.h>
14    
15     #include <memory>
16    
17     namespace ndk
18     {
19     class window;
20    
21     /**
22     * This is an abstraction of NCurses Pad feature - big window, which content you
23     * can se via small viewport window. You can use it as an internal big text buffer
24     * for the widgets
25     */
26     struct pad
27     {
28     explicit pad ();
29     virtual ~pad ();
30    
31     virtual void resize (int w, int h);
32    
33     int width () const;
34     int height () const;
35    
36     void draw (window &viewport, int x = 0, int y = 0);
37    
38     WINDOW *win () const { return pad_.get (); }
39    
40     private:
41     std::unique_ptr<WINDOW, int (*)(WINDOW *)> pad_; /**< pad window */
42     };
43     }
44    
45     #endif