2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __WINDOWS_H
|
|
|
|
#define __WINDOWS_H
|
|
|
|
|
2000-08-26 11:39:44 -04:00
|
|
|
#include "window-item-def.h"
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
enum {
|
2001-01-09 16:06:45 -05:00
|
|
|
DATA_LEVEL_NONE = 0,
|
|
|
|
DATA_LEVEL_TEXT,
|
|
|
|
DATA_LEVEL_MSG,
|
|
|
|
DATA_LEVEL_HILIGHT
|
2000-04-26 04:03:38 -04:00
|
|
|
};
|
|
|
|
|
2001-02-10 04:12:53 -05:00
|
|
|
typedef struct {
|
|
|
|
char *servertag;
|
|
|
|
char *name;
|
|
|
|
unsigned int sticky:1;
|
|
|
|
} WINDOW_BIND_REC;
|
|
|
|
|
2001-12-19 21:14:49 -05:00
|
|
|
struct _WINDOW_REC {
|
2000-04-26 04:03:38 -04:00
|
|
|
int refnum;
|
|
|
|
char *name;
|
|
|
|
|
2001-01-28 10:44:29 -05:00
|
|
|
int width, height;
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
GSList *items;
|
|
|
|
WI_ITEM_REC *active;
|
2000-08-26 11:39:44 -04:00
|
|
|
SERVER_REC *active_server;
|
2001-02-09 22:10:30 -05:00
|
|
|
char *servertag; /* active_server must be either NULL or have this tag (unless there's items in this window) */
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-09 16:06:45 -05:00
|
|
|
int level; /* message level */
|
2001-02-10 04:12:53 -05:00
|
|
|
GSList *bound_items; /* list of WINDOW_BIND_RECs */
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-01 13:30:23 -05:00
|
|
|
unsigned int sticky_refnum:1;
|
2000-11-23 17:57:59 -05:00
|
|
|
unsigned int destroying:1;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
/* window-specific command line history */
|
2001-03-07 19:45:56 -05:00
|
|
|
GList *history, *history_pos;
|
|
|
|
int history_lines, history_over_counter;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-01-09 16:06:45 -05:00
|
|
|
int data_level; /* current data level */
|
2001-03-16 20:52:43 -05:00
|
|
|
char *hilight_color; /* current hilight color in %format */
|
2001-01-09 16:06:45 -05:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
time_t last_timestamp; /* When was last timestamp printed */
|
2000-05-04 06:32:42 -04:00
|
|
|
time_t last_line; /* When was last line printed */
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-07-31 17:16:09 -04:00
|
|
|
char *theme_name; /* active theme in window, NULL = default */
|
|
|
|
void *theme; /* THEME_REC */
|
|
|
|
|
|
|
|
void *gui_data;
|
2001-12-19 21:14:49 -05:00
|
|
|
};
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
extern GSList *windows;
|
|
|
|
extern WINDOW_REC *active_win;
|
|
|
|
|
|
|
|
WINDOW_REC *window_create(WI_ITEM_REC *item, int automatic);
|
|
|
|
void window_destroy(WINDOW_REC *window);
|
|
|
|
|
2001-03-03 17:03:00 -05:00
|
|
|
void window_auto_destroy(WINDOW_REC *window);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void window_set_active(WINDOW_REC *window);
|
|
|
|
void window_change_server(WINDOW_REC *window, void *server);
|
|
|
|
|
2000-05-04 06:32:42 -04:00
|
|
|
void window_set_refnum(WINDOW_REC *window, int refnum);
|
2000-04-26 04:03:38 -04:00
|
|
|
void window_set_name(WINDOW_REC *window, const char *name);
|
|
|
|
void window_set_level(WINDOW_REC *window, int level);
|
2000-05-09 07:42:42 -04:00
|
|
|
|
|
|
|
/* return active item's name, or if none is active, window's name */
|
|
|
|
char *window_get_active_name(WINDOW_REC *window);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
WINDOW_REC *window_find_level(void *server, int level);
|
|
|
|
WINDOW_REC *window_find_closest(void *server, const char *name, int level);
|
2000-05-04 06:32:42 -04:00
|
|
|
WINDOW_REC *window_find_refnum(int refnum);
|
|
|
|
WINDOW_REC *window_find_name(const char *name);
|
2000-12-02 14:08:21 -05:00
|
|
|
WINDOW_REC *window_find_item(SERVER_REC *server, const char *name);
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2000-06-12 18:57:53 -04:00
|
|
|
int window_refnum_prev(int refnum, int wrap);
|
|
|
|
int window_refnum_next(int refnum, int wrap);
|
2000-05-15 04:25:45 -04:00
|
|
|
int windows_refnum_last(void);
|
|
|
|
|
2001-08-03 18:54:08 -04:00
|
|
|
int window_refnum_cmp(WINDOW_REC *w1, WINDOW_REC *w2);
|
2001-01-01 09:57:55 -05:00
|
|
|
GSList *windows_get_sorted(void);
|
|
|
|
|
2001-08-08 12:08:47 -04:00
|
|
|
/* Add a new bind to window - if duplicate is found it's returned */
|
2001-02-10 04:12:53 -05:00
|
|
|
WINDOW_BIND_REC *window_bind_add(WINDOW_REC *window, const char *servertag,
|
|
|
|
const char *name);
|
|
|
|
void window_bind_destroy(WINDOW_REC *window, WINDOW_BIND_REC *rec);
|
|
|
|
|
|
|
|
WINDOW_BIND_REC *window_bind_find(WINDOW_REC *window, const char *servertag,
|
|
|
|
const char *name);
|
|
|
|
void window_bind_remove_unsticky(WINDOW_REC *window);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void windows_init(void);
|
|
|
|
void windows_deinit(void);
|
|
|
|
|
|
|
|
#endif
|