CtkImage

CtkImage — A Widget that presents graphical texture data

Synopsis

#include <ctk-button.h>

                    CtkImage;
                    CtkImageClass;
                    CtkImagePrivate;
enum                CtkImageType;
ClutterActor *      ctk_image_new                       (guint size);
ClutterActor *      ctk_image_new_from_pixbuf           (guint size,
                                                         GdkPixbuf *pixbuf);
ClutterActor *      ctk_image_new_from_stock            (guint size,
                                                         const gchar *stock_id);
ClutterActor *      ctk_image_new_from_icon_name        (guint size,
                                                         const gchar *icon_name);
ClutterActor *      ctk_image_new_from_gicon            (guint size,
                                                         GIcon *icon);
ClutterActor *      ctk_image_new_from_filename         (guint size,
                                                         const gchar *filename);
CtkImageType        ctk_image_get_image_storage_type    (CtkImage *image);
void                ctk_image_set_size                  (CtkImage *image,
                                                         guint size);
guint               ctk_image_get_size                  (CtkImage *image);
void                ctk_image_set_from_pixbuf           (CtkImage *image,
                                                         GdkPixbuf *pixbuf);
void                ctk_image_set_from_stock            (CtkImage *image,
                                                         const gchar *stock_id);
void                ctk_image_set_from_icon_name        (CtkImage *image,
                                                         const gchar *icon_name);
void                ctk_image_set_from_gicon            (CtkImage *image,
                                                         GIcon *icon);
void                ctk_image_set_from_filename         (CtkImage *image,
                                                         const gchar *filename);
GdkPixbuf *         ctk_image_get_pixbuf                (CtkImage *image);
const gchar *       ctk_image_get_stock                 (CtkImage *image);
const gchar *       ctk_image_get_icon_name             (CtkImage *image);
GIcon *             ctk_image_get_gicon                 (CtkImage *image);
const gchar *       ctk_image_get_filename              (CtkImage *image);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----CtkActor
                     +----CtkImage

Implemented Interfaces

CtkImage implements ClutterScriptable and CtkFocusable.

Properties

  "filename"                 gchar*                : Read / Write
  "gicon"                    GIcon*                : Read / Write
  "icon-name"                gchar*                : Read / Write
  "pixbuf"                   GdkPixbuf*            : Read / Write
  "size"                     gint                  : Read / Write
  "stock-id"                 gchar*                : Read / Write

Description

CtkImage is designed to present graphical images whist being able to load from intelligent sources such as stock icons and icon names

Details

CtkImage

typedef struct _CtkImage CtkImage;


CtkImageClass

typedef struct {
  /* signals, not vfuncs */

  /* vtable */
} CtkImageClass;


CtkImagePrivate

typedef struct _CtkImagePrivate CtkImagePrivate;


enum CtkImageType

typedef enum
{
  CTK_IMAGE_EMPTY,
  CTK_IMAGE_PIXBUF,
  CTK_IMAGE_STOCK,
  CTK_IMAGE_ICON_NAME,
  CTK_IMAGE_GICON,
  CTK_IMAGE_FILENAME
} CtkImageType;


ctk_image_new ()

ClutterActor *      ctk_image_new                       (guint size);

Creates a new Ctk of the given size

size :

the size of the resulting image

Returns :

a CtkImage

ctk_image_new_from_pixbuf ()

ClutterActor *      ctk_image_new_from_pixbuf           (guint size,
                                                         GdkPixbuf *pixbuf);

Creates a new CtkImage object based on the data in pixbuf

size :

the size of the image in pixels

pixbuf :

a GdkPixbuf object

Returns :

a new CtkImage

ctk_image_new_from_stock ()

ClutterActor *      ctk_image_new_from_stock            (guint size,
                                                         const gchar *stock_id);

Creates a new CtkImage based on the stock_id provided, see GtkStockItem

size :

the size of the image in pixels

stock_id :

a string containing the stock id name

Returns :

a new CtkImage

ctk_image_new_from_icon_name ()

ClutterActor *      ctk_image_new_from_icon_name        (guint size,
                                                         const gchar *icon_name);

