~kroq-gar78/ubuntu/precise/gnome-control-center/fix-885947

« back to all changes in this revision

Viewing changes to capplets/common/gnome-theme-info.h

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2011-05-17 10:47:27 UTC
  • mto: (206.1.1 oneiric-proposed)
  • mto: This revision was merged to the branch mainline in revision 165.
  • Revision ID: james.westby@ubuntu.com-20110517104727-ky274kr7t5a1nk9r
Tags: upstream-3.0.1.1
ImportĀ upstreamĀ versionĀ 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* gnome-theme-info.h - GNOME Theme information
2
 
 
3
 
   Copyright (C) 2002 Jonathan Blandford <jrb@gnome.org>
4
 
   All rights reserved.
5
 
 
6
 
   This file is part of the Gnome Library.
7
 
 
8
 
   The Gnome Library is free software; you can redistribute it and/or
9
 
   modify it under the terms of the GNU Library General Public License as
10
 
   published by the Free Software Foundation; either version 2 of the
11
 
   License, or (at your option) any later version.
12
 
 
13
 
   The Gnome Library is distributed in the hope that it will be useful,
14
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 
   Library General Public License for more details.
17
 
 
18
 
   You should have received a copy of the GNU Library General Public
19
 
   License along with the Gnome Library; see the file COPYING.LIB.  If not,
20
 
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21
 
   Boston, MA 02111-1307, USA.  */
22
 
 
23
 
#ifndef GNOME_THEME_INFO_H
24
 
#define GNOME_THEME_INFO_H
25
 
 
26
 
#include <glib.h>
27
 
#include <gio/gio.h>
28
 
#include <gdk-pixbuf/gdk-pixbuf.h>
29
 
#include <gdk/gdk.h>
30
 
 
31
 
typedef enum {
32
 
  GNOME_THEME_TYPE_METATHEME,
33
 
  GNOME_THEME_TYPE_ICON,
34
 
  GNOME_THEME_TYPE_CURSOR,
35
 
  GNOME_THEME_TYPE_REGULAR
36
 
} GnomeThemeType;
37
 
 
38
 
typedef enum {
39
 
  GNOME_THEME_CHANGE_CREATED,
40
 
  GNOME_THEME_CHANGE_DELETED,
41
 
  GNOME_THEME_CHANGE_CHANGED
42
 
} GnomeThemeChangeType;
43
 
 
44
 
typedef enum {
45
 
  GNOME_THEME_METACITY = 1 << 0,
46
 
  GNOME_THEME_GTK_2 = 1 << 1,
47
 
  GNOME_THEME_GTK_2_KEYBINDING = 1 << 2
48
 
} GnomeThemeElement;
49
 
 
50
 
typedef struct _GnomeThemeCommonInfo GnomeThemeCommonInfo;
51
 
typedef struct _GnomeThemeCommonInfo GnomeThemeIconInfo;
52
 
struct _GnomeThemeCommonInfo
53
 
{
54
 
  GnomeThemeType type;
55
 
  gchar *path;
56
 
  gchar *name;
57
 
  gchar *readable_name;
58
 
  gint priority;
59
 
  gboolean hidden;
60
 
};
61
 
 
62
 
typedef struct _GnomeThemeInfo GnomeThemeInfo;
63
 
struct _GnomeThemeInfo
64
 
{
65
 
  GnomeThemeType type;
66
 
  gchar *path;
67
 
  gchar *name;
68
 
  gchar *readable_name;
69
 
  gint priority;
70
 
  gboolean hidden;
71
 
 
72
 
  guint has_gtk : 1;
73
 
  guint has_keybinding : 1;
74
 
  guint has_metacity : 1;
75
 
};
76
 
 
77
 
typedef struct _GnomeThemeCursorInfo GnomeThemeCursorInfo;
78
 
struct _GnomeThemeCursorInfo {
79
 
  GnomeThemeType type;
80
 
  gchar *path;
81
 
  gchar *name;
82
 
  gchar *readable_name;
83
 
  gint priority;
84
 
  gboolean hidden;
85
 
 
86
 
  GArray *sizes;
87
 
  GdkPixbuf *thumbnail;
88
 
};
89
 
 
90
 
typedef struct _GnomeThemeMetaInfo GnomeThemeMetaInfo;
91
 
struct _GnomeThemeMetaInfo
92
 
{
93
 
  GnomeThemeType type;
94
 
  gchar *path;
95
 
  gchar *name;
96
 
  gchar *readable_name;
97
 
  gint priority;
98
 
  gboolean hidden;
99
 
 
100
 
  gchar *comment;
101
 
  gchar *icon_file;
102
 
 
103
 
  gchar *gtk_theme_name;
104
 
  gchar *gtk_color_scheme;
105
 
  gchar *metacity_theme_name;
106
 
  gchar *icon_theme_name;
107
 
  gchar *notification_theme_name;
108
 
  gchar *sound_theme_name;
109
 
  gchar *cursor_theme_name;
110
 
  guint cursor_size;
111
 
 
112
 
  gchar *application_font;
113
 
  gchar *documents_font;
114
 
  gchar *desktop_font;
115
 
  gchar *windowtitle_font;
116
 
  gchar *monospace_font;
117
 
  gchar *background_image;
118
 
};
119
 
 
120
 
