Textview API. More...
Go to the source code of this file.
Data Structures | |
struct | _GntTextView |
struct | _GntTextViewClass |
Macros | |
#define | GNT_TYPE_TEXT_VIEW (gnt_text_view_get_gtype()) |
#define | GNT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TEXT_VIEW, GntTextView)) |
#define | GNT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) |
#define | GNT_IS_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_TEXT_VIEW)) |
#define | GNT_IS_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TEXT_VIEW)) |
#define | GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) |
#define | GNT_TEXT_VIEW_FLAGS(obj) (GNT_TEXT_VIEW(obj)->priv.flags) |
#define | GNT_TEXT_VIEW_SET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) |= flags) |
#define | GNT_TEXT_VIEW_UNSET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) &= ~(flags)) |
Typedefs | |
typedef struct _GntTextView | GntTextView |
typedef struct _GntTextViewPriv | GntTextViewPriv |
typedef struct _GntTextViewClass | GntTextViewClass |
Functions | |
G_BEGIN_DECLS GType | gnt_text_view_get_gtype (void) |
GntWidget * | gnt_text_view_new (void) |
Create a new textview. More... | |
void | gnt_text_view_scroll (GntTextView *view, int scroll) |
Scroll the textview. More... | |
void | gnt_text_view_append_text_with_flags (GntTextView *view, const char *text, GntTextFormatFlags flags) |
Append new text in a textview. More... | |
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. More... | |
void | gnt_text_view_next_line (GntTextView *view) |
Move the cursor to the beginning of the next line and resets text-attributes. More... | |
chtype | gnt_text_format_flag_to_chtype (GntTextFormatFlags flags) |
Convert GNT-text formats to ncurses-text attributes. More... | |
void | gnt_text_view_clear (GntTextView *view) |
Clear the contents of the textview. More... | |
int | gnt_text_view_get_lines_below (GntTextView *view) |
The number of lines below the bottom-most visible line. More... | |
int | gnt_text_view_get_lines_above (GntTextView *view) |
The number of lines above the topmost visible line. More... | |
int | gnt_text_view_tag_change (GntTextView *view, const char *name, const char *text, gboolean all) |
Change the text of a tag. More... | |
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 textview. More... | |
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 PAGER to popup with the contents of the textview in it. More... | |
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 popup with the contents of the textview in it. More... | |
void | gnt_text_view_set_flag (GntTextView *view, GntTextViewFlag flag) |
Set a GntTextViewFlag for the textview widget. More... | |
Textview API.
Definition in file gnttextview.h.
chtype gnt_text_format_flag_to_chtype | ( | GntTextFormatFlags | flags | ) |
Convert GNT-text formats to ncurses-text attributes.
flags | The GNT text format. |
void gnt_text_view_append_text_with_flags | ( | GntTextView * | view, |
const char * | text, | ||
GntTextFormatFlags | flags | ||
) |
Append new text in a textview.
view | The textview. |
text | The text to append to the textview. |
flags | The text-flags to apply to the new text. |
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.
view | The textview. |
text | The text to append. |
flags | The text-flags to apply to the new text. |
tag | The tag for the appended text, so it can be changed later ( |
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 popup with the contents of the textview in it.
The default key-combination to trigger the pager is a-e, and the default EDITOR application is $EDITOR. Both can be changed in ~/.gntrc like this:
view | The textview. |
widget | The widget to trigger the EDITOR. |
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 PAGER to popup with the contents of the textview in it.
The default key-combination to trigger the pager is a-v, and the default PAGER application is $PAGER. Both can be changed in ~/.gntrc like this:
view | The textview. |
pager | The widget to trigger the PAGER. |
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 textview.
view | The textview. |
widget | The trigger widget. |
void gnt_text_view_clear | ( | GntTextView * | view | ) |
Clear the contents of the textview.
view | The textview. |
G_BEGIN_DECLS GType gnt_text_view_get_gtype | ( | void | ) |
int gnt_text_view_get_lines_above | ( | GntTextView * | view | ) |
The number of lines above the topmost visible line.
view | The textview. |
int gnt_text_view_get_lines_below | ( | GntTextView * | view | ) |
The number of lines below the bottom-most visible line.
view | The textview. |
GntWidget* gnt_text_view_new | ( | void | ) |
Create a new textview.
void gnt_text_view_next_line | ( | GntTextView * | view | ) |
Move the cursor to the beginning of the next line and resets text-attributes.
It first completes the current line with the current text-attributes.
view | The textview. |
void gnt_text_view_scroll | ( | GntTextView * | view, |
int | scroll | ||
) |
Scroll the textview.
view | The textview to scroll. |
scroll | scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end. |
void gnt_text_view_set_flag | ( | GntTextView * | view, |
GntTextViewFlag | flag | ||
) |
Set a GntTextViewFlag for the textview widget.
view | The textview widget |
flag | The flag to set |
int gnt_text_view_tag_change | ( | GntTextView * | view, |
const char * | name, | ||
const char * | text, | ||
gboolean | all | ||
) |
Change the text of a tag.
view | The textview. |
name | The name of the tag. |
text | The new text for the text. If 'text' is NULL , the tag is removed. |
all | TRUE if all of the instancess of the tag should be changed, FALSE if only the first instance should be changed. |