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

FXGIFCursor.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * G I F C u r so r O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2000,2006 by Daniel Gehriger. 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: FXGIFCursor.h,v 1.22 2006/01/22 17:58:02 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXGIFCURSOR_H
25 #define FXGIFCURSOR_H
26 
27 #ifndef FXCURSOR_H
28 #include "FXCursor.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /// GIF Cursor class
35 class FXAPI FXGIFCursor : public FXCursor {
37 protected:
39 private:
40  FXGIFCursor(const FXGIFCursor&);
41  FXGIFCursor &operator=(const FXGIFCursor&);
42 public:
43  static const FXchar fileExt[];
44 public:
45 
46  /**
47  * Construct a cursor from memory stream in Compuserve GIF format.
48  * Hot spot may be specified using hx and hy parameters, since the GIF
49  * format does not specify a hot spot. The image must be smaller than
50  * 32x32 pixels.
51  */
52  FXGIFCursor(FXApp* a,const void* pix,FXint hx=0,FXint hy=0);
53 
54  /// Save pixel data only, in GIF format
55  virtual bool savePixels(FXStream& store) const;
56 
57  /// Load pixel data only, in GIF format
58  virtual bool loadPixels(FXStream& store);
59 
60  /// Destroy
61  virtual ~FXGIFCursor(){}
62  };
63 
64 
65 #ifndef FXLOADGIF
66 #define FXLOADGIF
67 
68 /**
69 * Check if stream contains a GIF, return TRUE if so.
70 */
71 extern FXAPI bool fxcheckGIF(FXStream& store);
72 
73 
74 /**
75 * Load an GIF (Graphics Interchange Format) file from a stream.
76 * Upon successful return, the pixel array and size are returned.
77 * If an error occurred, the pixel array is set to NULL.
78 */
79 extern FXAPI bool fxloadGIF(FXStream& store,FXColor*& data,FXint& width,FXint& height);
80 
81 
82 /**
83 * Save an GIF (Graphics Interchange Format) file to a stream.
84 */
85 extern FXAPI bool fxsaveGIF(FXStream& store,const FXColor *data,FXint width,FXint height,bool fast=true);
86 
87 #endif
88 
89 }
90 
91 #endif
char FXchar
Definition: fxdefs.h:387
#define FXAPI
Definition: fxdefs.h:122
bool fxcheckGIF(FXStream &store)
Check if stream contains a GIF, return TRUE if so.
GIF Cursor class.
Definition: FXGIFCursor.h:35
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
bool fxsaveGIF(FXStream &store, const FXColor *data, FXint width, FXint height, bool fast=true)
Save an GIF (Graphics Interchange Format) file to a stream.
int FXint
Definition: fxdefs.h:397
Cursor class.
Definition: FXCursor.h:68
bool fxloadGIF(FXStream &store, FXColor *&data, FXint &width, FXint &height)
Load an GIF (Graphics Interchange Format) file from a stream.
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp