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

FXDrawable.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                           D r a w a b l e   A r e a                           *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2010 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXDRAWABLE_H
00022 #define FXDRAWABLE_H
00023 
00024 #ifndef FXID_H
00025 #include "FXId.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXVisual;
00032 
00033 
00034 /**
00035 * Drawable is an abstract base class for any surface that can be
00036 * drawn upon, such as a FXWindow, or FXImage.
00037 */
00038 class FXAPI FXDrawable : public FXId {
00039   FXDECLARE_ABSTRACT(FXDrawable)
00040   friend class FXDC;
00041   friend class FXDCWindow;
00042   friend class FXGLContext;
00043 protected:
00044   FXVisual *visual;     // Visual for this window
00045   FXint     width;      // Width
00046   FXint     height;     // Height
00047 protected:
00048   FXDrawable();
00049   FXDrawable(FXApp* a,FXint w,FXint h);
00050 private:
00051   FXDrawable(const FXDrawable&);
00052   FXDrawable &operator=(const FXDrawable&);
00053 #ifdef WIN32
00054   virtual FXID GetDC() const { return NULL; }
00055   virtual int ReleaseDC(FXID) const { return 0; }
00056 #endif
00057 public:
00058 
00059   /// Get the visual
00060   FXVisual* getVisual() const { return visual; }
00061 
00062   /// Width of drawable
00063   FXint getWidth() const { return width; }
00064 
00065   /// Height of drawable
00066   FXint getHeight() const { return height; }
00067 
00068   /// Change visual
00069   void setVisual(FXVisual* vis);
00070 
00071   /// Resize drawable to the specified width and height
00072   virtual void resize(FXint w,FXint h);
00073 
00074   /// Save object to stream
00075   virtual void save(FXStream& store) const;
00076 
00077   /// Load object from stream
00078   virtual void load(FXStream& store);
00079 
00080   /// Cleanup
00081   virtual ~FXDrawable();
00082   };
00083 
00084 }
00085 
00086 #endif

Copyright © 1997-2010 Jeroen van der Zijp