aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Robert Manea <gotmor@gmail.com>2009-05-06 11:50:34 +0200
committerGravatar Robert Manea <gotmor@gmail.com>2009-05-06 11:50:34 +0200
commitef4b3ca77a3a71b5de606b96b18ff6620e8b16c5 (patch)
tree669592448908c540fac59d6fb02239d4aa931ad4 /uzbl.c
parentf93198c60aa3495b71a3fb493c94b7b2156fa0d5 (diff)
refactored status bar template symbol definition and setup
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/uzbl.c b/uzbl.c
index 4dab3c0..16cde01 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -410,6 +410,7 @@ close_uzbl (WebKitWebView *page, const char *param) {
gtk_main_quit ();
}
+/* --Statusbar functions-- */
static char*
build_progressbar_ascii(int percent) {
int width=10;
@@ -431,8 +432,6 @@ build_progressbar_ascii(int percent) {
return g_string_free(bar, FALSE);
}
-
-enum { SYM_TITLE, SYM_URI, SYM_NAME, SYM_LOADPRGS, SYM_LOADPRGSBAR};
static void
setup_scanner() {
const GScannerConfig scan_config = {
@@ -480,13 +479,12 @@ setup_scanner() {
};
uzbl.scan = g_scanner_new(&scan_config);
-
- /* TODO: move this stuff to an array and use a loop to actually set it */
- g_scanner_scope_add_symbol(uzbl.scan, 0, "TITLE", (gpointer)SYM_TITLE);
- g_scanner_scope_add_symbol(uzbl.scan, 0, "URI", (gpointer)SYM_URI);
- g_scanner_scope_add_symbol(uzbl.scan, 0, "NAME", (gpointer)SYM_NAME);
- g_scanner_scope_add_symbol(uzbl.scan, 0, "LOAD_PROGRESS", (gpointer)SYM_LOADPRGS);
- g_scanner_scope_add_symbol(uzbl.scan, 0, "LOAD_PROGRESSBAR", (gpointer)SYM_LOADPRGSBAR);
+ while(symp->symbol_name) {
+ g_scanner_scope_add_symbol(uzbl.scan, 0,
+ symp->symbol_name,
+ GINT_TO_POINTER(symp->symbol_token));
+ symp++;
+ }
}
static gchar *
@@ -542,6 +540,7 @@ parse_status_template(const char *template) {
return g_string_free(ret, FALSE);
}
+/* --End Statusbar functions-- */
// make sure to put '' around args, so that if there is whitespace we can still keep arguments together.