1 #ifndef __MCABBER_SCREEN_H__ 2 #define __MCABBER_SCREEN_H__ 1 3 4 #include <glib.h> 5 6 #include <mcabber/config.h> 7 8 #if HAVE_NCURSESW_NCURSES_H 9 # include <ncursesw/ncurses.h> 10 # include <ncursesw/panel.h> 11 #elif HAVE_NCURSES_NCURSES_H 12 # include <ncurses/ncurses.h> 13 # include <ncurses/panel.h> 14 #else 15 # include <ncurses.h> 16 # include <panel.h> 17 #endif 18 19 extern gboolean vi_mode; 20 21 #if defined(WITH_ENCHANT) || defined(WITH_ASPELL) 22 void spellcheck_init(void); 23 void spellcheck_deinit(void); 24 //static void spellcheck(char*, char*); 25 #endif 26 27 #include <mcabber/hbuf.h> 28 #include <mcabber/logprint.h> 29 #include <mcabber/roster.h> 30 31 #define INPUTLINE_LENGTH 1024 32 33 // Only used in screen.c; this is the maximum line number 34 // in a multi-line message. Should be < 1000 35 // Note: message length is limited by the HBB_BLOCKSIZE size too 36 #define MULTILINE_MAX_LINE_NUMBER 299 37 38 // When chatstates are enabled, timeout (in seconds) before "composing" 39 // becomes "paused" because of user inactivity. 40 // Warning: setting this very low will cause more network traffic. 41 #define COMPOSING_TIMEOUT 6L 42 43 enum colors { 44 COLOR_GENERAL = 3, 45 COLOR_MSGOUT, 46 COLOR_MSGHL, 47 COLOR_STATUS, 48 COLOR_LOG, 49 COLOR_ROSTER, 50 COLOR_ROSTERSEL, 51 COLOR_ROSTERSELNMSG, 52 COLOR_ROSTERNMSG, 53 COLOR_INFO, 54 COLOR_MSGIN, 55 COLOR_READMARK, 56 COLOR_TIMESTAMP, 57 COLOR_max 58 }; 59 60 extern int COLOR_ATTRIB[COLOR_max]; 61 62 extern gboolean chatstates_disabled; 63 extern gboolean Autoaway; 64 65 typedef struct { 66 int value; 67 int utf8; 68 enum { 69 MKEY_NONE = 0, 70 MKEY_META, 71 MKEY_EQUIV, 72 MKEY_CTRL_PGUP, 73 MKEY_CTRL_PGDOWN, 74 MKEY_SHIFT_PGUP, 75 MKEY_SHIFT_PGDOWN, 76 MKEY_CTRL_SHIFT_PGUP, 77 MKEY_CTRL_SHIFT_PGDOWN, 78 MKEY_CTRL_HOME, 79 MKEY_CTRL_END, 80 MKEY_CTRL_INS, 81 MKEY_CTRL_DEL, 82 MKEY_CTRL_SHIFT_HOME, 83 MKEY_CTRL_SHIFT_END, 84 MKEY_MOUSE 85 } mcode; 86 } keycode_t; 87 88 typedef enum { 89 MC_ALL, 90 MC_PRESET, 91 MC_OFF, 92 MC_REMOVE 93 } muccol_t; 94 95 96 void scr_write_incoming_message(const char *jidfrom, const char *text, 97 time_t timestamp, guint prefix, 98 unsigned mucnicklen); 99 void scr_write_outgoing_message(const char *jidto, const char *text, 100 guint prefix, gpointer xep184); 101 102 void scr_getch(keycode_t *kcode); 103 void scr_process_key(keycode_t kcode); 104 105 void scr_init_bindings(void); 106 void scr_init_locale_charset(void); 107 void scr_init_curses(void); 108 void scr_init_settings(void); 109 void scr_terminate_curses(void); 110 gboolean scr_curses_status(void); 111 void scr_resize(void); 112 void scr_draw_main_window(unsigned int fullinit); 113 void scr_draw_roster(void); 114 void scr_update_roster(void); 115 void scr_update_main_status(int forceupdate); 116 void scr_update_chat_status(int forceupdate); 117 void scr_roster_visibility(int status); 118 void scr_remove_receipt_flag(const char *jidto, gconstpointer xep184); 119 void scr_show_buddy_window(void); 120 int scr_buddy_buffer_exists(const char *jid); 121 void scr_update_buddy_window(void); 122 void scr_set_chatmode(int enable); 123 int scr_get_chatmode(void); 124 void scr_set_multimode(int enable, char *subject); 125 int scr_get_multimode(void); 126 void scr_setmsgflag_if_needed(const char *jid, int special); 127 void scr_setattentionflag_if_needed(const char *bjid, int special, 128 guint value, enum setuiprio_ops action); 129 void scr_append_multiline(const char *line); 130 const char *scr_get_multiline(void); 131 const char *scr_get_multimode_subj(void); 132 133 guint scr_getprefixwidth(void); 134 guint scr_gettextwidth(void); 135 guint scr_gettextheight(void); 136 guint scr_getlogwinheight(void); 137 size_t scr_line_prefix(hbb_line *line, char *prefix, guint preflen); 138 139 void scr_beep(void); 140 void scr_check_auto_away(int activity); 141 142 143 // For commands... 144 void scr_roster_top(void); 145 void scr_roster_bottom(void); 146 void scr_roster_up_down(int updown, unsigned int n); 147 void scr_roster_prev_group(void); 148 void scr_roster_next_group(void); 149 void scr_roster_search(char *); 150 void scr_roster_jump_jid(char *); 151 void scr_roster_jump_alternate(void); 152 void scr_roster_unread_message(int); 153 void scr_roster_display(const char *); 154 void scr_roster_next_open_buffer(void); 155 156 void scr_buffer_top_bottom(int topbottom); 157 void scr_buffer_clear(void); 158 void scr_buffer_scroll_lock(int lock); 159 void scr_buffer_purge(int, const char*); 160 void scr_buffer_purge_all(int); 161 void scr_buffer_search(int direction, const char *text); 162 void scr_buffer_percent(int pc); 163 void scr_buffer_date(time_t t); 164 void scr_buffer_dump(const char *file); 165 void scr_buffer_list(void); 166 void scr_buffer_scroll_up_down(int updown, unsigned int nblines); 167 void scr_buffer_readmark(gchar action); 168 void scr_buffer_jump_readmark(void); 169 170 bool scr_roster_color(const char *status, const char *wildcard, 171 const char *color); 172 void scr_roster_clear_color(void); 173 void scr_muc_color(const char *muc, muccol_t type); 174 void scr_muc_nick_color(const char *nick, const char *color); 175 176 void readline_transpose_chars(void); 177 void readline_forward_kill_word(void); 178 void readline_backward_kill_word(void); 179 void readline_backward_word(void); 180 void readline_forward_word(void); 181 void readline_updowncase_word(int); 182 void readline_capitalize_word(void); 183 void readline_backward_char(void); 184 void readline_forward_char(void); 185 void readline_accept_line(int down_history); 186 void readline_clear_history(void); 187 void readline_cancel_completion(void); 188 void readline_do_completion(gboolean fwd); 189 void readline_refresh_screen(void); 190 void readline_disable_chat_mode(guint show_roster); 191 void readline_hist_beginning_search_bwd(void); 192 void readline_hist_beginning_search_fwd(void); 193 void readline_hist_prev(void); 194 void readline_hist_next(void); 195 void readline_backward_kill_char(void); 196 void readline_forward_kill_char(void); 197 void readline_iline_start(void); 198 void readline_iline_end(void); 199 void readline_backward_kill_iline(void); 200 void readline_forward_kill_iline(void); 201 void readline_send_multiline(void); 202 void readline_insert(const char *toinsert); 203 204 205 // For backward compatibility: 206 207 #define scr_WriteIncomingMessage scr_write_incoming_message 208 #define scr_WriteOutgoingMessage scr_write_outgoing_message 209 210 #endif 211 212 /* vim: set et cindent cinoptions=>2\:2(0 ts=2 sw=2: For Vim users... */ 213