4 #include "mainwindows.h"
6 #define STATUSBAR_PRIORITY_HIGH 100
7 #define STATUSBAR_PRIORITY_NORMAL 0
8 #define STATUSBAR_PRIORITY_LOW -100
10 typedef struct SBAR_ITEM_REC SBAR_ITEM_REC;
11 typedef void (*STATUSBAR_FUNC) (SBAR_ITEM_REC *item, int get_size_only);
14 #define STATUSBAR_TYPE_ROOT 1
15 #define STATUSBAR_TYPE_WINDOW 2
18 #define STATUSBAR_TOP 1
19 #define STATUSBAR_BOTTOM 2
22 #define STATUSBAR_VISIBLE_ALWAYS 1
23 #define STATUSBAR_VISIBLE_ACTIVE 2
24 #define STATUSBAR_VISIBLE_INACTIVE 3
30 } STATUSBAR_GROUP_REC;
35 int type; /* root/window */
36 int placement; /* top/bottom */
37 int position; /* the higher the number, the lower it is in screen */
38 int visible; /* active/inactive/always */
41 } STATUSBAR_CONFIG_REC;
44 STATUSBAR_GROUP_REC *group;
45 STATUSBAR_CONFIG_REC *config;
47 MAIN_WINDOW_REC *parent_window; /* if config->type == STATUSBAR_TYPE_WINDOW */
50 char *color; /* background color */
51 int real_ypos; /* real Y-position in screen at the moment */
54 int dirty_xpos; /* -1 = only redraw some items, >= 0 = redraw all items after from xpos */
59 char *value; /* if non-NULL, overrides the default */
62 unsigned int right_alignment:1;
63 } SBAR_ITEM_CONFIG_REC;
65 struct SBAR_ITEM_REC {
67 SBAR_ITEM_CONFIG_REC *config;
71 int min_size, max_size;
76 int current_size; /* item size currently in screen */
80 extern GSList *statusbar_groups;
81 extern STATUSBAR_GROUP_REC *active_statusbar_group;
83 void statusbar_item_register(const char *name, const char *value,
85 void statusbar_item_unregister(const char *name);
87 STATUSBAR_GROUP_REC *statusbar_group_create(const char *name);
88 void statusbar_group_destroy(STATUSBAR_GROUP_REC *rec);
89 STATUSBAR_GROUP_REC *statusbar_group_find(const char *name);
91 STATUSBAR_REC *statusbar_create(STATUSBAR_GROUP_REC *group,
92 STATUSBAR_CONFIG_REC *config,
93 MAIN_WINDOW_REC *parent_window);
94 void statusbar_destroy(STATUSBAR_REC *bar);
95 STATUSBAR_REC *statusbar_find(STATUSBAR_GROUP_REC *group, const char *name,
96 MAIN_WINDOW_REC *window);
98 SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar,
99 SBAR_ITEM_CONFIG_REC *config);
100 void statusbar_item_destroy(SBAR_ITEM_REC *item);
102 void statusbar_item_default_handler(SBAR_ITEM_REC *item, int get_size_only,
103 const char *str, const char *data,
106 /* redraw statusbar, NULL = all */
107 void statusbar_redraw(STATUSBAR_REC *bar, int force);
108 void statusbar_item_redraw(SBAR_ITEM_REC *item);
109 void statusbar_items_redraw(const char *name);
111 void statusbar_recreate_items(STATUSBAR_REC *bar);
112 void statusbars_recreate_items(void);
113 void statusbars_create_window_bars(void);
115 void statusbar_redraw_dirty(void);
117 void statusbar_init(void);
118 void statusbar_deinit(void);