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

FX::FXIconSource Class Reference

An icon source is a class that loads an icon of any type. More...

#include <FXIconSource.h>

Inheritance diagram for FX::FXIconSource:
FX::FXObject

List of all members.

Public Member Functions

 FXIconSource (FXApp *a)
 Construct an icon source.
virtual FXIconloadIconFile (const FXString &filename, const FXString &type=FXString::null) const
 Load an icon from the file filename.
virtual FXIconloadIconData (const void *pixels, const FXString &type=FXString::null) const
 Load an icon of a given type (e.g.
virtual FXIconloadIconStream (FXStream &store, const FXString &type=FXString::null) const
 Load an icon of a given type (e.g.
virtual FXImageloadImageFile (const FXString &filename, const FXString &type=FXString::null) const
 Load an image from the file filename.
virtual FXImageloadImageData (const void *pixels, const FXString &type=FXString::null) const
 Load an image of a given type (e.g.
virtual FXImageloadImageStream (FXStream &store, const FXString &type=FXString::null) const
 Load an image of a given type (e.g.
virtual FXIconloadScaledIconFile (const FXString &filename, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load icon and scale it such that its dimensions does not exceed given size.
virtual FXIconloadScaledIconData (const void *pixels, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load icon and scale it such that its dimensions does not exceed given size.
virtual FXIconloadScaledIconStream (FXStream &store, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load icon and scale it such that its dimensions does not exceed given size.
virtual FXImageloadScaledImageFile (const FXString &filename, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load image and scale it such that its dimensions does not exceed given size.
virtual FXImageloadScaledImageData (const void *pixels, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load image and scale it such that its dimensions does not exceed given size.
virtual FXImageloadScaledImageStream (FXStream &store, FXint size=32, FXint qual=0, const FXString &type=FXString::null) const
 Load image and scale it such that its dimensions does not exceed given size.
virtual void save (FXStream &store) const
 Save to stream.
virtual void load (FXStream &store)
 Load from stream.
virtual ~FXIconSource ()
 Destroy.

Protected Attributes

FXAppapp

Detailed Description

An icon source is a class that loads an icon of any type.

It exists purely for convenience, to make loading icons simpler by concentrating the knowledge of the supported icon formats in a single place. Needless to say, this class is subclassable, allowing users to add additional icon types and make them available to all widgets which deal with icons. Note, the icons are loaded, but NOT created (realized) yet; this allows users to manipulate the pixel data prior to realizing the icons.


Member Function Documentation

virtual FXIcon* FX::FXIconSource::loadIconData ( const void *  pixels,
const FXString type = FXString::null 
) const [virtual]

Load an icon of a given type (e.g.

"gif") from reswrapped data. Returns NULL if there's some error loading the icon. [The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted].

virtual FXIcon* FX::FXIconSource::loadIconFile ( const FXString filename,
const FXString type = FXString::null 
) const [virtual]

Load an icon from the file filename.

By default, the file extension is stripped and used as the icon type; if an explicit icon type is forced, then that type is used and the extension is ignored. For example, loadIcon("icon","gif") will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the icon.

virtual FXIcon* FX::FXIconSource::loadIconStream ( FXStream store,
const FXString type = FXString::null 
) const [virtual]

Load an icon of a given type (e.g.

"gif") from an already open stream. Returns NULL if there's some error loading the icon. [The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted].

virtual FXImage* FX::FXIconSource::loadImageData ( const void *  pixels,
const FXString type = FXString::null 
) const [virtual]

Load an image of a given type (e.g.

"gif") from reswrapped data. Returns NULL if there's some error loading the icon. [The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted].

virtual FXImage* FX::FXIconSource::loadImageFile ( const FXString filename,
const FXString type = FXString::null 
) const [virtual]

Load an image from the file filename.

By default, the file extension is stripped and used as the image type; if an explicit image type is forced, then that type is used and the extension is ignored. For example, loadImage("image","gif") will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the image.

virtual FXImage* FX::FXIconSource::loadImageStream ( FXStream store,
const FXString type = FXString::null 
) const [virtual]

Load an image of a given type (e.g.

"gif") from an already open stream. Returns NULL if there's some error loading the image. [The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the image format if the parameter is omitted].


The documentation for this class was generated from the following file:

Copyright © 1997-2011 Jeroen van der Zijp