VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gxdrawable.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Graeme Walker
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 ///
18 /// \file gxdrawable.h
19 ///
20 
21 #ifndef GX_DRAWABLE_H
22 #define GX_DRAWABLE_H
23 
24 #include "gdef.h"
25 #include "gxdef.h"
26 
27 namespace GX
28 {
29  class Drawable ;
30  class Display ;
31  class Context ;
32 }
33 
34 /// \class GX::Drawable
35 /// An abstract base class for xserver-side drawables (windows, pixmaps, etc)
36 /// with methods for drawing points, lines and blocks.
37 ///
39 {
40 public:
41  explicit Drawable( Display & ) ;
42  ///< Constructor. The display reference is kept.
43 
44  virtual ~Drawable() ;
45  ///< Destructor.
46 
47  virtual ::Drawable xd() = 0 ;
48  ///< Returns the X object.
49 
50  void drawPoint( Context & , int x , int y ) ;
51  ///< Draws a point.
52 
53  void drawLine( Context & , int x1 , int y1 , int x2 , int y2 ) ;
54  ///< Draws a line.
55 
56  void drawRectangle( Context & , int x , int y , int dx , int dy ) ;
57  ///< Draws a rectangle.
58 
59  void drawArc( Context & , int x , int y , unsigned int width ,
60  unsigned int height , int angle1 , int angle2 ) ;
61  ///< Draws an arc.
62 
63 private:
64  Drawable( const Drawable & ) ;
65  void operator=( const Drawable & ) ;
66 
67 private:
68  Display & m_display ;
69 } ;
70 
71 #endif
An Xlib Display wrapper.
Definition: gxdisplay.h:38
void drawPoint(Context &, int x, int y)
Draws a point.
Definition: gxdrawable.cpp:37
Drawable(Display &)
Constructor. The display reference is kept.
Definition: gxdrawable.cpp:28
virtual ::Drawable xd()=0
Returns the X object.
void drawRectangle(Context &, int x, int y, int dx, int dy)
Draws a rectangle.
Definition: gxdrawable.cpp:47
void drawLine(Context &, int x1, int y1, int x2, int y2)
Draws a line.
Definition: gxdrawable.cpp:42
An Xlib GC wrapper.
Definition: gxcontext.h:37
void drawArc(Context &, int x, int y, unsigned int width, unsigned int height, int angle1, int angle2)
Draws an arc.
Definition: gxdrawable.cpp:54
An abstract base class for xserver-side drawables (windows, pixmaps, etc) with methods for drawing po...
Definition: gxdrawable.h:38
virtual ~Drawable()
Destructor.
Definition: gxdrawable.cpp:33