aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:32:25 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-04-26 19:32:25 +0100
commit6cf30e85dfa87dbb636751381c97fe7160628527 (patch)
tree76c5ceb95ff6d57d8031ba5b450dc4e853331149 /uzbl.c
parente821515a4d95f39d72e9a298fb920a228300d90b (diff)
parent2949de66f119ca352d17f6cfd81267d35ed381d6 (diff)
Merge branch 'dieter/experimental' into experimental
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c48
1 files changed, 29 insertions, 19 deletions
diff --git a/uzbl.c b/uzbl.c
index 9471c70..3e90100 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -43,13 +43,23 @@
#include <unistd.h>
#include <stdlib.h>
+/* housekeeping / internal variables */
static GtkWidget* main_window;
static GtkWidget* mainbar;
static WebKitWebView* web_view;
static gchar* main_title;
static gchar selected_url[500];
+static gint load_progress;
+static guint status_context_id;
+static Window xwin = 0;
+static char fifopath[64];
-/* Behaviour variables */
+/* state variables (initial values coming from command line arguments but may be changed later) */
+static gchar* uri = NULL;
+static gchar* config_file = NULL;
+static gboolean verbose = FALSE;
+
+/* settings from config: group behaviour */
static gchar* history_handler = NULL;
static gchar* fifodir = NULL;
static gchar* download_handler = NULL;
@@ -58,21 +68,31 @@ static gboolean show_status = FALSE;
static gboolean insert_mode = FALSE;
static gchar* modkey = NULL;
-static char fifopath[64];
-static gint load_progress;
-static guint status_context_id;
-static Window xwin = 0;
-static gchar* uri = NULL;
-static gboolean verbose = FALSE;
+typedef struct
+{
+ const char *binding;
+ const char *action;
+} Binding;
+/* settings from config: group bindings_internal */
+static Binding internal_bindings[256];
+static int num_internal_bindings = 0;
+
+/* settings from config: group bindings_external */
+static Binding external_bindings[256];
+static int num_external_bindings = 0;
+
+/* commandline arguments (set initial values for the state variables) */
static GOptionEntry entries[] =
{
- { "uri", 'u', 0, G_OPTION_ARG_STRING, &uri, "Uri to load", NULL },
- { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
+ { "uri", 'u', 0, G_OPTION_ARG_STRING, &uri, "Uri to load", NULL },
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
+ { "config", 'c', 0, G_OPTION_ARG_STRING, &config_file, "Config file", NULL },
{ NULL }
};
+/* for internal list of commands */
typedef struct
{
const char *command;
@@ -80,16 +100,6 @@ typedef struct
void (*func_2_params)(WebKitWebView*, char *);
} Command;
-typedef struct
-{
- const char *binding;
- const char *action;
-} Binding;
-
-static Binding internal_bindings[256];
-static Binding external_bindings[256];
-static int num_internal_bindings = 0;
-static int num_external_bindings = 0;
static void
update_title (GtkWindow* window);