GtefFoldRegion

GtefFoldRegion — Foldable region in a GtkTextBuffer

Functions

Properties

GtkTextBuffer * buffer Read / Write / Construct Only
gboolean folded Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GtefFoldRegion

Includes

#include <gtef/gtef.h>

Description

GtefFoldRegion represents a region in a GtkTextBuffer that can be folded.

When a region is being folded, a GtkTextTag with the “invisible” property is applied to the folded region. The actual start and end position of this GtkTextTag is respectively at the next new line after the start and end position of the bounds handed over to gtef_fold_region_set_bounds().

Functions

gtef_fold_region_new ()

GtefFoldRegion *
gtef_fold_region_new (GtkTextBuffer *buffer,
                      const GtkTextIter *start,
                      const GtkTextIter *end);

Parameters

buffer

a GtkTextBuffer.

 

start

a GtkTextIter.

 

end

a GtkTextIter.

 

Returns

a new GtefFoldRegion.

Since: 1.0


gtef_fold_region_get_buffer ()

GtkTextBuffer *
gtef_fold_region_get_buffer (GtefFoldRegion *fold_region);

Parameters

fold_region

a GtefFoldRegion.

 

Returns

the GtkTextBuffer where the fold region is applied.

[transfer none][nullable]

Since: 1.0


gtef_fold_region_get_folded ()

gboolean
gtef_fold_region_get_folded (GtefFoldRegion *fold_region);

Parameters

fold_region

a GtefFoldRegion.

 

Returns

whether the GtefFoldRegion is folded.

Since: 1.0


gtef_fold_region_set_folded ()

void
gtef_fold_region_set_folded (GtefFoldRegion *fold_region,
                             gboolean folded);

Folds or unfolds the region.

Parameters

fold_region

a GtefFoldRegion.

 

folded

the new value.

 

Since: 1.0


gtef_fold_region_get_bounds ()

gboolean
gtef_fold_region_get_bounds (GtefFoldRegion *fold_region,
                             GtkTextIter *start,
                             GtkTextIter *end);

Obtains iterators pointing to the start and end of the GtefFoldRegion.

Parameters

fold_region

a GtefFoldRegion.

 

start

iterator to initialize.

[out]

end

iterator to initialize.

[out]

Returns

TRUE on success, FALSE otherwise.

Since: 1.0


gtef_fold_region_set_bounds ()

void
gtef_fold_region_set_bounds (GtefFoldRegion *fold_region,
                             const GtkTextIter *start,
                             const GtkTextIter *end);

Sets the start and end of the GtefFoldRegion.

Parameters

fold_region

a GtefFoldRegion.

 

start

a GtkTextIter.

 

end

a GtkTextIter.

 

Since: 1.0

Types and Values

GtefFoldRegion

typedef struct _GtefFoldRegion GtefFoldRegion;

Property Details

The “buffer” property

  “buffer”                   GtkTextBuffer *

The GtkTextBuffer where the fold region is applied. The GtefFoldRegion object has a weak reference to the buffer.

Flags: Read / Write / Construct Only

Since: 1.0


The “folded” property

  “folded”                   gboolean

Whether the GtefFoldRegion is folded or not.

Flags: Read / Write

Default value: FALSE

Since: 1.0