From ee5db91f7af5dd2bfe80d4c3c36009989cd9affc Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 25 Apr 2009 13:28:11 +0200 Subject: some more keys --- sampleconfig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sampleconfig') diff --git a/sampleconfig b/sampleconfig index c1dac2b..e566676 100644 --- a/sampleconfig +++ b/sampleconfig @@ -18,9 +18,17 @@ modkey = Mod4 [bindings_internal] next = n +back = b +stop = s +refresh = r +reload = R +home = h follow_link_here = f follow_link_new_tab = F follow_link_new_window = w +zoom_in = + +zoom_out = - + [bindings_external] ./extra/insert_bookmark.sh = b -- cgit v1.2.3 From 9bdb2879ad9a8983369b51f3e70617387ce597bf Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 25 Apr 2009 16:12:52 +0200 Subject: remove the aliases concept. commands is all we need + synchronize command names with bindings in sample config --- sampleconfig | 2 +- uzbl.c | 42 ++++-------------------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) (limited to 'sampleconfig') diff --git a/sampleconfig b/sampleconfig index e566676..f40afe4 100644 --- a/sampleconfig +++ b/sampleconfig @@ -18,7 +18,7 @@ modkey = Mod4 [bindings_internal] next = n -back = b +forward = m stop = s refresh = r reload = R diff --git a/uzbl.c b/uzbl.c index 749064b..7499062 100644 --- a/uzbl.c +++ b/uzbl.c @@ -71,15 +71,6 @@ struct command static struct command commands[256]; static int numcmds = 0; -struct alias -{ - char alias[256]; - char command[256]; -}; - -static struct alias aliases[256]; -static int numalias = 0; - static void parse_command(const char*); @@ -94,16 +85,6 @@ parse_command(const char *command) strcpy(cmdstr, command); - printf("Checking aliases\n"); - for (i = 0; i < numalias && ! done; i++) - { - if (!strncmp (cmdstr, aliases[i].alias, strlen (aliases[i].alias))) - { - strcpy(cmdstr, aliases[i].command); - done = true; - } - } - done = false; printf("Checking commands\n"); for (i = 0; i < numcmds && ! done; i++) @@ -183,25 +164,17 @@ add_command (char* cmdstr, void* function) numcmds++; } -static void -add_command_alias (char* alias, char* command) -{ - strncpy (aliases[numalias].alias, alias, strlen (alias)); - strncpy (aliases[numalias].command, command, strlen (command)); - numalias++; -} - static void setup_commands () { - //This func. is nice but currently it cannot be used for functions that require arguments or return data. --sentientswitch - + // This func. is nice but currently it cannot be used for functions that require arguments or return data. --sentientswitch + // TODO: reload, home add_command("back", &webkit_web_view_go_back); add_command("forward", &webkit_web_view_go_forward); add_command("refresh", &webkit_web_view_reload); //Buggy add_command("stop", &webkit_web_view_stop_loading); - add_command("zoom in", &webkit_web_view_zoom_in); //Can crash (when max zoom reached?). - add_command("zoom out", &webkit_web_view_zoom_out); //Crashes as zoom + + add_command("zoom_in", &webkit_web_view_zoom_in); //Can crash (when max zoom reached?). + add_command("zoom_out", &webkit_web_view_zoom_out); //Crashes as zoom + //add_command("get uri", &webkit_web_view_get_uri); } @@ -367,13 +340,6 @@ int main (int argc, char* argv[]) } else { printf("history logging disabled\n"); } - /* Until segfaults is fixed, manually add aliases to test the rest of it. */ - add_command_alias("b", "back"); - add_command_alias("f", "forward"); - add_command_alias("z+", "zoom in"); - add_command_alias("z-", "zoom out"); - add_command_alias("r", "refresh"); - add_command_alias("s", "stop"); GtkWidget* vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), create_mainbar (), FALSE, TRUE, 0); -- cgit v1.2.3 From 6810475ee618f7bfde6c1fd7707065276d1e83be Mon Sep 17 00:00:00 2001 From: Barrucadu Date: Sat, 25 Apr 2009 15:25:47 +0100 Subject: Merged changes from dieter/experimental - bye bye aliases. --- sampleconfig | 1 + uzbl.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'sampleconfig') diff --git a/sampleconfig b/sampleconfig index f40afe4..e318e49 100644 --- a/sampleconfig +++ b/sampleconfig @@ -1,3 +1,4 @@ + # example uzbl config. in a real config, we should obey the xdg spec # all keys in the behavior group are optional. if not set, the corresponding behavior is disabed. diff --git a/uzbl.c b/uzbl.c index 7499062..e7b7999 100644 --- a/uzbl.c +++ b/uzbl.c @@ -71,10 +71,6 @@ struct command static struct command commands[256]; static int numcmds = 0; -static void -parse_command(const char*); - - static void parse_command(const char *command) { -- cgit v1.2.3