Module: GtkSource
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtksourceview4/loader.rb,
lib/gtksourceview4.rb,
lib/gtksourceview4/deprecated.rb,
lib/gtksourceview4/mark-attributes.rb
Overview
Copyright (C) 2015 Ruby-GNOME2 Project Team
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Defined Under Namespace
Modules: BackgroundPatternType, BracketMatchType, ChangeCaseType, CompletionActivation, CompletionColumn, CompletionProposal, CompletionProvider, CompressionType, FileLoaderError, FileSaverError, FileSaverFlags, GutterRendererAlignmentMode, HoverProvider, Indenter, NewlineType, SmartHomeEndType, SortFlags, SpaceLocationFlags, SpaceTypeFlags, StyleSchemeChooser, ViewGutterPosition Classes: Buffer, Completion, CompletionCell, CompletionContext, CompletionSnippets, CompletionWords, Error, File, FileLoader, FileSaver, Gutter, GutterLines, GutterRenderer, GutterRendererPixbuf, GutterRendererText, Hover, HoverContext, HoverDisplay, Language, LanguageManager, Loader, Map, Mark, MarkAttributes, PrintCompositor, Region, SearchContext, SearchSettings, Snippet, SnippetChunk, SnippetContext, SnippetManager, SpaceDrawer, Style, StyleScheme, StyleSchemeChooserButton, StyleSchemeChooserWidget, StyleSchemeManager, StyleSchemePreview, Tag, View, VimIMContext
Constant Summary collapse
- MAJOR_VERSION =
Like gtk_source_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
5- MICRO_VERSION =
Like gtk_source_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
0- MINOR_VERSION =
Like gtk_source_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.
12- LOG_DOMAIN =
"GtkSource"
Class Method Summary collapse
Instance Method Summary collapse
-
#check_version(major, minor, micro) ⇒ Boolean
Like GTK_SOURCE_CHECK_VERSION, but the check for gtk_source_check_version is at runtime instead of compile time.
-
#encoding_get_all ⇒ GLib::SList<GtkSource::Encoding>
Gets all encodings.
-
#encoding_get_current ⇒ GtkSource::Encoding
Gets the Gtk::SourceEncoding for the current locale.
-
#encoding_get_default_candidates ⇒ GLib::SList<GtkSource::Encoding>
Gets the list of default candidate encodings to try when loading a file.
-
#encoding_get_from_charset(charset) ⇒ GtkSource::Encoding
Gets a Gtk::SourceEncoding from a character set such as "UTF-8" or "ISO-8859-1".
-
#encoding_get_utf8 ⇒ GtkSource::Encoding
The UTF-8 encoding.
- #file_loader_error_quark ⇒ GLib::Quark
- #file_saver_error_quark ⇒ GLib::Quark
-
#finalize ⇒ nil
Free the resources allocated by GtkSourceView.
-
#init ⇒ nil
Initializes the GtkSourceView library (e.g. for the internationalization).
-
#major_version ⇒ Integer
Returns the major version number of the GtkSourceView library.
-
#micro_version ⇒ Integer
Returns the micro version number of the GtkSourceView library.
-
#minor_version ⇒ Integer
Returns the minor version number of the GtkSourceView library.
-
#scheduler_add(callback, user_data) ⇒ Integer
Simplified version of [funcscheduler_add_full].
-
#scheduler_add_full(callback, user_data, notify) ⇒ Integer
Adds a new callback that will be executed as time permits on the main thread.
-
#scheduler_remove(handler_id) ⇒ nil
Removes a scheduler callback previously registered with [funcscheduler_add] or [funcscheduler_add_full].
-
#utils_escape_search_text(text) ⇒ String
Use this function to escape the following characters:
\n,\r,\tand\. -
#utils_unescape_search_text(text) ⇒ String
Use this function before [methodSearchSettings.set_search_text], to unescape the following sequences of characters:
\n,\r,\tand\\.
Class Method Details
.const_missing(name) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/gtksourceview4.rb', line 29 def const_missing(name) init if const_defined?(name) const_get(name) else super end end |
Instance Method Details
#check_version(major, minor, micro) ⇒ Boolean
Like GTK_SOURCE_CHECK_VERSION, but the check for gtk_source_check_version is at runtime instead of compile time. This is useful for compiling against older versions of GtkSourceView, but using features from newer versions. is the same as or newer than the passed-in version.
#encoding_get_all ⇒ GLib::SList<GtkSource::Encoding>
Gets all encodings. all Gtk::SourceEncoding's. Free with g_slist_free().
#encoding_get_current ⇒ GtkSource::Encoding
Gets the Gtk::SourceEncoding for the current locale.
See also [funcGLib.get_charset].
#encoding_get_default_candidates ⇒ GLib::SList<GtkSource::Encoding>
Gets the list of default candidate encodings to try when loading a file.
See [methodFileLoader.set_candidate_encodings].
This function returns a different list depending on the current locale (i.e. language, country and default encoding). The UTF-8 encoding and the current locale encoding are guaranteed to be present in the returned list. default candidate encodings. Free with g_slist_free().
#encoding_get_from_charset(charset) ⇒ GtkSource::Encoding
Gets a Gtk::SourceEncoding from a character set such as "UTF-8" or "ISO-8859-1". if not found.
#encoding_get_utf8 ⇒ GtkSource::Encoding
Returns the UTF-8 encoding.
#file_loader_error_quark ⇒ GLib::Quark
#file_saver_error_quark ⇒ GLib::Quark
#finalize ⇒ nil
Free the resources allocated by GtkSourceView. For example it unrefs the singleton objects.
It is not mandatory to call this function, it's just to be friendlier to memory debugging tools. This function is meant to be called at the end of main(). It can be called several times.
#init ⇒ nil
Initializes the GtkSourceView library (e.g. for the internationalization).
This function can be called several times, but is meant to be called at the beginning of main(), before any other GtkSourceView function call.
#major_version ⇒ Integer
Returns the major version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 3.)
This function is in the library, so it represents the GtkSourceView library your code is running against. Contrast with the #GTK_SOURCE_MAJOR_VERSION macro, which represents the major version of the GtkSourceView headers you have included when compiling your code.
#micro_version ⇒ Integer
Returns the micro version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 0.)
This function is in the library, so it represents the GtkSourceView library your code is running against. Contrast with the #GTK_SOURCE_MICRO_VERSION macro, which represents the micro version of the GtkSourceView headers you have included when compiling your code.
#minor_version ⇒ Integer
Returns the minor version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 20.)
This function is in the library, so it represents the GtkSourceView library your code is running against. Contrast with the #GTK_SOURCE_MINOR_VERSION macro, which represents the minor version of the GtkSourceView headers you have included when compiling your code.
#scheduler_add(callback, user_data) ⇒ Integer
Simplified version of [funcscheduler_add_full].
#scheduler_add_full(callback, user_data, notify) ⇒ Integer
Adds a new callback that will be executed as time permits on the main thread.
This is useful when you need to do a lot of background work but want to do it incrementally.
callback will be provided a deadline that it should complete it's work by (or near) and can be checked using [funcGLib.get_monotonic_time] for comparison.
Use [funcscheduler_remove] to remove the handler.
#scheduler_remove(handler_id) ⇒ nil
Removes a scheduler callback previously registered with [funcscheduler_add] or [funcscheduler_add_full].
#utils_escape_search_text(text) ⇒ String
Use this function to escape the following characters: \n, \r, \t and \.
For a regular expression search, use g_regex_escape_string() instead.
One possible use case is to take the Gtk::TextBuffer's selection and put it in a search entry. The selection can contain tabulations, newlines, etc. So it's better to escape those special characters to better fit in the search entry.
See also: [funcutils_unescape_search_text].
#utils_unescape_search_text(text) ⇒ String
Use this function before [methodSearchSettings.set_search_text], to
unescape the following sequences of characters: \n, \r, \t and \\.
The purpose is to easily write those characters in a search entry.
Note that unescaping the search text is not needed for regular expression searches.
See also: [funcutils_escape_search_text].