Added SILC Thread Queue API
[crypto.git] / apps / irssi / src / fe-common / core / fe-windows.h
index c9ffe69a39b563632f3261dd2cffa8e38a7d7dc6..58c316ef115963b6113af3667f1a05e6efbef6a0 100644 (file)
@@ -1,10 +1,8 @@
 #ifndef __WINDOWS_H
 #define __WINDOWS_H
 
-#include "servers.h"
-
-#define STRUCT_SERVER_REC SERVER_REC
 #include "window-item-def.h"
+#include "command-history.h"
 
 enum {
         DATA_LEVEL_NONE = 0,
@@ -19,7 +17,7 @@ typedef struct {
        unsigned int sticky:1;
 } WINDOW_BIND_REC;
 
-typedef struct {
+struct _WINDOW_REC {
        int refnum;
        char *name;
 
@@ -28,17 +26,19 @@ typedef struct {
        GSList *items;
        WI_ITEM_REC *active;
        SERVER_REC *active_server;
+       SERVER_REC *connect_server;
         char *servertag; /* active_server must be either NULL or have this tag (unless there's items in this window) */
 
        int level; /* message level */
        GSList *bound_items; /* list of WINDOW_BIND_RECs */
 
+       unsigned int immortal:1;
        unsigned int sticky_refnum:1;
        unsigned int destroying:1;
 
        /* window-specific command line history */
-       GList *history, *history_pos;
-       int history_lines, history_over_counter;
+       HISTORY_REC *history;
+       char *history_name;
 
        int data_level; /* current data level */
        char *hilight_color; /* current hilight color in %format */
@@ -50,7 +50,7 @@ typedef struct {
        void *theme; /* THEME_REC */
 
        void *gui_data;
-} WINDOW_REC;
+};
 
 extern GSList *windows;
 extern WINDOW_REC *active_win;
@@ -65,10 +65,12 @@ void window_change_server(WINDOW_REC *window, void *server);
 
 void window_set_refnum(WINDOW_REC *window, int refnum);
 void window_set_name(WINDOW_REC *window, const char *name);
+void window_set_history(WINDOW_REC *window, const char *name);
 void window_set_level(WINDOW_REC *window, int level);
+void window_set_immortal(WINDOW_REC *window, int immortal);
 
 /* return active item's name, or if none is active, window's name */
-char *window_get_active_name(WINDOW_REC *window);
+const char *window_get_active_name(WINDOW_REC *window);
 
 WINDOW_REC *window_find_level(void *server, int level);
 WINDOW_REC *window_find_closest(void *server, const char *name, int level);
@@ -80,8 +82,10 @@ int window_refnum_prev(int refnum, int wrap);
 int window_refnum_next(int refnum, int wrap);
 int windows_refnum_last(void);
 
+int window_refnum_cmp(WINDOW_REC *w1, WINDOW_REC *w2);
 GSList *windows_get_sorted(void);
 
+/* Add a new bind to window - if duplicate is found it's returned */
 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);