]> git.mxchange.org Git - flightgear.git/blob - src/GUI/CanvasWidget.hxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / GUI / CanvasWidget.hxx
1 /*
2  * CanvasWidget.hxx
3  *
4  *  Created on: 03.07.2012
5  *      Author: tom
6  */
7
8 #ifndef CANVASWIDGET_HXX_
9 #define CANVASWIDGET_HXX_
10
11 #include <Main/fg_props.hxx>
12 #include <plib/pu.h>
13
14 class CanvasMgr;
15
16 class CanvasWidget:
17   public puObject
18 {
19   public:
20     CanvasWidget( int x, int y,
21                   int width, int height,
22                   SGPropertyNode* props,
23                   const std::string& module );
24     virtual ~CanvasWidget();
25
26     virtual void doHit (int button, int updown, int x, int y);
27     virtual int  checkKey(int key   , int updown);
28
29     virtual void setSize ( int w, int h );
30     virtual void draw(int dx, int dy);
31
32   private:
33
34     CanvasMgr  *_canvas_mgr; // TODO maybe we should store this in some central
35                              // location or make it static...
36
37     GLuint              _tex_id;    //<! OpenGL texture id if canvas
38     size_t              _no_tex_cnt;//<! Count since how many frames we were not
39                                     //   able to get the texture (for debugging)
40     SGPropertyNode_ptr  _canvas;    //<! Canvas root property node
41     SGPropertyNode     *_mouse_x,
42                        *_mouse_y,
43                        *_mouse_down,
44                        *_mouse_drag;
45 };
46
47 #endif /* CANVASWIDGET_HXX_ */