Class: Clutter::TextBuffer
- Inherits:
-
Object
- Object
- Clutter::TextBuffer
- Defined in:
- lib/clutter/text-buffer.rb
Overview
The Clutter::TextBufferClass structure contains only private data.
Instance Method Summary collapse
-
#bytes ⇒ Integer
Retrieves the length in bytes of the buffer.
-
#delete_text(position, n_chars) ⇒ Integer
Deletes a sequence of characters from the buffer.
-
#emit_deleted_text(position, n_chars) ⇒ nil
Emits the Clutter::TextBuffer::deleted-text signal on buffer.
-
#emit_inserted_text(position, string) ⇒ nil
Emits the Clutter::TextBuffer::inserted-text signal on buffer.
-
#emit_inserted_text_raw ⇒ nil
Emits the Clutter::TextBuffer::inserted-text signal on buffer.
-
#initialize(text, text_len) ⇒ Clutter::TextBuffer
constructor
Create a new ClutterTextBuffer object with some text.
-
#insert_text(position, string) ⇒ Integer
Inserts n_chars characters of chars into the contents of the buffer, at position position.
-
#insert_text_raw ⇒ Integer
Inserts n_chars characters of chars into the contents of the buffer, at position position.
-
#length ⇒ Integer
The length (in characters) of the text in buffer.
-
#length=(length) ⇒ Integer
The length (in characters) of the text in buffer.
-
#max_length ⇒ Integer
The maximum length (in characters) of the text in the buffer.
-
#max_length=(max_length) ⇒ Integer
The maximum length (in characters) of the text in the buffer.
-
#set_text(string) ⇒ nil
(also: #text=)
Sets the text in the buffer.
-
#set_text_raw ⇒ nil
Sets the text in the buffer.
-
#text ⇒ String
The contents of the buffer.
Constructor Details
#initialize(text, text_len) ⇒ Clutter::TextBuffer
Create a new ClutterTextBuffer object with some text.
Instance Method Details
#bytes ⇒ Integer
Retrieves the length in bytes of the buffer. See clutter_text_buffer_get_length().
#delete_text(position, n_chars) ⇒ Integer
Deletes a sequence of characters from the buffer. n_chars characters are deleted starting at position. If n_chars is negative, then all characters until the end of the text are deleted.
If position or n_chars are out of bounds, then they are coerced to sane values.
Note that the positions are specified in characters, not bytes.
#emit_deleted_text(position, n_chars) ⇒ nil
Emits the Clutter::TextBuffer::deleted-text signal on buffer.
Used when subclassing Clutter::TextBuffer
#emit_inserted_text(position, string) ⇒ nil
Emits the Clutter::TextBuffer::inserted-text signal on buffer.
Used when subclassing Clutter::TextBuffer
32 33 34 |
# File 'lib/clutter/text-buffer.rb', line 32 def emit_inserted_text(position, string) emit_inserted_text_raw(position, string, string.length) end |
#emit_inserted_text_raw ⇒ nil
Emits the Clutter::TextBuffer::inserted-text signal on buffer.
Used when subclassing Clutter::TextBuffer
|
|
# File 'lib/clutter/text-buffer.rb', line 21
|
#insert_text(position, string) ⇒ Integer
Inserts n_chars characters of chars into the contents of the buffer, at position position.
If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.
Note that the position and length are in characters, not in bytes.
28 29 30 |
# File 'lib/clutter/text-buffer.rb', line 28 def insert_text(position, string) insert_text_raw(position, string, string.length) end |
#insert_text_raw ⇒ Integer
Inserts n_chars characters of chars into the contents of the buffer, at position position.
If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.
Note that the position and length are in characters, not in bytes.
|
|
# File 'lib/clutter/text-buffer.rb', line 20
|
#length ⇒ Integer
The length (in characters) of the text in buffer.
#length=(length) ⇒ Integer
The length (in characters) of the text in buffer.
#max_length ⇒ Integer
The maximum length (in characters) of the text in the buffer.
#max_length=(max_length) ⇒ Integer
The maximum length (in characters) of the text in the buffer.
#set_text(string) ⇒ nil Also known as: text=
Sets the text in the buffer.
This is roughly equivalent to calling clutter_text_buffer_delete_text() and clutter_text_buffer_insert_text().
Note that n_chars is in characters, not in bytes.
23 24 25 |
# File 'lib/clutter/text-buffer.rb', line 23 def set_text(string) set_text_raw(string, string.length) end |
#set_text_raw ⇒ nil
Sets the text in the buffer.
This is roughly equivalent to calling clutter_text_buffer_delete_text() and clutter_text_buffer_insert_text().
Note that n_chars is in characters, not in bytes.
|
|
# File 'lib/clutter/text-buffer.rb', line 19
|
#text ⇒ String
The contents of the buffer.