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

FXDrawable.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * D r a w a b l e A r e a *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (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 GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXDrawable.h,v 1.25 2006/01/22 17:58:01 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXDRAWABLE_H
25 #define FXDRAWABLE_H
26 
27 #ifndef FXID_H
28 #include "FXId.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXVisual;
35 
36 
37 /**
38 * Drawable is an abstract base class for any surface that can be
39 * drawn upon, such as a FXWindow, or FXImage.
40 */
41 class FXAPI FXDrawable : public FXId {
43  friend class FXDC;
44  friend class FXDCWindow;
45 protected:
46  FXVisual *visual; // Visual for this window
47  FXint width; // Width
48  FXint height; // Height
49 protected:
50  FXDrawable();
51  FXDrawable(FXApp* a,FXint w,FXint h);
52 private:
53  FXDrawable(const FXDrawable&);
54  FXDrawable &operator=(const FXDrawable&);
55 #ifdef WIN32
56  virtual FXID GetDC() const { return NULL; }
57  virtual int ReleaseDC(FXID) const { return 0; }
58 #endif
59 public:
60 
61  /// Width of drawable
62  FXint getWidth() const { return width; }
63 
64  /// Height of drawable
65  FXint getHeight() const { return height; }
66 
67  /// Get the visual
68  FXVisual* getVisual() const { return visual; }
69 
70  /// Change visual
71  void setVisual(FXVisual* vis);
72 
73  /// Resize drawable to the specified width and height
74  virtual void resize(FXint w,FXint h);
75 
76  /// Save object to stream
77  virtual void save(FXStream& store) const;
78 
79  /// Load object from stream
80  virtual void load(FXStream& store);
81 
82  /// Cleanup
83  virtual ~FXDrawable();
84  };
85 
86 }
87 
88 #endif
unsigned long FXID
Definition: fxdefs.h:442
#define FXAPI
Definition: fxdefs.h:122
Application Object.
Definition: FXApp.h:158
#define FXDECLARE_ABSTRACT(classname)
Macro to set up abstract class declaration.
Definition: FXObject.h:114
#define NULL
Definition: fxdefs.h:41
Abstract Device Context.
Definition: FXDC.h:191
Encapsulates server side resource.
Definition: FXId.h:37
int FXint
Definition: fxdefs.h:397
Visual describes pixel format of a drawable.
Definition: FXVisual.h:84
Window Device Context.
Definition: FXDCWindow.h:52
Drawable is an abstract base class for any surface that can be drawn upon, such as a FXWindow...
Definition: FXDrawable.h:41

Copyright © 1997-2005 Jeroen van der Zijp