1 /* 2 * (SLIK) SimpLIstic sKin functions 3 * (C) 2005 John Ellis 4 * 5 * Author: John Ellis 6 * 7 * This software is released under the GNU General Public License (GNU GPL). 8 * Please read the included file COPYING for more information. 9 * This software comes with no warranty of any kind, use at your own risk! 10 */ 11 12 #ifndef UI_SKIN_H 13 #define UI_SKIN_H 14 15 16 SkinData *skin_new(void); 17 void skin_free(SkinData *s); 18 19 /* app data storage */ 20 void skin_set_data(SkinData *skin, const gchar *key, const gchar *data); 21 const gchar *skin_get_data(SkinData *skin, const gchar *key); 22 23 /* returns pixmap and pixbuf scratch buffers for use by widgets, 24 * size may be larger than requested width and height 25 * pixbuf does not have an alpha channel 26 */ 27 void skin_get_scratch(SkinData *skin, gint w, gint h, GdkPixbuf **pixbuf, GdkPixmap **pixmap); 28 29 GdkPixmap *skin_get_buffer(SkinData *s); 30 GdkPixbuf *skin_get_pixbuf(SkinData *s); 31 UIData *skin_get_ui(SkinData *skin); 32 33 void skin_sync_back(SkinData *s, UIData *ui); 34 void skin_set_underlay(SkinData *skin, UIData *ui, GdkPixbuf *pb); 35 void skin_sync_buffer(SkinData *si, UIData *ui); 36 37 /* key stuff */ 38 WidgetData *skin_register_widget(SkinData *skin, const gchar *key, const gchar *text_id, WidgetType type, gpointer widget); 39 void skin_register_free_all(SkinData *skin); 40 41 WidgetData *skin_widget_get_by_key(SkinData *skin, const gchar *key, WidgetType type); 42 WidgetData *skin_widget_get_by_text_id(SkinData *skin, const gchar *text_id); 43 WidgetData *skin_widget_get_by_widget(SkinData *skin, gpointer widget); 44 45 gint skin_widget_for_each_key(UIData *ui, const gchar *key, WidgetType type, 46 void (*func)(WidgetData *wd, gpointer data, GdkPixbuf *pb, UIData *ui), 47 gpointer data); 48 gint skin_widget_for_each_key_simple(SkinData *skin, const gchar *key, WidgetType type, 49 void (*func)(WidgetData *wd, gpointer data), 50 gpointer data); 51 52 void skin_debug_print_registered_keys(SkinData *skin); 53 54 void skin_widget_check_bounds(SkinData *skin, WidgetData *wd); 55 void skin_check_bounds(SkinData *skin); 56 57 /* only use this to resize a skin before it is added to a ui */ 58 void skin_set_size(SkinData *skin, gint w, gint h); 59 60 void skin_resize(UIData *ui, gint w, gint h); 61 62 void skin_widgets_init(SkinData *skin, UIData *ui); 63 64 void skin_finalize(SkinData *skin); 65 66 67 #endif 68 69 70 71 72 73 74