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

FXCURCursor.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * C U R C u r s o r O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2001,2006 by Sander Jansen. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXCURCursor.h,v 1.18 2006/01/22 17:57:59 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXCURCURSOR_H
25 #define FXCURCURSOR_H
26 
27 #ifndef FXCURSOR_H
28 #include "FXCursor.h"
29 #endif
30 
31 namespace FX {
32 
33 /// CUR Cursor class
34 class FXAPI FXCURCursor : public FXCursor {
36 protected:
38 private:
39  FXCURCursor(const FXCURCursor&);
40  FXCURCursor &operator=(const FXCURCursor&);
41 public:
42  static const FXchar fileExt[];
43 public:
44 
45  /**
46  * Construct a cursor from memory stream in Microsoft CUR format.
47  * The image is limited to 32x32 pixels.
48  */
49  FXCURCursor(FXApp* a,const void* pix);
50 
51  /// Save pixel data only, in CUR format
52  virtual bool savePixels(FXStream& store) const;
53 
54  /// Load pixel data only, in CUR format
55  virtual bool loadPixels(FXStream& store);
56 
57  /// Destructor
58  virtual ~FXCURCursor();
59  };
60 
61 
62 #ifndef FXLOADICO
63 #define FXLOADICO
64 
65 /**
66 * Check if stream contains a ICO, return TRUE if so.
67 */
68 extern FXAPI bool fxcheckICO(FXStream& store);
69 
70 
71 /**
72 * Load an ICO (Microsoft icon format) file from a stream.
73 * Upon successful return, the pixel array and size are returned.
74 * If an error occurred, the pixel array is set to NULL.
75 */
76 extern FXAPI bool fxloadICO(FXStream& store,FXColor*& data,FXint& width,FXint& height,FXint& xspot,FXint& yspot);
77 
78 
79 /**
80 * Save an ICO (Microsoft icon format) file to a stream.
81 * If no hot-spot given, save as an ICO instead of a CUR resource.
82 */
83 extern FXAPI bool fxsaveICO(FXStream& store,const FXColor *data,FXint width,FXint height,FXint xspot=-1,FXint yspot=-1);
84 
85 #endif
86 
87 }
88 
89 #endif
bool fxsaveICO(FXStream &store, const FXColor *data, FXint width, FXint height, FXint xspot=-1, FXint yspot=-1)
Save an ICO (Microsoft icon format) file to a stream.
char FXchar
Definition: fxdefs.h:387
bool fxcheckICO(FXStream &store)
Check if stream contains a ICO, return TRUE if so.
#define FXAPI
Definition: fxdefs.h:122
Application Object.
Definition: FXApp.h:158
FXuint FXColor
Definition: fxdefs.h:454
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
int FXint
Definition: fxdefs.h:397
Cursor class.
Definition: FXCursor.h:68
bool fxloadICO(FXStream &store, FXColor *&data, FXint &width, FXint &height, FXint &xspot, FXint &yspot)
Load an ICO (Microsoft icon format) file from a stream.
CUR Cursor class.
Definition: FXCURCursor.h:34
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp