From 7728278b675df32a1afc5531a57918df0d59f450 Mon Sep 17 00:00:00 2001 From: koral Date: Thu, 3 Feb 2011 09:54:42 +0100 Subject: Cleans and reorders initialization elements. --- src/uzbl-core.c | 112 ++++++++++++++++++++++++++++++++------------------------ src/uzbl-core.h | 4 +- 2 files changed, 66 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 877dbda..3c6407e 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -40,8 +40,7 @@ UzblCore uzbl; /* commandline arguments (set initial values for the state variables) */ const -GOptionEntry entries[] = -{ +GOptionEntry entries[] = { { "uri", 'u', 0, G_OPTION_ARG_STRING, &uzbl.state.uri, "Uri to load at startup (equivalent to 'uzbl ' or 'set uri = URI' after uzbl has launched)", "URI" }, { "verbose", 'v', 0, G_OPTION_ARG_NONE, &uzbl.state.verbose, @@ -623,8 +622,7 @@ struct {const char *key; CommandInfo value;} cmdlist[] = }; void -commands_hash(void) -{ +commands_hash(void) { unsigned int i; uzbl.behave.commands = g_hash_table_new(g_str_hash, g_str_equal); @@ -1874,11 +1872,24 @@ update_title (void) { } } + void -create_browser () { - GUI *g = &uzbl.gui; +create_scrolled_win() { + GUI* g = &uzbl.gui; + + g->web_view = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g->scrolled_win = gtk_scrolled_window_new(NULL, NULL); - g->web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ()); + gtk_scrolled_window_set_policy( + GTK_SCROLLED_WINDOW(g->scrolled_win), + GTK_POLICY_NEVER, + GTK_POLICY_NEVER + ); + + gtk_container_add( + GTK_CONTAINER(g->scrolled_win), + GTK_WIDGET(g->web_view) + ); g_object_connect((GObject*)g->web_view, "signal::key-press-event", (GCallback)key_press_cb, NULL, @@ -1904,8 +1915,9 @@ create_browser () { NULL); } + GtkWidget* -create_mainbar () { +create_mainbar() { GUI *g = &uzbl.gui; g->mainbar = gtk_hbox_new (FALSE, 0); @@ -2262,62 +2274,78 @@ set_webview_scroll_adjustments() { NULL); } -/* set up gtk, gobject, variable defaults and other things that tests and other + +/* Set up gtk, gobject, variable defaults and other things that tests and other * external applications need to do anyhow */ void -initialize(int argc, char *argv[]) { +initialize(int argc, char** argv) { int i; - for(i=0; i