新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::SourceBuffer

Gtk::SourceBuffer クラス

Gtk::SourceView用のテキストバッファ

クラスメソッド

Gtk::SourceBuffer.new(obj=nil)

Creates a new source buffer. If a Gtk::SourceTagTable is provided, the buffer will use it, otherwise it will create a new one. If a Gtk::SourceLanguage object is given, the buffer will be created using highlightings patterns in this language. This is equivalent to creating a new source buffer with the default tag table and then setting the 'language' property.

 新しいバッファオブジェクトを作成します。

 objがGtk::TextTagTableオブジェクトの場合、作成されたバッファでそれが使用され、Gtk::TextTagTableオブジェクトでなかった場合は、新しいGtk::TextTagTableオブジェクトが作成されます。

 objがGtk::SourceLanguageオブジェクトの場合、作成されたバッファオブジェクトでその言語のハイライトパターンが使用されます。これは引数なしでこのメソッドを実行し、後からlanguageプロパティを設定するのと同じです。

インスタンスメソッド

bracket_match_style=(style)

存在しない?

Sets the style used for highlighting matching brackets.

  • style: the Gtk::SourceTagStyle specifying colors and text attributes.
  • Returns: the given parameter 'style'.
can_redo?

Determines whether a source buffer can redo the last action (i.e. if the last operation was an undo).

  • Returns: whether a redo is possible.

 Redo(やり直し)が可能かどうか(=直前の操作がUndo(元に戻す)かどうか)を返します。

  • 戻り値: Redo(やり直し)が可能かどうかの真偽値
can_undo?

Determines whether a source buffer can undo the last action.

  • Returns: whether it's possible to undo the last action.

 直前の操作をUndoする(元に戻す)ことができるかどうかを返します。

  • 戻り値: 直前の操作をUndoする(元に戻す)ことができるかどうかの真偽値
create_marker(name=nil, type=nil, where)(存在しない。ただしTextBufferから継承したメソッドとしてcreate_markあり)

存在しない?

Creates a marker in the buffer of the given type. A marker is semantically very similar to a Gtk::TextMark, except it has a type which is used by the Gtk::SourceView object displaying the buffer to show a pixmap on the left margin, at the line the marker is in. Because of this, a marker is generally associated to a line and not a character position. Markers are also accessible through a position or range in the buffer. Markers are implemented using Gtk::TextMark, so all characteristics and restrictions to marks apply to markers too. These includes life cycle issues and "mark-set" and "mark-deleted" signal emissions. Like a Gtk::TextMark, a Gtk::SourceMarker can be anonymous if the passed name is nil. Markers always have left gravity and are moved to the beginning of the line when the user deletes the line they were in. Also, if the user deletes a region of text which contained lines with markers, those are deleted. Typical uses for a marker are bookmarks, breakpoints, current executing instruction indication in a source file, etc..

  • where: a location to place the marker, as a Gtk::TreeIter object.
  • name: the name of the marker.
  • type: a string defining the marker type.
  • Returns: a new Gtk::SourceMarker object, owned by the buffer.
delete_marker(marker)(存在しない。ただしTextBufferから継承したメソッドとしてdelete_markあり)

存在しない?

Deletes a marker from the source buffer. The same conditions as for Gtk::TextMark apply here.

first_marker

存在しない?

Gets the first (nearest to the top of the buffer) marker in the buffer.

  • Returns: a reference to the first Gtk::SourceMarker, or nil if there are no markers in the buffer.
get_iter_at_marker(iter, marker)(存在しない。ただしTextBufferから継承したメソッドとしてget_iter_at_markあり)

存在しない?

Initializes iter at the location of marker.

get_marker(name)(存在しない。ただしTextBufferから継承したメソッドとしてget_markあり)

存在しない?

Looks up the Gtk::SourceMarker named name in buffer, returning nil if it doesn't exists.

  • name: the name of the marker to retrieve.
  • Returns: a reference to a Gtk::SourceMarker object, or nil if it's not found.
get_markers(begin, end)

存在しない?

Returns an ordered (by position) list of Gtk::SourceMarker objects inside the region delimited by the Gtk::TextIter begin and end. The iters may be in any order.

get_next_marker(iter)

存在しない?

