openbox/plugins/resistance/resistance_config.c
Dana Jansens d1e355de2c 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)
2003-05-24 21:47:06 +00:00

64 lines
1.8 KiB
C

#include "plugins/obconf_interface.h"
#include "parser/parse.h"
#include "resistance.h"
#include <gtk/gtk.h>
#include <glade/glade.h>
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()
{
}