From 70c285199e5283044ea50bb9317c1d575dacaa00 Mon Sep 17 00:00:00 2001 From: uranther Date: Sat, 6 Jun 2009 17:01:45 -0400 Subject: WTF --- uzbl.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'uzbl.h') diff --git a/uzbl.h b/uzbl.h index ab45bae..6297a64 100644 --- a/uzbl.h +++ b/uzbl.h @@ -149,7 +149,6 @@ typedef struct { guint font_size; guint monospace_size; guint minimum_font_size; - gfloat zoom_level; guint disable_plugins; guint disable_scripts; guint autoload_img; @@ -409,6 +408,9 @@ search_forward_text (WebKitWebView *page, GArray *argv); static void search_reverse_text (WebKitWebView *page, GArray *argv); +static void +reset_zoom_level (WebKitWebView *page, GArray *argv); + static void dehilight (WebKitWebView *page, GArray *argv); @@ -478,14 +480,9 @@ cmd_max_conns(); static void cmd_max_conns_host(); -/* exported WebKitWebSettings properties */ - static void cmd_font_size(); -static void -cmd_zoom_level(); - static void cmd_disable_plugins(); -- cgit v1.2.3 From 758cf93e955c32f3ba9a7cd61a2a2995dde11cc7 Mon Sep 17 00:00:00 2001 From: uranther Date: Sat, 6 Jun 2009 17:13:29 -0400 Subject: ok added the zoom back in. fml --- uzbl.c | 7 ++++++- uzbl.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'uzbl.h') diff --git a/uzbl.c b/uzbl.c index b219ce3..01eb502 100644 --- a/uzbl.c +++ b/uzbl.c @@ -84,7 +84,7 @@ typedef const struct { void (*func)(void); } uzbl_cmdprop; -enum {TYPE_INT, TYPE_STR}; +enum {TYPE_INT, TYPE_STR, TYPE_FLOAT}; /* an abbreviation to help keep the table's width humane */ #define PTR(var, t, d, fun) { .ptr = (void*)&(var), .type = TYPE_##t, .dump = d, .func = fun } @@ -1377,6 +1377,11 @@ cmd_font_size() { uzbl.behave.font_size, NULL); } } + +static void +cmd_zoom_level() { + webkit_web_view_set_zoom_level (uzbl.gui.web_view, uzbl.behave.zoom_level); +} static void cmd_disable_plugins() { diff --git a/uzbl.h b/uzbl.h index 8a66506..666343a 100644 --- a/uzbl.h +++ b/uzbl.h @@ -146,6 +146,7 @@ typedef struct { guint http_debug; gchar* shell_cmd; /* WebKitWebSettings exports */ + gfloat zoom_level; guint font_size; guint monospace_size; guint minimum_font_size; @@ -483,6 +484,9 @@ cmd_max_conns_host(); static void cmd_font_size(); +static void +cmd_zoom_level(); + static void cmd_disable_plugins(); -- cgit v1.2.3 From 33cf5e01f5e88a3e136297ad11c964e2b6e71a02 Mon Sep 17 00:00:00 2001 From: uranther Date: Sun, 7 Jun 2009 10:13:55 -0400 Subject: got rid of my fifo fix for now - it needs more TLC --- uzbl.c | 13 ------------- uzbl.h | 3 --- 2 files changed, 16 deletions(-) (limited to 'uzbl.h') diff --git a/uzbl.c b/uzbl.c index 01eb502..41ec84e 100644 --- a/uzbl.c +++ b/uzbl.c @@ -613,7 +613,6 @@ static struct {char *name; Command command[2];} cmdlist[] = { "stop", {view_stop_loading, 0}, }, { "zoom_in", {view_zoom_in, 0}, }, //Can crash (when max zoom reached?). { "zoom_out", {view_zoom_out, 0}, }, - { "reset_zoom", {reset_zoom_level, 0}, }, { "uri", {load_uri, NOSPLIT} }, { "js", {run_js, NOSPLIT} }, { "script", {run_external_js, 0} }, @@ -813,12 +812,6 @@ search_reverse_text (WebKitWebView *page, GArray *argv) { search_text(page, argv, FALSE); } -static void -reset_zoom_level (WebKitWebView *page, GArray *argv) { - (void) argv; - webkit_web_view_set_zoom_level (page, 1.0); -} - static void dehilight (WebKitWebView *page, GArray *argv) { (void) argv; @@ -1693,12 +1686,6 @@ init_fifo(gchar *dir) { /* return dir or, on error, free dir and return NULL */ GError *error = NULL; gchar *path = build_stream_name(FIFO, dir); - // This extra check is an alternative to recursively calling init_fifo() or using goto - if (file_exists(path)) { - if (unlink(path)) - g_warning ("init_fifo: can't delete %s: %s", path, strerror(errno)); - } - if (!file_exists(path)) { if (mkfifo (path, 0666) == 0) { // we don't really need to write to the file, but if we open the file as 'r' we will block here, waiting for a writer to open the file. diff --git a/uzbl.h b/uzbl.h index 666343a..f238c1a 100644 --- a/uzbl.h +++ b/uzbl.h @@ -409,9 +409,6 @@ search_forward_text (WebKitWebView *page, GArray *argv); static void search_reverse_text (WebKitWebView *page, GArray *argv); -static void -reset_zoom_level (WebKitWebView *page, GArray *argv); - static void dehilight (WebKitWebView *page, GArray *argv); -- cgit v1.2.3 From 6cccec4508d6b0290e04716459db6a5790b2a072 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 7 Jun 2009 20:28:35 +0200 Subject: make icon setting configurable --- examples/configs/sampleconfig | 1 + examples/configs/sampleconfig-dev | 2 ++ uzbl.c | 15 +++++++++++---- uzbl.h | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) (limited to 'uzbl.h') diff --git a/examples/configs/sampleconfig b/examples/configs/sampleconfig index 5daa21c..736b49f 100644 --- a/examples/configs/sampleconfig +++ b/examples/configs/sampleconfig @@ -119,6 +119,7 @@ bind fl* = script /usr/share/uzbl/examples/scripts/follow_Numbers.js %s # using strings, not polished yet: bind fL* = script /usr/share/uzbl/examples/scripts/follow_Numbers_Strings.js %s +set icon = /usr/share/uzbl/uzbl.png # "home" page if you will set uri = uzbl.org diff --git a/examples/configs/sampleconfig-dev b/examples/configs/sampleconfig-dev index 03310b4..0aa0985 100644 --- a/examples/configs/sampleconfig-dev +++ b/examples/configs/sampleconfig-dev @@ -171,5 +171,7 @@ bind fL* = script ./examples/scripts/follow_Numbers_Strings.js %s # you can use this to disable all plugins set disable_plugins = 0 +set icon = ./uzbl.png + # "home" page if you will set uri = uzbl.org diff --git a/uzbl.c b/uzbl.c index 35a50fc..7b810dc 100644 --- a/uzbl.c +++ b/uzbl.c @@ -114,6 +114,7 @@ const struct { { "command_indicator", PTR(uzbl.behave.cmd_indicator, STR, 1, update_title)}, { "title_format_long", PTR(uzbl.behave.title_format_long, STR, 1, update_title)}, { "title_format_short", PTR(uzbl.behave.title_format_short, STR, 1, update_title)}, + { "icon", PTR(uzbl.gui.icon, STR, 1, set_icon)}, { "insert_mode", PTR(uzbl.behave.insert_mode, INT, 1, NULL)}, { "always_insert_mode", PTR(uzbl.behave.always_insert_mode, INT, 1, cmd_always_insert_mode)}, { "reset_command_mode", PTR(uzbl.behave.reset_command_mode, INT, 1, NULL)}, @@ -1311,6 +1312,16 @@ set_proxy_url() { return; } +static void +set_icon() { + if(file_exists(uzbl.gui.icon)) { + gtk_window_set_icon_from_file (GTK_WINDOW (uzbl.gui.main_window), uzbl.gui.icon, NULL); + } else { + g_printerr ("Icon \"%s\" not found. ignoring.\n", uzbl.gui.icon); + } + g_free (uzbl.gui.icon); +} + static void cmd_load_uri() { GArray *a = g_array_new (TRUE, FALSE, sizeof(gchar*)); @@ -2038,15 +2049,11 @@ create_mainbar () { static GtkWidget* create_window () { GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gchar* uzbl_icon = find_xdg_file(1, "/uzbl/uzbl.png"); gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); gtk_widget_set_name (window, "Uzbl browser"); - gtk_window_set_icon_from_file (GTK_WINDOW (window), uzbl_icon, NULL); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK (key_press_cb), NULL); - g_free (uzbl_icon); - return window; } diff --git a/uzbl.h b/uzbl.h index a6a3a6e..2e7ccf9 100644 --- a/uzbl.h +++ b/uzbl.h @@ -77,6 +77,7 @@ typedef struct { GtkAdjustment* bar_h; // and scrolling position WebKitWebView* web_view; gchar* main_title; + gchar* icon; /* WebInspector */ GtkWidget *inspector_window; @@ -460,6 +461,9 @@ cmd_set_status(); static void set_proxy_url(); +static void +set_icon(); + static void cmd_cookie_handler(); -- cgit v1.2.3