Returns the nearest marker to the right of iter. If there are multiple markers at the same position, this method will always return the first one (from the internal linked list), even if starting the search exactly at its location. You can get the others using Gtk::SourceMarker#next.

  • iter: the location to search from, as a Gtk::TextIter object.
  • Returns: the Gtk::SourceMarker nearest to the right of iter, or nil if there are no more markers after iter.
get_prev_marker(iter)

存在しない?

Returns the nearest marker to the left of iter. If there are multiple markers at the same position, this method will always return the last one (from the internal linked list), even if starting the search exactly at its location. You can get the others using Gtk::SourceMarker#next.

  • iter: the location to search from, as a Gtk::TextIter object.
  • Returns: the Gtk::SourceMarker nearest to the left of iter, or nil if there are no more markers after iter.
last_marker

存在しない?

Returns the last (nearest to the bottom of the buffer) marker in buffer.

  • Returns: a reference to the first Gtk::SourceMarker, or nil if there are no markers in the buffer.
move_marker(marker, where)(存在しない。ただしTextBufferから継承したメソッドとしてmove_markあり)

存在しない?

Moves a marker to a new location in the buffer.

non_undoable_action { ... }

Synonym for Gtk::SourceBuffer#not_undoable_action.

  • Returns: the return value of the provided block.

 Gtk::SourceBuffer#not_undoable_actionと同じです。

  • 戻り値: 与えられたブロックの戻り値
begin_not_undoable_action
begin_not_undoable_action { ... }
Marks the beginning of a not undoable action on the buffer, disabling the undo manager. If a block is given, the block is called after marking the beginning of a not undoable action on the buffer. At the end of the block, marks the end of a not undoable action on the buffer. When the last not undoable block is finished, the list of undo actions is cleared and the undo manager is re-enabled.
  • Returns: self
end_not_undoable_action
Marks the end of a not undoable action on the buffer. When the last not undoable block is finished, the list of undo actions is cleared and the undo manager is re-enabled.
  • Returns: self
not_undoable_action { ... }
Marks the beginning of a not undoable action on the buffer, disabling the undo manager, then calls the provided block of code. At the end of the block, marks the end of a not undoable action on the buffer. When the last not undoable block is finished, the list of undo actions is cleared and the undo manager is re-enabled. Deprecated Use begin_not_undoable_action instead.
  • Returns: the return value of the provided block.
redo!
Redoes the last undo operation. Use Gtk::SourceBuffer#can_redo? to check whether a call to this function will have any effect.
  • Returns: self.
set_bracket_match_style(style)

存在しない?

Sets the style used for highlighting matching brackets.

undo!
Undoes the last user action which modified the buffer. Use Gtk::SourceBuffer#can_undo? to check whether a call to this function will have any effect. Actions are defined as groups of operations between a call to Gtk::TextBuffer#begin_user_action and Gtk::TextBuffer#end_user_action, or sequences of similar edits (inserts or deletes) on the same line.
  • Returns: self.
check_brackets=(check_brackets)

存在しない?

Sets the value whether to check and highlight matching brackets or not.

  • check_brackets: true if to check and highlight matching brackets
  • Returns: check_brackets
check_brackets?

存在しない?

Gets the value whether to check and highlight matching brackets or not.

  • Returns: true if to check and highlight matching brackets
escape_char

存在しない?

Gets the Escaping character for syntax patterns.

  • Returns: Escaping character for syntax patterns
escape_char=(escape_char)

存在しない?

Sets the Escaping character for syntax patterns.

  • escape_char: Escaping character for syntax patterns
  • Returns: escape_char
highlight=(highlight)

存在しない?

Sets the value whether to highlight syntax in the buffer or not.

  • highlight: true if to highlight syntax in the buffer
  • Returns: highlight
highlight?

存在しない?

Gets the value whether to highlight syntax in the buffer or not.

  • Returns: true if to highlight syntax in the buffer
language
Gets the Language object to get highlighting patterns from.
  • Returns: Language object to get highlighting patterns from
language=(language)
Sets the Language object to get highlighting patterns from.
  • language: Language object to get highlighting patterns from
  • Returns: language
max_undo_levels
Gets the Number of undo levels for the buffer.
  • Returns: Number of undo levels for the buffer
max_undo_levels=(max_undo_levels)
Sets the Number of undo levels for the buffer.
  • max_undo_levels: Number of undo levels for the buffer
  • Returns: max_undo_levels
set_check_brackets(check_brackets)

存在しない?

Same as check_brackets=.

  • check_brackets: true if to check and highlight matching brackets
  • Returns: self
