diff options
author | rafa_99 <raroma09@gmail.com> | 2021-09-25 01:23:25 +0100 |
---|---|---|
committer | rafa_99 <raroma09@gmail.com> | 2021-09-25 01:23:25 +0100 |
commit | b1518d7d72421cae4b157943dd07e2030a918289 (patch) | |
tree | b882d71068852d0de1841b70e68a1ed104e640b4 /src | |
parent | bc11211ffb6ecc5bed00f144ab03cd8c770035a5 (diff) |
Project branch off
Diffstat (limited to 'src')
-rw-r--r-- | src/.gitignore | 2 | ||||
-rw-r--r-- | src/Makefile | 8 | ||||
-rw-r--r-- | src/bookmark.c | 2 | ||||
-rw-r--r-- | src/completion.c | 2 | ||||
-rw-r--r-- | src/config.def.h | 4 | ||||
-rw-r--r-- | src/ex.c | 10 | ||||
-rw-r--r-- | src/ext-proxy.c | 4 | ||||
-rw-r--r-- | src/handler.c | 2 | ||||
-rw-r--r-- | src/hints.c | 4 | ||||
-rw-r--r-- | src/input.c | 12 | ||||
-rw-r--r-- | src/main.c | 40 | ||||
-rw-r--r-- | src/main.h | 2 | ||||
-rw-r--r-- | src/map.c | 2 | ||||
-rw-r--r-- | src/normal.c | 8 | ||||
-rw-r--r-- | src/scripts/focus_editor_map_element.js | 4 | ||||
-rw-r--r-- | src/scripts/hints.css | 8 | ||||
-rw-r--r-- | src/scripts/hints.js | 6 | ||||
-rw-r--r-- | src/scripts/set_editor_map_element.js | 6 | ||||
-rw-r--r-- | src/setting.c | 4 | ||||
-rw-r--r-- | src/shortcut.c | 2 | ||||
-rw-r--r-- | src/util.c | 2 | ||||
-rw-r--r-- | src/webextension/ext-main.h | 6 |
22 files changed, 70 insertions, 70 deletions
diff --git a/src/.gitignore b/src/.gitignore index ca46d8a..909803c 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,2 +1,2 @@ config.h -vimb +neovimb diff --git a/src/Makefile b/src/Makefile index 3674315..382a38a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,17 +4,17 @@ OBJ = $(patsubst %.c, %.o, $(wildcard *.c)) JSFILES = $(wildcard scripts/*.js) CSSFILES = $(wildcard scripts/*.css) -all: vimb webextension.subdir-all +all: neovimb webextension.subdir-all clean: webextension.subdir-clean - $(RM) vimb vimb.so $(OBJ) + $(RM) neovimb neovimb.so $(OBJ) $(RM) scripts/scripts.h -vimb: $(OBJ) +neovimb: $(OBJ) @echo "${CC} $@" $(Q)$(CC) $(OBJ) $(LDFLAGS) -o $@ -vimb.so: $(OBJ) +neovimb.so: $(OBJ) $(Q)$(CC) -shared $(OBJ) $(LDFLAGS) -o $@ $(OBJ): config.h ../config.mk diff --git a/src/bookmark.c b/src/bookmark.c index 2a0a3cf..ec8d1de 100644 --- a/src/bookmark.c +++ b/src/bookmark.c @@ -31,7 +31,7 @@ typedef struct { char *tags; } Bookmark; -extern struct Vimb vb; +extern struct neovimb vb; static GList *load(const char *file); static gboolean bookmark_contains_all_tags(Bookmark *bm, char **query, diff --git a/src/completion.c b/src/completion.c index 3b27b6c..f521da9 100644 --- a/src/completion.c +++ b/src/completion.c @@ -30,7 +30,7 @@ typedef struct { static gboolean tree_selection_func(GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean selected, gpointer data); -extern struct Vimb vb; +extern struct neovimb vb; /** diff --git a/src/config.def.h b/src/config.def.h index dbfc01c..e4d27af 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -56,7 +56,7 @@ /* cookie-accept allowed values always, origin, never */ #define SETTING_COOKIE_ACCEPT "always" #define SETTING_HINT_KEYS "0123456789" -#define SETTING_DOWNLOAD_COMMAND "/bin/sh -c \"curl -sLJOC - -e '$VIMB_URI' %s\"" +#define SETTING_DOWNLOAD_COMMAND "/bin/sh -c \"curl -sLJOC - -e '$neovimb_URI' %s\"" #define SETTING_COMPLETION_CSS "color:#fff;background-color:#656565;font:" SETTING_GUI_FONT_NORMAL #define SETTING_COMPLETION_HOVER_CSS "background-color:#777;" #define SETTING_COMPLETION_SELECTED_CSS "color:#f6f3e8;background-color:#888;" @@ -71,7 +71,7 @@ #define WIN_WIDTH 800 #define WIN_HEIGHT 600 -/* if set to 1 vimb will check if the webextension could be found. */ +/* if set to 1 neovimb will check if the webextension could be found. */ #define CHECK_WEBEXTENSION_ON_STARTUP 1 /* Auto Hide Input Bar */ @@ -215,10 +215,10 @@ static struct { char *token; /* initial filter content */ } excomp; -extern struct Vimb vb; +extern struct neovimb vb; /** - * Function called when vimb enters the command mode. + * Function called when neovimb enters the command mode. */ void ex_enter(Client *c) { @@ -1084,13 +1084,13 @@ static VbCmdResult ex_shellcmd(Client *c, const ExArg *arg) return CMD_ERROR; } - /* Get current selection and write it as VIMB_SELECTION into env. */ + /* Get current selection and write it as neovimb_SELECTION into env. */ selection = ext_proxy_get_current_selection(c); if (selection) { - g_setenv("VIMB_SELECTION", selection, TRUE); + g_setenv("neovimb_SELECTION", selection, TRUE); g_free(selection); } else { - g_setenv("VIMB_SELECTION", "", TRUE); + g_setenv("neovimb_SELECTION", "", TRUE); } if (arg->bang) { diff --git a/src/ext-proxy.c b/src/ext-proxy.c index 84ab325..612f6e8 100644 --- a/src/ext-proxy.c +++ b/src/ext-proxy.c @@ -46,9 +46,9 @@ static void on_web_extension_page_created(GDBusConnection *connection, GVariant *parameters, gpointer data); /* TODO we need potentially multiple proxies. Because a single instance of - * vimb may hold multiple clients which may use more than one webprocess and + * neovimb may hold multiple clients which may use more than one webprocess and * therefore multiple webextension instances. */ -extern struct Vimb vb; +extern struct neovimb vb; static GDBusServer *dbusserver; diff --git a/src/handler.c b/src/handler.c index c41e869..a5e79e0 100644 --- a/src/handler.c +++ b/src/handler.c @@ -23,7 +23,7 @@ #include "handler.h" #include "util.h" -extern struct Vimb vb; +extern struct neovimb vb; struct handler { GHashTable *table; /* holds the protocol handlers */ diff --git a/src/hints.c b/src/hints.c index 0cb6a5b..fa12ff1 100644 --- a/src/hints.c +++ b/src/hints.c @@ -43,7 +43,7 @@ static struct { guint timeout_id; } hints; -extern struct Vimb vb; +extern struct neovimb vb; static gboolean call_hints_function(Client *c, const char *func, const char* args, gboolean sync); @@ -334,7 +334,7 @@ static gboolean hint_function_check_result(Client *c, GVariant *return_value) /* Change to normal mode only if we are currently in command mode and * we are not in g-mode hinting. This is required to not switch to * normal mode when the hinting triggered a click that set focus on - * editable element that lead vimb to switch to input mode. */ + * editable element that lead neovimb to switch to input mode. */ if (!hints.gmode && c->mode->id == 'c') { vb_enter(c, 'n'); } diff --git a/src/input.c b/src/input.c index 56e2676..62badbd 100644 --- a/src/input.c +++ b/src/input.c @@ -39,7 +39,7 @@ typedef struct { static void input_editor_formfiller(const char *text, Client *c, gpointer data); /** - * Function called when vimb enters the input mode. + * Function called when neovimb enters the input mode. */ void input_enter(Client *c) { @@ -47,7 +47,7 @@ void input_enter(Client *c) * disturbing the user */ gtk_widget_grab_focus(GTK_WIDGET(c->webview)); vb_modelabel_update(c, "-- INPUT --"); - ext_proxy_eval_script(c, "var vimb_input_mode_element = document.activeElement;", NULL); + ext_proxy_eval_script(c, "var neovimb_input_mode_element = document.activeElement;", NULL); } /** @@ -55,7 +55,7 @@ void input_enter(Client *c) */ void input_leave(Client *c) { - ext_proxy_eval_script(c, "vimb_input_mode_element.blur();", NULL); + ext_proxy_eval_script(c, "neovimb_input_mode_element.blur();", NULL); vb_modelabel_update(c, ""); } @@ -120,14 +120,14 @@ VbResult input_open_editor(Client *c) g_assert(c); /* get the selected input element */ - jsreturn = ext_proxy_eval_script_sync(c, "vimb_input_mode_element.value"); + jsreturn = ext_proxy_eval_script_sync(c, "neovimb_input_mode_element.value"); g_variant_get(jsreturn, "(bs)", &success, &text); if (!success || !text) { return RESULT_ERROR; } - idreturn = ext_proxy_eval_script_sync(c, "vimb_input_mode_element.id"); + idreturn = ext_proxy_eval_script_sync(c, "neovimb_input_mode_element.id"); g_variant_get(idreturn, "(bs)", &success, &id); /* Special case: the input element does not have an id assigned to it */ @@ -169,7 +169,7 @@ static void input_editor_formfiller(const char *text, Client *c, gpointer data) if (eed->element_id && strlen(eed->element_id) > 0) { jscode = g_strdup_printf("document.getElementById(\"%s\").value=\"%s\"", eed->element_id, escaped); } else { - jscode = g_strdup_printf("vimb_editor_map.get(\"%lu\").value=\"%s\"", eed->element_map_key, escaped); + jscode = g_strdup_printf("neovimb_editor_map.get(\"%lu\").value=\"%s\"", eed->element_map_key, escaped); } ext_proxy_eval_script(c, jscode, NULL); @@ -108,9 +108,9 @@ static void set_statusbar_style(Client *c, StatusType type); static void set_title(Client *c, const char *title); static void spawn_new_instance(const char *uri); #ifdef FREE_ON_QUIT -static void vimb_cleanup(void); +static void neovimb_cleanup(void); #endif -static void vimb_setup(void); +static void neovimb_setup(void); static WebKitWebView *webview_new(Client *c, WebKitWebView *webview); static void on_counted_matches(WebKitFindController *finder, guint count, Client *c); static gboolean on_permission_request(WebKitWebView *webview, @@ -123,7 +123,7 @@ static gboolean profileOptionArgFunc(const gchar *option_name, static gboolean autocmdOptionArgFunc(const gchar *option_name, const gchar *value, gpointer data, GError **error); -struct Vimb vb; +struct neovimb vb; /** * Set the destination for a download according to suggested file name and @@ -373,8 +373,8 @@ void vb_input_update_style(Client *c) * * If arg.i = TARGET_CURRENT, the url is opened into the current webview. * TARGET_RELATED causes the generation of a new window within the current - * instance of vimb with a own, but related webview. And TARGET_NEW spawns a - * new instance of vimb with the given uri. + * instance of neovimb with a own, but related webview. And TARGET_NEW spawns a + * new instance of neovimb with the given uri. */ gboolean vb_load_uri(Client *c, const Arg *arg) { @@ -813,16 +813,16 @@ static void client_show(WebKitWebView *webview, Client *c) char *wid; wid = g_strdup_printf("%d", (int)GDK_WINDOW_XID(gtk_widget_get_window(c->window))); - g_setenv("VIMB_WIN_ID", wid, TRUE); + g_setenv("neovimb_WIN_ID", wid, TRUE); #ifndef FEATURE_NO_XEMBED /* set the x window id to env */ if (vb.embed) { char *xid; xid = g_strdup_printf("%d", (int)vb.embed); - g_setenv("VIMB_XID", xid, TRUE); + g_setenv("neovimb_XID", xid, TRUE); g_free(xid); } else { - g_setenv("VIMB_XID", wid, TRUE); + g_setenv("neovimb_XID", wid, TRUE); } #endif g_free(wid); @@ -1015,7 +1015,7 @@ static void set_title(Client *c, const char *title) { OVERWRITE_STRING(c->state.title, title); update_title(c); - g_setenv("VIMB_TITLE", title ? title : "", TRUE); + g_setenv("neovimb_TITLE", title ? title : "", TRUE); } /** @@ -1170,7 +1170,7 @@ static void spawn_download_command(Client *c, WebKitURIResponse *response) } envp = g_get_environ(); - envp = g_environ_setenv(envp, "VIMB_DOWNLOAD_PATH", + envp = g_environ_setenv(envp, "neovimb_DOWNLOAD_PATH", GET_CHAR(c, "download-path"), TRUE); if (g_spawn_async(NULL, argv, envp, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) { @@ -1328,7 +1328,7 @@ static WebKitWebView *on_webview_create(WebKitWebView *webview, /** * Callback for the webview decide-policy signal. * Checks the reasons for some navigation actions and decides if the action is - * allowed, or should go into a new instance of vimb. + * allowed, or should go into a new instance of neovimb. */ static gboolean on_webview_decide_policy(WebKitWebView *webview, WebKitPolicyDecision *dec, WebKitPolicyDecisionType type, Client *c) @@ -1481,7 +1481,7 @@ static void on_webview_load_changed(WebKitWebView *webview, set_title(c, uri); } /* Make sure hinting is cleared before the new page is loaded. - * Without that vimb would still be in hinting mode after hinting + * Without that neovimb would still be in hinting mode after hinting * was started and some links was clicked my mouse. Even if there * could not hints be shown. */ if (c->mode->flags & FLAG_HINTING) { @@ -1603,7 +1603,7 @@ static void on_webview_notify_uri(WebKitWebView *webview, GParamSpec *pspec, Cli c->state.uri = util_sanitize_uri(webkit_web_view_get_uri(c->webview)); update_urlbar(c); - g_setenv("VIMB_URI", c->state.uri, TRUE); + g_setenv("neovimb_URI", c->state.uri, TRUE); } /** @@ -1785,7 +1785,7 @@ static void update_urlbar(Client *c) /** * Free memory of the whole application. */ -static void vimb_cleanup(void) +static void neovimb_cleanup(void) { int i; @@ -1814,7 +1814,7 @@ static void vimb_cleanup(void) /** * Setup resources used on application scope. */ -static void vimb_setup(void) +static void neovimb_setup(void) { char *path, *dataPath; @@ -1900,7 +1900,7 @@ void vb_gui_style_update(Client *c, const char *setting_name_new, const char *se GString *style_sheet = g_string_new(GUI_STYLE_CSS_BASE); size_t i; - /* Mapping from vimb config setting name to css style sheet string */ + /* Mapping from neovimb config setting name to css style sheet string */ static const char *setting_style_map[][2] = { {"completion-css", " #completion{%s}"}, {"completion-hover-css", " #completion:hover{%s}"}, @@ -1961,7 +1961,7 @@ void vb_gui_style_update(Client *c, const char *setting_name_new, const char *se * invalidated automatically." * https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-invalidate * - * Required settings in vimb config file: + * Required settings in neovimb config file: * set input-autohide=true * set input-font-normal=20pt monospace * @@ -2219,10 +2219,10 @@ int main(int argc, char* argv[]) /* set the current pid in env */ pidstr = g_strdup_printf("%d", (int)getpid()); - g_setenv("VIMB_PID", pidstr, TRUE); + g_setenv("neovimb_PID", pidstr, TRUE); g_free(pidstr); - vimb_setup(); + neovimb_setup(); #ifndef FEATURE_NO_XEMBED if (winid) { @@ -2248,7 +2248,7 @@ int main(int argc, char* argv[]) gtk_main(); #ifdef FREE_ON_QUIT - vimb_cleanup(); + neovimb_cleanup(); #endif return EXIT_SUCCESS; @@ -267,7 +267,7 @@ struct Client { } autocmd; }; -struct Vimb { +struct neovimb { char *argv0; Client *clients; #ifndef FEATURE_NO_XEMBED @@ -41,7 +41,7 @@ static void process_events(void); static void free_events(void); static void process_event(GdkEventKey* event); -extern struct Vimb vb; +extern struct neovimb vb; static struct { guint state; diff --git a/src/normal.c b/src/normal.c index 37074f5..b0becfc 100644 --- a/src/normal.c +++ b/src/normal.c @@ -212,10 +212,10 @@ static struct { /* DEL 0x7f */ {NULL}, }; -extern struct Vimb vb; +extern struct neovimb vb; /** - * Function called when vimb enters the normal mode. + * Function called when neovimb enters the normal mode. */ void normal_enter(Client *c) { @@ -313,7 +313,7 @@ VbResult normal_keypress(Client *c, int key) } /** - * Function called when vimb enters the passthrough mode. + * Function called when neovimb enters the passthrough mode. */ void pass_enter(Client *c) { @@ -449,7 +449,7 @@ static VbResult normal_focus_last_active(Client *c, const NormalCmdInfo *info) GVariant *variant; gboolean focused; - variant = ext_proxy_eval_script_sync(c, "vimb_input_mode_element.focus();"); + variant = ext_proxy_eval_script_sync(c, "neovimb_input_mode_element.focus();"); g_variant_get(variant, "(bs)", &focused, NULL); if (!focused) { ext_proxy_focus_input(c); diff --git a/src/scripts/focus_editor_map_element.js b/src/scripts/focus_editor_map_element.js index b3137c5..387b41d 100644 --- a/src/scripts/focus_editor_map_element.js +++ b/src/scripts/focus_editor_map_element.js @@ -1,2 +1,2 @@ -vimb_editor_map.get("%lu").disabled=false; -vimb_editor_map.get("%lu").focus(); +neovimb_editor_map.get("%lu").disabled=false; +neovimb_editor_map.get("%lu").focus(); diff --git a/src/scripts/hints.css b/src/scripts/hints.css index 078b37e..f23c4e1 100644 --- a/src/scripts/hints.css +++ b/src/scripts/hints.css @@ -1,4 +1,4 @@ -span[vimbhint^='label']{ +span[neovimbhint^='label']{ background-color:#fff; border:1px solid #444; color:#000; @@ -9,17 +9,17 @@ span[vimbhint^='label']{ position:fixed !important; z-index:225000 } -*[vimbhint^='hint']{ +*[neovimbhint^='hint']{ background-color:#ff0 !important; color:#000 !important; transition-delay:all 0 !important; transition:all 0 !important; opacity:1 !important } -*[vimbhint='hint focus']{ +*[neovimbhint='hint focus']{ background-color:#8f0 !important } -span[vimbhint='label focus']{ +span[neovimbhint='label focus']{ opacity:1; } body::-webkit-scrollbar { diff --git a/src/scripts/hints.js b/src/scripts/hints.js index 6ee86ad..6a21586 100644 --- a/src/scripts/hints.js +++ b/src/scripts/hints.js @@ -7,7 +7,7 @@ var hints = Object.freeze((function(){ activeHint, /* holds the active hint object */ filterText = "", /* holds the typed text filter */ filterKeys = "", /* holds the typed hint-keys filter */ - attr = "vimbhint", + attr = "neovimbhint", config; /* the hint class used to maintain hinted element and labels */ function Hint() { @@ -89,8 +89,8 @@ var hints = Object.freeze((function(){ } for (i = 0; i < docs.length; i++) { doc = docs[i]; - /* find all hinted elements vimbhint 'hint' */ - var res = xpath(doc.doc, "//*[@vimbhint]"); + /* find all hinted elements neovimbhint 'hint' */ + var res = xpath(doc.doc, "//*[@neovimbhint]"); for (j = 0; j < res.snapshotLength; j++) { e = res.snapshotItem(j); e.removeAttribute(attr); diff --git a/src/scripts/set_editor_map_element.js b/src/scripts/set_editor_map_element.js index 875b410..8166b09 100644 --- a/src/scripts/set_editor_map_element.js +++ b/src/scripts/set_editor_map_element.js @@ -1,4 +1,4 @@ -if (typeof(vimb_editor_map) !== 'object') { - var vimb_editor_map = new Map; +if (typeof(neovimb_editor_map) !== 'object') { + var neovimb_editor_map = new Map; } -vimb_editor_map.set("%lu", vimb_input_mode_element); +neovimb_editor_map.set("%lu", neovimb_input_mode_element); diff --git a/src/setting.c b/src/setting.c index f73798e..8ed5d0b 100644 --- a/src/setting.c +++ b/src/setting.c @@ -70,7 +70,7 @@ static int webkit_spell_checking(Client *c, const char *name, DataType type, voi static int webkit_spell_checking_language(Client *c, const char *name, DataType type, void *value, void *data); static int window_decorate(Client *c, const char *name, DataType type, void *value, void *data); -extern struct Vimb vb; +extern struct neovimb vb; void setting_init(Client *c) @@ -169,7 +169,7 @@ void setting_init(Client *c) setting_add(c, "spell-checking", TYPE_BOOLEAN, &off, webkit_spell_checking, 0, NULL); setting_add(c, "spell-checking-languages", TYPE_CHAR, &"en_US", webkit_spell_checking_language, FLAG_LIST|FLAG_NODUP, NULL); - /* gui style settings vimb */ + /* gui style settings neovimb */ setting_add(c, "completion-css", TYPE_CHAR, &SETTING_COMPLETION_CSS, gui_style, 0, NULL); setting_add(c, "completion-hover-css", TYPE_CHAR, &SETTING_COMPLETION_HOVER_CSS, gui_style, 0, NULL); setting_add(c, "completion-selected-css", TYPE_CHAR, &SETTING_COMPLETION_SELECTED_CSS, gui_style, 0, NULL); diff --git a/src/shortcut.c b/src/shortcut.c index 692b727..0a74977 100644 --- a/src/shortcut.c +++ b/src/shortcut.c @@ -30,7 +30,7 @@ struct shortcut { char *fallback; /* default shortcut to use if none given in request */ }; -extern struct Vimb vb; +extern struct neovimb vb; static int get_max_placeholder(const char *str); static const char *shortcut_lookup(Shortcut *sc, const char *string, const char **query); @@ -37,7 +37,7 @@ static struct { char *config_dir; } util; -extern struct Vimb vb; +extern struct neovimb vb; static void create_dir_if_not_exists(const char *dirpath); static gboolean match(const char *pattern, int patlen, const char *subject); diff --git a/src/webextension/ext-main.h b/src/webextension/ext-main.h index 0f5a744..1976585 100644 --- a/src/webextension/ext-main.h +++ b/src/webextension/ext-main.h @@ -20,8 +20,8 @@ #ifndef _EXT_MAIN_H #define _EXT_MAIN_H -#define VB_WEBEXTENSION_SERVICE_NAME "org.vimb.browser.WebExtension" -#define VB_WEBEXTENSION_OBJECT_PATH "/org/vimb/browser/WebExtension" -#define VB_WEBEXTENSION_INTERFACE "org.vimb.browser.WebExtension" +#define VB_WEBEXTENSION_SERVICE_NAME "org.neovimb.browser.WebExtension" +#define VB_WEBEXTENSION_OBJECT_PATH "/org/neovimb/browser/WebExtension" +#define VB_WEBEXTENSION_INTERFACE "org.neovimb.browser.WebExtension" #endif /* end of include guard: _EXT_MAIN_H */ |