[yelp/yelp-3-0] [yelp-settings] Adding yelp_settings_get_all_params for XSLT parameters
- From: Shaun McCance <shaunm src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [yelp/yelp-3-0] [yelp-settings] Adding yelp_settings_get_all_params for XSLT parameters
- Date: Sun, 15 Nov 2009 22:37:22 +0000 (UTC)
commit 63016128972c806708cd458c4bf4331da42a9423
Author: Shaun McCance <shaunm gnome org>
Date: Fri Nov 13 13:20:55 2009 -0600
[yelp-settings] Adding yelp_settings_get_all_params for XSLT parameters
libyelp/yelp-mallard-document.c | 25 ++-----------------------
libyelp/yelp-settings.c | 39 +++++++++++++++++++++++++++++++++++++++
libyelp/yelp-settings.h | 4 ++++
3 files changed, 45 insertions(+), 23 deletions(-)
---
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index 261ff5f..bed450d 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -239,7 +239,7 @@ mallard_request_page (YelpDocument *document,
case MALLARD_STATE_BLANK:
case MALLARD_STATE_STOP:
docuri = yelp_uri_get_document_uri (priv->uri);
- error = g_error_new (YELP_ERROR, YELP_ERROR_PROCESSING,
+ error = g_error_new (YELP_ERROR, YELP_ERROR_NOT_FOUND,
_("The page â??%sâ?? was not found in the document â??%sâ??."),
page_id, docuri);
g_free (docuri);
@@ -553,28 +553,7 @@ mallard_page_data_run (MallardPageData *page_data)
(GCallback) transform_error,
page_data);
- params = g_new0 (gchar *,
- (2*YELP_SETTINGS_NUM_COLORS) + (2*YELP_SETTINGS_NUM_ICONS) + 3);
- for (i = 0; i < YELP_SETTINGS_NUM_COLORS; i++) {
- gchar *val;
- ix = 2 * i;
- params[ix] = g_strdup (yelp_settings_get_color_param (i));
- val = yelp_settings_get_color (settings, i);
- params[ix + 1] = g_strdup_printf ("\"%s\"", val);
- g_free (val);
- }
- for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++) {
- gchar *val;
- ix = 2 * (YELP_SETTINGS_NUM_COLORS + i);
- params[ix] = g_strdup (yelp_settings_get_icon_param (i));
- val = yelp_settings_get_icon (settings, i);
- params[ix + 1] = g_strdup_printf ("\"%s\"", val);
- g_free (val);
- }
- ix = 2 * (YELP_SETTINGS_NUM_COLORS + YELP_SETTINGS_NUM_ICONS);
- params[ix++] = g_strdup ("theme.icon.admon.size");
- params[ix++] = g_strdup_printf ("%i", yelp_settings_get_icon_size (settings));
- params[ix] = NULL;
+ params = yelp_settings_get_all_params (settings, 0, NULL);
yelp_transform_start (page_data->transform,
page_data->xmldoc,
diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c
index 58c945b..8ac5408 100644
--- a/libyelp/yelp-settings.c
+++ b/libyelp/yelp-settings.c
@@ -564,6 +564,45 @@ yelp_settings_get_icon_param (YelpSettingsIcon icon)
/******************************************************************************/
+gchar **
+yelp_settings_get_all_params (YelpSettings *settings,
+ gint extra,
+ gint *end)
+{
+ gchar **params;
+ gint i, ix;
+
+ params = g_new0 (gchar *,
+ (2*YELP_SETTINGS_NUM_COLORS) + (2*YELP_SETTINGS_NUM_ICONS) + extra + 3);
+
+ for (i = 0; i < YELP_SETTINGS_NUM_COLORS; i++) {
+ gchar *val;
+ ix = 2 * i;
+ params[ix] = g_strdup (yelp_settings_get_color_param (i));
+ val = yelp_settings_get_color (settings, i);
+ params[ix + 1] = g_strdup_printf ("\"%s\"", val);
+ g_free (val);
+ }
+ for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++) {
+ gchar *val;
+ ix = 2 * (YELP_SETTINGS_NUM_COLORS + i);
+ params[ix] = g_strdup (yelp_settings_get_icon_param (i));
+ val = yelp_settings_get_icon (settings, i);
+ params[ix + 1] = g_strdup_printf ("\"%s\"", val);
+ g_free (val);
+ }
+ ix = 2 * (YELP_SETTINGS_NUM_COLORS + YELP_SETTINGS_NUM_ICONS);
+ params[ix++] = g_strdup ("theme.icon.admon.size");
+ params[ix++] = g_strdup_printf ("%i", yelp_settings_get_icon_size (settings));
+ params[ix] = NULL;
+
+ if (end != NULL)
+ *end = ix;
+ return params;
+}
+
+/******************************************************************************/
+
static void
gtk_theme_changed (GtkSettings *gtk_settings,
GParamSpec *pspec,
diff --git a/libyelp/yelp-settings.h b/libyelp/yelp-settings.h
index c5bebe9..c1324fc 100644
--- a/libyelp/yelp-settings.h
+++ b/libyelp/yelp-settings.h
@@ -111,6 +111,10 @@ void yelp_settings_set_icons (YelpSettings *sett
...);
const gchar * yelp_settings_get_icon_param (YelpSettingsIcon icon);
+gchar ** yelp_settings_get_all_params (YelpSettings *settings,
+ gint extra,
+ gint *end);
+
G_END_DECLS
#endif /* __YELP_SETTINGS_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]