set_escape_char(escape_char)

存在しない?

Same as escape_char=.

  • escape_char: Escaping character for syntax patterns
  • Returns: self
set_highlight(highlight)

存在しない?

Same as highlight=.

  • highlight: true if to highlight syntax in the buffer
  • Returns: self
set_language(language)
Same as language=.
  • language: Language object to get highlighting patterns from
  • Returns: self
set_max_undo_levels(max_undo_levels)
Same as max_undo_levels=.
  • max_undo_levels: Number of undo levels for the buffer
  • Returns: self
backward_iter_to_source_mark
  • Returns: self: FIXME
create_source_mark
  • Returns: self: FIXME
ensure_highlight
  • Returns: self: FIXME
forward_iter_to_source_mark
  • Returns: self: FIXME
get_source_marks_at_iter
  • Returns: self: FIXME
get_source_marks_at_line
  • Returns: self: FIXME
highlight_matching_brackets=(highlight_matching_brackets)
Sets the value whether to highlight matching brackets or not.
  • highlight_matching_brackets: true if to highlight matching brackets
  • Returns: highlight_matching_brackets
highlight_matching_brackets?
Gets the value whether to highlight matching brackets or not.
  • Returns: true if to highlight matching brackets
highlight_syntax=(highlight_syntax)
Sets the value whether to highlight syntax in the buffer or not.
  • highlight_syntax: true if to highlight syntax in the buffer
  • Returns: highlight_syntax
highlight_syntax?
Gets the value whether to highlight syntax in the buffer or not.
  • Returns: true if to highlight syntax in the buffer
remove_source_marks
  • Returns: self: FIXME
set_highlight_matching_brackets(highlight_matching_brackets)
Same as highlight_matching_brackets=.
  • highlight_matching_brackets: true if to highlight matching brackets
  • Returns: self
set_highlight_syntax(highlight_syntax)
Same as highlight_syntax=.
  • highlight_syntax: true if to highlight syntax in the buffer
  • Returns: self
set_style_scheme(style_scheme)
Same as style_scheme=.
  • style_scheme: Style scheme
  • Returns: self
set_undo_manager(undo_manager)
Same as undo_manager=.
  • undo_manager: The buffer undo manager
  • Returns: self
style_scheme
Gets the Style scheme.
  • Returns: Style scheme
style_scheme=(style_scheme)
Sets the Style scheme.
  • style_scheme: Style scheme
  • Returns: style_scheme
undo_manager
Gets the buffer undo manager.
  • Returns: The buffer undo manager
undo_manager=(undo_manager)
Sets the buffer undo manager.
  • undo_manager: The buffer undo manager
  • Returns: undo_manager

プロパティ

check-brackets: true or false (Read/Write)

存在しない?

Whether to check and highlight matching brackets.

escape-char: Integer (Read/Write)

存在しない?

Escaping character for syntax patterns.

highlight: true or false (Read/Write)

存在しない?

Whether to highlight syntax in the buffer.

language: Gtk::SourceLanguage (Read/Write)
Language object to get highlighting patterns from.
max-undo-levels: Integer (Read/Write)
Number of undo levels for the buffer.
can-redo: true or false (Read)
Whether Redo operation is possible
can-undo: true or false (Read)
Whether Undo operation is possible
highlight-matching-brackets: true or false (Read/Write)
Whether to highlight matching brackets
highlight-syntax: true or false (Read/Write)
Whether to highlight syntax in the buffer
style-scheme: Gtk::SourceStyleScheme (Read/Write)
Style scheme
undo-manager: Gtk::SourceUndoManager (Read/Write)

無名のクラスとして存在?

The buffer undo manager

シグナル

can-redo
存在しない?
can-undo
存在しない?
highlight-updated
marker-updated
存在しない?
redo: self
source-mark-updated: self
undo: self

更新履歴

  • 2014-06-14 クラスのメンバ項目の存在チェック("存在しない?"とマーク)。 - きたがわ
  • 2014-05-11 メソッド、プロパティの存在チェック。 - きたがわ
  • 2014-05-08 現在の英語版で上書き
  • lrz?
更新日時:2014/06/14 19:46:41
キーワード:
参照:[Ruby/GTK] [Gtk::SourceBuffer] [Ruby/GtkSourceView] [Gtk::SourceView] [Gtk::SourceMarker]