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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXCursor.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                         C u r s o r - O b j e c t                             *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1997,2012 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 FXCURSOR_H
00022 #define FXCURSOR_H
00023 
00024 #ifndef FXID_H
00025 #include "FXId.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 // Stock cursors
00032 enum FXStockCursor {
00033   CURSOR_ARROW=1,               
00034   CURSOR_RARROW,                
00035   CURSOR_IBEAM,                 
00036   CURSOR_WATCH,                 
00037   CURSOR_CROSS,                 
00038   CURSOR_UPDOWN,                
00039   CURSOR_LEFTRIGHT,             
00040   CURSOR_MOVE                   
00041   };
00042 
00043 
00045 enum {
00046   CURSOR_KEEP  = 0x00000100,    
00047   CURSOR_OWNED = 0x00000200     
00048   };
00049 
00050 
00052 class FXAPI FXCursor : public FXId {
00053   FXDECLARE(FXCursor)
00054 protected:
00055   FXColor *data;        // Source data
00056   FXint    width;       // Width
00057   FXint    height;      // Height
00058   FXint    hotx;        // Hot spot x
00059   FXint    hoty;        // Hot spot y
00060   FXuint   options;     // Options
00061 protected:
00062   FXCursor();
00063 private:
00064   FXCursor(const FXCursor&);
00065   FXCursor &operator=(const FXCursor&);
00066 public:
00067 
00069   FXCursor(FXApp* a,FXStockCursor curid=CURSOR_ARROW);
00070 
00072   FXCursor(FXApp* a,const FXuchar* src,const FXuchar* msk,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0);
00073 
00075   FXCursor(FXApp* a,const FXColor* pix,FXint w=32,FXint h=32,FXint hx=0,FXint hy=0);
00076 
00078   void setOptions(FXuint opts);
00079 
00081   FXuint getOptions() const { return options; }
00082 
00084   void setOwned(FXbool owned);
00085 
00087   FXbool isOwned() const;
00088 
00090   FXint getWidth() const { return width; }
00091 
00093   FXint getHeight() const { return height; }
00094 
00096   void setHotX(FXint x){ hotx=x; }
00097 
00099   FXint getHotX() const { return hotx; }
00100 
00102   void setHotY(FXint y){ hoty=y; }
00103 
00105   FXint getHotY() const { return hoty; }
00106 
00108   FXbool isColor() const;
00109 
00111   virtual void create();
00112 
00114   virtual void detach();
00115 
00117   virtual void destroy();
00118 
00120   virtual void release();
00121 
00123   virtual FXbool savePixels(FXStream& store) const;
00124 
00126   virtual FXbool loadPixels(FXStream& store);
00127 
00129   virtual void save(FXStream& store) const;
00130 
00132   virtual void load(FXStream& store);
00133 
00135   virtual ~FXCursor();
00136   };
00137 
00138 }
00139 
00140 #endif

Copyright © 1997-2011 Jeroen van der Zijp