1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

core: move creation of info_hashtable from gui-focus.c to plugin-api-info.c (issue #1257)

This commit is contained in:
Sébastien Helleu
2020-05-16 14:20:18 +02:00
parent a5b851826e
commit a3747fefcd
4 changed files with 14 additions and 18 deletions
-1
View File
@@ -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);
-16
View File
@@ -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);
}
+4 -1
View File
@@ -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 */
+10
View File
@@ -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"),