GtrView: GTranslator Reference Manual

## GtrView GtrView |

## Functions

GType | gtr_view_register_type ()
GtkWidget * | gtr_view_new ()
gboolean | gtr_view_get_selected_text ()
void | gtr_view_enable_spellcheck ()
void | gtr_view_enable_visible_whitespace ()
void | gtr_view_cut_clipboard ()
void | gtr_view_copy_clipboard ()
void | gtr_view_paste_clipboard ()
void | gtr_view_set_font ()
void | gtr_view_set_search_text ()
gchar * | gtr_view_get_search_text ()
gboolean | gtr_view_get_can_search_again ()
gboolean | gtr_view_search_forward ()
gboolean | gtr_view_search_backward ()
gint | gtr_view_replace_all ()
void | gtr_view_reload_scheme_color ()

## Types and Values

enum | GtrSearchFlags

## Description

## Functions

### gtr_view_register_type ()

    GType
    gtr_view_register_type (GTypeModule *module);

#### Returns

### gtr_view_new ()

    GtkWidget *
    gtr_view_new (void);

Creates a new GtrView. An empty default buffer will be created for you.

#### Returns

a new GtrView

### gtr_view_get_selected_text ()

    gboolean
    gtr_view_get_selected_text (GtrView *view,
                                gchar **selected_text,
                                gint *len);

Gets the selected text region of the GtrView

#### Parameters

view | a GtrView |
selected_text | it stores the text selected in the GtrView |
len | it stores the length of the `selected_text` |

#### Returns

TRUE if the `selected_text` was got correctly.

### gtr_view_enable_spellcheck ()

    void
    gtr_view_enable_spellcheck (GtrView *view,
                                gboolean enable);

Enables the spellcheck

#### Parameters

view | a GtrView |
enable | TRUE if you want enable the spellcheck |

### gtr_view_enable_visible_whitespace ()

    void
    gtr_view_enable_visible_whitespace (GtrView *view,
                                        gboolean enable);

Enables special chars for white spaces including \n and \t

#### Parameters

view | a GtrView |
enable | TRUE if you want to enable special chars for white spaces |

### gtr_view_cut_clipboard ()

    void
    gtr_view_cut_clipboard (GtrView *view);

Copies the currently-selected text to a clipboard, then deletes said text if it's editable.

#### Parameters

view | a GtrView |

### gtr_view_copy_clipboard ()

    void
    gtr_view_copy_clipboard (GtrView *view);

Copies the currently-selected text to a clipboard.

#### Parameters

view | a GtrView |

### gtr_view_paste_clipboard ()

    void
    gtr_view_paste_clipboard (GtrView *view);

Pastes the contents of a clipboard at the insertion point, or at override_location.

#### Parameters

view | a GtrView |

### gtr_view_set_font ()

    void
    gtr_view_set_font (GtrView *view,
                       gboolean def,
                       const gchar *font_name);

Sets the GtrView font.

#### Parameters

view | a GtrView |
def | TRUE if you want to use the default font |
font_name | The name of the font you want to use in the GtrView |

### gtr_view_set_search_text ()

    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` .

#### Parameters

view | a GtrView |
text | the text to set for searching |
flags | a GtrSearchFlags |

### gtr_view_get_search_text ()

    gchar *
    gtr_view_get_search_text (GtrView *view,
                              guint *flags);

Returns the text to search for it and the GtrSearchFlags of that text.

#### Parameters

view | a GtrView |
flags | the GtrSearchFlags of the stored text. |

#### Returns

the text to search for it.

### gtr_view_get_can_search_again ()

    gboolean
    gtr_view_get_can_search_again (GtrView *view);

#### Parameters

view | a GtrView |

#### Returns

TRUE if it can search again

### gtr_view_search_forward ()

    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.

#### Parameters

view | a GtrView |
start | start of search |
end | bound for the search, or `NULL` for the end of the buffer |
match_start | return location for start of match, or `NULL` |
match_end | return location for end of match, or `NULL` |

#### Returns

whether a match was found

### gtr_view_search_backward ()

    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.

#### Parameters

view | a GtrView |
start | start of search |
end | bound for the search, or `NULL` for the end of the buffer |
match_start | return location for start of match, or `NULL` |
match_end | return location for end of match, or `NULL` |

#### Returns

whether a match was found

### gtr_view_replace_all ()

    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.

#### Parameters

view | a GtrView |
find | the text to find |
replace | the text to replace `find` |
flags | a GtrSearchFlags |

#### Returns

the number of replacements made it.

### gtr_view_reload_scheme_color ()

    void
    gtr_view_reload_scheme_color (GtrView *view);

Reloads the gtksourceview scheme color. Neccessary when the scheme color changes.

#### Parameters

view | a GtrView |

## Types and Values

### enum GtrSearchFlags

#### Members

GTR_SEARCH_DONT_SET_FLAGS |  |
GTR_SEARCH_ENTIRE_WORD |  |
GTR_SEARCH_CASE_SENSITIVE |  |