TeplCodeCommentView: libgedit-tepl 6 Reference Manual

## TeplCodeCommentView TeplCodeCommentView — Code comment - GtkSourceView class extension |

## Functions

TeplCodeCommentView * | tepl_code_comment_view_new ()
GtkSourceView * | tepl_code_comment_view_get_source_view ()
gboolean | tepl_code_comment_view_code_comment_is_supported ()
void | tepl_code_comment_view_comment_lines ()
void | tepl_code_comment_view_comment_selected_lines ()
void | tepl_code_comment_view_uncomment_selection ()

## Properties

gboolean | code-comment-is-supported | Read
GtkSourceView * | source-view | Read / Write / Construct Only

## Types and Values

struct | TeplCodeCommentView

## Object Hierarchy

        GObject
        ╰── TeplCodeCommentView

## Includes

    #include <tepl/tepl.h>

## Description

TeplCodeCommentView extends the GtkSourceView class with the code comment and uncomment feature.

## Functions

### tepl_code_comment_view_new ()

    TeplCodeCommentView *
    tepl_code_comment_view_new (GtkSourceView *view);

#### Parameters

view | a GtkSourceView widget. |

#### Returns

a new TeplCodeCommentView object.

[transfer full]

Since: 6.14

### tepl_code_comment_view_get_source_view ()

    GtkSourceView *
    tepl_code_comment_view_get_source_view
                                   (TeplCodeCommentView *code_comment_view);

#### Parameters

code_comment_view | a TeplCodeCommentView. |

#### Returns

the “source-view”.

[transfer none][nullable]

Since: 6.14

### tepl_code_comment_view_code_comment_is_supported ()

    gboolean
    tepl_code_comment_view_code_comment_is_supported
                                   (TeplCodeCommentView *code_comment_view);

#### Parameters

code_comment_view | a TeplCodeCommentView. |

#### Returns

the current value of the “code-comment-is-supported” property.

Since: 6.14

### tepl_code_comment_view_comment_lines ()

    void
    tepl_code_comment_view_comment_lines (TeplCodeCommentView *code_comment_view,
                                          const GtkTextIter *start_iter,
                                          const GtkTextIter *end_iter);

Comments the lines between `start_iter` and `end_iter` included.

If `end_iter` is `NULL`, only a single line is commented.

Ensure that code comment is supported before calling this function. See `tepl_code_comment_view_code_comment_is_supported()`.

#### Parameters

code_comment_view | a TeplCodeCommentView. |
start_iter | a GtkTextIter. |
end_iter | a GtkTextIter, or `NULL` to comment only the line at `start_iter` . | [nullable]

Since: 6.14

### tepl_code_comment_view_comment_selected_lines ()

    void
    tepl_code_comment_view_comment_selected_lines
                                   (TeplCodeCommentView *code_comment_view);

Comments the selected lines.

Ensure that code comment is supported before calling this function. See `tepl_code_comment_view_code_comment_is_supported()`.

#### Parameters

code_comment_view | a TeplCodeCommentView. |

Since: 6.14

### tepl_code_comment_view_uncomment_selection ()

    void
    tepl_code_comment_view_uncomment_selection
                                   (TeplCodeCommentView *code_comment_view);

Uncomments the selected text.

Ensure that code comment is supported before calling this function. See `tepl_code_comment_view_code_comment_is_supported()`.

#### Parameters

code_comment_view | a TeplCodeCommentView. |

Since: 6.14

## Types and Values

### struct TeplCodeCommentView

    struct TeplCodeCommentView;

## Property Details

### The `“code-comment-is-supported”` property

      “code-comment-is-supported” gboolean

Whether code comment/uncomment is supported.

This property is `TRUE` when all these conditions are met:

- The necessary metadata is available, to know what character or string to insert or remove.

- The “editable” property is `TRUE`.

Owner: TeplCodeCommentView

Flags: Read

Default value: FALSE

Since: 6.14

### The `“source-view”` property

      “source-view”              GtkSourceView *

The associated GtkSourceView widget. TeplCodeCommentView has a weak reference to the GtkSourceView.

Owner: TeplCodeCommentView

Flags: Read / Write / Construct Only

Since: 6.14