[ruby-gnome2-doc-cvs] [Hiki] create - Gtk::SourceBuffer

アーカイブの一覧に戻る

ruby-****@sourc***** ruby-****@sourc*****
2004年 5月 16日 (日) 01:29:08 JST


-------------------------
REMOTE_ADDR = 217.117.55.140
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp//?Gtk%3A%3ASourceBuffer
-------------------------
= class Gtk::SourceBuffer
Text buffer object for Gtk::SourceView.

== Object Hierarchy
* Object
  * GLib::Instantiatable
    * GLib::Object
      * Gtk::TextBuffer
        * Gtk::SourceBuffer

== Class Methods
--- 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: either a Gtk::SourceTagTable, a Gtk::SourceLanguage, or nil.   
    * Returns: a newly created Gtk::SourceBuffer object.

== Instance Methods
--- 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.

--- can_undo?
    Determines whether a source buffer can undo the last action.
    * Returns: whether it's possible to undo the last action.

--- create_marker(name, type, where)
    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)
    Deletes a marker from the source buffer. The same conditions as for
    Gtk::TextMark apply here.
    * marker: a Gtk::SourceMarker object in the buffer.  
    * Returns: self.

--- 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)
    Initializes iter at the location of marker.
    * iter: a Gtk::TextIter to initialize. 
    * marker: a Gtk::SourceMarker of the buffer.  
    * Returns: self.

--- get_marker(name)
    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.
    * begin: beginning of the range, as a Gtk::TextIter object. 
    * end: end of the range, as a Gtk::TextIter object.  
    * Returns: an array of Gtk::SourceMarker objects inside the range.

--- 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)
    Moves a marker to a new location in the buffer.
    * where: the new location of the marker, as a Gtk::TreeIter object.  
    * marker: a Gtk::SourceMarker object in the buffer. 
    * Returns: self.

--- non_undoable_action { ... }
    Synonym for Gtk::SourceBuffer#not_undoable_action.
    * Returns: the return value of the provided block.

--- 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.
    * 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.
    * style: the Gtk::SourceTagStyle specifying colors and text attributes.  
    * Returns: self.

--- 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.

== Properties
--- 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.

== Signals
--- can-redo

--- can-undo

--- highlight-updated

--- marker-updated

== See Also
((<Gtk>)).

- ((<lrz>))






ruby-gnome2-cvs メーリングリストの案内
アーカイブの一覧に戻る