X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Ffe-text%2Fstatusbar.h;fp=apps%2Firssi%2Fsrc%2Ffe-text%2Fstatusbar.h;h=32d35b8238687a9f658349d55eb6b63ebf3491b6;hb=23c5df1c8b0bfe539d3fa65802186e6e09e044aa;hp=0000000000000000000000000000000000000000;hpb=0f9738ce962b8498bbed0a75d5fb6fa127e3577f;p=silc.git diff --git a/apps/irssi/src/fe-text/statusbar.h b/apps/irssi/src/fe-text/statusbar.h new file mode 100644 index 00000000..32d35b82 --- /dev/null +++ b/apps/irssi/src/fe-text/statusbar.h @@ -0,0 +1,63 @@ +#ifndef __STATUSBAR_H +#define __STATUSBAR_H + +#include "mainwindows.h" + +#define SBAR_PRIORITY_HIGH 100 +#define SBAR_PRIORITY_NORMAL 0 +#define SBAR_PRIORITY_LOW -100 + +enum { + STATUSBAR_POS_UP, + STATUSBAR_POS_MIDDLE, + STATUSBAR_POS_DOWN +}; + +typedef struct SBAR_ITEM_REC SBAR_ITEM_REC; +typedef void (*STATUSBAR_FUNC) (SBAR_ITEM_REC *item, int get_size_only); + +typedef struct { + MAIN_WINDOW_REC *window; + + int pos; + int line; + + char *color_string; + int color; + + int ypos; /* real position in screen at the moment */ + GSList *items; +} STATUSBAR_REC; + +struct SBAR_ITEM_REC { + STATUSBAR_REC *bar; + STATUSBAR_FUNC func; + + /* what item wants */ + int priority; + int min_size, max_size; + unsigned int right_justify:1; + + /* what item gets */ + int xpos, size; +}; + +/* ypos is used only when pos == STATUSBAR_POS_MIDDLE */ +STATUSBAR_REC *statusbar_create(int pos, int ypos); +void statusbar_destroy(STATUSBAR_REC *bar); + +STATUSBAR_REC *statusbar_find(int pos, int line); + +SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar, + int priority, int right_justify, + STATUSBAR_FUNC func); +void statusbar_item_remove(SBAR_ITEM_REC *item); + +/* redraw statusbar, NULL = all */ +void statusbar_redraw(STATUSBAR_REC *bar); +void statusbar_item_redraw(SBAR_ITEM_REC *item); + +void statusbar_init(void); +void statusbar_deinit(void); + +#endif