--- a/gf_theme_editor.c Sun Dec 28 13:38:01 2003 +0000
+++ b/gf_theme_editor.c Sun Dec 28 16:27:50 2003 +0000
@@ -83,6 +83,7 @@
static void menu_save_as_cb();
static void menu_quit_cb();
static void menu_debug_theme_dump_cb();
+static void menu_debug_xml_theme_dump_cb(); static void preview_option_cb(GtkWidget *widget, gpointer data);
static gboolean entry_cb(GtkWidget *widget, gpointer data);
static void spin_button_cb(GtkWidget *widget, gpointer data);
@@ -112,6 +113,7 @@
{ "/File/_Quit", "<CTL>Q", menu_quit_cb, 0, "<StockItem>", GTK_STOCK_QUIT },
{ "/_Debug", NULL, NULL, 0, "<Branch>" },
{ "/Debug/_Dump Theme", "<CTL>D", menu_debug_theme_dump_cb, 0, NULL },
+ { "/Debug/Dump _XML Theme", "<CTL>X", menu_debug_xml_theme_dump_cb, 0, NULL }, /***********************************************************************
@@ -921,6 +923,128 @@
printf(" * THEME DUMP END\n");
printf(" ********************\n");
+menu_debug_xml_theme_dump_cb() { + xmlnode *node, *parent, *parent2, *child; + node = xmlnode_new("guifications_theme"); + parent = xmlnode_new_child(node, "info"); + child = xmlnode_new_child(parent, "type"); + value = g_strdup_printf("%d", theme.type); + xmlnode_set_attrib(child, "value", value); + child = xmlnode_new_child(parent, "name"); + xmlnode_set_attrib(child, "value", (theme.info[0]) ? theme.info[0] : ""); + child = xmlnode_new_child(parent, "version"); + xmlnode_set_attrib(child, "value", (theme.info[1]) ? theme.info[1] : ""); + child = xmlnode_new_child(parent, "description"); + xmlnode_set_attrib(child, "value", (theme.info[2]) ? theme.info[2] : ""); + child = xmlnode_new_child(parent, "author"); + xmlnode_set_attrib(child, "value", (theme.info[3]) ? theme.info[3] : ""); + child = xmlnode_new_child(parent, "website"); + xmlnode_set_attrib(child, "value", (theme.info[4]) ? theme.info[4] : ""); + if (theme.type == gf_theme_type_basic) { + parent = xmlnode_new_child(node, "basic"); + child = xmlnode_new_child(parent, "image"); + xmlnode_set_attrib(child, "value", (theme.data.basic.image) ? theme.data.basic.image : ""); + parent2 = xmlnode_new_child(parent, "text"); + child = xmlnode_new_child(parent2, "font"); + value = g_strdup_printf("%d", theme.data.basic.text_custom_font); + xmlnode_set_attrib(child, "custom", value); + xmlnode_set_attrib(child, "value", (theme.data.basic.text_font) ? theme.data.basic.text_font : ""); + child = xmlnode_new_child(parent2, "color"); + value = g_strdup_printf("%d", theme.data.basic.text_custom_color); + xmlnode_set_attrib(child, "custom", value); + xmlnode_set_attrib(child, "value", (theme.data.basic.text_color) ? theme.data.basic.text_color : ""); + child = xmlnode_new_child(parent2, "clipping"); + value = g_strdup_printf("%d", theme.data.basic.text_clipping); + xmlnode_set_attrib(child, "value", value); + child = xmlnode_new_child(parent2, "position"); + value = g_strdup_printf("%d", theme.data.basic.text_position); + xmlnode_set_attrib(child, "value", value); + child = xmlnode_new_child(parent2, "offset"); + value = g_strdup_printf("%d", theme.data.basic.text_horz_offset); + xmlnode_set_attrib(child, "horizontal", value); + value = g_strdup_printf("%d", theme.data.basic.text_vert_offset); + xmlnode_set_attrib(child, "vertical", value); + parent2 = xmlnode_new_child(parent, "icon"); + child = xmlnode_new_child(parent2, "position"); + value = g_strdup_printf("%d", theme.data.basic.proto_position); + xmlnode_set_attrib(child, "value", value); + child = xmlnode_new_child(parent2, "size"); + value = g_strdup_printf("%d", theme.data.basic.proto_size); + xmlnode_set_attrib(child, "value", value); + child = xmlnode_new_child(parent2, "offset"); + value = g_strdup_printf("%d", theme.data.basic.proto_horz_offset); + xmlnode_set_attrib(child, "horizontal", value); + value = g_strdup_printf("%d", theme.data.basic.proto_vert_offset); + xmlnode_set_attrib(child, "vertical", value); + parent2 = xmlnode_new_child(parent, "messages"); + child = xmlnode_new_child(parent2, "sign_on"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[0]) ? theme.data.basic.messages[0] : ""); + child = xmlnode_new_child(parent2, "sign_off"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[1]) ? theme.data.basic.messages[1] : ""); + child = xmlnode_new_child(parent2, "away"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[2]) ? theme.data.basic.messages[2] : ""); + child = xmlnode_new_child(parent2, "back"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[3]) ? theme.data.basic.messages[3] : ""); + child = xmlnode_new_child(parent2, "idle"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[4]) ? theme.data.basic.messages[4] : ""); + child = xmlnode_new_child(parent2, "unidle"); + xmlnode_set_attrib(child, "value", (theme.data.basic.messages[5]) ? theme.data.basic.messages[5] : ""); + value = xmlnode_to_str(node, &len); + printf("************************\n"); + printf("XML Theme Dump\n"); + printf("************************\n"); + printf("************************\n"); + printf("XML Theme Dump end\n"); + printf("Theme is %d characters long\n", len); + printf("************************\n"); /**********************************************************************/
preview_option_cb(GtkWidget *widget, gpointer data) {