gtksourceview.SourceLanguage

gtksourceview.SourceLanguage — Source language object for gtksourceview.SourceView

Synopsis

class gtksourceview.SourceLanguage(gobject.GObject):
    gtksourceview.SourceLanguage()
def get_name()
def get_section()
def get_tags()
def get_escape_char()
def get_mime_types()
def set_mime_types(mime_types)
def get_style_scheme()
def set_style_scheme(style_scheme)
def get_tag_style()
def set_tag_style(tag_style)
def get_tag_default_style()

Ancestry

+-- gobject.GObject
  +-- gtksourceview.SourceLanguage

Signal Prototypes

""tag-style-changed"" def callback(sourcelanguage, arg1, user_param1, ...)

Description

Constructor

    gtksourceview.SourceLanguage()
Returns :a new gtksourceview.SourceLanguage.

Creates a new gtksourceview.SourceLanguage object.

Methods

gtksourceview.SourceLanguage.get_name

    def get_name()
Returns : the name of language.

The get_name() method returns the localized name of the language.

gtksourceview.SourceLanguage.get_section

    def get_section()
Returns : the section of language.

The get_section() method returns the localized section of the language. Each language belong to a section (ex. HTML belogs to the Markup section)

gtksourceview.SourceLanguage.get_tags

    def get_tags()
Returns : a list of gtksourceview.SourceTagStyle objects.

The get_tags() method Returns a list of tags for the given language. You should unref the tags and free the list after usage.

gtksourceview.SourceLanguage.get_escape_char

    def get_escape_char()
Returns : the value of the ESC character.

The get_escape_char() method gets the value of the ESC character in the given language.

gtksourceview.SourceLanguage.get_mime_types

    def get_mime_types()
Returns : a list of mime types (strings).

The get_mime_types() method returns a list of mime types for the given language. After usage you should free each element of the list as well as the list itself.

gtksourceview.SourceLanguage.set_mime_types

    def set_mime_types(mime_types)
mime_types : a list of mime types (strings).

The set_mime_types() method sets a list of mime_types for the given language. If mime_types is None this function will use the default mime types from the language file.

gtksourceview.SourceLanguage.get_style_scheme

    def get_style_scheme()
Returns : a gtksourceview.SourceStyleScheme.

The get_style_scheme() method gets the style scheme associated with the given language.

gtksourceview.SourceLanguage.set_style_scheme

    def set_style_scheme(style_scheme)
style_scheme : a gtksourceview.SourceStyleScheme.

The set_style_scheme() method Sets the style scheme of the given language.

gtksourceview.SourceLanguage.get_tag_style

    def get_tag_style(tag_id)
tag_id : the ID of a gtksourceview.SourceTag.
Returns : a gtksourceview.SourceTagStyle.

The get_tag_style() method gets the style of the tag whose ID is tag_id. If the style is not defined then returns the default style.

gtksourceview.SourceLanguage.set_style_scheme

    def set_tag_style(tag_id, style)
tag_id : the ID of a gtksourceview.SourceTag.
style : a gtksourceview.SourceTagStyle.

The set_tag_style() method sets the style of the tag whose ID is tag_id. If style is None restore the default style.

gtksourceview.SourceLanguage.get_tag_default_style

    def get_tag_default_style(tag_id)
tag_id : the ID of a gtksourceview.SourceTag.
Returns : a gtksourceview.SourceTagStyle.

The get_tag_default_style() method gets the default style of the tag whose ID is tag_id.

Signals

The "tag-style-changed" gtksourceview.SourceLanguage Signal

    def callback(sourcelanguage, arg1, user_param1, ...)
sourcelanguage :the sourcelanguage that received the signal
arg1 :
user_param1 :the first user parameter (if any) specified with the connect() method
... :additional user parameters (if any)

The "tag-style-changed" signal is emitted when ....