[atomix/wip/kill-libxml] Cleanup unused code
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix/wip/kill-libxml] Cleanup unused code
- Date: Sat, 17 Jan 2015 22:44:11 +0000 (UTC)
commit 17c757c3cd2e028721129acecc4b259bdbd81bf0
Author: Robert Roth <robert roth off gmail com>
Date: Sun Jan 18 00:36:39 2015 +0200
Cleanup unused code
src/theme.c | 98 -----------------------------------------------------------
1 files changed, 0 insertions(+), 98 deletions(-)
---
diff --git a/src/theme.c b/src/theme.c
index 15d3a0c..4c1ccce 100644
--- a/src/theme.c
+++ b/src/theme.c
@@ -464,101 +464,3 @@ void theme_add_image_decoration (Theme *theme, GQuark base, GQuark decor)
ti->decorations = g_slist_append (ti->decorations, (gpointer) decor);
}
-
-#if 0
-void theme_save_xml (Theme *theme, gchar *filename)
-{
- xmlDocPtr doc;
- xmlAttrPtr attr;
- xmlNodePtr node;
- xmlNodePtr theme_node;
- xmlNodePtr section_node;
- gint dist;
- gint i;
- gchar *str_buffer;
-
- gchar *node_name[N_IMG_LISTS];
- node_name[THEME_IMAGE_MOVEABLE] = "MOVEABLE";
- node_name[THEME_IMAGE_OBSTACLE] = "OBSTACLE";
- node_name[THEME_IMAGE_LINK] = "LINK";
-
- str_buffer = g_malloc (6 * sizeof (gchar));
-
- /* create xml doc */
- doc = xmlNewDoc ("1.0");
- // xmlSetDocCompressMode(doc, 9);
-
- /* theme name */
- theme_node = xmlNewDocNode (doc, NULL, "THEME", NULL);
- doc->xmlRootNode = theme_node;
- attr = xmlSetProp (theme_node, "name", g_strdup (theme->name));
-
- /* revision */
- node = xmlNewChild (theme_node, NULL, "REVISION", "2");
-
- /* bg_color */
- node = xmlNewChild (theme_node, NULL, "BGCOLOR_RGB", NULL);
- dist = g_snprintf (str_buffer, 6, "%i", theme->bg_color.red);
- attr = xmlSetProp (node, "red", g_strdup (str_buffer));
- dist = g_snprintf (str_buffer, 6, "%i", theme->bg_color.green);
- attr = xmlSetProp (node, "green", g_strdup (str_buffer));
- dist = g_snprintf (str_buffer, 6, "%i", theme->bg_color.blue);
- attr = xmlSetProp (node, "blue", g_strdup (str_buffer));
-
- /* animstep */
- node = xmlNewChild (theme_node, NULL, "ANIMSTEP", NULL);
- dist = g_snprintf (str_buffer, 5, "%i", theme->animstep);
- attr = xmlSetProp (node, "dist", g_strdup (str_buffer));
-
- /* the different image lists */
- for (i = 0; i < N_IMG_LISTS; i++)
- {
- section_node = xmlNewChild (theme_node, NULL, node_name[i], NULL);
- dist = g_snprintf (str_buffer, 5, "%i", theme->last_id[i]);
- attr = xmlSetProp (section_node, "last_id", g_strdup (str_buffer));
- g_hash_table_foreach (theme->image_list[i],
- (GHFunc) theme_save_image_element_xml,
- (gpointer) section_node);
- }
-
- /* selector section */
- if (theme->selector)
- {
- xmlNodePtr selector_node;
- selector_node = xmlNewChild (theme_node, NULL, "SELECTOR", NULL);
- attr =
- xmlSetProp (selector_node, "src", g_strdup (theme->selector->file));
- }
-
- xmlSaveFile (filename, doc);
-
- xmlFreeDoc (doc);
- g_free (str_buffer);
-}
-
-void theme_save_image_element_xml (gpointer key, gpointer value,
- gpointer user_data)
-{
- ThemeElement *element = (ThemeElement *) value;
-
- if (!element->loading_failed)
- {
- gchar *str_buffer;
- gint length;
- gint id = GPOINTER_TO_INT (key);
- xmlNodePtr child;
- xmlNodePtr parent = (xmlNodePtr) user_data;
- xmlAttrPtr attr;
-
- str_buffer = g_malloc (5 * sizeof (gchar));
-
- child = xmlNewChild (parent, NULL, "IMAGE", NULL);
- length = g_snprintf (str_buffer, 5, "%i", id);
- attr = xmlSetProp (child, "no", g_strdup (str_buffer));
- attr = xmlSetProp (child, "src", g_strdup (element->file));
- attr = xmlSetProp (child, "name", g_strdup (element->name));
-
- g_free (str_buffer);
- }
-}
-#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]