27 #ifndef GNT_TEXT_VIEW_H 28 #define GNT_TEXT_VIEW_H 35 #define GNT_TYPE_TEXT_VIEW (gnt_text_view_get_gtype()) 36 #define GNT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TEXT_VIEW, GntTextView)) 37 #define GNT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) 38 #define GNT_IS_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_TEXT_VIEW)) 39 #define GNT_IS_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TEXT_VIEW)) 40 #define GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) 42 #define GNT_TEXT_VIEW_FLAGS(obj) (GNT_TEXT_VIEW(obj)->priv.flags) 43 #define GNT_TEXT_VIEW_SET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) |= flags) 44 #define GNT_TEXT_VIEW_UNSET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) &= ~(flags)) 47 typedef struct _GntTextViewPriv GntTextViewPriv;
52 GNT_TEXT_VIEW_NO_SCROLL = 1 << 0,
53 GNT_TEXT_VIEW_WRAP_CHAR = 1 << 1,
54 GNT_TEXT_VIEW_TOP_ALIGN = 1 << 2,
65 GntTextViewFlag flags;
70 GNT_TEXT_FLAG_NORMAL = 0,
71 GNT_TEXT_FLAG_BOLD = 1 << 0,
72 GNT_TEXT_FLAG_UNDERLINE = 1 << 1,
73 GNT_TEXT_FLAG_BLINK = 1 << 2,
74 GNT_TEXT_FLAG_DIM = 1 << 3,
75 GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4,
82 void (*gnt_reserved1)(void);
83 void (*gnt_reserved2)(void);
84 void (*gnt_reserved3)(void);
85 void (*gnt_reserved4)(void);
void gnt_text_view_attach_scroll_widget(GntTextView *view, GntWidget *widget)
Setup hooks so that pressing up/down/page-up/page-down keys when 'widget' is in focus scrolls the tex...
void gnt_text_view_attach_pager_widget(GntTextView *view, GntWidget *pager)
Setup appropriate hooks so that pressing some keys when the 'pager' widget is in focus triggers the P...
int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all)
Change the text of a tag.
void gnt_text_view_attach_editor_widget(GntTextView *view, GntWidget *widget)
Setup appropriate hooks so that pressing some keys when 'widget' is in focus triggers the EDITOR to p...
void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag)
Append text in the textview, with some identifier (tag) for the added text.
int gnt_text_view_get_lines_above(GntTextView *view)
The number of lines above the topmost visible line.
void gnt_text_view_set_flag(GntTextView *view, GntTextViewFlag flag)
Set a GntTextViewFlag for the textview widget.
GntWidget * gnt_text_view_new(void)
Create a new textview.
void gnt_text_view_clear(GntTextView *view)
Clear the contents of the textview.
int gnt_text_view_get_lines_below(GntTextView *view)
The number of lines below the bottom-most visible line.
G_BEGIN_DECLS GType gnt_text_view_get_gtype(void)
chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags)
Convert GNT-text formats to ncurses-text attributes.
void gnt_text_view_next_line(GntTextView *view)
Move the cursor to the beginning of the next line and resets text-attributes.
void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags)
Append new text in a textview.
void gnt_text_view_scroll(GntTextView *view, int scroll)
Scroll the textview.