2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __WINDOWS_H
|
|
|
|
#define __WINDOWS_H
|
|
|
|
|
|
|
|
enum {
|
|
|
|
NEWDATA_TEXT = 1,
|
|
|
|
NEWDATA_MSG,
|
2000-06-30 15:50:56 -04:00
|
|
|
NEWDATA_HILIGHT,
|
2000-04-26 04:03:38 -04:00
|
|
|
NEWDATA_CUSTOM
|
|
|
|
};
|
|
|
|
|
|
|
|
/* All window items *MUST* have these variables in same order
|
|
|
|
at the start of the structure - the server's type can of course be
|
2000-06-30 17:33:57 -04:00
|
|
|
replaced with the preferred record type.
|
|
|
|
|
|
|
|
!!!! So IF YOU CHANGE THIS: REMEMBER TO UPDATE WI_IRC_REC, CHANNEL_REC
|
|
|
|
and QUERY_REC !!!! (I already forgot this once :) */
|
2000-04-26 04:03:38 -04:00
|
|
|
typedef struct {
|
|
|
|
int type;
|
|
|
|
GHashTable *module_data;
|
|
|
|
|
|
|
|
void *server;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
int new_data;
|
2000-06-30 15:50:56 -04:00
|
|
|
int last_color; /* if NEWDATA_HILIGHT is set, color number could be specified here */
|
2000-04-26 04:03:38 -04:00
|
|
|
} WI_ITEM_REC;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int refnum;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
GSList *items;
|
|
|
|
WI_ITEM_REC *active;
|
|
|
|
void *active_server;
|
|
|
|
|
|
|
|
GSList *waiting_channels; /* list of "<server tag> <channel>" */
|
|
|
|
|
|
|
|
int lines;
|
|
|
|
int destroying:1;
|
|
|
|
|
|
|
|
/* window-specific command line history */
|
|
|
|
GList *cmdhist, *histpos;
|
|
|
|
int histlines;
|
|
|
|
|
|
|
|
int level;
|
|
|
|
int new_data;
|
2000-06-30 15:50:56 -04:00
|
|
|
int last_color;
|
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;
|
2000-04-26 04:03:38 -04: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 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);
|
|
|
|
WINDOW_REC *window_find_item(WINDOW_REC *window, 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);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void windows_init(void);
|
|
|
|
void windows_deinit(void);
|
|
|
|
|
|
|
|
#endif
|