annotate libpurple/theme-loader.h @ 32728:5050da3d9c95

Add a directory probe to theme loaders. The default just checks for $dir/purple/$type as the theme manager currently does.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 03 Mar 2012 06:39:49 +0000
parents 4d92a431d0a1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
1 /**
25083
c1cabd5eb625 Added skeleton (non-working) sound loader class
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25076
diff changeset
2 * @file theme-loader.h Purple Theme Loader Abstact Class API
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
3 */
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
4
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
5 /* purple
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
6 *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
7 * Purple is the legal property of its developers, whose names are too numerous
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
8 * to list here. Please refer to the COPYRIGHT file distributed with this
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
9 * source distribution.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
10 *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
12 * it under the terms of the GNU General Public License as published by
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
13 * the Free Software Foundation; either version 2 of the License, or
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
14 * (at your option) any later version.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
15 *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
19 * GNU General Public License for more details.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
20 *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
21 * You should have received a copy of the GNU General Public License
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
22 * along with this program; if not, write to the Free Software
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
24 */
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
25
25911
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
26 #ifndef PURPLE_THEME_LOADER_H
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
27 #define PURPLE_THEME_LOADER_H
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
28
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
29 #include <glib.h>
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
30 #include <glib-object.h>
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
31 #include "theme.h"
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
32
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
33 /**
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
34 * A purple theme loader.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
35 * This is an abstract class for Purple to use with the Purple theme manager.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
36 * The loader is responsible for building each type of theme
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
37 *
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
38 * PurpleThemeLoader is a GObject.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
39 */
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
40 typedef struct _PurpleThemeLoader PurpleThemeLoader;
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
41 typedef struct _PurpleThemeLoaderClass PurpleThemeLoaderClass;
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
42
25911
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
43 #define PURPLE_TYPE_THEME_LOADER (purple_theme_loader_get_type())
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
44 #define PURPLE_THEME_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_THEME_LOADER, PurpleThemeLoader))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
45 #define PURPLE_THEME_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_THEME_LOADER, PurpleThemeLoaderClass))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
46 #define PURPLE_IS_THEME_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_THEME_LOADER))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
47 #define PURPLE_IS_THEME_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_THEME_LOADER))
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
48 #define PURPLE_THEME_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_THEME_LOADER, PurpleThemeLoaderClass))
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
49
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
50 struct _PurpleThemeLoader
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
51 {
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
52 GObject parent;
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
53 };
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
54
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
55 struct _PurpleThemeLoaderClass
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
56 {
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
57 GObjectClass parent_class;
25121
b37ccfd1697b Changed PurpleTheme build function to only return PurpleTheme*
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25096
diff changeset
58 PurpleTheme *((*purple_theme_loader_build)(const gchar*));
32728
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
59 gboolean (*probe_directory)(const gchar *);
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
60 };
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
61
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
62 /**************************************************************************/
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
63 /** @name Purple Theme-Loader API */
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
64 /**************************************************************************/
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
65 G_BEGIN_DECLS
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
66
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
67 /**
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
68 * GObject foo.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
69 * @internal.
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
70 */
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
71 GType purple_theme_loader_get_type(void);
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
72
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
73 /**
28163
a444fe876e52 Fix some typos.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26669
diff changeset
74 * Returns the string representing the type of the theme loader
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
75 *
25911
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
76 * @param self The theme loader
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
77 *
28163
a444fe876e52 Fix some typos.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26669
diff changeset
78 * @returns The string representing this type
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
79 */
25096
fbf72bbd1084 Fixed up a few typos, readability, leaks, and bugs, all minor and mostly in theme and theme loader classes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25087
diff changeset
80 const gchar *purple_theme_loader_get_type_string(PurpleThemeLoader *self);
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
81
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
82 /**
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
83 * Creates a new PurpleTheme
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
84 *
26669
b1c8ffbd48f9 Fix more `make docs` warnings
Paul Aurich <paul@darkrain42.org>
parents: 25911
diff changeset
85 * @param loader The theme loader
b1c8ffbd48f9 Fix more `make docs` warnings
Paul Aurich <paul@darkrain42.org>
parents: 25911
diff changeset
86 * @param dir The directory containing the theme
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
87 *
25911
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
88 * @returns A PurpleTheme containing the information from the directory
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
89 */
25121
b37ccfd1697b Changed PurpleTheme build function to only return PurpleTheme*
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents: 25096
diff changeset
90 PurpleTheme *purple_theme_loader_build(PurpleThemeLoader *loader, const gchar *dir);
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
91
32728
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
92 /**
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
93 * Probes a directory to see if it might possibly contain a theme
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
94 *
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
95 * This function might only check for obvious files or directory structure.
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
96 * Loading of a theme may fail for other reasons.
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
97 * The default prober checks for $dir/purple/$type.
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
98 *
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
99 * @param loader The theme loader
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
100 * @param dir The directory that may contain the theme
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
101 *
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
102 * @returns TRUE if the directory appears to contain a theme, FALSE otherwise.
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
103 */
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
104 gboolean purple_theme_loader_probe(PurpleThemeLoader *loader, const gchar *dir);
5050da3d9c95 Add a directory probe to theme loaders. The default just checks for
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32157
diff changeset
105
25076
68b7691aa3ed Added theme loader class abstract whose only (current/planned) function is to build themes
Justin Rodriguez <ffdragon@soc.pidgin.im>
parents:
diff changeset
106 G_END_DECLS
25911
0c7b74fc558e Lots of minor whitespace and comment changes:
Mark Doliner <mark@kingant.net>
parents: 25121
diff changeset
107 #endif /* PURPLE_THEME_LOADER_H */