summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-05-16 14:20:18 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-05-16 14:23:09 +0200
commita3747fefcd07b81a9ea951b5cfdc8107a6189a4a (patch)
tree4cb103de457c69f48187c1a3ccbcfc9448ed098f
parenta5b851826e09228e409a3f864bc2b7266e9eb595 (diff)
downloadweechat-a3747fefcd07b81a9ea951b5cfdc8107a6189a4a.zip
core: move creation of info_hashtable from gui-focus.c to plugin-api-info.c (issue #1257)
-rw-r--r--src/core/weechat.c1
-rw-r--r--src/gui/gui-focus.c16
-rw-r--r--src/gui/gui-focus.h5
-rw-r--r--src/plugins/plugin-api-info.c10
4 files changed, 14 insertions, 18 deletions
diff --git a/src/core/weechat.c b/src/core/weechat.c
index 9a61c6894..1d4e7d9bb 100644
--- a/src/core/weechat.c
+++ b/src/core/weechat.c
@@ -802,7 +802,6 @@ weechat_init (int argc, char *argv[], void (*gui_init_cb)())
command_init (); /* initialize WeeChat commands */
completion_init (); /* add core completion hooks */
gui_key_init (); /* init keys */
- gui_focus_init (); /* initialize focus */
network_init_gcrypt (); /* init gcrypt */
if (!secure_init ()) /* init secured data */
weechat_shutdown (EXIT_FAILURE, 0);
diff --git a/src/gui/gui-focus.c b/src/gui/gui-focus.c
index b81056692..52f6e3edc 100644
--- a/src/gui/gui-focus.c
+++ b/src/gui/gui-focus.c
@@ -316,19 +316,3 @@ gui_focus_info_hashtable_gui_focus_info_cb (const void *pointer, void *data,
return ret_hashtable;
}
-
-/*
- * Initializes focus hooks.
- */
-
-void
-gui_focus_init ()
-{
- hook_info_hashtable (NULL,
- "gui_focus_info",
- N_("get focus info"),
- /* TRANSLATORS: please do not translate key names (enclosed by quotes) */
- N_("\"x\": x coordinate, \"y\": y coordinate"),
- N_("see hook_focus"),
- &gui_focus_info_hashtable_gui_focus_info_cb, NULL, NULL);
-} \ No newline at end of file
diff --git a/src/gui/gui-focus.h b/src/gui/gui-focus.h
index c684556fc..39dc3b2c6 100644
--- a/src/gui/gui-focus.h
+++ b/src/gui/gui-focus.h
@@ -45,6 +45,9 @@ extern struct t_gui_focus_info *gui_focus_get_info (int x, int y);
extern void gui_focus_free_info (struct t_gui_focus_info *focus_info);
extern struct t_hashtable *gui_focus_to_hashtable (struct t_gui_focus_info *focus_info,
const char *key);
-extern void gui_focus_init ();
+extern struct t_hashtable *gui_focus_info_hashtable_gui_focus_info_cb (const void *pointer,
+ void *data,
+ const char *info_name,
+ struct t_hashtable *hashtable);
#endif /* WEECHAT_GUI_FOCUS_H */
diff --git a/src/plugins/plugin-api-info.c b/src/plugins/plugin-api-info.c
index 2dc32cadc..2adbfde8b 100644
--- a/src/plugins/plugin-api-info.c
+++ b/src/plugins/plugin-api-info.c
@@ -46,6 +46,7 @@
#include "../gui/gui-color.h"
#include "../gui/gui-cursor.h"
#include "../gui/gui-filter.h"
+#include "../gui/gui-focus.h"
#include "../gui/gui-history.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-key.h"
@@ -1859,6 +1860,15 @@ plugin_api_info_init ()
"passwords before/after to test (optional, 0 by default)"),
&plugin_api_info_totp_validate_cb, NULL, NULL);
+ /* WeeChat core info_hashtable hooks */
+ hook_info_hashtable (NULL,
+ "gui_focus_info",
+ N_("get focus info"),
+ /* TRANSLATORS: please do not translate key names (enclosed by quotes) */
+ N_("\"x\": x coordinate, \"y\": y coordinate"),
+ N_("see hook_focus"),
+ &gui_focus_info_hashtable_gui_focus_info_cb, NULL, NULL);
+
/* WeeChat core infolist hooks */
hook_infolist (NULL, "bar",
N_("list of bars"),