Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions | Static Public Member Functions
Xfc::Gdk::Pixmap Class Reference

A GdkPixmap C++ wrapper class. More...

#include <xfc/gdk/pixmap.hh>

Inheritance diagram for Xfc::Gdk::Pixmap:
Xfc::Gdk::Drawable Xfc::G::Object Xfc::G::TypeInstance Xfc::Trackable Xfc::Gdk::Bitmap

List of all members.

Public Member Functions

Static Public Member Functions

Constructors


Detailed Description

A GdkPixmap C++ wrapper class.

Pixmaps are offscreen drawables. They can be drawn upon with the standard drawing primitives, then copied to another drawable (such as a Gdk::Window) with draw(). The depth of a pixmap is the number of bits per pixels. Bitmaps are simply pixmaps with a depth of 1. (That is, they are monochrome bitmaps, each pixel can be either on or off).

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.


Constructor & Destructor Documentation

Xfc::Gdk::Pixmap::Pixmap ( GdkPixmap *  pixmap,
bool  owns_reference = true 
) [explicit, protected]

Construct a new Pixmap from an existing GdkPixmap.

Parameters:
pixmapA pointer to a GdkPixmap.
owns_referenceSet false if the initial reference count is floating, set true if it's not.

The pixmap can be a newly created GdkPixmap or an existing GdkPixmap. (see G::Object::Object).

Xfc::Gdk::Pixmap::Pixmap ( const Drawable drawable,
int  width,
int  height 
)

Construct a new pixmap with the given size, using window to determine the default values.

Parameters:
drawableThe Drawable to use to get the depth.
widthThe width of the new pixmap in pixels.
heightThe height of the new pixmap in pixels.

The depth of the new pixmap will be equal to that of the window. Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( int  width,
int  height,
int  depth 
)

Create a new pixmap with the given size and depth.

Parameters:
widthThe width of the new pixmap in pixels.
heightThe height of the new pixmap in pixels.
depthThe depth (number of bits per pixel) of the new pixmap.

Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( const Drawable drawable,
const char *  data,
int  width,
int  height,
const Color fg,
const Color bg 
)

Create a two colored pixmap from data in XBM format.

Parameters:
drawableThe Drawable to use to get the depth.
dataA pointer to the data.
widthThe width of the new pixmap in pixels.
heightThe height of the new pixmap in pixels.
fgThe foreground color.
bgThe background color.

Pixmap is created with a reference count of 1 the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( const char *  data,
int  width,
int  height,
int  depth,
const Color fg,
const Color bg 
)

Create a two colored pixmap from data in XBM format using the root window to determine the default values.

Parameters:
dataA pointer to the data.
widthThe width of the new pixmap in pixels.
heightThe height of the new pixmap in pixels.
depthThe depth (number of bits per pixel) of the new pixmap.
fgThe foreground color.
bgThe background color.

Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( const Drawable drawable,
const String filename,
Pointer< Bitmap > *  mask = 0,
const Color transparent_color = 0 
)

Create a pixmap from a XPM file.

Parameters:
drawableThe Drawable whose colormap the pixmap will use.
filenameThe filename of a file containing XPM data.
maskA smart pointer to a place to store a bitmap representing the transparency mask of the XPM file. Can be null, in which case transparency will be ignored.
transparent_colorThe color to be used for the pixels that are transparent in the input file. Can be null, in which case a default color will be used.

Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( Colormap colormap,
const String filename,
Pointer< Bitmap > *  mask = 0,
const Color transparent_color = 0 
)

Create a pixmap from a XPM file using a particular colormap.

Parameters:
colormapThe Colormap that the new pixmap will be use.
filenameThe filename of a file containing XPM data.
maskA smart pointer to a place to store a bitmap representing the transparency mask of the XPM file. Can be null, in which case transparency will be ignored.
transparent_colorThe color to be used for the pixels that are transparent in the input file. Can be null, in which case a default color will be used.

Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( const Drawable drawable,
const char *const *  data,
Pointer< Bitmap > *  mask = 0,
const Color transparent_color = 0 
)

Create a pixmap from data in XPM format.

Parameters:
drawableThe Drawable whose colormap the pixmap will use.
dataA pointer to a string containing the XPM data.
maskA smart pointer to a place to store a bitmap representing the transparency mask of the XPM file. Can be null, in which case transparency will be ignored.
transparent_colorThe color to be used for the pixels that are transparent in the input file. Can be null, in which case a default color will be used.

Pixmap is created with a reference count of 1 that the caller owns.

Xfc::Gdk::Pixmap::Pixmap ( Colormap colormap,
const char *const *  data,
Pointer< Bitmap > *  mask = 0,
const Color transparent_color = 0 
)

Create a pixmap from data in XPM format using a particular colormap.

Parameters:
colormapThe Colormap that the new pixmap will be use.
dataA pointer to a string containing the XPM data.
maskA smart pointer to a place to store a bitmap representing the transparency mask of the XPM file. Can be null, in which case transparency will be ignored.
transparent_colorThe color to be used for the pixels that are transparent in the input file. Can be null, in which case a default color will be used.

Pixmap is created with a reference count of 1 that the caller owns.


Member Function Documentation

void Xfc::Gdk::Pixmap::clear ( GC gc,
const Color color 
)

Clears a pixmap with the color specified.

Parameters:
gcA graphics context.
colorThe color to clear the pixmap with.
static Pointer<Pixmap> Xfc::Gdk::Pixmap::create ( GdkNativeWindow  anid,
const Display display = 0 
) [static]

Wraps a native pixmap in a Gdk::Pixmap.

Parameters:
anidA native pixmap handle.
displayThe Display where anid is located, or null for the default display.
Returns:
A smart pointer to the newly-created Gdk::Pixmap wrapper for the native pixmap, or null if the pixmap has been destroyed.

In the X backend, a native pixmap handle is an Xlib XID. This method fail if the pixmap has been destroyed.

static Pointer<Pixmap> Xfc::Gdk::Pixmap::lookup ( GdkNativeWindow  anid,
const Display display = 0 
) [static]

Looks up the Gdk::Pixmap that wraps the given native pixmap handle.

Parameters:
anidA native pixmap handle.
displayThe Display associated with anid, or null for the default display.
Returns:
The Gdk::Pixmap wrapper for the native pixmap, or null if there is none.

In the X backend, a native pixmap handle is an Xlib XID.


The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC