![]() |
![]() |
![]() |
Clutter-Gtk 0.90.2 Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum ClutterGtkInitError; GOptionGroup * gtk_clutter_get_option_group (void
); ClutterInitError gtk_clutter_init (int *argc
,char ***argv
); ClutterInitError gtk_clutter_init_with_args (int *argc
,char ***argv
,const char *parameter_string
,GOptionEntry *entries
,const char *translation_domain
,GError **error
); void gtk_clutter_get_fg_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_bg_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_text_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_base_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_text_aa_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_light_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_mid_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); void gtk_clutter_get_dark_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
); enum GtkClutterTextureError; #define GTK_CLUTTER_TEXTURE_ERROR ClutterActor * gtk_clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf
); ClutterActor * gtk_clutter_texture_new_from_stock (GtkWidget *widget
,const gchar *stock_id
,GtkIconSize size
); ClutterActor * gtk_clutter_texture_new_from_icon_name (GtkWidget *widget
,const gchar *icon_name
,GtkIconSize size
); gboolean gtk_clutter_texture_set_from_pixbuf (ClutterTexture *texture
,GdkPixbuf *pixbuf
,GError **error
); gboolean gtk_clutter_texture_set_from_stock (ClutterTexture *texture
,GtkWidget *widget
,const gchar *stock_id
,GtkIconSize size
,GError **error
); gboolean gtk_clutter_texture_set_from_icon_name (ClutterTexture *texture
,GtkWidget *widget
,const gchar *icon_name
,GtkIconSize size
,GError **error
);
In order to properly integrate a Clutter scene into a GTK+ applications a certain degree of state must be retrieved from GTK+ itself.
Clutter-GTK provides API for easing the process of synchronizing colors with the current GTK+ theme and for loading image sources from GdkPixbuf, GTK+ stock items and icon themes.
typedef enum { CLUTTER_INIT_ERROR_LAST = CLUTTER_INIT_ERROR_INTERNAL, CLUTTER_INIT_ERROR_GTK = (CLUTTER_INIT_ERROR_LAST - 1) } ClutterGtkInitError;
Extension of the ClutterInitError enumeration for the integration with GTK+
This enumeration might be extended at later date
GOptionGroup * gtk_clutter_get_option_group (void
);
Returns a GOptionGroup for the command line arguments recognized
by Clutter. You should add this group to your GOptionContext with
g_option_context_add_group()
, if you are using g_option_context_parse()
to parse your commandline arguments instead of using gtk_clutter_init()
or gtk_clutter_init_with_args()
.
You should add this option group to your GOptionContext after
the GTK option group created with gtk_get_option_group()
, and after
the clutter option group obtained from clutter_get_option_group_without_init()
.
You should not use clutter_get_option_group()
together with this function.
You must pass TRUE
to gtk_get_option_group()
since gtk-clutter's option
group relies on it.
Parsing options using g_option_context_parse()
with a GOptionContext
containing the returned GOptionGroupwith will result in Clutter's and
GTK-Clutter's initialisation. That is, the following code:
1 2 3 4 5 |
g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_add_group (context, cogl_get_option_group ()); g_option_context_add_group (context, clutter_get_option_group_without_init ()); g_option_context_add_group (context, gtk_clutter_get_option_group ()); res = g_option_context_parse (context, &argc, &argc, NULL); |
is functionally equivalent to:
1 |
gtk_clutter_init (&argc, &argv); |
After g_option_context_parse()
on a GOptionContext containing the
the returned GOptionGroup has returned TRUE
, Clutter and GTK-Clutter are
guaranteed to be initialized.
Returns : |
a GOptionGroup for the commandline arguments recognized by ClutterGtk. [transfer full] |
ClutterInitError gtk_clutter_init (int *argc
,char ***argv
);
This function should be called instead of clutter_init()
and
gtk_init()
.
|
pointer to the arguments count, or NULL
|
|
pointer to the arguments vector, or NULL . [array length=argc]
|
Returns : |
CLUTTER_INIT_SUCCESS on success, a negative integer
on failure.
|
ClutterInitError gtk_clutter_init_with_args (int *argc
,char ***argv
,const char *parameter_string
,GOptionEntry *entries
,const char *translation_domain
,GError **error
);
This function should be called instead of clutter_init()
and
gtk_init_with_args()
.
|
a pointer to the number of command line arguments. |
|
a pointer to the array of command line arguments. [array length=argc] |
|
a string which is displayed in
the first line of --help output, after
|
|
a NULL -terminated array of GOptionEntrys
describing the options of your program
|
|
a translation domain to use for translating
the --help output for the options in entries
with gettext() , or NULL
|
|
a return location for errors |
Returns : |
CLUTTER_INIT_SUCCESS on success, a negative integer
on failure.
|
void gtk_clutter_get_fg_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the foreground color of widget
for the given state
and copies
it into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_bg_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the background color of widget
for the given state
and copies
it into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_text_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the text color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_base_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the base color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_text_aa_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the text-aa color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor |
void gtk_clutter_get_light_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the light color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_mid_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the mid color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
void gtk_clutter_get_dark_color (GtkWidget *widget
,GtkStateType state
,ClutterColor *color
);
Retrieves the dark color of widget
for the given state
and copies it
into color
.
|
a GtkWidget |
|
a state |
|
return location for a ClutterColor. [out] |
typedef enum { GTK_CLUTTER_TEXTURE_INVALID_STOCK_ID } GtkClutterTextureError;
An enumeration of error types used in ClutterGtk texture functions
This enumeration might be extended at later date
ClutterActor * gtk_clutter_texture_new_from_pixbuf (GdkPixbuf *pixbuf
);
Creates a new ClutterTexture and sets its contents with a copy
of pixbuf
.
|
a GdkPixbuf |
Returns : |
the newly created ClutterTexture |
ClutterActor * gtk_clutter_texture_new_from_stock (GtkWidget *widget
,const gchar *stock_id
,GtkIconSize size
);
Creates a new ClutterTexture and sets its contents using the stock
icon stock_id
as rendered by widget
.
|
a GtkWidget |
|
the stock id of the icon |
|
the size of the icon, or -1 |
Returns : |
the newly created ClutterTexture |
ClutterActor * gtk_clutter_texture_new_from_icon_name (GtkWidget *widget
,const gchar *icon_name
,GtkIconSize size
);
Creates a new ClutterTexture and sets its contents to be
the icon_name
from the current icon theme.
gboolean gtk_clutter_texture_set_from_pixbuf (ClutterTexture *texture
,GdkPixbuf *pixbuf
,GError **error
);
Sets the contents of texture
with a copy of pixbuf
.
|
a ClutterTexture |
|
a GdkPixbuf |
|
a return location for errors |
Returns : |
TRUE on success, FALSE on failure.
|
gboolean gtk_clutter_texture_set_from_stock (ClutterTexture *texture
,GtkWidget *widget
,const gchar *stock_id
,GtkIconSize size
,GError **error
);
Sets the contents of texture
using the stock icon stock_id
, as
rendered by widget
.
|
a ClutterTexture |
|
a GtkWidget |
|
the stock id of the icon |
|
the size of the icon, or -1 |
|
a return location for errors |
Returns : |
TRUE on success, FALSE on failure.
|
gboolean gtk_clutter_texture_set_from_icon_name (ClutterTexture *texture
,GtkWidget *widget
,const gchar *icon_name
,GtkIconSize size
,GError **error
);
Sets the contents of texture
using the icon_name
from the
current icon theme.
|
a ClutterTexture |
|
a GtkWidget or NULL
|
|
the name of the icon |
|
the icon size or -1 |
|
a return location for errors |
Returns : |
TRUE on success, FALSE on failure.
|