#include <FXIcon.h>
Public Member Functions | |
FXIcon (FXApp *a, const FXColor *pix=NULL, FXColor clr=0, FXuint opts=0, FXint w=1, FXint h=1) | |
virtual void | create () |
virtual void | detach () |
virtual void | destroy () |
virtual void | render () |
virtual void | resize (FXint w, FXint h) |
FXColor | getTransparentColor () const |
void | setTransparentColor (FXColor color) |
virtual | ~FXIcon () |
void | setOptions (FXuint opts) |
FXuint | getOptions () const |
virtual void | setData (FXColor *pix, FXuint opts=0) |
virtual void | setData (FXColor *pix, FXuint opts, FXint w, FXint h) |
FXColor * | getData () const |
FXColor | getPixel (FXint x, FXint y) const |
void | setPixel (FXint x, FXint y, FXColor color) |
bool | hasAlpha () const |
virtual void | restore () |
virtual void | release () |
virtual void | scale (FXint w, FXint h, FXint quality=0) |
virtual void | mirror (bool horizontal, bool vertical) |
virtual void | rotate (FXint degrees) |
virtual void | crop (FXint x, FXint y, FXint w, FXint h, FXColor color=0) |
virtual void | fill (FXColor color) |
virtual void | fade (FXColor color, FXint factor=255) |
virtual void | xshear (FXint shear, FXColor clr=0) |
virtual void | yshear (FXint shear, FXColor clr=0) |
virtual void | hgradient (FXColor left, FXColor right) |
virtual void | vgradient (FXColor top, FXColor bottom) |
virtual void | gradient (FXColor topleft, FXColor topright, FXColor bottomleft, FXColor bottomright) |
virtual void | blend (FXColor color) |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
virtual bool | savePixels (FXStream &store) const |
virtual bool | loadPixels (FXStream &store) |
FXint | getWidth () const |
FXint | getHeight () const |
FXVisual * | getVisual () const |
void | setVisual (FXVisual *vis) |
FXApp * | getApp () const |
FXEventLoop * | getEventLoop () const |
FXID | id () const |
void | setUserData (void *ptr) |
void * | getUserData () const |
virtual long | onDefault (FXObject *, FXSelector, void *) |
const FXchar * | getClassName () const |
bool | isMemberOf (const FXMetaClass *metaclass) const |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
QTransString | tr (const char *text, const char *hint=0) |
virtual void * | getPythonObject () const |
virtual void | decouplePythonObject () const |
Protected Member Functions | |
FXColor | guesstransp () |
Protected Attributes | |
FXID | shape |
FXID | etch |
FXColor | transp |
FXColor * | data |
FXuint | options |
FXVisual * | visual |
FXint | width |
FXint | height |
FXID | xid |
Friends | |
class | FXDC |
class | FXWindow |
class | FXDCWindow |
class | FXDrawable |
class | FXTopWindow |
FX::FXIcon::FXIcon | ( | FXApp * | a, | |
const FXColor * | pix = NULL , |
|||
FXColor | clr = 0 , |
|||
FXuint | opts = 0 , |
|||
FXint | w = 1 , |
|||
FXint | h = 1 | |||
) |
Create an icon with an initial pixel buffer pix, a transparent color clr, and options as in FXImage. The transparent color is used to determine which pixel values are transparent, i.e. need to be masked out in the absence of a true alpha channel. If the flag IMAGE_OPAQUE is passed, the shape and etch bitmaps are generated as if the image is fully opaque, even if it has an alpha channel or transparancy color. The flag IMAGE_ALPHACOLOR is used to force a specific alpha color instead of the alpha channel obtained from the image file. Specifying IMAGE_ALPHAGUESS causes Icon to obtain the alpha color from the background color of the image; it has the same effect as IMAGE_ALPHACOLOR in the sense that the icon will be transparent for those colors matching the alpha color.
virtual FX::FXIcon::~FXIcon | ( | ) | [virtual] |
Destructor.
virtual void FX::FXIcon::create | ( | ) | [virtual] |
Create the server side pixmap, the shape bitmap, and the etch bitmap, then call render() to fill it with the pixel data from the client-side buffer. After the server-side pixmap and bitmaps have been created, the client-side pixel buffer will be deleted unless IMAGE_KEEP has been specified. If the pixel buffer is not owned, i.e. the flag IMAGE_OWNED is not set, the pixel buffer will not be deleted; however the pixel buffer will be set to NULL.
Reimplemented from FX::FXImage.
virtual void FX::FXIcon::detach | ( | ) | [virtual] |
Detach the server side pixmap, shape bitmap, and etch bitmap from the Icon. Afterwards, the Icon is left as if it never had a server-side resources.
Reimplemented from FX::FXImage.
virtual void FX::FXIcon::destroy | ( | ) | [virtual] |
Destroy the server-side pixmap and the shape bitmap and etch bitmap. The client-side pixel buffer is not affected.
Reimplemented from FX::FXImage.
virtual void FX::FXIcon::render | ( | ) | [virtual] |
Render the server-side pixmap, shape bitmap and etch bitmap for the icon from the client-side pixel buffer.
Reimplemented from FX::FXImage.
virtual void FX::FXIcon::resize | ( | FXint | w, | |
FXint | h | |||
) | [virtual] |
Resize both client-side and server-side representations (if any) to the given width and height. The new representations typically contain garbage after this operation and need to be re-filled.
Reimplemented from FX::FXImage.
FXColor FX::FXIcon::getTransparentColor | ( | ) | const [inline] |
Obtain transparency color.
void FX::FXIcon::setTransparentColor | ( | FXColor | color | ) | [inline] |
Change transparency color.
void FX::FXImage::setOptions | ( | FXuint | opts | ) | [inherited] |
Change options.
FXuint FX::FXImage::getOptions | ( | ) | const [inline, inherited] |
To get to the option flags.
virtual void FX::FXImage::setData | ( | FXColor * | pix, | |
FXuint | opts = 0 | |||
) | [virtual, inherited] |
Populate the image with new pixel data of the same size; it will assume ownership of the pixel data if image IMAGE_OWNED option is passed. The server-side representation of the image, if it exists, is not updated. This can be done by calling render().
virtual void FX::FXImage::setData | ( | FXColor * | pix, | |
FXuint | opts, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual, inherited] |
Populate the image with new pixel data of a new size; it will assume ownership of the pixel data if image IMAGE_OWNED option is passed. The size of the server- side representation of the image, if it exists, is adjusted but the contents are not updated yet. This can be done by calling render().
FXColor* FX::FXImage::getData | ( | ) | const [inline, inherited] |
Return pointer to the pixel data of the image.
FXColor FX::FXImage::getPixel | ( | FXint | x, | |
FXint | y | |||
) | const [inline, inherited] |
Get pixel at x,y.
void FX::FXImage::setPixel | ( | FXint | x, | |
FXint | y, | |||
FXColor | color | |||
) | [inline, inherited] |
Change pixel at x,y.
bool FX::FXImage::hasAlpha | ( | ) | const [inherited] |
Scan the image and return false if fully opaque.
virtual void FX::FXImage::restore | ( | ) | [virtual, inherited] |
Retrieves pixels from the server-side image. For example, to make screen snapshots, or to retrieve an image after it has been drawn into by various means.
virtual void FX::FXImage::release | ( | ) | [virtual, inherited] |
Release the client-side pixels buffer, free it if it was owned. If it is not owned, the image just forgets about the buffer.
virtual void FX::FXImage::scale | ( | FXint | w, | |
FXint | h, | |||
FXint | quality = 0 | |||
) | [virtual, inherited] |
Rescale pixels image to the specified width and height; this calls resize() to adjust the client and server side representations.
virtual void FX::FXImage::mirror | ( | bool | horizontal, | |
bool | vertical | |||
) | [virtual, inherited] |
Mirror image horizontally and/or vertically.
virtual void FX::FXImage::rotate | ( | FXint | degrees | ) | [virtual, inherited] |
Rotate image by degrees ccw; this calls resize() to adjust the client and server side representations if necessary.
virtual void FX::FXImage::crop | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXColor | color = 0 | |||
) | [virtual, inherited] |
Crop image to given rectangle; this calls resize() to adjust the client and server side representations. The new image may be smaller or larger than the old one; blank areas are filled with color. There must be at least one pixel of overlap between the old and the new image.
virtual void FX::FXImage::fill | ( | FXColor | color | ) | [virtual, inherited] |
Fill image with uniform color.
virtual void FX::FXImage::fade | ( | FXColor | color, | |
FXint | factor = 255 | |||
) | [virtual, inherited] |
Fade image to uniform color.
virtual void FX::FXImage::xshear | ( | FXint | shear, | |
FXColor | clr = 0 | |||
) | [virtual, inherited] |
Shear image horizontally; the number of pixels is equal to the shear parameter times 256. The area outside the image is filled with transparent black, unless another color is specified.
virtual void FX::FXImage::yshear | ( | FXint | shear, | |
FXColor | clr = 0 | |||
) | [virtual, inherited] |
Shear image vertically; the number of pixels is equal to the shear parameter times 256. The area outside the image is filled with transparent black, unless another color is specified.
virtual void FX::FXImage::hgradient | ( | FXColor | left, | |
FXColor | right | |||
) | [virtual, inherited] |
Fill horizontal gradient.
virtual void FX::FXImage::vgradient | ( | FXColor | top, | |
FXColor | bottom | |||
) | [virtual, inherited] |
Fill vertical gradient.
virtual void FX::FXImage::gradient | ( | FXColor | topleft, | |
FXColor | topright, | |||
FXColor | bottomleft, | |||
FXColor | bottomright | |||
) | [virtual, inherited] |
Fill with gradient.
virtual void FX::FXImage::blend | ( | FXColor | color | ) | [virtual, inherited] |
Blend image over uniform color.
virtual void FX::FXImage::save | ( | FXStream & | store | ) | const [virtual, inherited] |
virtual void FX::FXImage::load | ( | FXStream & | store | ) | [virtual, inherited] |
virtual bool FX::FXImage::savePixels | ( | FXStream & | store | ) | const [virtual, inherited] |
Save pixel data only.
Reimplemented in FX::FXBMPIcon, FX::FXBMPImage, FX::FXGIFIcon, FX::FXGIFImage, FX::FXICOIcon, FX::FXICOImage, FX::FXIFFIcon, FX::FXIFFImage, FX::FXJPGIcon, FX::FXJPGImage, FX::FXPCXIcon, FX::FXPCXImage, FX::FXPNGIcon, FX::FXPNGImage, FX::FXPPMIcon, FX::FXPPMImage, FX::FXRASIcon, FX::FXRASImage, FX::FXRGBIcon, FX::FXRGBImage, FX::FXTGAIcon, FX::FXTGAImage, FX::FXTIFIcon, FX::FXTIFImage, FX::FXXBMIcon, FX::FXXBMImage, FX::FXXPMIcon, and FX::FXXPMImage.
virtual bool FX::FXImage::loadPixels | ( | FXStream & | store | ) | [virtual, inherited] |
Load pixel data only.
Reimplemented in FX::FXBMPIcon, FX::FXBMPImage, FX::FXGIFIcon, FX::FXGIFImage, FX::FXICOIcon, FX::FXICOImage, FX::FXIFFIcon, FX::FXIFFImage, FX::FXJPGIcon, FX::FXJPGImage, FX::FXPCXIcon, FX::FXPCXImage, FX::FXPNGIcon, FX::FXPNGImage, FX::FXPPMIcon, FX::FXPPMImage, FX::FXRASIcon, FX::FXRASImage, FX::FXRGBIcon, FX::FXRGBImage, FX::FXTGAIcon, FX::FXTGAImage, FX::FXTIFIcon, FX::FXTIFImage, FX::FXXBMIcon, FX::FXXBMImage, FX::FXXPMIcon, and FX::FXXPMImage.
FXint FX::FXDrawable::getWidth | ( | ) | const [inline, inherited] |
Width of drawable.
FXint FX::FXDrawable::getHeight | ( | ) | const [inline, inherited] |
Height of drawable.
FXVisual* FX::FXDrawable::getVisual | ( | ) | const [inline, inherited] |
Get the visual.
void FX::FXDrawable::setVisual | ( | FXVisual * | vis | ) | [inherited] |
Change visual.
FXApp* FX::FXId::getApp | ( | ) | const [inline, inherited] |
Get application.
FXEventLoop* FX::FXId::getEventLoop | ( | ) | const [inline, inherited] |
Get event loop which owns this.
FXID FX::FXId::id | ( | ) | const [inline, inherited] |
Get XID handle.
void FX::FXId::setUserData | ( | void * | ptr | ) | [inline, inherited] |
Set user data pointer.
void* FX::FXId::getUserData | ( | ) | const [inline, inherited] |
Get user data pointer.
virtual long FX::FXObject::onDefault | ( | FXObject * | , | |
FXSelector | , | |||
void * | ||||
) | [virtual, inherited] |
Called for unhandled messages.
Reimplemented in FX::FXDelegator, FX::FXGLViewer, FX::FXMDIChild, and FX::FXMDIClient.
const FXchar* FX::FXObject::getClassName | ( | ) | const [inherited] |
Get class name of some object.
bool FX::FXObject::isMemberOf | ( | const FXMetaClass * | metaclass | ) | const [inherited] |
Check if object is member of metaclass.
virtual long FX::FXObject::tryHandle | ( | FXObject * | sender, | |
FXSelector | sel, | |||
void * | ptr | |||
) | [virtual, inherited] |
Try handle message safely.
QTransString FX::FXObject::tr | ( | const char * | text, | |
const char * | hint = 0 | |||
) | [inherited] |
Returns a human translated version of the text to the locale language (warning: uses a virtual method call, so can't use before construction)
virtual void* FX::FXObject::getPythonObject | ( | ) | const [inline, virtual, inherited] |
Returns the python object representing this instance (if created in python).
virtual void FX::FXObject::decouplePythonObject | ( | ) | const [inline, virtual, inherited] |
Causes decoupling of python object from this object (deletes self).