Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXDrawable.h
1 /********************************************************************************
2 * *
3 * D r a w a b l e A r e a *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2024 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXDRAWABLE_H
22 #define FXDRAWABLE_H
23 
24 #ifndef FXID_H
25 #include "FXId.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXVisual;
32 
33 
38 class FXAPI FXDrawable : public FXId {
39  FXDECLARE_ABSTRACT(FXDrawable)
40  friend class FXDC;
41  friend class FXDCWindow;
42  friend class FXGLContext;
43 protected:
44  FXVisual *visual; // Visual for this window
45  FXint width; // Width
46  FXint height; // Height
47 protected:
48  FXDrawable();
49  FXDrawable(FXApp* a,FXint w,FXint h);
50 private:
51  FXDrawable(const FXDrawable&);
52  FXDrawable &operator=(const FXDrawable&);
53 #ifdef WIN32
54  virtual FXID GetDC() const { return nullptr; }
55  virtual int ReleaseDC(FXID) const { return 0; }
56 #endif
57 public:
58 
60  FXVisual* getVisual() const { return visual; }
61 
63  FXint getWidth() const { return width; }
64 
66  FXint getHeight() const { return height; }
67 
69  void setVisual(FXVisual* vis);
70 
72  virtual void resize(FXint w,FXint h);
73 
75  virtual void save(FXStream& store) const;
76 
78  virtual void load(FXStream& store);
79 
81  virtual ~FXDrawable();
82  };
83 
84 }
85 
86 #endif
FXint getHeight() const
Height of drawable.
Definition: FXDrawable.h:66
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
FXVisual * getVisual() const
Get the visual.
Definition: FXDrawable.h:60
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
Abstract Device Context.
Definition: FXDC.h:153
Encapsulates server side resource.
Definition: FXId.h:34
Definition: FX4Splitter.h:28
GL Context.
Definition: FXGLContext.h:32
Visual describes pixel format of a drawable.
Definition: FXVisual.h:58
Window Device Context.
Definition: FXDCWindow.h:48
FXint getWidth() const
Width of drawable.
Definition: FXDrawable.h:63
Drawable is an abstract base class for any surface that can be drawn upon, such as a FXWindow...
Definition: FXDrawable.h:38

Copyright © 1997-2022 Jeroen van der Zijp