Renamed the insert mode to input mode.
authorDaniel Carl <danielcarl@gmx.de>
Tue, 6 Aug 2013 19:24:28 +0000 (21:24 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Tue, 6 Aug 2013 19:24:28 +0000 (21:24 +0200)
This reflects better what we are doing and we used both terms in the manual
page which was confusing. So now the mode is called 'Input Mode'.

doc/vimb.1
src/command.c
src/dom.c
src/hints.c
src/main.c
src/main.h

index 85eaaad..5cb2904 100644 (file)
@@ -43,11 +43,13 @@ PROJECT is modal an has following main modes:
 .B Normal Mode
 The default mode. Pressing Escape always enter normal mode.
 .TP
-.B Insert Mode
+.B Input Mode
 Used for editing text elements in a webpage.
 .TP
 .B Command Mode
 Execute PROJECT commands from the builtin inputbox (commandline).
+
+.SS Submodes
 .TP
 .B Pass-Through Mode
 In Pass-Through mode only the <ctrl-c> and <esc> keybindings are interpreted
@@ -61,7 +63,7 @@ that could be done with this browser. Commands allow to set config variables,
 to assign keybindings and much more. Also the keybindings are only shortcut
 for the commands itself.
 
-Commands can be called in Insert Mode from the inputbox in the way like
+Commands can be called in Input Mode from the inputbox in the way like
 ":[count]command[ param[=value]]". But some commands are not available in
 Command Mode and therefore not callable directly. To use them too, they must be
 bound to the keybinding.
@@ -89,7 +91,7 @@ the browser with various prefilled content.
 .BI "input [" TEXT "], in [" TEXT ]
 Writes
 .I TEXT
-into to inputbox and switch to command mode. If no
+into to inputbox and switch to Command Mode. If no
 .I TEXT
 is given, print ':' into the inputbox.
 .TP
@@ -378,7 +380,7 @@ Example:
 
 .TP
 .B pass-through
-Switch PROJECT into pass-trough mode.
+Switch PROJECT into Pass-Through Mode.
 
 .TP
 .BI "shellcmd " CMD
@@ -411,7 +413,7 @@ Close the browser.
 .TP
 .B focus-input
 Set the cursor to the first found editable element on the page and switch
-PROJECT into insert mode.
+PROJECT into Input Mode.
 .TP
 .B source
 Toggle between normal view and source view for the current page.
@@ -471,9 +473,9 @@ Example:
 "25G" to got to 25% of the page.
 .TP
 .B esc
-Got back to normal mode indipendent from current mode.
+Got back to Normal Mode indipendent from current mode.
 
-.SS NORMAL_MODE
+.SS NORMAL MODE
 .TP
 .B g\-f
 Toggle show html source of current page.
@@ -482,17 +484,17 @@ Toggle show html source of current page.
 Opend the Web Inspector for current page.
 .TP
 .B g\-i
-Set cursor to the first editable element in the page and switch to insert
-mode.
+Set cursor to the first editable element in the page and switch to Input
+Mode.
 .TP
 .B :
-Start command mode and print `:' to the input box.
+Start Command Mode and print `:' to the input box.
 .TP
 .B /
-Start command mode and print `/' to inputbox to start searching forward.
+Start Command Mode and print `/' to inputbox to start searching forward.
 .TP
 .B ?
-Start command mode and print `?' to inputbox to start searching backward.
+Start Command Mode and print `?' to inputbox to start searching backward.
 .TP
 .B *
 Search forward for current selected text.
@@ -501,16 +503,16 @@ Search forward for current selected text.
 Search backward for current selected text.
 .TP
 .B o
-Start command mode and print `:open ' to input box.
+Start Command Mode and print `:open ' to input box.
 .TP
 .B O
-Start command mode and print `:open CURRENT_URI' to input box.
+Start Command Mode and print `:open CURRENT_URI' to input box.
 .TP
 .B t
-Start command mode and print `:tabopen ' to input box.
+Start Command Mode and print `:tabopen ' to input box.
 .TP
 .B T
-Start command mode and print `:tabopen CURRENT_URI' to input box.
+Start Command Mode and print `:tabopen CURRENT_URI' to input box.
 .TP
 .B g\-h
 Opend the configured home-page.