enum {
121
 
  COLOR_FG,
122
 
  COLOR_BG,
123
 
  COLOR_TEXT,
124
 
  COLOR_BASE,
125
 
  COLOR_SELECTED_FG,
126
 
  COLOR_SELECTED_BG,
127
 
  COLOR_TOOLTIP_FG,
128
 
  COLOR_TOOLTIP_BG,
129
 
  NUM_SYMBOLIC_COLORS
130
 
};
131
 
 
132
 
typedef void (* ThemeChangedCallback) (GnomeThemeCommonInfo *theme,
133
 
                                       GnomeThemeChangeType  change_type,
134
 
                                       GnomeThemeElement     element_type,
135
 
                                       gpointer              user_data);
136
 
 
137
 
#define GNOME_THEME_ERROR gnome_theme_info_error_quark ()
138
 
 
139
 
enum {
140
 
  GNOME_THEME_ERROR_GTK_THEME_NOT_AVAILABLE = 1,
141
 
  GNOME_THEME_ERROR_WM_THEME_NOT_AVAILABLE,
142
 
  GNOME_THEME_ERROR_ICON_THEME_NOT_AVAILABLE,
143
 
  GNOME_THEME_ERROR_GTK_ENGINE_NOT_AVAILABLE,
144
 
  GNOME_THEME_ERROR_UNKNOWN
145
 
};
146
 
 
147
 
 
148
 
/* GTK/Metacity/keybinding Themes */
149
 
GnomeThemeInfo     *gnome_theme_info_new                   (void);
150
 
void                gnome_theme_info_free                  (GnomeThemeInfo     *theme_info);
151
 
GnomeThemeInfo     *gnome_theme_info_find                  (const gchar        *theme_name);
152
 
GList              *gnome_theme_info_find_by_type          (guint               elements);
153
 
GQuark              gnome_theme_info_error_quark           (void);
154
 
gchar              *gtk_theme_info_missing_engine          (const gchar *gtk_theme,
155
 
                                                            gboolean nameOnly);
156
 
 
157
 
/* Icon Themes */
158
 
GnomeThemeIconInfo *gnome_theme_icon_info_new              (void);
159
 
void                gnome_theme_icon_info_free             (GnomeThemeIconInfo *icon_theme_info);
160
 
GnomeThemeIconInfo *gnome_theme_icon_info_find             (const gchar        *icon_theme_name);
161
 
GList              *gnome_theme_icon_info_find_all         (void);
162
 
gint                gnome_theme_icon_info_compare          (GnomeThemeIconInfo *a,
163
 
                                                            GnomeThemeIconInfo *b);
164
 
 
165
 
/* Cursor Themes */
166
 
GnomeThemeCursorInfo *gnome_theme_cursor_info_new          (void);
167
 
void                  gnome_theme_cursor_info_free         (GnomeThemeCursorInfo *info);
168
 
GnomeThemeCursorInfo *gnome_theme_cursor_info_find         (const gchar          *name);
169
 
GList                *gnome_theme_cursor_info_find_all     (void);
170
 
gint                  gnome_theme_cursor_info_compare      (GnomeThemeCursorInfo *a,
171
 
                                                            GnomeThemeCursorInfo *b);
172
 
 
173
 
/* Meta themes*/
174
 
GnomeThemeMetaInfo *gnome_theme_meta_info_new              (void);
175
 
void                gnome_theme_meta_info_free             (GnomeThemeMetaInfo *meta_theme_info);
176
 
GnomeThemeMetaInfo *gnome_theme_meta_info_find             (const gchar        *meta_theme_name);
177
 
GList              *gnome_theme_meta_info_find_all         (void);
178
 
gint                gnome_theme_meta_info_compare          (GnomeThemeMetaInfo *a,
179
 
                                                            GnomeThemeMetaInfo *b);
180
 
gboolean            gnome_theme_meta_info_validate         (const GnomeThemeMetaInfo *info,
181
 
                                                            GError            **error);
182
 
GnomeThemeMetaInfo *gnome_theme_read_meta_theme            (GFile              *meta_theme_uri);
183
 
 
184
 
/* Other */
185
 
void                gnome_theme_init                       (void);
186
 
void                gnome_theme_info_register_theme_change (ThemeChangedCallback func,
187
 
                                                            gpointer             data);
188
 
 
189
 
gboolean            gnome_theme_color_scheme_parse         (const gchar         *scheme,
190
 
                                                            GdkColor            *colors);
191
 
gboolean            gnome_theme_color_scheme_equal         (const gchar         *s1,
192
 
                                                            const gchar         *s2);
193
 
 
194
 
#endif /* GNOME_THEME_INFO_H */