From d1e355de2c6aae38cea3cdc0e0b902ea2b194e86 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 24 May 2003 21:47:06 +0000 Subject: this is a big one! im putting stats in here just cuz! 59 files changed, 1691 insertions(+), 607 deletions(-) Adding the beginings of ObConf. Adding a resistance-config plugin for ObConf. Creating an obparser library that obrender can use, the kernel can use, plugins can use, and ObConf and its plugins can use. (its just code for using libXml2) --- plugins/resistance/resistance_config.c | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/resistance/resistance_config.c (limited to 'plugins/resistance/resistance_config.c') diff --git a/plugins/resistance/resistance_config.c b/plugins/resistance/resistance_config.c new file mode 100644 index 00000000..1384fe3f --- /dev/null +++ b/plugins/resistance/resistance_config.c @@ -0,0 +1,64 @@ +#include "plugins/obconf_interface.h" +#include "parser/parse.h" +#include "resistance.h" +#include +#include + +static GtkWidget *conf_widget; +static GtkCheckButton *conf_resist_windows; +static GtkSpinButton *conf_resist_strength; +static gboolean conf_edited = FALSE; + +int plugin_interface_version() { return OBCONF_INTERFACE_VERSION; } + +char *plugin_name() { return "Resistance"; } +char *plugin_plugin_name() { return "resistance"; } +void plugin_icon() {} + +GtkWidget *plugin_toplevel_widget() { return conf_widget; } + +gboolean plugin_edited() { return conf_edited; } + +void plugin_load(xmlDocPtr doc, xmlNodePtr root) +{ + xmlNodePtr node, n; + + gtk_spin_button_set_value(conf_resist_strength, DEFAULT_RESISTANCE); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(conf_resist_windows), + DEFAULT_RESIST_WINDOWS); + + node = parse_find_node("resistance", root); + while (node) { + if ((n = parse_find_node("strength", node))) + gtk_spin_button_set_value(conf_resist_strength, + parse_int(doc, n)); + if ((n = parse_find_node("windows", node))) + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON(conf_resist_windows), + parse_bool(doc, n)); + + node = parse_find_node("resistance", node->next); + } +} + +void plugin_save(xmlDocPtr doc, xmlNodePtr root) +{ +} + +void plugin_startup() +{ + GladeXML *xml; + + xml = glade_xml_new("obconf.glade", NULL, NULL); + glade_xml_signal_autoconnect(xml); + + conf_widget = glade_xml_get_widget(xml, "resistwindow"); + conf_resist_strength = + GTK_SPIN_BUTTON(glade_xml_get_widget(xml, "resist_strength")); + conf_resist_windows = + GTK_CHECK_BUTTON(glade_xml_get_widget(xml, "resist_windows")); +} + +void plugin_shutdown() +{ +} -- cgit v1.2.3