libt3widget
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
t3_widget::text_line_t Class Reference

Classes

struct  break_pos_t
struct  paint_info_t

Public Types

enum  {
  BREAK, PARTIAL_CHAR, SPACECLEAR, TAB_AS_CONTROL,
  EXTEND_SELECTION, DEBUG_LINE, SHOW_TABS
}

Public Member Functions

int adjust_position (int pos, int adjust) const
 Adjust the line position adjust non-zero-width characters.
bool append_char (key_t c, undo_t *undo)
bool backspace_char (int pos, undo_t *undo)
text_line_tbreak_line (int pos)
text_line_tbreak_on_nl (int *start_from)
int calculate_line_pos (int start, int max, int pos, int tabsize) const
int calculate_screen_width (int start, int pos, int tabsize) const
text_line_tclone (int start, int end)
text_line_tcut_line (int start, int end)
bool delete_char (int pos, undo_t *undo)
break_pos_t find_next_break_pos (int start, int length, int tabsize) const
const std::string * get_data (void) const
int get_length (void) const
int get_next_word (int start) const
int get_next_word_boundary (int start) const
int get_previous_word (int start) const
int get_previous_word_boundary (int start) const
void insert (text_line_t *other, int pos)
bool insert_char (int pos, key_t c, undo_t *undo)
bool is_alnum (int pos) const
bool is_bad_draw (int pos) const
bool is_print (int pos) const
bool is_space (int pos) const
void merge (text_line_t *other)
void minimize (void)
bool overwrite_char (int pos, key_t c, undo_t *undo)
void paint_line (t3_window_t *win, const paint_info_t *info)
void set_text (const char *_buffer)
void set_text (const char *_buffer, size_t length)
void set_text (const std::string *str)
 text_line_t (int buffersize=BUFFERSIZE, text_line_factory_t *_factory=NULL)
 text_line_t (const char *_buffer, text_line_factory_t *_factory=NULL)
 text_line_t (const char *_buffer, int length, text_line_factory_t *_factory=NULL)
 text_line_t (const std::string *str, text_line_factory_t *_factory=NULL)
int width_at (int pos) const

Static Public Member Functions

static void init (void)

Protected Member Functions

virtual t3_attr_t get_base_attr (int i, const paint_info_t *info)

Protected Attributes

text_line_factory_tfactory

Member Function Documentation

int t3_widget::text_line_t::adjust_position ( int  pos,
int  adjust 
) const

Adjust the line position adjust non-zero-width characters.

@param pos The starting position.
@param adjust How many characters to adjust.

This function finds the next (previous) point in the line at which the

cursor could be. This means skipping all zero-width characters between the current position and the next non-zero-width character, and repeating for adjust times.