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

FXCURCursor.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        C U R   C u r s o r    O b j e c t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2001,2009 by Sander Jansen.   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 * $Id: FXCURCursor.h,v 1.24 2009/01/06 13:07:22 fox Exp $                       *
00022 ********************************************************************************/
00023 #ifndef FXCURCURSOR_H
00024 #define FXCURCURSOR_H
00025 
00026 #ifndef FXCURSOR_H
00027 #include "FXCursor.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 /// CUR Cursor class
00033 class FXAPI FXCURCursor : public FXCursor {
00034   FXDECLARE(FXCURCursor)
00035 protected:
00036   FXCURCursor(){}
00037 private:
00038   FXCURCursor(const FXCURCursor&);
00039   FXCURCursor &operator=(const FXCURCursor&);
00040 public:
00041   static const FXchar fileExt[];
00042 public:
00043 
00044   /**
00045   * Construct a cursor from memory stream in Microsoft CUR format.
00046   * The image is limited to 32x32 pixels.
00047   */
00048   FXCURCursor(FXApp* a,const void* pix);
00049 
00050   /// Save pixel data only, in CUR format
00051   virtual FXbool savePixels(FXStream& store) const;
00052 
00053   /// Load pixel data only, in CUR format
00054   virtual FXbool loadPixels(FXStream& store);
00055 
00056   /// Destructor
00057   virtual ~FXCURCursor();
00058   };
00059 
00060 
00061 #ifndef FXLOADICO
00062 #define FXLOADICO
00063 
00064 /**
00065 * Check if stream contains a ICO, return true if so.
00066 */
00067 extern FXAPI FXbool fxcheckICO(FXStream& store);
00068 
00069 
00070 /**
00071 * Load an ICO (Microsoft icon format) file from a stream.
00072 * Upon successful return, the pixel array and size are returned.
00073 * If an error occurred, the pixel array is set to NULL.
00074 */
00075 extern FXAPI FXbool fxloadICO(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& xspot,FXint& yspot);
00076 
00077 
00078 /**
00079 * Save an ICO (Microsoft icon format) file to a stream.
00080 * If no hot-spot given, save as an ICO instead of a CUR resource.
00081 */
00082 extern FXAPI FXbool fxsaveICO(FXStream& store,const FXColor *data,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
00083 
00084 #endif
00085 
00086 }
00087 
00088 #endif

Copyright © 1997-2009 Jeroen van der Zijp