From 5de2e430068083e7514fa8045b791f8d2f6b8597 Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 12 Nov 2009 14:10:22 +0100 Subject: added COMMAND_ERROR event --- README | 2 ++ events.c | 3 ++- events.h | 2 +- uzbl-core.c | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README b/README index e751d42..e3e22ea 100644 --- a/README +++ b/README @@ -453,6 +453,7 @@ Basically all events have this format: - `EVENT [uzbl_instance_name] INSTANCE_EXIT process_id`: uzbl shutdown - `EVENT [uzbl_instance_name] VARIABLE_SET variable_name str|int|float variable_value`. Note: str|int|float denote the type of variable_value - `EVENT [uzbl_instance_name] COMMAND_EXECUTED command_name optional_command_arguments` + - `EVENT [uzbl_instance_name] COMMAND_ERROR command` - `EVENT [uzbl_instance_name] GEOMETRY_CHANGED WIDTHxHEIGHT+X_POSITION+Y_POSITION`: when the size or position of the uzbl window changes - `EVENT [uzbl_instance_name] FIFO_SET path_to_fifo` - `EVENT [uzbl_instance_name] SOCKET_SET path_to_socket` @@ -460,6 +461,7 @@ Basically all events have this format: - `EVENT [uzbl_instance_name] LOAD_START uri` - `EVENT [uzbl_instance_name] LOAD_FINISHED uri` - `EVENT [uzbl_instance_name] LOAD_ERROR reason_of_error` + - `EVENT [uzbl_instance_name] LOAD_PROGRESS percentage` : while the page is loading - `EVENT [uzbl_instance_name] TITLE_CHANGED title_name`: when the title of the webpage (and hence maybe, the window title) changed - `EVENT [uzbl_instance_name] DOWNLOAD_REQUEST download_uri`: when content needs to be downloaded - `EVENT [uzbl_instance_name] LINK_HOVER uri`: mouse hovers over a link diff --git a/events.c b/events.c index 2663091..ca10058 100644 --- a/events.c +++ b/events.c @@ -41,7 +41,8 @@ const char *event_table[LAST_EVENT] = { "FOCUS_LOST" , "FOCUS_GAINED" , "FILE_INCLUDED" , - "PLUG_CREATED" + "PLUG_CREATED" , + "COMMAND_ERROR" }; void diff --git a/events.h b/events.h index a2ae2bb..9e7a01d 100644 --- a/events.h +++ b/events.h @@ -13,7 +13,7 @@ enum event_type { INSTANCE_START, INSTANCE_EXIT, LOAD_PROGRESS, LINK_UNHOVER, FORM_ACTIVE, ROOT_ACTIVE, FOCUS_LOST, FOCUS_GAINED, FILE_INCLUDED, - PLUG_CREATED, + PLUG_CREATED, COMMAND_ERROR, /* must be last entry */ LAST_EVENT diff --git a/uzbl-core.c b/uzbl-core.c index 146642c..5543d95 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -1492,8 +1492,8 @@ parse_command(const char *cmd, const char *param, GString *result) { g_string_free(tmp, TRUE); } - } else - g_printerr ("command \"%s\" not understood. ignoring.\n", cmd); + } else + send_event(COMMAND_ERROR, cmd, NULL); } -- cgit v1.2.3 From 6289f7eeb404a2e825447eb83e159fb9d9689c3a Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 12 Nov 2009 15:49:33 +0100 Subject: add command params to COMMAND_ERROR --- uzbl-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/uzbl-core.c b/uzbl-core.c index 5543d95..2e1ef9d 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -1491,9 +1491,12 @@ parse_command(const char *cmd, const char *param, GString *result) { send_event(COMMAND_EXECUTED, tmp->str, NULL); g_string_free(tmp, TRUE); } - - } else - send_event(COMMAND_ERROR, cmd, NULL); + } + else { + gchar *tmp = g_strdup_printf("%s %s", cmd, param?param:""); + send_event(COMMAND_ERROR, tmp, NULL); + g_free(tmp); + } } -- cgit v1.2.3 From f85c745e67eccda70d43ead308ababa37cfd036f Mon Sep 17 00:00:00 2001 From: Rob Date: Thu, 12 Nov 2009 16:34:54 +0100 Subject: remove obsolete statusbar code --- uzbl-core.c | 1 - uzbl-core.h | 8 -------- 2 files changed, 9 deletions(-) diff --git a/uzbl-core.c b/uzbl-core.c index 2e1ef9d..96a6208 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -88,7 +88,6 @@ const struct var_name_to_ptr_t { { "inject_html", PTR_V_STR(uzbl.behave.inject_html, 0, cmd_inject_html)}, { "geometry", PTR_V_STR(uzbl.gui.geometry, 1, cmd_set_geometry)}, { "keycmd", PTR_V_STR(uzbl.state.keycmd, 1, NULL)}, - { "status_message", PTR_V_STR(uzbl.gui.sbar.msg, 1, NULL)}, { "show_status", PTR_V_INT(uzbl.behave.show_status, 1, cmd_set_status)}, { "status_top", PTR_V_INT(uzbl.behave.status_top, 1, move_statusbar)}, { "status_format", PTR_V_STR(uzbl.behave.status_format, 1, NULL)}, diff --git a/uzbl-core.h b/uzbl-core.h index 48c99ae..5c291e5 100644 --- a/uzbl-core.h +++ b/uzbl-core.h @@ -41,12 +41,6 @@ #define LENGTH(x) (sizeof x / sizeof x[0]) -/* status bar elements */ -typedef struct { - gchar *msg; -} StatusBar; - - /* gui elements */ typedef struct { GtkWidget* main_window; @@ -68,8 +62,6 @@ typedef struct { GtkWidget *inspector_window; WebKitWebInspector *inspector; - StatusBar sbar; - /* custom context menu item */ GPtrArray *menu_items; } GUI; -- cgit v1.2.3