Top | Description | Object Hierarchy | Signals | ![]() |
![]() |
![]() |
![]() |
struct StTextureCache; struct StTextureCacheClass; enum StTextureCachePolicy; StTextureCache * st_texture_cache_get_default (void
); ClutterActor * st_texture_cache_load_sliced_image (StTextureCache *cache
,const gchar *path
,gint grid_width
,gint grid_height
,GFunc load_callback
,gpointer user_data
); ClutterActor * st_texture_cache_bind_pixbuf_property (StTextureCache *cache
,GObject *object
,const char *property_name
); ClutterActor * st_texture_cache_load_gicon (StTextureCache *cache
,StThemeNode *theme_node
,GIcon *icon
,gint size
); ClutterActor * st_texture_cache_load_uri_async (StTextureCache *cache
,const gchar *uri
,int available_width
,int available_height
); CoglHandle st_texture_cache_load_file_to_cogl_texture (StTextureCache *cache
,const gchar *file_path
); cairo_surface_t * st_texture_cache_load_file_to_cairo_surface (StTextureCache *cache
,const gchar *file_path
); CoglHandle (*StTextureCacheLoader) (StTextureCache *cache
,const char *key
,void *data
,GError **error
); CoglHandle st_texture_cache_load (StTextureCache *cache
,const char *key
,StTextureCachePolicy policy
,StTextureCacheLoader load
,void *data
,GError **error
);
typedef enum { ST_TEXTURE_CACHE_POLICY_NONE, ST_TEXTURE_CACHE_POLICY_FOREVER } StTextureCachePolicy;
StTextureCache * st_texture_cache_get_default (void
);
Returns : |
The global texture cache. [transfer none] |
ClutterActor * st_texture_cache_load_sliced_image (StTextureCache *cache
,const gchar *path
,gint grid_width
,gint grid_height
,GFunc load_callback
,gpointer user_data
);
This function reads a single image file which contains multiple images internally.
The image file will be divided using grid_width
and grid_height
;
note that the dimensions of the image loaded from path
should be a multiple of the specified grid dimensions.
|
A StTextureCache |
|
Path to a filename |
|
Width in pixels |
|
Height in pixels |
|
Function called when the image is loaded, or NULL . [scope async][allow-none]
|
|
Data to pass to the load callback |
Returns : |
A new ClutterActor. [transfer none] |
ClutterActor * st_texture_cache_bind_pixbuf_property (StTextureCache *cache
,GObject *object
,const char *property_name
);
Create a ClutterTexture which tracks the GdkPixbuf value of a GObject property
named by property_name
. Unlike other methods in StTextureCache, the underlying
CoglHandle is not shared by default with other invocations to this method.
If the source object is destroyed, the texture will continue to show the last value of the property.
|
A GObject with a property property_name of type GdkPixbuf
|
|
Name of a property |
Returns : |
A new ClutterActor. [transfer none] |
ClutterActor * st_texture_cache_load_gicon (StTextureCache *cache
,StThemeNode *theme_node
,GIcon *icon
,gint size
);
This method returns a new ClutterActor for a given GIcon. If the icon isn't loaded already, the texture will be filled asynchronously.
|
The texture cache instance |
|
The StThemeNode to use for colors, or NULL if the icon must not be recolored. [allow-none] |
|
the GIcon to load |
|
Size of themed |
Returns : |
A new ClutterActor for the icon, or NULL if not found. [transfer none]
|
ClutterActor * st_texture_cache_load_uri_async (StTextureCache *cache
,const gchar *uri
,int available_width
,int available_height
);
Asynchronously load an image. Initially, the returned texture will have a natural size of zero. At some later point, either the image will be loaded successfully and at that point size will be negotiated, or upon an error, no image will be set.
|
The texture cache instance |
|
uri of the image file from which to create a pixbuf |
|
available width for the image, can be -1 if not limited |
|
available height for the image, can be -1 if not limited |
Returns : |
A new ClutterActor with no image loaded initially. [transfer none] |
CoglHandle st_texture_cache_load_file_to_cogl_texture (StTextureCache *cache
,const gchar *file_path
);
This function synchronously loads the given file path
into a COGL texture. On error, a warning is emitted
and COGL_INVALID_HANDLE
is returned.
|
A StTextureCache |
|
Path to a file in supported image format |
Returns : |
a new CoglHandle. [transfer full] |
cairo_surface_t * st_texture_cache_load_file_to_cairo_surface (StTextureCache *cache
,const gchar *file_path
);
This function synchronously loads the given file path
into a cairo surface. On error, a warning is emitted
and NULL
is returned.
|
A StTextureCache |
|
Path to a file in supported image format |
Returns : |
a new cairo_surface_t. [transfer full] |
CoglHandle (*StTextureCacheLoader) (StTextureCache *cache
,const char *key
,void *data
,GError **error
);
See st_texture_cache_load()
. Implementations should return a
texture handle for the given key, or set error
.
|
a StTextureCache |
|
Unique identifier for this texture |
|
Callback user data |
|
A GError |
CoglHandle st_texture_cache_load (StTextureCache *cache
,const char *key
,StTextureCachePolicy policy
,StTextureCacheLoader load
,void *data
,GError **error
);
Load an arbitrary texture, caching it. The string chosen for key
should be of the form "type-prefix:type-uuid". For example,
"url:file:///usr/share/icons/hicolor/48x48/apps/firefox.png", or
"stock-icon:gtk-ok".
|
A StTextureCache |
|
Arbitrary string used to refer to item |
|
Caching policy |
|
Function to create the texture, if not already cached |
|
User data passed to load
|
|
A GError |
Returns : |
A newly-referenced handle to the texture. [transfer full] |
"icon-theme-changed"
signalvoid user_function (StTextureCache *sttexturecache,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"texture-file-changed"
signalvoid user_function (StTextureCache *sttexturecache,
gchar *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |