From 65ace942fdabfd6116163a21eec7cd7bbd3cbcb1 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 25 Jul 2011 19:06:10 +0000 Subject: introduce getter and setter functions. some variables didn't always have a value reflecting the browser's internal state. for example, if `default_encoding` was never set then `print @default_encoding` would always print a blank string. this introduces getter functions that ensure the value of a variable is always in sync with the internal state of the browser. also: setters, because sometimes you need to process user input before storing it. --- src/variables.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/variables.h') diff --git a/src/variables.h b/src/variables.h index 6aa0ab0..ea3bdcf 100644 --- a/src/variables.h +++ b/src/variables.h @@ -8,14 +8,30 @@ #include #include +#include "type.h" + gboolean set_var_value(const gchar *name, gchar *val); void expand_variable(GString *buf, const gchar *name); void variables_hash(); + +gchar *get_var_value_string_c(const uzbl_cmdprop *c); +gchar *get_var_value_string(const char *name); +int get_var_value_int_c(const uzbl_cmdprop *c); +int get_var_value_int(const char *name); +float get_var_value_float_c(const uzbl_cmdprop *c); +float get_var_value_float(const char *name); + void dump_config(); void dump_config_as_events(); void uri_change_cb (WebKitWebView *web_view, GParamSpec param_spec); -void set_show_status(); -void set_geometry(); + +void set_show_status(int); + +void set_zoom_type(int); +int get_zoom_type(); + +gchar *get_geometry(); +void set_geometry(const gchar *); #endif -- cgit v1.2.3