2008-03-05 16:19:10 +01:00
|
|
|
/*
|
2020-01-04 10:41:26 +01:00
|
|
|
* Copyright (C) 2003-2020 Sébastien Helleu <flashcode@flashtux.org>
|
2008-03-05 16:19:10 +01:00
|
|
|
*
|
2010-06-22 19:46:28 +02:00
|
|
|
* This file is part of WeeChat, the extensible chat client.
|
|
|
|
*
|
|
|
|
* WeeChat is free software; you can redistribute it and/or modify
|
2008-03-05 16:19:10 +01:00
|
|
|
* 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.
|
|
|
|
*
|
2010-06-22 19:46:28 +02:00
|
|
|
* WeeChat is distributed in the hope that it will be useful,
|
2008-03-05 16:19:10 +01:00
|
|
|
* 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
|
2018-11-29 23:16:07 +01:00
|
|
|
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
|
2008-03-05 16:19:10 +01:00
|
|
|
*/
|
|
|
|
|
2014-03-19 10:39:13 +01:00
|
|
|
#ifndef WEECHAT_GUI_BAR_ITEM_H
|
2017-08-10 20:05:16 +02:00
|
|
|
#define WEECHAT_GUI_BAR_ITEM_H
|
2008-03-05 16:19:10 +01:00
|
|
|
|
|
|
|
enum t_gui_bar_item_weechat
|
|
|
|
{
|
2008-10-10 15:58:11 +02:00
|
|
|
GUI_BAR_ITEM_INPUT_PASTE = 0,
|
|
|
|
GUI_BAR_ITEM_INPUT_PROMPT,
|
|
|
|
GUI_BAR_ITEM_INPUT_SEARCH,
|
2008-06-27 17:15:26 +02:00
|
|
|
GUI_BAR_ITEM_INPUT_TEXT,
|
|
|
|
GUI_BAR_ITEM_TIME,
|
2008-04-12 23:59:27 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_COUNT,
|
2013-11-30 15:57:34 +01:00
|
|
|
GUI_BAR_ITEM_BUFFER_LAST_NUMBER,
|
2008-04-12 23:59:27 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_PLUGIN,
|
2008-12-19 10:17:55 +01:00
|
|
|
GUI_BAR_ITEM_BUFFER_NUMBER,
|
2008-04-12 23:59:27 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_NAME,
|
2014-05-16 20:55:56 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_SHORT_NAME,
|
2012-07-07 12:44:55 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_MODES,
|
2008-04-12 23:59:27 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_FILTER,
|
2013-11-09 13:21:56 +01:00
|
|
|
GUI_BAR_ITEM_BUFFER_ZOOM,
|
2008-07-03 16:02:03 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT,
|
2020-05-16 11:27:41 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT_GROUPS,
|
|
|
|
GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT_ALL,
|
2008-04-12 23:59:27 +02:00
|
|
|
GUI_BAR_ITEM_SCROLL,
|
|
|
|
GUI_BAR_ITEM_HOTLIST,
|
2008-06-18 16:47:09 +02:00
|
|
|
GUI_BAR_ITEM_COMPLETION,
|
2008-06-28 12:59:58 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_TITLE,
|
2008-07-03 16:02:03 +02:00
|
|
|
GUI_BAR_ITEM_BUFFER_NICKLIST,
|
2011-07-29 19:46:02 +02:00
|
|
|
GUI_BAR_ITEM_WINDOW_NUMBER,
|
2014-11-02 18:01:33 +01:00
|
|
|
GUI_BAR_ITEM_MOUSE_STATUS,
|
2016-02-15 13:36:16 +01:00
|
|
|
GUI_BAR_ITEM_AWAY,
|
2008-03-05 16:19:10 +01:00
|
|
|
/* number of bar items */
|
|
|
|
GUI_BAR_NUM_ITEMS,
|
|
|
|
};
|
|
|
|
|
2018-11-03 23:01:46 +01:00
|
|
|
struct t_gui_buffer;
|
2008-03-05 16:19:10 +01:00
|
|
|
struct t_gui_window;
|
|
|
|
|
|
|
|
struct t_gui_bar_item
|
|
|
|
{
|
|
|
|
struct t_weechat_plugin *plugin; /* plugin */
|
|
|
|
char *name; /* bar item name */
|
2016-03-21 18:11:21 +01:00
|
|
|
char *(*build_callback)(const void *pointer,
|
|
|
|
void *data,
|
2008-03-05 16:19:10 +01:00
|
|
|
struct t_gui_bar_item *item,
|
2013-08-19 21:22:10 +02:00
|
|
|
struct t_gui_window *window,
|
|
|
|
struct t_gui_buffer *buffer,
|
|
|
|
struct t_hashtable *extra_info);
|
2008-03-05 16:19:10 +01:00
|
|
|
/* callback called for building item */
|
2016-03-21 18:11:21 +01:00
|
|
|
const void *build_callback_pointer; /* pointer for callback */
|
|
|
|
void *build_callback_data; /* data for callback */
|
2008-03-05 16:19:10 +01:00
|
|
|
struct t_gui_bar_item *prev_item; /* link to previous bar item */
|
|
|
|
struct t_gui_bar_item *next_item; /* link to next bar item */
|
|
|
|
};
|
|
|
|
|
2008-03-15 10:49:42 +01:00
|
|
|
struct t_gui_bar_item_hook
|
|
|
|
{
|
|
|
|
struct t_hook *hook; /* pointer to hook */
|
|
|
|
struct t_gui_bar_item_hook *next_hook; /* next hook */
|
|
|
|
};
|
|
|
|
|
2008-03-05 16:19:10 +01:00
|
|
|
/* variables */
|
|
|
|
|
|
|
|
extern struct t_gui_bar_item *gui_bar_items;
|
|
|
|
extern struct t_gui_bar_item *last_gui_bar_item;
|
2008-06-27 17:15:26 +02:00
|
|
|
extern char *gui_bar_item_names[];
|
2010-10-23 12:29:43 +02:00
|
|
|
extern char *gui_bar_items_default_for_bars[][2];
|
2008-03-05 16:19:10 +01:00
|
|
|
|
|
|
|
/* functions */
|
|
|
|
|
2008-12-13 19:43:11 +01:00
|
|
|
extern int gui_bar_item_valid (struct t_gui_bar_item *bar_item);
|
2008-06-03 10:56:51 +02:00
|
|
|
extern struct t_gui_bar_item *gui_bar_item_search (const char *name);
|
2012-11-02 09:37:15 +01:00
|
|
|
extern int gui_bar_item_used_in_bar (struct t_gui_bar *bar,
|
|
|
|
const char *item_name,
|
|
|
|
int partial_name);
|
|
|
|
extern int gui_bar_item_used_in_at_least_one_bar (const char *item_name,
|
2012-12-05 19:04:07 +01:00
|
|
|
int partial_name,
|
|
|
|
int ignore_hidden_bars);
|
2013-08-19 21:22:10 +02:00
|
|
|
extern void gui_bar_item_get_vars (const char *item_name,
|
|
|
|
char **buffer, char **prefix, char **name,
|
|
|
|
char **suffix);
|
2011-07-26 18:50:29 +02:00
|
|
|
extern char *gui_bar_item_get_value (struct t_gui_bar *bar,
|
|
|
|
struct t_gui_window *window,
|
|
|
|
int item, int subitem);
|
|
|
|
extern int gui_bar_item_count_lines (char *string);
|
2008-03-05 16:19:10 +01:00
|
|
|
extern struct t_gui_bar_item *gui_bar_item_new (struct t_weechat_plugin *plugin,
|
2008-06-03 10:56:51 +02:00
|
|
|
const char *name,
|
2016-03-21 18:11:21 +01:00
|
|
|
char *(*build_callback)(const void *pointer,
|
|
|
|
void *data,
|
2008-03-05 16:19:10 +01:00
|
|
|
struct t_gui_bar_item *item,
|
2013-08-19 21:22:10 +02:00
|
|
|
struct t_gui_window *window,
|
|
|
|
struct t_gui_buffer *buffer,
|
|
|
|
struct t_hashtable *extra_info),
|
2016-03-21 18:11:21 +01:00
|
|
|
const void *build_callback_pointer,
|
2008-03-05 16:19:10 +01:00
|
|
|
void *build_callback_data);
|
2008-06-03 10:56:51 +02:00
|
|
|
extern void gui_bar_item_update (const char *name);
|
2008-03-05 16:19:10 +01:00
|
|
|
extern void gui_bar_item_free (struct t_gui_bar_item *item);
|
|
|
|
extern void gui_bar_item_free_all ();
|
|
|
|
extern void gui_bar_item_free_all_plugin (struct t_weechat_plugin *plugin);
|
|
|
|
extern void gui_bar_item_init ();
|
|
|
|
extern void gui_bar_item_end ();
|
2016-03-21 18:11:21 +01:00
|
|
|
extern struct t_hdata *gui_bar_item_hdata_bar_item_cb (const void *pointer,
|
|
|
|
void *data,
|
2011-06-13 12:32:27 +02:00
|
|
|
const char *hdata_name);
|
2008-12-13 19:43:11 +01:00
|
|
|
extern int gui_bar_item_add_to_infolist (struct t_infolist *infolist,
|
|
|
|
struct t_gui_bar_item *bar_item);
|
2008-03-05 16:19:10 +01:00
|
|
|
extern void gui_bar_item_print_log ();
|
|
|
|
|
2014-03-19 10:39:13 +01:00
|
|
|
#endif /* WEECHAT_GUI_BAR_ITEM_H */
|