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,2005 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.24 2005/01/16 16:06:06 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXDRAWABLE_H 00025 #define FXDRAWABLE_H 00026 00027 #ifndef FXID_H 00028 #include "FXId.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 class FXVisual; 00035 00036 00037 /** 00038 * Drawable is an abstract base class for any surface that can be 00039 * drawn upon, such as a FXWindow, or FXImage. 00040 */ 00041 class FXAPI FXDrawable : public FXId { 00042 FXDECLARE_ABSTRACT(FXDrawable) 00043 friend class FXDC; 00044 friend class FXDCWindow; 00045 protected: 00046 FXVisual *visual; // Visual for this window 00047 FXint width; // Width 00048 FXint height; // Height 00049 protected: 00050 FXDrawable(); 00051 FXDrawable(FXApp* a,FXint w,FXint h); 00052 private: 00053 FXDrawable(const FXDrawable&); 00054 FXDrawable &operator=(const FXDrawable&); 00055 #ifdef WIN32 00056 virtual FXID GetDC() const { return NULL; } 00057 virtual int ReleaseDC(FXID) const { return 0; } 00058 #endif 00059 public: 00060 00061 /// Width of drawable 00062 FXint getWidth() const { return width; } 00063 00064 /// Height of drawable 00065 FXint getHeight() const { return height; } 00066 00067 /// Get the visual 00068 FXVisual* getVisual() const { return visual; } 00069 00070 /// Change visual 00071 void setVisual(FXVisual* vis); 00072 00073 /// Resize drawable to the specified width and height 00074 virtual void resize(FXint w,FXint h); 00075 00076 /// Save object to stream 00077 virtual void save(FXStream& store) const; 00078 00079 /// Load object from stream 00080 virtual void load(FXStream& store); 00081 00082 /// Cleanup 00083 virtual ~FXDrawable(); 00084 }; 00085 00086 } 00087 00088 #endif

Copyright © 1997-2005 Jeroen van der Zijp