ekg2  GIT master
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
nc-stuff.h
Idź do dokumentacji tego pliku.
1 #ifndef __EKG_NCURSES_NC_STUFF_H
2 #define __EKG_NCURSES_NC_STUFF_H
3 
4 #include "ecurses.h"
5 
6 void ncurses_init(void);
7 void ncurses_deinit(void);
8 
10 
11 // int ncurses_resize_term;
12 
13 extern int ncurses_plugin_destroyed;
14 
15 #define LINE_MAXLEN 1000 /* max line length */
16 #define MULTILINE_INPUT_SIZE 5
17 
18 #define ncurses_current ((ncurses_window_t *) window_current->priv_data)
19 
20 void update_statusbar(int commit);
21 
22 struct screen_line { /* everything locale-encoded */
23  int len; /* line length */
24 
25  unsigned char *str; /* content */
26  fstr_attr_t *attr; /* attributes */
27 
28  unsigned char *prompt_str; /* prompt string */
29  fstr_attr_t *prompt_attr; /* prompt attributes */
30  int prompt_len; /* prompt length */
31 
32  char *ts; /* timestamp */
33  fstr_attr_t *ts_attr; /* attributes of the timestamp */
34 
35  int backlog; /* backlog line it comes from */
36  int margin_left; /* where the margin should be setted */
37 };
38 
40  WF_LEFT = 1,
41  WF_TOP = 2,
42  WF_RIGHT = 4,
43  WF_BOTTOM = 8,
44  WF_ALL = 15
45 };
46 
47 typedef struct {
48  WINDOW *window; /* WINDOW of a window */
49 
50  /* -- the input prompt -- */
51  gchar *prompt; /* prompt target or NULL */
52  int prompt_len; /* prompt length or 0 */
53 
54  int margin_left, margin_right, margin_top, margin_bottom;
55  /* margins */
56 
57  fstring_t **backlog; /* buffer with lines */
58  int backlog_size; /* backlog size */
59 
60  int redraw; /* does it have to be redrawn before display */
61 
62  int start; /* from which line displaying starts */
63  int lines_count; /* number of screen lines in backlog */
64  struct screen_line *lines;
65  /* screen lines */
66 
67  int overflow; /* number of superfluous lines in a window */
68 
69  int (*handle_redraw)(window_t *w);
70  /* window contents redraw handler */
71 
72  void (*handle_mouse)(int x, int y, int state);
73 
74  time_t last_red_line; /* timestamp for red line marker */
76 
77 extern WINDOW *ncurses_contacts;
78 extern WINDOW *ncurses_input;
79 
81 
82 gboolean ncurses_simple_print(WINDOW *w, const char *s, fstr_attr_t attr, gssize maxx);
83 const char *ncurses_fstring_print(WINDOW *w, const char *s, const fstr_attr_t *attr, gssize maxx);
84 
85 void ncurses_prompt_set(window_t *w, const gchar *str);
87 void ncurses_resize(void);
88 void ncurses_redraw(window_t *w);
89 void ncurses_redraw_input(unsigned int ch);
90 void ncurses_clear(window_t *w, int full);
91 void ncurses_refresh(void);
92 void ncurses_commit(void);
95 
96 #define contacts ncurses_contacts
97 #define history ncurses_history
98 #define history_index ncurses_history_index
99 
100 #define HISTORY_MAX 1000
102 extern int ncurses_history_index;
103 extern int ncurses_debug;
104 
105 void header_statusbar_resize(const char *dummy);
106 void changed_backlog_size(const char *var);
107 
108 extern int config_backlog_size;
110 
111 extern int config_display_transparent;
112 extern int config_enter_scrolls;
113 extern int config_margin_size;
114 extern int config_kill_irc_window;
115 
116 extern int config_text_bottomalign;
117 
120 extern int config_lastlog_size;
121 extern int config_lastlog_lock;
123 
126 int ncurses_command_window(void *data, va_list ap);
128 
129 extern int have_winch_pipe;
130 extern int winch_pipe[2];
131 
132 extern int ncurses_screen_height;
133 extern int ncurses_screen_width;
134 
135 int color_pair(int fg, int bg);
136 int ncurses_backlog_add_real(window_t *w, /*locale*/ fstring_t *str);
137 
139 
140 #ifndef COLOR_DEFAULT
141 # define COLOR_DEFAULT (-1)
142 #endif
143 
144 #endif
145 
146 /*
147  * Local Variables:
148  * mode: c
149  * c-file-style: "k&r"
150  * c-basic-offset: 8
151  * indent-tabs-mode: t
152  * End:
153  */