[14481] | 1 | /* GTK - The GIMP Toolkit |
---|
| 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
---|
| 3 | * |
---|
| 4 | * This library is free software; you can redistribute it and/or |
---|
| 5 | * modify it under the terms of the GNU Library General Public |
---|
| 6 | * License as published by the Free Software Foundation; either |
---|
| 7 | * version 2 of the License, or (at your option) any later version. |
---|
| 8 | * |
---|
| 9 | * This library is distributed in the hope that it will be useful, |
---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 12 | * Library General Public License for more details. |
---|
| 13 | * |
---|
| 14 | * You should have received a copy of the GNU Library General Public |
---|
| 15 | * License along with this library; if not, write to the |
---|
| 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
| 17 | * Boston, MA 02111-1307, USA. |
---|
| 18 | */ |
---|
| 19 | |
---|
| 20 | /* |
---|
| 21 | * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS |
---|
| 22 | * file for a list of people on the GTK+ Team. See the ChangeLog |
---|
| 23 | * files for a list of changes. These files are distributed with |
---|
| 24 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | #ifndef __GTK_RC_H__ |
---|
| 28 | #define __GTK_RC_H__ |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | #include <gtk/gtkstyle.h> |
---|
| 32 | #include <gtk/gtkwidget.h> |
---|
| 33 | |
---|
| 34 | #ifdef __cplusplus |
---|
| 35 | extern "C" { |
---|
| 36 | #endif /* __cplusplus */ |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | typedef enum { |
---|
| 40 | GTK_RC_FG = 1 << 0, |
---|
| 41 | GTK_RC_BG = 1 << 1, |
---|
| 42 | GTK_RC_TEXT = 1 << 2, |
---|
| 43 | GTK_RC_BASE = 1 << 3 |
---|
| 44 | } GtkRcFlags; |
---|
| 45 | |
---|
| 46 | struct _GtkRcStyle |
---|
| 47 | { |
---|
| 48 | gchar *name; |
---|
| 49 | gchar *font_name; |
---|
| 50 | gchar *fontset_name; |
---|
| 51 | gchar *bg_pixmap_name[5]; |
---|
| 52 | |
---|
| 53 | GtkRcFlags color_flags[5]; |
---|
| 54 | GdkColor fg[5]; |
---|
| 55 | GdkColor bg[5]; |
---|
| 56 | GdkColor text[5]; |
---|
| 57 | GdkColor base[5]; |
---|
| 58 | |
---|
| 59 | GtkThemeEngine *engine; |
---|
| 60 | gpointer engine_data; |
---|
| 61 | }; |
---|
| 62 | |
---|
| 63 | void gtk_rc_init (void); |
---|
| 64 | void gtk_rc_add_default_file (const gchar *filename); |
---|
| 65 | void gtk_rc_set_default_files (gchar **filenames); |
---|
| 66 | gchar** gtk_rc_get_default_files (void); |
---|
| 67 | void gtk_rc_parse (const gchar *filename); |
---|
| 68 | void gtk_rc_parse_string (const gchar *rc_string); |
---|
| 69 | gboolean gtk_rc_reparse_all (void); |
---|
| 70 | GtkStyle* gtk_rc_get_style (GtkWidget *widget); |
---|
| 71 | void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style, |
---|
| 72 | const gchar *pattern); |
---|
| 73 | void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style, |
---|
| 74 | const gchar *pattern); |
---|
| 75 | void gtk_rc_add_class_style (GtkRcStyle *rc_style, |
---|
| 76 | const gchar *pattern); |
---|
| 77 | |
---|
| 78 | GtkRcStyle* gtk_rc_style_new (void); |
---|
| 79 | void gtk_rc_style_ref (GtkRcStyle *rc_style); |
---|
| 80 | void gtk_rc_style_unref (GtkRcStyle *rc_style); |
---|
| 81 | |
---|
| 82 | /* Tell gtkrc to use a custom routine to load images specified in rc files instead of |
---|
| 83 | * the default xpm-only loader |
---|
| 84 | */ |
---|
| 85 | typedef GdkPixmap* (*GtkImageLoader) (GdkWindow *window, |
---|
| 86 | GdkColormap *colormap, |
---|
| 87 | GdkBitmap **mask, |
---|
| 88 | GdkColor *transparent_color, |
---|
| 89 | const gchar *filename); |
---|
| 90 | void gtk_rc_set_image_loader (GtkImageLoader loader); |
---|
| 91 | |
---|
| 92 | GdkPixmap* gtk_rc_load_image (GdkColormap *colormap, |
---|
| 93 | GdkColor *transparent_color, |
---|
| 94 | const gchar *filename); |
---|
| 95 | gchar* gtk_rc_find_pixmap_in_path (GScanner *scanner, |
---|
| 96 | const gchar *pixmap_file); |
---|
| 97 | gchar* gtk_rc_find_module_in_path (const gchar *module_file); |
---|
| 98 | gchar* gtk_rc_get_theme_dir (void); |
---|
| 99 | gchar* gtk_rc_get_module_dir (void); |
---|
| 100 | |
---|
| 101 | /* private functions/definitions */ |
---|
| 102 | typedef enum { |
---|
| 103 | GTK_RC_TOKEN_INVALID = G_TOKEN_LAST, |
---|
| 104 | GTK_RC_TOKEN_INCLUDE, |
---|
| 105 | GTK_RC_TOKEN_NORMAL, |
---|
| 106 | GTK_RC_TOKEN_ACTIVE, |
---|
| 107 | GTK_RC_TOKEN_PRELIGHT, |
---|
| 108 | GTK_RC_TOKEN_SELECTED, |
---|
| 109 | GTK_RC_TOKEN_INSENSITIVE, |
---|
| 110 | GTK_RC_TOKEN_FG, |
---|
| 111 | GTK_RC_TOKEN_BG, |
---|
| 112 | GTK_RC_TOKEN_BASE, |
---|
| 113 | GTK_RC_TOKEN_TEXT, |
---|
| 114 | GTK_RC_TOKEN_FONT, |
---|
| 115 | GTK_RC_TOKEN_FONTSET, |
---|
| 116 | GTK_RC_TOKEN_BG_PIXMAP, |
---|
| 117 | GTK_RC_TOKEN_PIXMAP_PATH, |
---|
| 118 | GTK_RC_TOKEN_STYLE, |
---|
| 119 | GTK_RC_TOKEN_BINDING, |
---|
| 120 | GTK_RC_TOKEN_BIND, |
---|
| 121 | GTK_RC_TOKEN_WIDGET, |
---|
| 122 | GTK_RC_TOKEN_WIDGET_CLASS, |
---|
| 123 | GTK_RC_TOKEN_CLASS, |
---|
| 124 | GTK_RC_TOKEN_LOWEST, |
---|
| 125 | GTK_RC_TOKEN_GTK, |
---|
| 126 | GTK_RC_TOKEN_APPLICATION, |
---|
| 127 | GTK_RC_TOKEN_RC, |
---|
| 128 | GTK_RC_TOKEN_HIGHEST, |
---|
| 129 | GTK_RC_TOKEN_ENGINE, |
---|
| 130 | GTK_RC_TOKEN_MODULE_PATH, |
---|
| 131 | GTK_RC_TOKEN_LAST |
---|
| 132 | } GtkRcTokenType; |
---|
| 133 | |
---|
| 134 | guint gtk_rc_parse_color (GScanner *scanner, |
---|
| 135 | GdkColor *color); |
---|
| 136 | guint gtk_rc_parse_state (GScanner *scanner, |
---|
| 137 | GtkStateType *state); |
---|
| 138 | guint gtk_rc_parse_priority (GScanner *scanner, |
---|
| 139 | GtkPathPriorityType *priority); |
---|
| 140 | |
---|
| 141 | |
---|
| 142 | |
---|
| 143 | #ifdef __cplusplus |
---|
| 144 | } |
---|
| 145 | #endif /* __cplusplus */ |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | #endif /* __GTK_RC_H__ */ |
---|