Uses a "named icon" to create a new CtkImage object

size :

the size of the image in pixels

icon_name :

a string containing the icon name

Returns :

a new ClutterActor

ctk_image_new_from_gicon ()

ClutterActor *      ctk_image_new_from_gicon            (guint size,
                                                         GIcon *icon);

Creates a new CtkImage object based on the data in the provided GIcon icon

size :

the size of the image in pixels

icon :

a GIcon object containing the icon

Returns :

a new CtkImage

ctk_image_new_from_filename ()

ClutterActor *      ctk_image_new_from_filename         (guint size,
                                                         const gchar *filename);

Creates a new CtkImage from the image containined at filename

size :

the size of the image in pixels

filename :

the filename of the image

Returns :

a new CtkImage

ctk_image_get_image_storage_type ()

CtkImageType        ctk_image_get_image_storage_type    (CtkImage *image);

Retrives the storage type used to create/set the CtkImage object

image :

A CtkImage

Returns :

a CtkImageType object

ctk_image_set_size ()

void                ctk_image_set_size                  (CtkImage *image,
                                                         guint size);

Sets the size of image to the given size

image :

A CtkImage

size :

size in pixels of the image

ctk_image_get_size ()

guint               ctk_image_get_size                  (CtkImage *image);

Retrives the current size in pixels of image

image :

A CtkImage object

Returns :

a uint, 0 if image is invalid

ctk_image_set_from_pixbuf ()

void                ctk_image_set_from_pixbuf           (CtkImage *image,
                                                         GdkPixbuf *pixbuf);

sets image to use pixbuf for its image data see ctk_image_new_from_pixbuf()

image :

A CtkImage object

pixbuf :

A GdkPixbuf object

ctk_image_set_from_stock ()

void                ctk_image_set_from_stock            (CtkImage *image,
                                                         const gchar *stock_id);

sets a CtkImage to display a stock icon see ctk_image_new_from_stock()

image :

a CtkImage

stock_id :

a gchar referencing the stock image id

ctk_image_set_from_icon_name ()

void                ctk_image_set_from_icon_name        (CtkImage *image,
                                                         const gchar *icon_name);

Sets image to use the image data supplied with the given icon_name see: ctk_image_new_from_icon_name();

image :

A CtkImage

icon_name :

a string representation of the icon name

ctk_image_set_from_gicon ()

void                ctk_image_set_from_gicon            (CtkImage *image,
                                                         GIcon *icon);

Sets image to use icon as its image data see: ctk_image_new_from_gicon()

image :

a CtkImage

icon :

A GIcon object

ctk_image_set_from_filename ()

void                ctk_image_set_from_filename         (CtkImage *image,
                                                         const gchar *filename);

Sets image to use filename as its iamge data

image :

a CtkImage

filename :

a string representation of the filename

ctk_image_get_pixbuf ()

GdkPixbuf *         ctk_image_get_pixbuf                (CtkImage *image);

image :

Returns :


ctk_image_get_stock ()

const gchar *       ctk_image_get_stock                 (CtkImage *image);

image :

Returns :


ctk_image_get_icon_name ()

const gchar *       ctk_image_get_icon_name             (CtkImage *image);

image :

Returns :


ctk_image_get_gicon ()

GIcon *             ctk_image_get_gicon                 (CtkImage *image);

image :

Returns :


ctk_image_get_filename ()

const gchar *       ctk_image_get_filename              (CtkImage *image);

image :

Returns :

Property Details

The "filename" property

  "filename"                 gchar*                : Read / Write

Filename to display image of.

Default value: NULL


The "gicon" property

  "gicon"                    GIcon*                : Read / Write

GIcon to display.


The "icon-name" property

  "icon-name"                gchar*                : Read / Write

Icon name of icon to display.

Default value: NULL


The "pixbuf" property

  "pixbuf"                   GdkPixbuf*            : Read / Write

Pixbuf to display.


The "size" property

  "size"                     gint                  : Read / Write

Size of image.

Allowed values: >= 0

Default value: 48


The "stock-id" property

  "stock-id"                 gchar*                : Read / Write

Stock ID of icon to display.

Default value: NULL