00001 #ifndef __EKG_NCURSES_OLD_H
00002 #define __EKG_NCURSES_OLD_H
00003
00004 #include "ekg2-config.h"
00005
00006 #include "ecurses.h"
00007
00008 #include <ekg/commands.h>
00009 #include <ekg/plugins.h>
00010 #include <ekg/themes.h>
00011 #include <ekg/windows.h>
00012
00013 void ncurses_init();
00014 void ncurses_deinit();
00015
00016 extern plugin_t ncurses_plugin;
00017
00018
00019
00020 extern int ncurses_plugin_destroyed;
00021
00022 #define LINE_MAXLEN 1000
00023
00024 #define ncurses_current ((ncurses_window_t *) window_current->priv_data)
00025
00026 void update_statusbar(int commit);
00027
00028 struct screen_line {
00029 int len;
00030
00031 CHAR_T *str;
00032 short *attr;
00033
00034 CHAR_T *prompt_str;
00035 short *prompt_attr;
00036 int prompt_len;
00037
00038 char *ts;
00039 short *ts_attr;
00040
00041 int backlog;
00042 int margin_left;
00043 };
00044
00045 enum window_frame_t {
00046 WF_LEFT = 1,
00047 WF_TOP = 2,
00048 WF_RIGHT = 4,
00049 WF_BOTTOM = 8,
00050 WF_ALL = 15
00051 };
00052
00053 typedef struct {
00054 WINDOW *window;
00055
00056 char *prompt;
00057 int prompt_len;
00058
00059 int margin_left, margin_right, margin_top, margin_bottom;
00060
00061
00062 fstring_t **backlog;
00063 int backlog_size;
00064
00065 int redraw;
00066
00067 int start;
00068 int lines_count;
00069 struct screen_line *lines;
00070
00071
00072 int overflow;
00073
00074 int (*handle_redraw)(window_t *w);
00075
00076
00077 void (*handle_mouse)(int x, int y, int state);
00078
00079 CHAR_T *prompt_real;
00080 int prompt_real_len;
00081 time_t last_red_line;
00082 } ncurses_window_t;
00083
00084 struct format_data {
00085 char *name;
00086 char *text;
00087 };
00088
00089 extern WINDOW *ncurses_contacts;
00090 extern WINDOW *ncurses_input;
00091
00092 TIMER(ncurses_typing);
00093 QUERY(ncurses_session_disconnect_handler);
00094 void ncurses_main_window_mouse_handler(int x, int y, int mouse_state);
00095
00096 void ncurses_update_real_prompt(ncurses_window_t *n);
00097 void ncurses_resize();
00098 int ncurses_backlog_add(window_t *w, fstring_t *str);
00099 int ncurses_backlog_split(window_t *w, int full, int removed);
00100 void ncurses_redraw(window_t *w);
00101 void ncurses_redraw_input(unsigned int ch);
00102 void ncurses_clear(window_t *w, int full);
00103 void ncurses_refresh();
00104 void ncurses_commit();
00105 void ncurses_input_update();
00106 void ncurses_line_adjust();
00107 #define line_adjust ncurses_line_adjust
00108 void ncurses_lines_adjust();
00109 #define lines_adjust ncurses_lines_adjust
00110 int ncurses_window_kill(window_t *w);
00111 int ncurses_window_new(window_t *w);
00112
00113 #define input ncurses_input
00114 #define header ncurses_header
00115 #define contacts ncurses_contacts
00116 #define history ncurses_history
00117 #define history_index ncurses_history_index
00118 #define line_index ncurses_line_index
00119 #define line_start ncurses_line_start
00120 #define lines_index ncurses_lines_index
00121 #define lines_start ncurses_lines_start
00122 #define input_size ncurses_input_size
00123 #define yanked ncurses_yanked
00124
00125 #define HISTORY_MAX 1000
00126 extern CHAR_T *ncurses_history[HISTORY_MAX];
00127 extern int ncurses_history_index;
00128 extern CHAR_T *ncurses_line;
00129 extern CHAR_T *ncurses_yanked;
00130 extern CHAR_T **ncurses_lines;
00131 extern int ncurses_line_start;
00132 extern int ncurses_line_index;
00133 extern int ncurses_lines_start;
00134 extern int ncurses_lines_index;
00135 extern int ncurses_input_size;
00136 extern int ncurses_debug;
00137
00138 void header_statusbar_resize(const char *dummy);
00139 #ifdef WITH_ASPELL
00140 void ncurses_spellcheck_init();
00141
00142 extern int config_aspell;
00143 extern char *config_aspell_lang;
00144 #endif
00145 void changed_backlog_size(const char *var);
00146
00147 extern int config_backlog_size;
00148 extern int config_display_transparent;
00149 extern int config_enter_scrolls;
00150 extern int config_header_size;
00151 extern int config_margin_size;
00152 extern int config_statusbar_size;
00153 extern int config_kill_irc_window;
00154
00155 extern int config_text_bottomalign;
00156 extern int config_typing_timeout;
00157 extern int config_typing_timeout_empty;
00158
00159 int ncurses_lastlog_update(window_t *w);
00160 void ncurses_lastlog_new(window_t *w);
00161 extern int config_lastlog_size;
00162 extern int config_lastlog_lock;
00163
00164 WATCHER(ncurses_watch_stdin);
00165 WATCHER(ncurses_watch_winch);
00166 int ncurses_command_window(void *data, va_list ap);
00167 COMMAND(cmd_mark);
00168
00169 extern int have_winch_pipe;
00170 extern int winch_pipe[2];
00171
00172 #ifndef COLOR_DEFAULT
00173 # define COLOR_DEFAULT (-1)
00174 #endif
00175
00176 #endif
00177
00178
00179
00180
00181
00182
00183
00184
00185