![]() |
![]() |
![]() |
GTranslator Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum GtrSearchFlags; struct GtrView; struct GtrViewClass; GType gtr_view_register_type (GTypeModule *module
); GtkWidget * gtr_view_new (void
); gboolean gtr_view_get_selected_text (GtrView *view
,gchar **selected_text
,gint *len
); void gtr_view_enable_spellcheck (GtrView *view
,gboolean enable
); void gtr_view_enable_visible_whitespace (GtrView *view
,gboolean enable
); void gtr_view_cut_clipboard (GtrView *view
); void gtr_view_copy_clipboard (GtrView *view
); void gtr_view_paste_clipboard (GtrView *view
); void gtr_view_set_font (GtrView *view
,gboolean def
,const gchar *font_name
); void gtr_view_set_search_text (GtrView *view
,const gchar *text
,guint flags
); gchar * gtr_view_get_search_text (GtrView *view
,guint *flags
); gboolean gtr_view_get_can_search_again (GtrView *view
); gboolean gtr_view_search_forward (GtrView *view
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
); gboolean gtr_view_search_backward (GtrView *view
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
); gint gtr_view_replace_all (GtrView *view
,const gchar *find
,const gchar *replace
,guint flags
); void gtr_view_reload_scheme_color (GtrView *view
);
typedef enum { GTR_SEARCH_DONT_SET_FLAGS = 1 << 0, GTR_SEARCH_ENTIRE_WORD = 1 << 1, GTR_SEARCH_CASE_SENSITIVE = 1 << 2 } GtrSearchFlags;
GtkWidget * gtr_view_new (void
);
Creates a new GtrView. An empty default buffer will be created for you.
Returns : |
a new GtrView |
gboolean gtr_view_get_selected_text (GtrView *view
,gchar **selected_text
,gint *len
);
Gets the selected text region of the GtrView
void gtr_view_enable_spellcheck (GtrView *view
,gboolean enable
);
Enables the spellcheck
|
a GtrView |
|
TRUE if you want enable the spellcheck |
void gtr_view_enable_visible_whitespace (GtrView *view
,gboolean enable
);
Enables special chars for white spaces including \n and \t
|
a GtrView |
|
TRUE if you want to enable special chars for white spaces |
void gtr_view_cut_clipboard (GtrView *view
);
Copies the currently-selected text to a clipboard, then deletes said text if it's editable.
|
a GtrView |
void gtr_view_copy_clipboard (GtrView *view
);
Copies the currently-selected text to a clipboard.
|
a GtrView |
void gtr_view_paste_clipboard (GtrView *view
);
Pastes the contents of a clipboard at the insertion point, or at override_location.
|
a GtrView |
void gtr_view_set_font (GtrView *view
,gboolean def
,const gchar *font_name
);
Sets the GtrView font.
void gtr_view_set_search_text (GtrView *view
,const gchar *text
,guint flags
);
Stores the text to search for in the view
with some specific flags
.
|
a GtrView |
|
the text to set for searching |
|
a GtrSearchFlags |
gchar * gtr_view_get_search_text (GtrView *view
,guint *flags
);
Returns the text to search for it and the GtrSearchFlags of that text.
|
a GtrView |
|
the GtrSearchFlags of the stored text. |
Returns : |
the text to search for it. |
gboolean gtr_view_get_can_search_again (GtrView *view
);
|
a GtrView |
Returns : |
TRUE if it can search again |
gboolean gtr_view_search_forward (GtrView *view
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
);
Searches forward for str. Any match is returned by setting match_start to the first character of the match and match_end to the first character after the match. The search will not continue past limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid locking up your UI on large buffers.
|
a GtrView |
|
start of search |
|
bound for the search, or NULL for the end of the buffer |
|
return location for start of match, or NULL
|
|
return location for end of match, or NULL
|
Returns : |
whether a match was found |
gboolean gtr_view_search_backward (GtrView *view
,const GtkTextIter *start
,const GtkTextIter *end
,GtkTextIter *match_start
,GtkTextIter *match_end
);
Searches backward for str. Any match is returned by setting match_start to the first character of the match and match_end to the first character after the match. The search will not continue past limit. Note that a search is a linear or O(n) operation, so you may wish to use limit to avoid locking up your UI on large buffers.
|
a GtrView |
|
start of search |
|
bound for the search, or NULL for the end of the buffer |
|
return location for start of match, or NULL
|
|
return location for end of match, or NULL
|
Returns : |
whether a match was found |
gint gtr_view_replace_all (GtrView *view
,const gchar *find
,const gchar *replace
,guint flags
);
Replaces all matches of find
with replace
and returns the number of
replacements.
|
a GtrView |
|
the text to find |
|
the text to replace find
|
|
a GtrSearchFlags |
Returns : |
the number of replacements made it. |