GtkSourceFileBuffer
Object Hierarchy:
Description:
public class GtkSourceFileBuffer :
Buffer,
FileBuffer
GTK SourceView buffer implementation for GUI contexts.
Extends GtkSource.Buffer directly and provides FileBuffer interface. Provides syntax highlighting via GtkSource.Language, tracks file
modification time and auto-reloads if file changed on disk, and supports cursor position and text selection. Integrates with GTK
SourceView widgets.
When to Use
Use GtkSourceFileBuffer when:
- Working in GUI context (GTK application)
- Need syntax highlighting
- Need cursor position tracking
- Need text selection support
- Working with SourceView widgets
- Need auto-reload when file changes on disk
Content:
Properties:
- public File file { get; set; }
Reference to the file this buffer represents.
- public int indent_size { get; }
Number of spaces per indent level (0 if using tabs).
- public bool is_loaded { get; set; }
Whether the buffer has been loaded with file content.
- public bool is_modified { get; set; }
Whether the buffer has unsaved modifications.
- public int64 last_read_timestamp { get; set; }
Last read timestamp (Unix timestamp). Used to detect if file was
modified on disk since last read.
- public bool uses_tabs { get; }
Whether the file uses tabs for indentation.
Creation methods:
Methods:
- public async void apply_edit (FileChange change) throws Error
Apply a single edit to the buffer.
- public async void apply_edits (ArrayList<FileChange> changes) throws Error
Apply multiple edits to the buffer efficiently using GTK buffer
operations.
- public async void clear () throws Error
Clear buffer contents to empty.
- public void get_cursor (out int line, out int offset)
Get the current cursor position.
- public string get_line (int line)
Get the content of a specific line.
- public int get_line_count ()
Get the total number of lines in the buffer.
- public string get_selection (out int cursor_line, out int cursor_offset)
Get the currently selected text and cursor position.
- public string get_text (int start_line = 0, int end_line = -1)
Get text from buffer, optionally limited to a line range.
- public HashMap<int,string> locate (string needle, bool match_trimmed, bool case_sensitive)
- public async string read_async () throws Error
Read file contents asynchronously.
- public async void sync_to_file () throws Error
Sync buffer contents to file on disk.
- public async void write (string contents) throws Error
Write contents to buffer and file.
Inherited Members:
All known members inherited from class GtkSource.Buffer
- backward_iter_to_source_mark
- bracket_matched
- change_case
- create_source_mark
- cursor_moved
- ensure_highlight
- forward_iter_to_source_mark
- get_context_classes_at_iter
- get_highlight_matching_brackets
- get_highlight_syntax
- get_implicit_trailing_newline
- get_language
- get_loading
- get_source_marks_at_iter
- get_source_marks_at_line
- get_style_scheme
- highlight_matching_brackets
- highlight_syntax
- highlight_updated
- implicit_trailing_newline
- iter_backward_to_context_class_toggle
- iter_forward_to_context_class_toggle
- iter_has_context_class
- join_lines
- language
- loading
- remove_source_marks
- set_highlight_matching_brackets
- set_highlight_syntax
- set_implicit_trailing_newline
- set_language
- set_style_scheme
- sort_lines
- source_mark_updated
- style_scheme
All known members inherited from class Gtk.TextBuffer
- @delete
- add_mark
- add_selection_clipboard
- apply_tag
- apply_tag_by_name
- backspace
- begin_irreversible_action
- begin_user_action
- can_redo
- can_undo
- changed
- copy_clipboard
- create_child_anchor
- create_mark
- create_tag
- cursor_position
- cut_clipboard
- delete_interactive
- delete_mark
- delete_mark_by_name
- delete_range
- delete_selection
- enable_undo
- end_irreversible_action
- end_user_action
- get_bounds
- get_can_redo
- get_can_undo
- get_char_count
- get_enable_undo
- get_end_iter
- get_has_selection
- get_insert
- get_iter_at_child_anchor
- get_iter_at_line
- get_iter_at_line_index
- get_iter_at_line_offset
- get_iter_at_mark
- get_iter_at_offset
- get_line_count
- get_mark
- get_max_undo_levels
- get_modified
- get_selection_bound
- get_selection_bounds
- get_selection_content
- get_slice
- get_start_iter
- get_tag_table
- get_text
- has_selection
- insert
- insert_at_cursor
- insert_child_anchor
- insert_interactive
- insert_interactive_at_cursor
- insert_markup
- insert_paintable
- insert_range
- insert_range_interactive
- insert_text
- insert_with_tags
- insert_with_tags_by_name
- mark_deleted
- mark_set
- modified_changed
- move_mark
- move_mark_by_name
- paste_clipboard
- paste_done
- place_cursor
- redo
- remove_all_tags
- remove_selection_clipboard
- remove_tag
- remove_tag_by_name
- select_range
- set_enable_undo
- set_max_undo_levels
- set_modified
- set_text
- tag_table
- text
- undo
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface OLLMfiles.FileBuffer