[util] Add error arguments to texture functions
[clutter-gtk] / clutter-gtk / gtk-clutter-util.h
1 /* gtk-clutter-util.h: GTK+ integration utilities
2  *
3  * Copyright (C) 2008 OpenedHand
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not see <http://www.fsf.org/licensing>.
17  *
18  * Authors:
19  *   Emmanuele Bassi  <ebassi@openedhand.com>
20  */
21
22 #if !defined(__CLUTTER_GTK_H_INSIDE__) && !defined(CLUTTER_GTK_COMPILATION)
23 #error "Only <clutter-gtk/clutter-gtk.h> can be included directly."
24 #endif
25
26 #ifndef __GTK_CLUTTER_UTIL_H__
27 #define __GTK_CLUTTER_UTIL_H__
28
29 #include <gtk/gtk.h>
30 #include <clutter/clutter.h>
31
32 G_BEGIN_DECLS
33
34 /**
35  * ClutterGtkInitError:
36  * @CLUTTER_INIT_ERROR_LAST: Placeholder
37  * @CLUTTER_INIT_ERROR_GTK: Unable to initialize GTK+
38  *
39  * Extension of the #ClutterInitError enumeration for the integration
40  * with GTK+
41  *
42  * Since: 0.8
43  */
44 typedef enum {
45   CLUTTER_INIT_ERROR_LAST = CLUTTER_INIT_ERROR_INTERNAL,
46
47   CLUTTER_INIT_ERROR_GTK  = (CLUTTER_INIT_ERROR_LAST - 1)
48 } ClutterGtkInitError;
49
50 /**
51  * ClutterGtkTextureError:
52  * @CLUTTER_INVALID_TYPE: Invalid type given as parameter
53  *
54  * An enumeration of error types used in ClutterGtk texture functions
55  *
56  * Since: 1.0
57  * */
58 typedef enum {
59   CLUTTER_GTK_TEXTURE_INVALID_STOCK_ID,
60
61   CLUTTER_GTK_TEXTURE_ERROR_LAST
62 } ClutterGtkTextureError;
63
64 #define CLUTTER_GTK_TEXTURE_ERROR gtk_clutter_texture_error_quark ()
65
66 ClutterInitError gtk_clutter_init           (int            *argc,
67                                              char         ***argv);
68 ClutterInitError gtk_clutter_init_with_args (int            *argc,
69                                              char         ***argv,
70                                              const char     *parameter_string,
71                                              GOptionEntry   *entries,
72                                              const char     *translation_domain,
73                                              GError        **error);
74
75 void          gtk_clutter_get_fg_color               (GtkWidget      *widget,
76                                                       GtkStateType    state,
77                                                       ClutterColor   *color);
78 void          gtk_clutter_get_bg_color               (GtkWidget      *widget,
79                                                       GtkStateType    state,
80                                                       ClutterColor   *color);
81 void          gtk_clutter_get_text_color             (GtkWidget      *widget,
82                                                       GtkStateType    state,
83                                                       ClutterColor   *color);
84 void          gtk_clutter_get_text_aa_color          (GtkWidget      *widget,
85                                                       GtkStateType    state,
86                                                       ClutterColor   *color);
87 void          gtk_clutter_get_base_color             (GtkWidget      *widget,
88                                                       GtkStateType    state,
89                                                       ClutterColor   *color);
90 void          gtk_clutter_get_light_color            (GtkWidget      *widget,
91                                                       GtkStateType    state,
92                                                       ClutterColor   *color);
93 void          gtk_clutter_get_dark_color             (GtkWidget      *widget,
94                                                       GtkStateType    state,
95                                                       ClutterColor   *color);
96 void          gtk_clutter_get_mid_color              (GtkWidget      *widget,
97                                                       GtkStateType    state,
98                                                       ClutterColor   *color);
99
100 ClutterActor *gtk_clutter_texture_new_from_pixbuf    (GdkPixbuf      *pixbuf);
101 ClutterActor *gtk_clutter_texture_new_from_stock     (GtkWidget      *widget,
102                                                       const gchar    *stock_id,
103                                                       GtkIconSize     size);
104 ClutterActor *gtk_clutter_texture_new_from_icon_name (GtkWidget      *widget,
105                                                       const gchar    *icon_name,
106                                                       GtkIconSize     size);
107 GQuark        gtk_clutter_texture_error_quark        (void);
108 gboolean      gtk_clutter_texture_set_from_pixbuf    (ClutterTexture *texture,
109                                                       GdkPixbuf      *pixbuf,
110                                                       GError        **error);
111 gboolean      gtk_clutter_texture_set_from_stock     (ClutterTexture *texture,
112                                                       GtkWidget      *widget,
113                                                       const gchar    *stock_id,
114                                                       GtkIconSize     size,
115                                                       GError        **error);
116 gboolean      gtk_clutter_texture_set_from_icon_name (ClutterTexture *texture,
117                                                       GtkWidget      *widget,
118                                                       const gchar    *icon_name,
119                                                       GtkIconSize     size,
120                                                       GError        **error);
121
122 G_END_DECLS
123
124 #endif /* __GTK_CLUTTER_UTIL_H__ */