TeplView: libgedit-tepl 6 Reference Manual

## TeplView TeplView — Subclass of GtkSourceView |

## Functions

GtkWidget * | tepl_view_new ()
GtkWidget * | tepl_view_new_with_buffer ()
void | tepl_view_cut_clipboard ()
void | tepl_view_copy_clipboard ()
void | tepl_view_paste_clipboard ()
void | tepl_view_delete_selection ()
void | tepl_view_select_all ()
void | tepl_view_scroll_to_cursor ()
gboolean | tepl_view_goto_line ()
gboolean | tepl_view_goto_line_offset ()
void | tepl_view_select_lines ()

## Types and Values

| TeplView

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkTextView
                        ╰── GtkSourceView
                            ╰── TeplView

## Implemented Interfaces

TeplView implements AtkImplementorIface, GtkBuildable and GtkScrollable.

## Includes

    #include <tepl/tepl.h>

## Description

TeplView is a subclass of GtkSourceView, to add more features useful for a text editor.

## Functions

### tepl_view_new ()

    GtkWidget *
    tepl_view_new (void);

Creates a new TeplView.

By default, an empty TeplBuffer will be lazily created and can be retrieved with `gtk_text_view_get_buffer()`.

If you want to specify your own buffer, either override the GtkTextViewClass create_buffer factory method, or use `tepl_view_new_with_buffer()`.

#### Returns

a new TeplView.

Since: 1.0

### tepl_view_new_with_buffer ()

    GtkWidget *
    tepl_view_new_with_buffer (GtkSourceBuffer *buffer);

Creates a new TeplView widget displaying the buffer `buffer` .

#### Parameters

buffer | a GtkSourceBuffer or a subclass of it. |

#### Returns

a new TeplView.

Since: 5.0

### tepl_view_cut_clipboard ()

    void
    tepl_view_cut_clipboard (TeplView *view);

Cuts the clipboard and then scrolls to the cursor position.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_copy_clipboard ()

    void
    tepl_view_copy_clipboard (TeplView *view);

Copies the clipboard.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_paste_clipboard ()

    void
    tepl_view_paste_clipboard (TeplView *view);

Pastes the clipboard and then scrolls to the cursor position.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_delete_selection ()

    void
    tepl_view_delete_selection (TeplView *view);

Deletes the text currently selected in the GtkTextBuffer associated to the view and then scrolls to the cursor position.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_select_all ()

    void
    tepl_view_select_all (TeplView *view);

Selects all the text.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_scroll_to_cursor ()

    void
    tepl_view_scroll_to_cursor (TeplView *view);

Scrolls the `view` to the cursor position.

#### Parameters

view | a TeplView. |

Since: 1.0

### tepl_view_goto_line ()

    gboolean
    tepl_view_goto_line (TeplView *view,
                         gint line);

Places the cursor at the position returned by `gtk_text_buffer_get_iter_at_line()`, and scrolls to that position.

#### Parameters

view | a TeplView. |
line | a line number, counting from 0. |

#### Returns

`TRUE` if the cursor has been moved exactly to `line` , `FALSE` if that line didn't exist.

Since: 2.0

### tepl_view_goto_line_offset ()

    gboolean
    tepl_view_goto_line_offset (TeplView *view,
                                gint line,
                                gint line_offset);

Places the cursor at the position returned by `gtk_text_buffer_get_iter_at_line_offset()`, and scrolls to that position.

#### Parameters

view | a TeplView. |
line | a line number, counting from 0. |
line_offset | the line offset, in characters (not bytes). |

#### Returns

`TRUE` if the cursor has been moved exactly to `line` and `line_offset` , `FALSE` if that position didn't exist.

Since: 2.0

### tepl_view_select_lines ()

    void
    tepl_view_select_lines (TeplView *view,
                            gint start_line,
                            gint end_line);

Selects the lines between `start_line` and `end_line` included, counting from zero. And then scrolls to the cursor.

Possible use-case: line numbers coming from a compilation output, to go to the place where a warning or error occurred.

#### Parameters

view | a TeplView. |
start_line | start of the region to select. |
end_line | end of the region to select. |

Since: 2.0

## Types and Values

### TeplView

    typedef struct _TeplView TeplView;