aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-25 16:12:52 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-25 16:12:52 +0200
commit9bdb2879ad9a8983369b51f3e70617387ce597bf (patch)
tree8c91068b35f5837b6e36f329b932fa640572fdf1 /uzbl.c
parent1f1853565b70570fcbe71cc10508f90c71e7cc55 (diff)
remove the aliases concept. commands is all we need + synchronize command names with bindings in sample config
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c42
1 files changed, 4 insertions, 38 deletions
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++)
@@ -184,24 +165,16 @@ add_command (char* cmdstr, void* function)
}
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);