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

FXDrawable.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                           D r a w a b l e   A r e a                           *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2002 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXDrawable.h,v 1.17 2002/01/18 22:42:52 jeroen Exp $                     *
00023 ********************************************************************************/
00024 #ifndef FXDRAWABLE_H
00025 #define FXDRAWABLE_H
00026 
00027 #ifndef FXID_H
00028 #include "FXId.h"
00029 #endif
00030 
00031 
00032 
00033 class FXVisual;
00034 
00035 
00036 /**
00037 * Drawable is an abstract base class for any surface that can be
00038 * drawn upon, such as a FXWindow, or FXImage.
00039 */
00040 class FXAPI FXDrawable : public FXId {
00041   FXDECLARE_ABSTRACT(FXDrawable)
00042   friend class FXDC;
00043   friend class FXDCWindow;
00044 protected:
00045   FXVisual     *visual;                 // Visual for this window
00046   FXint         width;                  // Width
00047   FXint         height;                 // Height
00048 protected:
00049   FXDrawable();
00050   FXDrawable(FXApp* a,FXint w,FXint h);
00051 private:
00052   FXDrawable(const FXDrawable&);
00053   FXDrawable &operator=(const FXDrawable&);
00054 #ifdef WIN32
00055   virtual FXID GetDC() const { return NULL; }
00056   virtual int ReleaseDC(FXID) const { return 0; }
00057 #endif
00058 public:
00059 
00060   /// Width of drawable
00061   FXint getWidth() const { return width; }
00062 
00063   /// Height of drawable
00064   FXint getHeight() const { return height; }
00065 
00066   /// Get the visual
00067   FXVisual* getVisual() const { return visual; }
00068 
00069   /// Change visual
00070   void setVisual(FXVisual* vis);
00071 
00072   /// Resize drawable to the specified width and height
00073   virtual void resize(FXint w,FXint h);
00074 
00075   /// Save object to stream
00076   virtual void save(FXStream& store) const;
00077 
00078   /// Load object from stream
00079   virtual void load(FXStream& store);
00080 
00081   /// Cleanup
00082   virtual ~FXDrawable();
00083   };
00084 
00085 
00086 #endif