| clutk Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
enum CtkLayerRepeatMode; CtkLayer; CtkLayerClass; CtkLayerPrivate; CtkLayer * ctk_layer_new (guint width,guint height,CtkLayerRepeatMode image_repeat,CtkLayerRepeatMode mask_repeat); guint ctk_layer_get_width (CtkLayer *self); void ctk_layer_set_width (CtkLayer *self,guint width); guint ctk_layer_get_height (CtkLayer *self); void ctk_layer_set_height (CtkLayer *self,guint height); void ctk_layer_get_color (CtkLayer *self,ClutterColor *color); void ctk_layer_set_color (CtkLayer *self,ClutterColor *color); guint8 ctk_layer_get_opacity (CtkLayer *self); void ctk_layer_set_opacity (CtkLayer *self,guint8 opacity); void ctk_layer_set_image_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf); GdkPixbuf * ctk_layer_get_image_pixbuf (CtkLayer *self); void ctk_layer_set_mask_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf); GdkPixbuf * ctk_layer_get_mask_pixbuf (CtkLayer *self); void ctk_layer_set_image_from_file (CtkLayer *self,gchar *filename); void ctk_layer_set_image_from_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf); void ctk_layer_set_image_from_surface (CtkLayer *self,cairo_surface_t *surface); void ctk_layer_set_mask_from_file (CtkLayer *self,gchar *filename); void ctk_layer_set_mask_from_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf); void ctk_layer_set_mask_from_surface (CtkLayer *self,cairo_surface_t *surface); void ctk_layer_set_image_from_id (CtkLayer *self,guint id); void ctk_layer_set_mask_from_id (CtkLayer *self,guint id); guint ctk_layer_get_image_id (CtkLayer *self); guint ctk_layer_get_mask_id (CtkLayer *self); void ctk_layer_set_image_repeat_mode (CtkLayer *self,CtkLayerRepeatMode repeat); CtkLayerRepeatMode ctk_layer_get_image_repeat_mode (CtkLayer *self); void ctk_layer_set_mask_repeat_mode (CtkLayer *self,CtkLayerRepeatMode repeat); CtkLayerRepeatMode ctk_layer_get_mask_repeat_mode (CtkLayer *self); gboolean ctk_layer_is_valid (CtkLayer *self); gboolean ctk_layer_get_enabled (CtkLayer *self); void ctk_layer_set_enabled (CtkLayer *self,gboolean enabled);
"color" ClutterColor* : Read / Write "enabled" gboolean : Read / Write "height" guint : Read / Write "image-id" guint : Read "image-pixbuf" GdkPixbuf* : Read / Write "image-repeat-mode" guint : Read / Write "mask-id" guint : Read "mask-pixbuf" GdkPixbuf* : Read / Write "mask-repeat-mode" guint : Read / Write "opacity" guint : Read / Write "valid" gboolean : Read "width" guint : Read / Write
CtkLayer is a class holding an image or solid color with an associated, but optional, mask. It cannot render itself but is used for painting in class CtkLayerActor.
typedef enum _CtkLayerRepeatMode
{
CTK_LAYER_REPEAT_NONE = 0,
CTK_LAYER_REPEAT_X,
CTK_LAYER_REPEAT_Y,
} CtkLayerRepeatMode;
CtkLayer * ctk_layer_new (guint width,guint height,CtkLayerRepeatMode image_repeat,CtkLayerRepeatMode mask_repeat);
Creates a new CtkLayer with width width and height height. image_repeat
and mask_repeat need to be passed in too, but are not taking into account
yet. Only CTK_LAYER_REPEAT_NONE is used for both at the moment.
|
a guint |
|
a guint |
|
a CtkLayerRepeatMode |
|
a CtkLayerRepeatMode |
Returns : |
a CtkLayer or NULL in an error-case |
void ctk_layer_set_width (CtkLayer *self,guint width);
Set the width of self. If width is set after a previously set image or mask
and does not match their respective width, self will be marked as invalid
and thus will not be rendered, if added to a CtkLayerActor.
void ctk_layer_set_height (CtkLayer *self,guint height);
Set the height of self. If height is set after a previously set image or
mask and does not match their respective height, self will be marked as
invalid and thus will not be rendered, if added to a CtkLayerActor.
void ctk_layer_get_color (CtkLayer *self,ClutterColor *color);
Copy the color of self to the ClutterColor pointed to by color. If you
pass a NULL-pointer for color nothing happens.
If you only need to get the opacity use #ctk_layer_get_opacity() instead.
|
a CtkLayer |
|
a ClutterColor |
void ctk_layer_set_color (CtkLayer *self,ClutterColor *color);
Set the red-, green-, blue- and alpha-component of self. If color or self
is a NULL-pointer nothing happens.
color is used if self only consists of a mask but no image.
If you only need to set the opacity use #ctk_layer_set_opacity() instead.
|
a CtkLayer |
|
a ClutterColor |
guint8 ctk_layer_get_opacity (CtkLayer *self);
Grab the opacity- or alpha-component of self. If you pass in a NULL-pointer
for self this will return 0.
void ctk_layer_set_opacity (CtkLayer *self,guint8 opacity);
Set the alpha- or opacity-component of self. This is mostly used with layers
which have an image and mask defined.
If you pass in a NULL-pointer for self this call does nothing.
void ctk_layer_set_image_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf);
Set the image's pixbuf of self directly. This will reference pixbuf.
GdkPixbuf * ctk_layer_get_image_pixbuf (CtkLayer *self);
Get the pixbuf of self's image, if one is set.
void ctk_layer_set_mask_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf);
Set the mask's pixbuf of self directly. This will reference pixbuf.
GdkPixbuf * ctk_layer_get_mask_pixbuf (CtkLayer *self);
Get the pixbuf of self's mask, if one is set.
|
a CtkLayer |
Returns : |
a pointer to a GtkPixbuf |
void ctk_layer_set_image_from_file (CtkLayer *self,gchar *filename);
Set the image of self by loading the image from filename. Any pre-existing
image will be replaced. If something during loading filename goes wrong
self will be marked as invalid.
void ctk_layer_set_image_from_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf);
Set the image of self by grabbing the pixel-data from pixbuf.
After this call you can free and delete pixbuf. No copy or reference of it
is kept.
void ctk_layer_set_image_from_surface (CtkLayer *self,cairo_surface_t *surface);
Set the image of self by grabbing the pixel-data from surface. surface
needs to be a cairo image-surface. Any pre-existing image will be replaced.
After this call you can free and delete surface. No copy or reference of it
is kept.
|
a CtkLayer |
|
a cairo_surface_t* |
void ctk_layer_set_mask_from_file (CtkLayer *self,gchar *filename);
Set the mask of self by loading the image from filename. Any pre-existing
mask will be replaced. If something during loading filename goes wrong self
will be marked as invalid.
void ctk_layer_set_mask_from_pixbuf (CtkLayer *self,GdkPixbuf *pixbuf);
Sets self's mask from a GdkPixbuf pixbuf. Any pre-existing mask will be
removed by this call. Remember that the passed in surface needs to be of the
same width and height as self. If surface is not an image-surface this call
has no effect.
After this call you can free pixbuf. It is not referenced or copied. A
texture is created and uploaded to the GPU.
void ctk_layer_set_mask_from_surface (CtkLayer *self,cairo_surface_t *surface);
Sets self's mask from a cairo image-surface surface. Any pre-existing mask
will be removed by this call. Remember that the passed in surface needs to
be of the same width and height as self. If surface is not an image-surface
this call has no effect.
After this call you can free surface. It is not referenced or copied. A
texture is created and uploaded to the GPU.
|
a CtkLayer |
|
a cairo_surface_t |
void ctk_layer_set_image_from_id (CtkLayer *self,guint id);
Sets self's image from an OpenGL-texture ID id. Any pre-existing image will
be removed by this call. Remember that the passed in id needs to belong to
a texture with the same width and height as self has.
The texture pointed to by id is NOT cloned. Don't delete after this call!
void ctk_layer_set_mask_from_id (CtkLayer *self,guint id);
Sets self's mask from an OpenGL-texture ID id. Any pre-existing mask will
be removed by this call. Remember that the passed in id needs to belong to
a texture with the same width and height as self has.
The texture pointed to by id is NOT cloned. Don't delete after this call!
guint ctk_layer_get_image_id (CtkLayer *self);
Gets the OpenGL-texture ID of self's image.
guint ctk_layer_get_mask_id (CtkLayer *self);
Gets the OpenGL-texture ID of self's mask.
void ctk_layer_set_image_repeat_mode (CtkLayer *self,CtkLayerRepeatMode repeat);
Set the repeat-mode of self's image. This can be set, but is not taken into
account yet. Sofar only CTK_LAYER_REPEAT_NONE is always applied no matter
what you set here.
|
a CtkLayer |
|
a CtkLayerRepeatMode |
CtkLayerRepeatMode ctk_layer_get_image_repeat_mode (CtkLayer *self);
Get the of repeat-mode of self's image.
|
a CtkLayer |
Returns : |
a CtkLayerRepeatMode |
void ctk_layer_set_mask_repeat_mode (CtkLayer *self,CtkLayerRepeatMode repeat);
Set the repeat-mode of self's mask. This can be set, but is not taken into
account yet. Sofar only CTK_LAYER_REPEAT_NONE is always applied no matter
what you set here.
|
a CtkLayer |
|
a CtkLayerRepeatMode |
CtkLayerRepeatMode ctk_layer_get_mask_repeat_mode (CtkLayer *self);
Get the of repeat-mode of self's mask.
|
a CtkLayer |
Returns : |
a CtkLayerRepeatMode |
gboolean ctk_layer_is_valid (CtkLayer *self);
Get the validity-state of self. A CtkLayer may be invalid if image and mask
provided for it are not of the same size.
gboolean ctk_layer_get_enabled (CtkLayer *self);
Get the enabled-state of self.
"enabled" property"enabled" gboolean : Read / Write
Indicator-flag telling if layer is enabled.
Default value: TRUE
"image-repeat-mode" property"image-repeat-mode" guint : Read / Write
Repeat-mode of layer-image.
Allowed values: <= 3
Default value: 0
"mask-repeat-mode" property"mask-repeat-mode" guint : Read / Write
Repeat-mode of layer-mask.
Allowed values: <= 3
Default value: 0
"opacity" property"opacity" guint : Read / Write
Opacity of layer (A-component of color).
Default value: 0