From: Daniel Carl Date: Thu, 4 Dec 2014 21:13:01 +0000 (+0100) Subject: Moved pass through mode functions to normal.c. X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=0d0ca28cdab08c7e456962cba600ae15013a3a76;p=vimb.git Moved pass through mode functions to normal.c. --- diff --git a/src/main.c b/src/main.c index ad3ccbb..00a72da 100644 --- a/src/main.c +++ b/src/main.c @@ -39,7 +39,6 @@ #include "ex.h" #include "input.h" #include "map.h" -#include "pass.h" #include "bookmark.h" #include "js.h" #include "autocmd.h" diff --git a/src/normal.c b/src/normal.c index fb24641..2e085e3 100644 --- a/src/normal.c +++ b/src/normal.c @@ -310,6 +310,31 @@ VbResult normal_keypress(int key) return res; } +/** + * Function called when vimb enters the passthrough mode. + */ +void pass_enter(void) +{ + vb_update_mode_label("-- PASS THROUGH --"); +} + +/** + * Called when passthrough mode is left. + */ +void pass_leave(void) +{ + vb_update_mode_label(""); +} + +VbResult pass_keypress(int key) +{ + if (key == CTRL('[')) { /* esc */ + mode_enter('n'); + } + vb.state.processed_key = false; + return RESULT_COMPLETE; +} + static VbResult normal_clear_input(const NormalCmdInfo *info) { gtk_widget_grab_focus(GTK_WIDGET(vb.gui.webview)); diff --git a/src/normal.h b/src/normal.h index ac2eae0..e9a2f93 100644 --- a/src/normal.h +++ b/src/normal.h @@ -26,5 +26,8 @@ void normal_enter(void); void normal_leave(void); VbResult normal_keypress(int key); +void pass_enter(void); +void pass_leave(void); +VbResult pass_keypress(int key); #endif /* end of include guard: _NORMAL_H */ diff --git a/src/pass.c b/src/pass.c deleted file mode 100644 index d98104a..0000000 --- a/src/pass.c +++ /dev/null @@ -1,53 +0,0 @@ -/** - * vimb - a webkit based vim like browser. - * - * Copyright (C) 2012-2014 Daniel Carl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - */ - -#include "config.h" -#include "main.h" -#include "pass.h" -#include "mode.h" -#include "dom.h" -#include "ascii.h" - -extern VbCore vb; - - -/** - * Function called when vimb enters the passthrough mode. - */ -void pass_enter(void) -{ - vb_update_mode_label("-- PASS THROUGH --"); -} - -/** - * Called when passthrough mode is left. - */ -void pass_leave(void) -{ - vb_update_mode_label(""); -} - -VbResult pass_keypress(int key) -{ - if (key == CTRL('[')) { /* esc */ - mode_enter('n'); - } - vb.state.processed_key = false; - return RESULT_COMPLETE; -} diff --git a/src/pass.h b/src/pass.h deleted file mode 100644 index 03b34a2..0000000 --- a/src/pass.h +++ /dev/null @@ -1,30 +0,0 @@ -/** - * vimb - a webkit based vim like browser. - * - * Copyright (C) 2012-2014 Daniel Carl - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - */ - -#ifndef _PASS_H -#define _PASS_H - -#include "config.h" -#include "main.h" - -void pass_enter(void); -void pass_leave(void); -VbResult pass_keypress(int key); - -#endif /* end of include guard: _PASS_H */