4 #include "mainwindows.h"
5 #include "statusbar-item.h"
7 #define STATUSBAR_PRIORITY_HIGH 100
8 #define STATUSBAR_PRIORITY_NORMAL 0
9 #define STATUSBAR_PRIORITY_LOW -100
11 typedef struct SBAR_ITEM_REC SBAR_ITEM_REC;
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 STATUSBAR_GROUP_REC *statusbar_group_create(const char *name);
84 void statusbar_group_destroy(STATUSBAR_GROUP_REC *rec);
85 STATUSBAR_GROUP_REC *statusbar_group_find(const char *name);
87 STATUSBAR_REC *statusbar_create(STATUSBAR_GROUP_REC *group,
88 STATUSBAR_CONFIG_REC *config,
89 MAIN_WINDOW_REC *parent_window);
90 void statusbar_destroy(STATUSBAR_REC *bar);
91 STATUSBAR_REC *statusbar_find(STATUSBAR_GROUP_REC *group, const char *name,
92 MAIN_WINDOW_REC *window);
94 SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar,
95 SBAR_ITEM_CONFIG_REC *config);
96 void statusbar_item_destroy(SBAR_ITEM_REC *item);
98 /* redraw statusbar, NULL = all */
99 void statusbar_redraw(STATUSBAR_REC *bar, int force);
100 void statusbar_item_redraw(SBAR_ITEM_REC *item);
102 void statusbar_recreate_items(STATUSBAR_REC *bar);
103 void statusbars_recreate_items(void);
104 void statusbars_create_window_bars(void);
106 void statusbar_redraw_dirty(void);
108 void statusbar_init(void);
109 void statusbar_deinit(void);