2000-04-26 08:03:38 +00:00
|
|
|
#ifndef __WINDOWS_H
|
|
|
|
#define __WINDOWS_H
|
|
|
|
|
2000-08-26 15:39:44 +00:00
|
|
|
#include "servers.h"
|
|
|
|
|
|
|
|
#define STRUCT_SERVER_REC SERVER_REC
|
|
|
|
#include "window-item-def.h"
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
enum {
|
2001-01-09 21:06:45 +00:00
|
|
|
DATA_LEVEL_NONE = 0,
|
|
|
|
DATA_LEVEL_TEXT,
|
|
|
|
DATA_LEVEL_MSG,
|
|
|
|
DATA_LEVEL_HILIGHT
|
2000-04-26 08:03:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int refnum;
|
|
|
|
char *name;
|
|
|
|
|
2001-01-28 15:44:29 +00:00
|
|
|
int width, height;
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
GSList *items;
|
|
|
|
WI_ITEM_REC *active;
|
2000-08-26 15:39:44 +00:00
|
|
|
SERVER_REC *active_server;
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2001-01-09 21:06:45 +00:00
|
|
|
int level; /* message level */
|
2000-04-26 08:03:38 +00:00
|
|
|
GSList *waiting_channels; /* list of "<server tag> <channel>" */
|
|
|
|
|
|
|
|
int lines;
|
2001-01-01 18:30:23 +00:00
|
|
|
unsigned int sticky_refnum:1;
|
2000-11-23 22:57:59 +00:00
|
|
|
unsigned int destroying:1;
|
2000-04-26 08:03:38 +00:00
|
|
|
|
|
|
|
/* window-specific command line history */
|
|
|
|
GList *cmdhist, *histpos;
|
|
|
|
int histlines;
|
|
|
|
|
2001-01-09 21:06:45 +00:00
|
|
|
int data_level; /* current data level */
|
|
|
|
int hilight_color; /* current hilight color */
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
time_t last_timestamp; /* When was last timestamp printed */
|
2000-05-04 10:32:42 +00:00
|
|
|
time_t last_line; /* When was last line printed */
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2000-07-31 21:16:09 +00:00
|
|
|
char *theme_name; /* active theme in window, NULL = default */
|
|
|
|
void *theme; /* THEME_REC */
|
|
|
|
|
|
|
|
void *gui_data;
|
2000-04-26 08:03:38 +00:00
|
|
|
} WINDOW_REC;
|
|
|
|
|
|
|
|
extern GSList *windows;
|
|
|
|
extern WINDOW_REC *active_win;
|
|
|
|
|
|
|
|
WINDOW_REC *window_create(WI_ITEM_REC *item, int automatic);
|
|
|
|
void window_destroy(WINDOW_REC *window);
|
|
|
|
|
|
|
|
void window_set_active(WINDOW_REC *window);
|
|
|
|
void window_change_server(WINDOW_REC *window, void *server);
|
|
|
|
|
2000-05-04 10:32:42 +00:00
|
|
|
void window_set_refnum(WINDOW_REC *window, int refnum);
|
2000-04-26 08:03:38 +00:00
|
|
|
void window_set_name(WINDOW_REC *window, const char *name);
|
|
|
|
void window_set_level(WINDOW_REC *window, int level);
|
2000-05-09 11:42:42 +00: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 08:03:38 +00: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 10:32:42 +00:00
|
|
|
WINDOW_REC *window_find_refnum(int refnum);
|
|
|
|
WINDOW_REC *window_find_name(const char *name);
|
2000-12-02 19:08:21 +00:00
|
|
|
WINDOW_REC *window_find_item(SERVER_REC *server, const char *name);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
2000-06-12 22:57:53 +00:00
|
|
|
int window_refnum_prev(int refnum, int wrap);
|
|
|
|
int window_refnum_next(int refnum, int wrap);
|
2000-05-15 08:25:45 +00:00
|
|
|
int windows_refnum_last(void);
|
|
|
|
|
2001-01-01 14:57:55 +00:00
|
|
|
GSList *windows_get_sorted(void);
|
|
|
|
|
2000-04-26 08:03:38 +00:00
|
|
|
void windows_init(void);
|
|
|
|
void windows_deinit(void);
|
|
|
|
|
|
|
|
#endif
|