ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/cf.schmorp.de/dclient/include/ncurses/window.hh
Revision: 1.2
Committed: Wed Oct 20 05:09:14 2010 UTC (16 years ago) by sf-pippijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
unused

File Contents

# User Rev Content
1 sf-pippijn 1.1 /* window.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_WINDOW_HH__
9     #define NCURSESXX_WINDOW_HH__
10    
11     #include <ncurses/support.hh>
12    
13     #include <curses.h>
14    
15     #include <memory>
16    
17     namespace ncurses
18     {
19    
20     /**
21     * Generic interface to NCurses window, it's only a container with general
22     * functions, more powerful interface with subwindows and moving will be
23     * provided by panel note: derived windows (and subwindows) are unusable,
24     * because their separate single buffer with window, so I use only general
25     * windows ().
26     */
27     struct window
28     {
29     explicit window ();
30     virtual ~window ();
31    
32     virtual void resize (int w, int h);
33    
34     int width () const;
35     int height () const;
36     int x () const;
37     int y () const;
38     int right_x () const { return x () + width (); }
39     int bottom_y () const { return y () + height (); }
40    
41     /**
42     * mark line of the window as needed to update
43     * @param num number of the line
44     * @param count number of the lines to touch
45     */
46     void touch_line (int num, int count = 1);
47     void commit (); /**< commit window changes to virtual screen */
48    
49     void set_scroll (bool res = false); /**< scroll window content or not */
50    
51     void update () { wrefresh (win ()); }
52    
53     WINDOW *win () const { return win_.get (); }
54    
55     private:
56     std::unique_ptr<WINDOW, int (*)(WINDOW *)> win_;
57     };
58    
59     /**
60     * copy window content from source to destination
61     */
62     void copy (window &source, window &destination);
63     }
64    
65     #endif