14 #ifndef T3_WIDGET_TEXTLINE_H
15 #define T3_WIDGET_TEXTLINE_H
20 #include <sys/types.h>
23 #include <t3window/window.h>
25 #include <t3widget/widget_api.h>
26 #include <t3widget/key.h>
32 #define _T3_MAX_TAB 80
34 class text_line_factory_t;
40 PARTIAL_CHAR = (1<<1),
42 TAB_AS_CONTROL = (1<<3),
43 EXTEND_SELECTION = (1<<4),
60 t3_attr_t normal_attr, selected_attr;
71 bool starts_with_combining;
77 static char spaces[_T3_MAX_TAB];
78 static char dashes[_T3_MAX_TAB];
80 static const char *control_map;
81 static const char *wrap_symbol;
83 static void paint_part(t3_window_t *win,
const char *paint_buffer,
bool is_print,
int todo, t3_attr_t selection_attr);
84 static int key_width(
key_t key);
88 void fill_line(
const char *_buffer,
int length);
89 bool check_boundaries(
int match_start,
int match_end)
const;
90 void update_meta_buffer(
int start_pos = 0);
91 char get_char_meta(
int pos)
const;
93 void insert_bytes(
int pos,
const char *bytes,
int space);
94 void reserve(
int size);
95 int byte_width_from_first(
int pos)
const;
104 void set_text(
const char *_buffer);
105 void set_text(
const char *_buffer,
size_t length);
106 void set_text(
const std::string *str);
117 int calculate_screen_width(
int start,
int pos,
int tabsize)
const;
118 int calculate_line_pos(
int start,
int max,
int pos,
int tabsize)
const;
120 void paint_line(t3_window_t *win,
const paint_info_t *info);
122 break_pos_t find_next_break_pos(
int start,
int length,
int tabsize)
const;
123 int get_next_word(
int start)
const;
124 int get_previous_word(
int start)
const;
127 bool overwrite_char(
int pos,
key_t c,
undo_t *undo);
128 bool delete_char(
int pos,
undo_t *undo);
130 bool backspace_char(
int pos,
undo_t *undo);
132 int adjust_position(
int pos,
int adjust)
const;
134 int get_length(
void)
const;
135 int width_at(
int pos)
const;
136 bool is_print(
int pos)
const;
137 bool is_space(
int pos)
const;
138 bool is_alnum(
int pos)
const;
139 bool is_bad_draw(
int pos)
const;
141 const std::string *get_data(
void)
const;
143 int get_next_word_boundary(
int start)
const;
144 int get_previous_word_boundary(
int start)
const;
146 static void init(
void);
149 virtual t3_attr_t get_base_attr(
int i,
const paint_info_t *info);
156 virtual text_line_t *new_text_line_t(
int buffersize = BUFFERSIZE);
157 virtual text_line_t *new_text_line_t(
const char *_buffer);
158 virtual text_line_t *new_text_line_t(
const char *_buffer,
int length);
159 virtual text_line_t *new_text_line_t(
const std::string *str);
Definition: textline.h:152
Definition: textline.h:64
Definition: textline.h:36
Definition: textline.h:48