@@ -657,9 +659,9 @@ Search for \fIN\fPnth next search result.
 Search for \fIN\fPnth previous search result.
 .TP
 .B ctrl\-z
-Switch PROJECT into pass-through mode.
+Switch PROJECT into Pass-Through Mode.
 
-.SS COMMAND_MODE
+.SS COMMAND MODE
 .TP
 .B tab
 Complete different sources in the inputbox or if hinting is active, focus next
@@ -675,15 +677,15 @@ Step through history backward.
 .B down
 Step through history forward.
 
-.SS INSERT_MODE
+.SS INPUT MODE
 .TP
-.B ctrl-t
+.B ctrl\-t
 If the current active form element is an inputbox or textarea, the content is
 copied to temporary file and the file openen with the configured external
 editor (setting `editor-command').
 .TP
 .B ctrl\-z
-Switch PROJECT into pass-through mode.
+Switch PROJECT into Pass-Through Mode.
 
 .SH FILES
 .I $XDG_CONFIG_HOME/PROJECT/config
index d1cd64f..e42777e 100644 (file)
@@ -78,10 +78,10 @@ static CommandInfo cmd_list[] = {
     {"scrollup",                  NULL,    command_scroll,               {VB_SCROLL_TYPE_SCROLL | VB_SCROLL_DIRECTION_TOP | VB_SCROLL_UNIT_LINE}},
     {"scrolldown",                NULL,    command_scroll,               {VB_SCROLL_TYPE_SCROLL | VB_SCROLL_DIRECTION_DOWN | VB_SCROLL_UNIT_LINE}},
     {"nmap",                      NULL,    command_map,                  {VB_MODE_NORMAL}},
-    {"imap",                      NULL,    command_map,                  {VB_MODE_INSERT}},
+    {"imap",                      NULL,    command_map,                  {VB_MODE_INPUT}},
     {"cmap",                      NULL,    command_map,                  {VB_MODE_COMMAND}},
     {"nunmap",                    NULL,    command_unmap,                {VB_MODE_NORMAL}},
-    {"iunmap",                    NULL,    command_unmap,                {VB_MODE_INSERT}},
+    {"iunmap",                    NULL,    command_unmap,                {VB_MODE_INPUT}},
     {"cunmap",                    NULL,    command_unmap,                {VB_MODE_COMMAND}},
     {"set",                       NULL,    command_set,                  {0}},
     {"inspect",                   NULL,    command_inspect,              {0}},
@@ -961,7 +961,7 @@ gboolean command_mode(const Arg *arg)
 gboolean command_focusinput(const Arg *arg)
 {
     if (dom_focus_input(vb.gui.webview)) {
-        vb_set_mode(VB_MODE_INSERT, false);
+        vb_set_mode(VB_MODE_INPUT, false);
 
         return true;
     }
index 65d9c43..cc5f31a 100644 (file)
--- a/src/dom.c
+++ b/src/dom.c
@@ -79,8 +79,7 @@ gboolean dom_focus_input(WebKitWebView *view)
         return false;
     }
 
-    html = webkit_dom_node_list_item(list, 0);
-
+    html     = webkit_dom_node_list_item(list, 0);
     resolver = webkit_dom_document_create_ns_resolver(doc, html);
     if (!resolver) {
         return false;
@@ -195,7 +194,7 @@ static gboolean element_is_visible(WebKitDOMDOMWindow* win, WebKitDOMElement* el
 static gboolean auto_insert(Element *element)
 {
     if (dom_is_editable(element)) {
-        vb_set_mode(VB_MODE_INSERT, false);
+        vb_set_mode(VB_MODE_INPUT, false);
         return true;
     }
     return false;
@@ -206,7 +205,7 @@ static gboolean editable_focus_cb(Element *element, Event *event)
     webkit_dom_event_target_remove_event_listener(
         WEBKIT_DOM_EVENT_TARGET(element), "focus", G_CALLBACK(editable_focus_cb), false
     );
-    if (CLEAN_MODE(vb.state.mode) != VB_MODE_INSERT) {
+    if (CLEAN_MODE(vb.state.mode) != VB_MODE_INPUT) {
         EventTarget *target = webkit_dom_event_get_target(event);
         auto_insert((void*)target);
     }
index c9d61e2..52c9772 100644 (file)
@@ -149,7 +149,7 @@ static void run_script(char *js)
     } else if (!strncmp(value, "DONE:", 5)) {
         vb_set_mode(VB_MODE_NORMAL, true);
     } else if (!strncmp(value, "INSERT:", 7)) {
-        vb_set_mode(VB_MODE_INSERT, false);
+        vb_set_mode(VB_MODE_INPUT, false);
         if (HINTS_GET_TYPE(mode) == HINTS_TYPE_EDITABLE) {
             command_editor(NULL);
         }
index 90c9bdb..08b0641 100644 (file)
@@ -207,7 +207,7 @@ gboolean vb_set_mode(Mode mode, gboolean clean)
             command_search(&((Arg){VB_SEARCH_OFF}));
         } else if ((vb.state.mode & VB_MODE_HINTING) && !(mode & VB_MODE_HINTING)) {
             hints_clear();
-        } else if (CLEAN_MODE(vb.state.mode) == VB_MODE_INSERT && !(mode & VB_MODE_INSERT)) {
+        } else if (CLEAN_MODE(vb.state.mode) == VB_MODE_INPUT && !(mode & VB_MODE_INPUT)) {
             clean = true;
             dom_clear_focus(vb.gui.webview);
         }
@@ -227,7 +227,7 @@ gboolean vb_set_mode(Mode mode, gboolean clean)
                 gtk_widget_grab_focus(GTK_WIDGET(vb.gui.inputbox));
                 break;
 
-            case VB_MODE_INSERT:
+            case VB_MODE_INPUT:
                 clean = false;
                 gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview));
                 if (mode & VB_MODE_PASSTHROUGH) {
@@ -456,7 +456,7 @@ static void webview_load_status_cb(WebKitWebView *view, GParamSpec *pspec)
                 run_user_script(frame);
             }
 
-            if (vb.state.mode & VB_MODE_INSERT) {
+            if (vb.state.mode & VB_MODE_INPUT) {
                 /* status bar is updated by vb_set_mode */
                 vb_set_mode(VB_MODE_NORMAL, false);
             } else {
@@ -887,7 +887,7 @@ static gboolean button_relase_cb(WebKitWebView *webview, GdkEventButton *event)
 
     g_object_get(result, "context", &context, NULL);
     if (mode == VB_MODE_NORMAL && context & WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE) {
-        vb_set_mode(VB_MODE_INSERT, false);
+        vb_set_mode(VB_MODE_INPUT, false);
 
         propagate = true;
     }
index a4d630a..17a89d4 100644 (file)
@@ -61,7 +61,7 @@
     gtk_editable_set_position(GTK_EDITABLE(vb.gui.inputbox), -1); \
 }
 #define GET_URI() (webkit_web_view_get_uri(vb.gui.webview))
-#define CLEAN_MODE(mode) ((mode) & (VB_MODE_NORMAL|VB_MODE_COMMAND|VB_MODE_INSERT))
+#define CLEAN_MODE(mode) ((mode) & (VB_MODE_NORMAL|VB_MODE_COMMAND|VB_MODE_INPUT))
 #define CLEAR_INPUT() (vb_echo(VB_MSG_NORMAL, ""))
 #define PRIMARY_CLIPBOARD() gtk_clipboard_get(GDK_SELECTION_PRIMARY)
 #define SECONDARY_CLIPBOARD() gtk_clipboard_get(GDK_NONE)
@@ -115,7 +115,7 @@ typedef enum _vb_mode {
     /* main modes */
     VB_MODE_NORMAL        = 1<<0,
     VB_MODE_COMMAND       = 1<<1,
-    VB_MODE_INSERT        = 1<<2,
+    VB_MODE_INPUT         = 1<<2,
     /* sub modes */
     VB_MODE_PASSTHROUGH   = 1<<3, /* normal or insert mode */
     VB_MODE_SEARCH        = 1<<4, /* normal mode */