2000-05-04 06:32:42 -04:00
|
|
|
#ifndef __STATUSBAR_H
|
|
|
|
#define __STATUSBAR_H
|
|
|
|
|
2001-05-11 13:35:38 -04:00
|
|
|
#include "mainwindows.h"
|
2008-12-01 13:12:52 -05:00
|
|
|
#include "statusbar-item.h"
|
2001-05-11 13:35:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
#define STATUSBAR_PRIORITY_HIGH 100
|
|
|
|
#define STATUSBAR_PRIORITY_NORMAL 0
|
|
|
|
#define STATUSBAR_PRIORITY_LOW -100
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-03-12 05:33:13 -05:00
|
|
|
typedef struct SBAR_ITEM_REC SBAR_ITEM_REC;
|
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
/* type */
|
|
|
|
#define STATUSBAR_TYPE_ROOT 1
|
|
|
|
#define STATUSBAR_TYPE_WINDOW 2
|
|
|
|
|
|
|
|
/* placement */
|
|
|
|
#define STATUSBAR_TOP 1
|
|
|
|
#define STATUSBAR_BOTTOM 2
|
|
|
|
|
|
|
|
/* visible */
|
|
|
|
#define STATUSBAR_VISIBLE_ALWAYS 1
|
|
|
|
#define STATUSBAR_VISIBLE_ACTIVE 2
|
|
|
|
#define STATUSBAR_VISIBLE_INACTIVE 3
|
|
|
|
|
2017-04-24 18:42:53 -04:00
|
|
|
#define ITEM_WINDOW_REAL_XPOS(item) ( ( (item)->bar->parent_window != NULL ? \
|
|
|
|
(item)->bar->parent_window->first_column + (item)->bar->parent_window->statusbar_columns_left : 0 ) + (item)->xpos )
|
|
|
|
|
|
|
|
#define BAR_WINDOW_REAL_DIRTY_XPOS(bar) ( ( (bar)->parent_window != NULL ? \
|
|
|
|
(bar)->parent_window->first_column + (bar)->parent_window->statusbar_columns_left : 0 ) + (bar)->dirty_xpos )
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
typedef struct {
|
2001-10-13 12:11:13 -04:00
|
|
|
char *name;
|
|
|
|
GSList *config_bars;
|
|
|
|
GSList *bars;
|
|
|
|
} STATUSBAR_GROUP_REC;
|
2001-05-11 13:35:38 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
typedef struct {
|
|
|
|
char *name;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
int type; /* root/window */
|
|
|
|
int placement; /* top/bottom */
|
|
|
|
int position; /* the higher the number, the lower it is in screen */
|
|
|
|
int visible; /* active/inactive/always */
|
2001-03-14 21:26:12 -05:00
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
GSList *items;
|
2001-10-13 12:11:13 -04:00
|
|
|
} STATUSBAR_CONFIG_REC;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
STATUSBAR_GROUP_REC *group;
|
|
|
|
STATUSBAR_CONFIG_REC *config;
|
|
|
|
|
|
|
|
MAIN_WINDOW_REC *parent_window; /* if config->type == STATUSBAR_TYPE_WINDOW */
|
|
|
|
GSList *items;
|
|
|
|
|
|
|
|
char *color; /* background color */
|
|
|
|
int real_ypos; /* real Y-position in screen at the moment */
|
2001-10-28 13:40:12 -05:00
|
|
|
|
2002-03-12 22:23:38 -05:00
|
|
|
unsigned int dirty:1;
|
2001-10-28 13:40:12 -05:00
|
|
|
int dirty_xpos; /* -1 = only redraw some items, >= 0 = redraw all items after from xpos */
|
2000-05-04 06:32:42 -04:00
|
|
|
} STATUSBAR_REC;
|
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
typedef struct {
|
|
|
|
char *name;
|
|
|
|
char *value; /* if non-NULL, overrides the default */
|
|
|
|
|
|
|
|
int priority;
|
|
|
|
unsigned int right_alignment:1;
|
|
|
|
} SBAR_ITEM_CONFIG_REC;
|
|
|
|
|
2001-03-12 05:33:13 -05:00
|
|
|
struct SBAR_ITEM_REC {
|
|
|
|
STATUSBAR_REC *bar;
|
2001-10-13 12:11:13 -04:00
|
|
|
SBAR_ITEM_CONFIG_REC *config;
|
|
|
|
STATUSBAR_FUNC func;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-03-12 05:33:13 -05:00
|
|
|
/* what item wants */
|
|
|
|
int min_size, max_size;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-03-12 05:33:13 -05:00
|
|
|
/* what item gets */
|
2001-10-13 12:11:13 -04:00
|
|
|
int xpos, size;
|
2001-10-28 13:40:12 -05:00
|
|
|
|
|
|
|
int current_size; /* item size currently in screen */
|
2002-03-12 22:23:38 -05:00
|
|
|
unsigned int dirty:1;
|
2001-03-12 05:33:13 -05:00
|
|
|
};
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
extern GSList *statusbar_groups;
|
|
|
|
extern STATUSBAR_GROUP_REC *active_statusbar_group;
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-10-13 12:11:13 -04:00
|
|
|
STATUSBAR_GROUP_REC *statusbar_group_create(const char *name);
|
|
|
|
void statusbar_group_destroy(STATUSBAR_GROUP_REC *rec);
|
|
|
|
STATUSBAR_GROUP_REC *statusbar_group_find(const char *name);
|
|
|
|
|
|
|
|
STATUSBAR_REC *statusbar_create(STATUSBAR_GROUP_REC *group,
|
|
|
|
STATUSBAR_CONFIG_REC *config,
|
|
|
|
MAIN_WINDOW_REC *parent_window);
|
|
|
|
void statusbar_destroy(STATUSBAR_REC *bar);
|
|
|
|
STATUSBAR_REC *statusbar_find(STATUSBAR_GROUP_REC *group, const char *name,
|
|
|
|
MAIN_WINDOW_REC *window);
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-03-12 05:33:13 -05:00
|
|
|
SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar,
|
2001-10-13 12:11:13 -04:00
|
|
|
SBAR_ITEM_CONFIG_REC *config);
|
|
|
|
void statusbar_item_destroy(SBAR_ITEM_REC *item);
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
/* redraw statusbar, NULL = all */
|
2001-10-28 13:40:12 -05:00
|
|
|
void statusbar_redraw(STATUSBAR_REC *bar, int force);
|
2000-05-04 06:32:42 -04:00
|
|
|
void statusbar_item_redraw(SBAR_ITEM_REC *item);
|
2001-10-20 15:52:07 -04:00
|
|
|
|
|
|
|
void statusbar_recreate_items(STATUSBAR_REC *bar);
|
|
|
|
void statusbars_recreate_items(void);
|
2002-02-15 16:42:31 -05:00
|
|
|
void statusbars_create_window_bars(void);
|
2000-05-04 06:32:42 -04:00
|
|
|
|
2001-10-28 13:40:12 -05:00
|
|
|
void statusbar_redraw_dirty(void);
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
void statusbar_init(void);
|
|
|
|
void statusbar_deinit(void);
|
|
|
|
|
|
|
|
#endif
|