Creates a new source buffer.
a new source buffer.
a #GtkTextTagTable, or %NULL to create a new one.
Creates a new source buffer using the highlighting patterns in
a new tag table and then calling gtk_source_buffer_set_language().
according to the highlighting patterns in @language.
a new source buffer which will highlight text
a #GtkSourceLanguage.
Determines whether syntax highlighting is activated in the source
buffer.
%TRUE if syntax highlighting is enabled, %FALSE otherwise.
Controls whether syntax is highlighted in the buffer. If @highlight
is %TRUE, the text will be highlighted according to the syntax
patterns specified in the language set with
gtk_source_buffer_set_language(). If @highlight is %FALSE, syntax highlighting
is disabled and all the GtkTextTag objects that have been added by the
syntax highlighting engine are removed from the buffer.
%TRUE to enable syntax highlighting, %FALSE to disable it.
Determines whether bracket match highlighting is activated for the
source buffer.
brackets.
%TRUE if the source buffer will highlight matching
Controls the bracket match highlighting function in the buffer. If
activated, when you position your cursor over a bracket character
(a parenthesis, a square bracket, etc.) the matching opening or
closing bracket character will be highlighted. You can specify the
style with the gtk_source_buffer_set_bracket_match_style()
function.
%TRUE if you want matching brackets highlighted.
Determines the number of undo levels the buffer will track for
buffer edits.
-1 if no limit is set.
the maximum number of possible undo levels or
Sets the number of undo levels for user actions the buffer will
track. If the number of user actions exceeds the limit set by this
function, older actions will be discarded.
If @max_undo_levels is -1, no limit is set.
A new action is started whenever the function
gtk_text_buffer_begin_user_action() is called. In general, this
happens whenever the user presses any key which modifies the
buffer, but the undo manager will try to merge similar consecutive
actions, such as multiple character insertions into one action.
But, inserting a newline does start a new action.
the desired maximum number of undo levels.
Returns the #GtkSourceLanguage associated with the buffer,
see gtk_source_buffer_set_language(). The returned object should not be
unreferenced by the user.
#GtkSourceLanguage associated with the buffer, or %NULL.
Associate a #GtkSourceLanguage with the source buffer. If @language is
not-%NULL and syntax highlighting is enabled (see gtk_source_buffer_set_highlight_syntax()),
the syntax patterns defined in @language will be used to highlight the text
contained in the buffer. If @language is %NULL, the text contained in the
buffer is not highlighted.
The buffer holds a reference to @language.
a #GtkSourceLanguage to set, or %NULL.
Determines whether a source buffer can undo the last action.
%TRUE if it's possible to undo the last action.
Determines whether a source buffer can redo the last action
(i.e. if the last operation was an undo).
%TRUE if a redo is possible.
Returns the #GtkSourceStyleScheme currently used in @buffer.
gtk_source_buffer_set_style_scheme(), or %NULL.
the #GtkSourceStyleScheme set by
Sets style scheme used by the buffer. If @scheme is %NULL no
style scheme is used.
style scheme.
Forces buffer to analyze and highlight the given area synchronously.
<note>
<para>
This is a potentially slow operation and should be used only
when you need to make sure that some text not currently
visible is highlighted, for instance before printing.
</para>
</note>
start of the area to highlight.
end of the area to highlight.
Undoes the last user action which modified the buffer. Use
gtk_source_buffer_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_text_buffer_begin_user_action() and
gtk_text_buffer_end_user_action(), or sequences of similar edits
(inserts or deletes) on the same line.
Redoes the last undo operation. Use gtk_source_buffer_can_redo()
to check whether a call to this function will have any effect.
Marks the beginning of a not undoable action on the buffer,
disabling the undo manager. Typically you would call this function
before initially setting the contents of the buffer (e.g. when
loading a file in a text editor).
You may nest gtk_source_buffer_begin_not_undoable_action() /
gtk_source_buffer_end_not_undoable_action() blocks.
Marks the end of a not undoable action on the buffer. When the
last not undoable block is closed through the call to this
function, the list of undo actions is cleared and the undo manager
is re-enabled.
Creates a source mark in the @buffer of category @category. A source mark is
a #GtkTextMark but organised into categories. Depending on the category
a pixbuf can be specified that will be displayed along the line of the mark.
Like a #GtkTextMark, a #GtkSourceMark can be anonymous if the
passed @name is %NULL. Also, the buffer owns the marks so you
shouldn't unreference it.
Marks always have left gravity and are moved to the beginning of
the line when the user deletes the line they were in.
Typical uses for a source mark are bookmarks, breakpoints, current
executing instruction indication in a source file, etc..
a new #GtkSourceMark, owned by the buffer.
the name of the mark, or %NULL.
a string defining the mark category.
location to place the mark.
Moves @iter to the position of the next #GtkSourceMark of the given
next source mark can be of any category.
whether iter moved.
an iterator.
category to search for or %NULL
Moves @iter to the position of the previous #GtkSourceMark of the given
category. Returns #TRUE if @iter was moved. If @category is NULL, the
previous source mark can be of any category.
whether iter moved.
an iterator.
category to search for or %NULL
Returns the list of marks of the given category at @iter. If @category
is %NULL it returns all marks at @iter.
a newly allocated #GSList.
an iterator.
category to search for or %NULL
Returns the list of marks of the given category at @line.
If @category is NULL, all marks at @line are returned.
a newly allocated #GSList.
a line number.
category to search for or %NULL
Remove all marks of @category between @start and @end from the buffer.
If @category is NULL, all marks in the range will be removed.
a #GtkTextIter
a #GtkTextIter
category to search for or NULL
Check if the class @context_klass is set on @iter.
a #GtkTextIter
class to search for
Get all defined context classes at @iter.
#g_strfreev to free the array if it is no longer needed.
a new %NULL terminated array of context class names. Use
a #GtkTextIter
Moves forward to the next toggle (on or off) of the context class. If no
matching context class toggles are found, returns %FALSE, otherwise %TRUE.
Does not return toggles located at @iter, only toggles after @iter. Sets
toggle is found.
whether we found a context class toggle after @iter
a #GtkTextIter
the context class
Moves backward to the next toggle (on or off) of the context class. If no
matching context class toggles are found, returns %FALSE, otherwise %TRUE.
Does not return toggles located at @iter, only toggles after @iter. Sets
toggle is found.
whether we found a context class toggle before @iter
a #GtkTextIter
the context class
Get the undo manager associated with the buffer.
A #GtkSourceUndoManager
Set the buffer undo manager. If @manager is %NULL the default undo manager
will be set.
A #GtkSourceUndoManager
Create a new #GtkSourceCompletion associated with @view.
The new #GtkSourceCompletion.
A separator is a character like (, an space etc. An _ is not a separator
TRUE if @ch is a separator
The character to check
the current word
The #GtkSourceBuffer
if != NULL then assign it the start position of the word
if != NULL then assing it the end position of the word
the current word
Replaces the current word in the #GtkSourceBuffer with the new word
The #GtkSourceBuffer
The text to be inserted instead of the current word
the #GtkWindow to move
the view
the iter to move @window to
Add a new #GtkSourceCompletionProvider to the completion object. This will
add a reference @provider, so make sure to unref your own copy when you
no longer need it.
is provided, it will be set with the error and %FALSE is returned.
%TRUE if @provider was successfully added, otherwise if @error
A #GtkSourceCompletionProvider
Remove @provider from the completion.
is provided, it will be set with the error and %FALSE is returned.
%TRUE if @provider was successfully removed, otherwise if @error
A #GtkSourceCompletionProvider
Get list of providers registered on @completion. The returned list is owned
by the completion and should not be freed.
list of #GtkSourceCompletionProvider
Starts a new completion with the specified #GtkSourceCompletionContext and
a list of potential candidate providers for completion.
%TRUE if it was possible to the show completion window.
A list of #GtkSourceCompletionProvider or %NULL
The #GtkSourceCompletionContext with which to start the completion
Hides the completion if it is active (visible).
The info widget is the window where the completion displays optional extra
information of the proposal.
The #GtkSourceCompletionInfo window.
The #GtkSourceView associated with @completion.
The #GtkSourceView associated with @completion.
Create a new #GtkSourceCompletionContext for @completion. The position at
which the completion using the new context will consider completion can
be provider by @position. If @position is %NULL, the current cursor
position will be used.
is a 'floating' reference, so if you invoke #gtk_source_completion_show
with this context you don't need to unref it.
a new #GtkSourceCompletionContext. The reference being returned
A #GtkTextIter
Move the completion window to a specific iter.
A #GtkTextIter
Block interactive completion. This can be used to disable interactive
completion when inserting or deleting text from the buffer associated with
the completion. Use #gtk_source_completion_unblock_interactive to enable
interactive completion again.
Unblock interactive completion. This can be used after using
#gtk_source_completion_block_interactive to enable interactive completion
again.
Providers can use this function to add proposals to the completion. They
can do so asynchronously by means of the @finished argument. Providers must
ensure that they always call this function with @finished set to %TRUE
once each population (even if no proposals need to be added).
A #GtkSourceCompletionProvider
The list of proposals to add
Whether the provider is finished adding proposals
Get the iter at which the completion was invoked. Providers can use this
to determine how and if to match proposals.
A #GtkTextIter
Get the context activation
The context activation
The new GtkSourceCompletionInfo.
Moves the #GtkSourceCompletionInfo to @iter. If @iter is %NULL @info is
moved to the cursor position. Moving will respect the #GdkGravity setting
of the info window and will ensure the line at @iter is not occluded by
the window.
A #GtkTextView on which the info window should be positioned
A #GtkTextIter
Set sizing information for the info window. If @shrink_width or
window contents, with a maximum size given by @width and @height. Setting
and height of the window.
The maximum/requested width of the window (-1 to default)
The maximum/requested height of the window (-1 to default)
Whether to shrink the width of the window to fit its contents
Whether to shrink the height of the window to fit its contents
Sets the content widget of the info window. If @widget does not fit within
the size requirements of the window, a #GtkScrolledWindow will automatically
be created and added to the window.
A #GtkWidget
Get the current content widget.
The current content widget.
Gets the label of @proposal. The label is shown in the list of proposals as
plain text. If you need any markup (such as bold or italic text), you have
to implement #gtk_source_completion_proposal_get_markup. The returned string
must be freed with g_free().
A new string containing the label of @proposal.
Gets the label of @proposal with markup. The label is shown in the list of
proposals and may contain markup. This will be used instead of
#gtk_source_completion_proposal_get_label if implemented. The returned string
must be freed with g_free().
A new string containing the label of @proposal with markup.
Gets the text of @proposal. The text that is inserted into
the text buffer when the proposal is activated by the default activation.
You are free to implement a custom activation handler in the provider and
not implement this function. The returned string must be freed with g_free().
A new string containing the text of @proposal.
Gets the icon of @proposal.
The icon of @proposal.
Gets extra information associated to the proposal. This information will be
used to present the user with extra, detailed information about the
selected proposal. The returned string must be freed with g_free().
no extra information is associated to @proposal.
A new string containing extra information of @proposal or %NULL if
Get the hash value of @proposal. This is used to (together with
#gtk_source_completion_proposal_equal) to match proposals in the completion
model. By default, it uses a direct hash (#g_direct_hash).
The hash value of @proposal
Get whether two proposal objects are the same. This is used to (together
with #gtk_source_completion_proposal_hash) to match proposals in the
completion model. By default, it uses direct equality (#g_direct_equal).
%TRUE if @proposal and @object are the same proposal
A #GtkSourceCompletionProposal
Gets the label of @proposal. The label is shown in the list of proposals as
plain text. If you need any markup (such as bold or italic text), you have
to implement #gtk_source_completion_proposal_get_markup. The returned string
must be freed with g_free().
A new string containing the label of @proposal.
Gets the label of @proposal with markup. The label is shown in the list of
proposals and may contain markup. This will be used instead of
#gtk_source_completion_proposal_get_label if implemented. The returned string
must be freed with g_free().
A new string containing the label of @proposal with markup.
Gets the text of @proposal. The text that is inserted into
the text buffer when the proposal is activated by the default activation.
You are free to implement a custom activation handler in the provider and
not implement this function. The returned string must be freed with g_free().
A new string containing the text of @proposal.
Gets the icon of @proposal.
The icon of @proposal.
Gets extra information associated to the proposal. This information will be
used to present the user with extra, detailed information about the
selected proposal. The returned string must be freed with g_free().
no extra information is associated to @proposal.
A new string containing extra information of @proposal or %NULL if
Emits the "changed" signal on @proposal. This should be called by
implementations whenever the name, icon or info of the proposal has
changed.
Get the hash value of @proposal. This is used to (together with
#gtk_source_completion_proposal_equal) to match proposals in the completion
model. By default, it uses a direct hash (#g_direct_hash).
The hash value of @proposal
Get whether two proposal objects are the same. This is used to (together
with #gtk_source_completion_proposal_hash) to match proposals in the
completion model. By default, it uses direct equality (#g_direct_equal).
%TRUE if @proposal and @object are the same proposal
A #GtkSourceCompletionProposal
A new string containing the label of @proposal.
A new string containing the label of @proposal with markup.
A new string containing the text of @proposal.
The icon of @proposal.
A new string containing extra information of @proposal or %NULL if
The hash value of @proposal
%TRUE if @proposal and @object are the same proposal
A #GtkSourceCompletionProposal
Get the name of the provider. This should be a translatable name for
returned string must be freed with g_free().
A new string containing the name of the provider.
Get the icon of the provider.
not have a special icon.
The icon to be used for the provider, or %NULL if the provider does
Populate @context with proposals from @provider
The #GtkSourceCompletionContext
Get whether the provider match the context of completion detailed in
%TRUE if @provider matches the completion context, %FALSE otherwise
The #GtkSourceCompletionContext
Get with what kind of activation the provider should be activated.
a combination of #GtkSourceCompletionActivation.
Get a customized info widget to show extra information of a proposal.
This allows for customized widgets on a proposal basis, although in general
providers will have the same custom widget for all their proposals and
If implemented, #gtk_source_completion_provider_update_info MUST also be
implemented. If not implemented, the default
#gtk_source_completion_proposal_get_info will be used to display extra
information about a #GtkSourceCompletionProposal.
a custom #GtkWidget to show extra information about @proposal.
The currently selected #GtkSourceCompletionProposal
Update extra information shown in @info for @proposal. This should be
implemented if your provider sets a custom info widget for @proposal.
This function MUST be implemented when
#gtk_source_completion_provider_get_info_widget is implemented.
A #GtkSourceCompletionProposal
A #GtkSourceCompletionInfo
Get the #GtkTextIter at which the completion for @proposal starts. When
implemented, the completion can use this information to position the
completion window accordingly when a proposal is selected in the completion
window.
%TRUE if @iter was set for @proposal, %FALSE otherwise
A #GtkSourceCompletionContext
A #GtkSourceCompletionProposal
A #GtkTextIter
Activate @proposal at @iter. When this functions returns %FALSE, the default
activation of @proposal will take place which replaces the word at @iter
with the label of @proposal.
%FALSE otherwise.
%TRUE to indicate that the proposal activation has been handled,
A #GtkSourceCompletionProposal
A #GtkTextIter
Get the delay in milliseconds before starting interactive completion for
this provider. A value of -1 indicates to use the default value as set
by #GtkSourceCompletion::auto-complete-delay.
the interactive delay in milliseconds.
Get the provider priority. The priority determines the order in which
proposals appear in the completion popup. Higher priorities are sorted
before lower priorities. The default priority is 0.
the provider priority.
Get the name of the provider. This should be a translatable name for
returned string must be freed with g_free().
A new string containing the name of the provider.
Get the icon of the provider.
not have a special icon.
The icon to be used for the provider, or %NULL if the provider does
Populate @context with proposals from @provider
The #GtkSourceCompletionContext
Get with what kind of activation the provider should be activated.
a combination of #GtkSourceCompletionActivation.
Get whether the provider match the context of completion detailed in
%TRUE if @provider matches the completion context, %FALSE otherwise
The #GtkSourceCompletionContext
Get a customized info widget to show extra information of a proposal.
This allows for customized widgets on a proposal basis, although in general
providers will have the same custom widget for all their proposals and
If implemented, #gtk_source_completion_provider_update_info MUST also be
implemented. If not implemented, the default
#gtk_source_completion_proposal_get_info will be used to display extra
information about a #GtkSourceCompletionProposal.
a custom #GtkWidget to show extra information about @proposal.
The currently selected #GtkSourceCompletionProposal
Update extra information shown in @info for @proposal. This should be
implemented if your provider sets a custom info widget for @proposal.
This function MUST be implemented when
#gtk_source_completion_provider_get_info_widget is implemented.
A #GtkSourceCompletionProposal
A #GtkSourceCompletionInfo
Get the #GtkTextIter at which the completion for @proposal starts. When
implemented, the completion can use this information to position the
completion window accordingly when a proposal is selected in the completion
window.
%TRUE if @iter was set for @proposal, %FALSE otherwise
A #GtkSourceCompletionContext
A #GtkSourceCompletionProposal
A #GtkTextIter
Activate @proposal at @iter. When this functions returns %FALSE, the default
activation of @proposal will take place which replaces the word at @iter
with the label of @proposal.
%FALSE otherwise.
%TRUE to indicate that the proposal activation has been handled,
A #GtkSourceCompletionProposal
A #GtkTextIter
Get the delay in milliseconds before starting interactive completion for
this provider. A value of -1 indicates to use the default value as set
by #GtkSourceCompletion::auto-complete-delay.
the interactive delay in milliseconds.
Get the provider priority. The priority determines the order in which
proposals appear in the completion popup. Higher priorities are sorted
before lower priorities. The default priority is 0.
the provider priority.
A new string containing the name of the provider.
The icon to be used for the provider, or %NULL if the provider does
The #GtkSourceCompletionContext
%TRUE if @provider matches the completion context, %FALSE otherwise
The #GtkSourceCompletionContext
a combination of #GtkSourceCompletionActivation.
a custom #GtkWidget to show extra information about @proposal.
The currently selected #GtkSourceCompletionProposal
A #GtkSourceCompletionProposal
A #GtkSourceCompletionInfo
%TRUE if @iter was set for @proposal, %FALSE otherwise
A #GtkSourceCompletionContext
A #GtkSourceCompletionProposal
A #GtkTextIter
%TRUE to indicate that the proposal activation has been handled,
A #GtkSourceCompletionProposal
A #GtkTextIter
the interactive delay in milliseconds.
the provider priority.
GtkSourceDrawSpacesFlags determine what kind of spaces whould be drawn. If none
of GTK_SOURCE_DRAW_SPACES_LEADING, GTK_SOURCE_DRAW_SPACES_TEXT or
GTK_SOURCE_DRAW_SPACES_TRAILING is specified, whitespaces at any position in
the line will be drawn (i.e. it has the same effect as specifying all of them).
Get the #GdkWindow of the gutter. The window will only be available when the
gutter has at least one, non-zero width, cell renderer packed.
the #GdkWindow of the gutter, or %NULL if the gutter has no window.
Inserts @renderer into @gutter at @position.
a #GtkCellRenderer
the renderers position
Reorders @renderer in @gutter to new @position.
a #GtkCellRenderer
the new renderer position
Removes @renderer from @gutter.
a #GtkCellRenderer
Sets the #GtkSourceGutterDataFunc to use for @renderer. This function is
used to setup the cell renderer properties for rendering the current cell.
a #GtkCellRenderer
the #GtkSourceGutterDataFunc to use
the user data for @func
the destroy notification for @func_data
Sets the #GtkSourceGutterSizeFunc to use for @renderer. This function is
used to setup the cell renderer properties for measuring the maximum size
of the cell.
a #GtkCellRenderer
the #GtkSourceGutterSizeFunc to use
the user data for @func
the destroy notification for @func_data
Invalidates the drawable area of the gutter. You can use this to force a
redraw of the gutter if something has changed and needs to be redrawn.
Returns the ID of the language. The ID is not locale-dependent.
The returned string is owned by @language and should not be freed
or modified.
the ID of @language.
Returns the localized name of the language.
The returned string is owned by @language and should not be freed
or modified.
the name of @language.
Returns the localized section of the language.
Each language belong to a section (ex. HTML belogs to the
Markup section).
The returned string is owned by @language and should not be freed
or modified.
the section of @language.
Returns whether the language should be hidden from the user.
TRUE if the language should be hidden, FALSE otherwise.
or %NULL if language doesn't contain that metadata property.
The returned string is owned by @language and should not be freed
or modified.
value of property @name stored in the metadata of @language
metadata property name.
Returns the mime types associated to this language. This is just
an utility wrapper around gtk_source_language_get_metadata() to
retrieve the "mimetypes" metadata property and split it into an
array.
the mime types or %NULL if no mime types are found.
The returned array must be freed with g_strfreev().
a newly-allocated %NULL terminated array containing
Returns the globs associated to this language. This is just
an utility wrapper around gtk_source_language_get_metadata() to
retrieve the "globs" metadata property and split it into an array.
the globs or %NULL if no globs are found.
The returned array must be freed with g_strfreev().
a newly-allocated %NULL terminated array containing
Returns the ids of the styles defined by this @language.
ids of the styles defined by this @language or %NULL if no style is
defined. The returned array must be freed with g_strfreev().
a %NULL terminated array containing
Returns the name of the style with ID @style_id defined by this @language.
%NULL if the style has no name or there is no style with ID @style_id defined
by this @language. The returned string is owned by the @language and must
not be modified.
the name of the style with ID @style_id defined by this @language or
a style ID
Creates a new language manager. If you do not need more than one language
manager or a private language manager instance then use
gtk_source_language_manager_get_default() instead.
a #GtkSourceLanguageManager.
Returns the default #GtkSourceLanguageManager instance.
by GtkSourceView library and must not be unref'ed.
a #GtkSourceLanguageManager. Return value is owned
Gets the list directories where @lm looks for language files.
The array is owned by @lm and must not be modified.
%NULL-terminated array containg a list of language files directories.
Sets the list of directories where the @lm looks for
language files.
If @dirs is %NULL, the search path is reset to default.
<note>
<para>
At the moment this function can be called only before the
language files are loaded for the first time. In practice
to set a custom search path for a #GtkSourceLanguageManager,
you have to call this function right after creating it.
</para>
</note>
a %NULL-terminated array of strings or %NULL.
Returns the ids of the available languages.
available languages or %NULL if no language is available. The array
is owned by @lm and must not be modified.
a %NULL-terminated array of string containing the ids of the
Gets the #GtkSourceLanguage identified by the given @id in the language
manager.
identified by the given @id. Return value is owned by @lm and should not
be freed.
a #GtkSourceLanguage, or %NULL if there is no language
a language id.
Picks a #GtkSourceLanguage for given file name and content type,
according to the information in lang files. Either @filename or
<informalexample><programlisting>
GtkSourceLanguage *lang;
lang = gtk_source_language_manager_guess_language (filename, NULL);
gtk_source_buffer_set_language (buffer, lang);
</programlisting></informalexample>
or
<informalexample><programlisting>
GtkSourceLanguage *lang = NULL;
gboolean result_uncertain;
gchar *content_type;
content_type = g_content_type_guess (filename, NULL, 0, &result_uncertain);
if (result_uncertain)
{
g_free (content_type);
content_type = NULL;
}
lang = gtk_source_language_manager_guess_language (manager, filename, content_type);
gtk_source_buffer_set_language (buffer, lang);
g_free (content_type);
</programlisting></informalexample>
etc. Use gtk_source_language_get_mime_types() and gtk_source_language_get_globs()
if you need full control over file -> language mapping.
for given @filename and/or @content_type. Return value is owned by @lm
and should not be freed.
a #GtkSourceLanguage, or %NULL if there is no suitable language
a filename in Glib filename encoding, or %NULL.
a content type (as in GIO API), or %NULL.
Creates a text mark. Add it to a buffer using gtk_text_buffer_add_mark().
If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved
by name using gtk_text_buffer_get_mark().
Normally marks are created using the utility function
gtk_source_buffer_create_mark().
a new #GtkSourceMark that can be added using gtk_text_buffer_add_mark()
Name of the #GtkSourceMark, can be NULL when not using a name
is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could belong to the "bookmark" category, or all the marks representing a compilation error could belong to "error" category).
Returns the mark category
the category of the #GtkSourceMark
Returns the next #GtkSourceMark in the buffer or %NULL if the mark
was not added to a buffer. If there is no next mark, %NULL will be returned.
If @category is %NULL, looks for marks of any category
the next #GtkSourceMark or %NULL
a string specifying the mark category or %NULL
Returns the previous #GtkSourceMark in the buffer or %NULL if the mark
was not added to a buffer. If there is no previous mark, %NULL is returned.
If @category is %NULL, looks for marks of any category
the previous #GtkSourceMark or %NULL
a string specifying the mark category or %NULL
Creates a new print compositor that can be used to print @buffer.
a new print compositor object.
the #GtkSourceBuffer to print
Creates a new print compositor that can be used to print the buffer
associated with @view.
This constructor sets some configuration properties to make the
printed output match @view as much as possible. The properties set are
#GtkSourcePrintCompositor:tab-width, #GtkSourcePrintCompositor:highlight-syntax,
#GtkSourcePrintCompositor:wrap-mode, #GtkSourcePrintCompositor:body-font-name and
#GtkSourcePrintCompositor:print-line-numbers.
a new print compositor object.
a #GtkSourceView to get configuration from.
Gets the #GtkSourceBuffer associated with the compositor. The returned
object reference is owned by the compositor object and
should not be unreferenced.
the #GtkSourceBuffer associated with the compositor.
Sets the width of tabulation in characters for printed text.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
width of tab in characters.
Returns the width of tabulation in characters for printed text.
width of tab.
Sets the line wrapping mode for the printed text.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
a #GtkWrapMode.
Gets the line wrapping mode for the printed text.
the line wrap mode.
Sets whether the printed text will be highlighted according to the
buffer rules. Both color and font style are applied.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
whether syntax should be highlighted.
Determines whether the printed text will be highlighted according to the
buffer rules. Note that highlighting will happen
only if the buffer to print has highlighting activated.
%TRUE if the printed output will be highlighted.
Sets the interval for printed line numbers. If @interval is 0 no
numbers will be printed. If greater than 0, a number will be
printed every @interval lines (i.e. 1 will print all line numbers).
Maximum accepted value for @interval is 100.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
interval for printed line numbers.
Returns the interval used for line number printing. If the
value is 0, no line numbers will be printed. The default value is
1 (i.e. numbers printed in all lines).
the interval of printed line numbers.
Sets the default font for the printed text.
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See pango_font_description_from_string()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
the name of the default font for the body text.
Returns the name of the font used to print the text body. The returned string
must be freed with g_free().
text body.
a new string containing the name of the font used to print the
Sets the font for printing line numbers on the left margin. If
%NULL is supplied, the default font (i.e. the one being used for the
text) will be used instead.
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See pango_font_description_from_string()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
the name of the font for line numbers, or %NULL.
Returns the name of the font used to print line numbers on the left margin.
The returned string must be freed with g_free())
line numbers on the left margin.
a new string containing the name of the font used to print
Sets the font for printing the page header. If
%NULL is supplied, the default font (i.e. the one being used for the
text) will be used instead.
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See pango_font_description_from_string()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
the name of the font for header text, or %NULL.
Returns the name of the font used to print the page header.
The returned string must be freed with g_free())
the page header.
a new string containing the name of the font used to print
Sets the font for printing the page footer. If
%NULL is supplied, the default font (i.e. the one being used for the
text) will be used instead.
string representation of a font description Pango can understand.
(e.g. "Monospace 10"). See pango_font_description_from_string()
for a description of the format of the string representation.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
the name of the font for the footer text, or %NULL.
Returns the name of the font used to print the page footer.
The returned string must be freed with g_free())
the page footer.
a new string containing the name of the font used to print
Gets the top margin in units of @unit.
the top margin.
the unit for the return value.
Sets the top margin used by @compositor.
the new top margin in units of @unit
the units for @margin
Gets the bottom margin in units of @unit.
the bottom margin.
the unit for the return value.
Sets the bottom margin used by @compositor.
the new bottom margin in units of @unit
the units for @margin
Gets the left margin in units of @unit.
the left margin
the unit for the return value.
Sets the left margin used by @compositor.
the new left margin in units of @unit
the units for @margin
Gets the right margin in units of @unit.
the right margin
the unit for the return value.
Sets the right margin used by @compositor.
the new right margin in units of @unit
the units for @margin
Sets whether you want to print a header in each page. The
header consists of three pieces of text and an optional line
separator, configurable with
gtk_source_print_compositor_set_header_format().
Note that by default the header format is unspecified, and if it's
empty it will not be printed, regardless of this setting.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
%TRUE if you want the header to be printed.
Determines if a header is set to be printed for each page. A
header will be printed if this function returns %TRUE
<emphasis>and</emphasis> some format strings have been specified
with gtk_source_print_compositor_set_header_format().
%TRUE if the header is set to be printed.
Sets whether you want to print a footer in each page. The
footer consists of three pieces of text and an optional line
separator, configurable with
gtk_source_print_compositor_set_footer_format().
Note that by default the footer format is unspecified, and if it's
empty it will not be printed, regardless of this setting.
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
%TRUE if you want the footer to be printed.
Determines if a footer is set to be printed for each page. A
footer will be printed if this function returns %TRUE
<emphasis>and</emphasis> some format strings have been specified
with gtk_source_print_compositor_set_footer_format().
%TRUE if the footer is set to be printed.
Sets strftime like header format strings, to be printed on the
left, center and right of the top of each page. The strings may
include strftime(3) codes which will be expanded at print time.
All strftime() codes are accepted, with the addition of %N for the
page number and %Q for the page count.
the header from the document text.
If %NULL is given for any of the three arguments, that particular
string will not be printed.
For the header to be printed, in
addition to specifying format strings, you need to enable header
printing with gtk_source_print_compositor_set_print_header().
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
%TRUE if you want a separator line to be printed.
a format string to print on the left of the header.
a format string to print on the center of the header.
a format string to print on the right of the header.
Sets strftime like header format strings, to be printed on the
left, center and right of the bottom of each page. The strings may
include strftime(3) codes which will be expanded at print time.
All strftime() codes are accepted, with the addition of %N for the
page number and %Q for the page count.
the footer from the document text.
If %NULL is given for any of the three arguments, that particular
string will not be printed.
For the footer to be printed, in
addition to specifying format strings, you need to enable footer
printing with gtk_source_print_compositor_set_print_footer().
This function cannot be called anymore after the first call to the
gtk_source_print_compositor_paginate() function.
%TRUE if you want a separator line to be printed.
a format string to print on the left of the footer.
a format string to print on the center of the footer.
a format string to print on the right of the footer.
Returns the number of pages in the document or <code>-1</code> if the
document has not been completely paginated.
document has not been completely paginated.
the number of pages in the document or <code>-1</code> if the
Paginate the document associated with the @compositor.
In order to support non-blocking pagination, document is paginated in small chunks.
Each time gtk_source_print_compositor_paginate() is invoked, a chunk of the document
is paginated. To paginate the entire document, gtk_source_print_compositor_paginate()
must be invoked multiple times.
It returns %TRUE if the document has been completely paginated, otherwise it returns %FALSE.
This method has been designed to be invoked in the handler of the #GtkPrintOperation::paginate signal,
as shown in the following example:
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::paginate signal
static gboolean
paginate (GtkPrintOperation *operation,
GtkPrintContext *context,
gpointer user_data)
{
GtkSourcePrintCompositor *compositor;
compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
if (gtk_source_print_compositor_paginate (compositor, context))
{
gint n_pages;
n_pages = gtk_source_print_compositor_get_n_pages (compositor);
gtk_print_operation_set_n_pages (operation, n_pages);
return TRUE;
}
return FALSE;
}
</programlisting></informalexample>
If you don't need to do pagination in chunks, you can simply do it all in the
#GtkPrintOperation::begin-print handler, and set the number of pages from there, like
in the following example:
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::begin-print signal
static void
begin_print (GtkPrintOperation *operation,
GtkPrintContext *context,
gpointer user_data)
{
GtkSourcePrintCompositor *compositor;
gint n_pages;
compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
while (!gtk_source_print_compositor_paginate (compositor, context));
n_pages = gtk_source_print_compositor_get_n_pages (compositor);
gtk_print_operation_set_n_pages (operation, n_pages);
}
</programlisting></informalexample>
%TRUE if the document has been completely paginated, %FALSE otherwise.
the #GtkPrintContext whose parameters (e.g. paper size, print margins, etc.) are used by the the @compositor to paginate the document.
Returns the current fraction of the document pagination that has been completed.
a fraction from 0.0 to 1.0 inclusive
Draw page @page_nr for printing on the the Cairo context encapsuled in @context.
This method has been designed to be called in the handler of the #GtkPrintOperation::draw_page signal
as shown in the following example:
<informalexample><programlisting>
// Signal handler for the GtkPrintOperation::draw_page signal
static void
draw_page (GtkPrintOperation *operation,
GtkPrintContext *context,
gint page_nr,
gpointer user_data)
{
GtkSourcePrintCompositor *compositor;
compositor = GTK_SOURCE_PRINT_COMPOSITOR (user_data);
gtk_source_print_compositor_draw_page (compositor,
context,
page_nr);
}
</programlisting></informalexample>
the #GtkPrintContext encapsulating the context information that is required when drawing the page for printing.
the number of the page to print.
Creates a copy of @style, that is a new #GtkSourceStyle instance which
has the same attributes set.
copy of @style, call g_object_unref() when you are done with it.
@scheme id.
@scheme name.
@scheme description (if defined) or NULL.
%NULL if no author is specified by the style
scheme.
a %NULL-terminated array containing the @scheme authors or
style scheme file or NULL in the other cases.
@scheme file name if the scheme was created parsing a
or %NULL when no style with this name found. It is owned by @scheme
and may not be unref'ed.
style which corresponds to @style_id in the @scheme,
id of the style to retrieve.
Creates a new style manager. If you do not need more than one style
manager then use gtk_source_style_scheme_manager_get_default() instead.
a #GtkSourceStyleSchemeManager.
Returns the default #GtkSourceStyleSchemeManager instance.
by GtkSourceView library and must not be unref'ed.
a #GtkSourceStyleSchemeManager. Return value is owned
Sets the list of directories where the @manager looks for
style scheme files.
If @dirs is %NULL, the search path is reset to default.
a %NULL-terminated array of strings or %NULL.
Appends @path to the list of directories where the @manager looks for
style scheme files.
See gtk_source_style_scheme_manager_set_search_path() for details.
a directory or a filename.
Prepends @path to the list of directories where the @manager looks
for style scheme files.
See gtk_source_style_scheme_manager_set_search_path() for details.
a directory or a filename.
Returns the current search path for the @manager.
See gtk_source_style_scheme_manager_set_search_path() for details.
The array is owned by the @manager and must not be modified.
a NULL-terminated array of string containing the search path.
Mark any currently cached information about the available style scehems
as invalid. All the available style schemes will be reloaded next time
the @manager is accessed.
Returns the ids of the available style schemes.
available style schemes or %NULL if no style scheme is available. The array
is owned by the @manager and must not be modified.
a %NULL-terminated array of string containing the ids of the
Looks up style scheme by id.
a #GtkSourceStyleScheme object. Returned value is owned by
style scheme id to find
Get whether there are undo operations available.
%TRUE if there are undo operations available, %FALSE otherwise
Get whether there are redo operations available.
%TRUE if there are redo operations available, %FALSE otherwise
Perform a single undo. Calling this function when there are no undo operations
available is an error. Use #gtk_source_undo_manager_can_undo to find out
if there are undo operations available.
Perform a single redo. Calling this function when there are no redo operations
available is an error. Use #gtk_source_undo_manager_can_redo to find out
if there are redo operations available.
Begin a not undoable action on the buffer. All changes between this call
and the call to #gtk_source_undo_manager_end_not_undoable_action cannot
be undone. This function should be re-entrant.
Ends a not undoable action on the buffer.
Get whether there are undo operations available.
%TRUE if there are undo operations available, %FALSE otherwise
Get whether there are redo operations available.
%TRUE if there are redo operations available, %FALSE otherwise
Perform a single undo. Calling this function when there are no undo operations
available is an error. Use #gtk_source_undo_manager_can_undo to find out
if there are undo operations available.
Perform a single redo. Calling this function when there are no redo operations
available is an error. Use #gtk_source_undo_manager_can_redo to find out
if there are redo operations available.
Begin a not undoable action on the buffer. All changes between this call
and the call to #gtk_source_undo_manager_end_not_undoable_action cannot
be undone. This function should be re-entrant.
Ends a not undoable action on the buffer.
Emits the #GtkSourceUndoManager::can-undo-changed signal.
Emits the #GtkSourceUndoManager::can-redo-changed signal.
%TRUE if there are undo operations available, %FALSE otherwise
%TRUE if there are redo operations available, %FALSE otherwise
Creates a new #GtkSourceView. An empty default buffer will be
created for you. If you want to specify your own buffer, consider
gtk_source_view_new_with_buffer().
a new #GtkSourceView
Creates a new #GtkSourceView widget displaying the buffer
a new #GtkTextView.
a #GtkSourceBuffer.
If %TRUE line numbers will be displayed beside the text.
whether line numbers should be displayed.
Returns whether line numbers are displayed beside the text.
%TRUE if the line numbers are displayed.
Sets the width of tabulation in characters.
width of tab in characters.
Returns the width of tabulation in characters.
width of tab.
Sets the number of spaces to use for each step of indent.
If @width is -1, the value of the GtkSourceView::tab-width property
will be used.
indent width in characters.
Returns the number of spaces to use for each step of indent.
See gtk_source_view_set_indent_width() for details.
indent width.
If %TRUE auto indentation of text is enabled.
whether to enable auto indentation.
Returns whether auto indentation of text is enabled.
%TRUE if auto indentation is enabled.
If %TRUE any tabulator character inserted is replaced by a group
of space characters.
whether to insert spaces instead of tabs.
Returns whether when inserting a tabulator character it should
be replaced by a group of space characters.
%TRUE if spaces are inserted instead of tabs.
If %TRUE, when the tab key is pressed and there is a selection, the
selected text is indented of one level instead of being replaced with
the \t characters. Shift+Tab unindents the selection.
whether to indent a block when tab is pressed.
Returns whether when the tab key is pressed the current selection
should get indented instead of replaced with the \t character.
%TRUE if the selection is indented when tab is pressed.
If @show is %TRUE the current line is highlighted.
whether to highlight the current line
Returns whether the current line is highlighted
%TRUE if the current line is highlighted.
If %TRUE a right margin is displayed
whether to show a right margin.
Returns whether a right margin is displayed.
%TRUE if the right margin is shown.
Sets the position of the right margin in the given @view.
the width in characters where to position the right margin.
Gets the position of the right margin in the given @view.
the position of the right margin.
If %TRUE line marks will be displayed beside the text.
whether line marks should be displayed.
Returns whether line marks are displayed beside the text.
%TRUE if the line marks are displayed.
Associates a given @pixbuf with a given mark @category.
If @pixbuf is #NULL, the pixbuf is unset.
a mark category.
a #GdkPixbuf or #NULL.
Sets the icon to be used for @category to @pixbuf.
If @pixbuf is #NULL, the icon is unset.
a mark category.
a #GdkPixbuf or #NULL.
Sets the icon to be used for @category to the stock item @stock_id.
If @stock_id is #NULL, the icon is unset.
a mark category.
the stock id or #NULL.
Sets the icon to be used for @category to the named theme item @name.
If @name is #NULL, the icon is unset.
a mark category.
the themed icon name or #NULL.
Gets the pixbuf which is associated with the given mark @category.
the associated #GdkPixbuf, or %NULL if not found.
a mark category.
Sets given background @color for mark @category.
If @color is #NULL, the background color is unset.
a mark category.
background color or %NULL to unset it.
Gets the background color associated with given @category.
and @dest is set to a valid color, or %FALSE otherwise.
%TRUE if background color for @category was set
a mark category.
destination #GdkColor structure to fill in.
Set a #GtkSourceViewMarkTooltipFunc used to set tooltip on marks from the
given mark @category.
If you also specified a function with
gtk_source_view_set_mark_category_tooltip_markup_func() the markup
variant takes precedence.
<informalexample><programlisting><![CDATA[
static gchar *
tooltip_func (GtkSourceMark *mark,
gpointer user_data)
{
gchar *text;
text = get_tooltip_for_mark (mark, user_data);
return text;
}
...
GtkSourceView *view;
gtk_source_view_set_mark_category_tooltip_func (view, "other-mark",
tooltip_func,
NULL, NULL);
]]></programlisting></informalexample>
a mark category.
a #GtkSourceViewMarkTooltipFunc or %NULL.
user data which will be passed to @func. or %NULL if you do not want to supply such a function.
See gtk_source_view_set_mark_category_tooltip_func() for more information.
a mark category.
a #GtkSourceViewMarkTooltipFunc or %NULL.
user data which will be passed to @func. or %NULL if you do not want to supply such a function.
Set the @priority for the given mark @category. When there are
multiple marks on the same line, marks of categories with
higher priorities will be drawn on top.
a mark category.
the priority for the category
Gets the priority which is associated with the given @category.
exists but no priority was set, it defaults to 0.
the priority or if @category
a mark category.
Set the desired movement of the cursor when HOME and END keys
are pressed.
the desired behavior among #GtkSourceSmartHomeEndType.
Returns a #GtkSourceSmartHomeEndType end value specifying
how the cursor will move when HOME and END keys are pressed.
a #GtkSourceSmartHomeEndTypeend value.
Set if and how the spaces should be visualized. Specifying @flags as 0 will
disable display of spaces.
#GtkSourceDrawSpacesFlags specifing how white spaces should be displayed
Returns the #GtkSourceDrawSpacesFlags specifying if and how spaces
should be displayed for this @view.
the #GtkSourceDrawSpacesFlags, 0 if no spaces should be drawn.
Gets the #GtkSourceCompletion associated with @view.
the #GtkSourceCompletion associated with @view.
Returns the #GtkSourceGutter object associated with @window_type for @view.
Only GTK_TEXT_WINDOW_LEFT and GTK_TEXT_WINDOW_RIGHT are supported,
respectively corresponding to the left and right gutter. The line numbers
and mark category icons are rendered in the gutter corresponding to
GTK_TEXT_WINDOW_LEFT.
the #GtkSourceGutter.
the gutter window type
Function type for setting up a tooltip for #GtkSourceMark.
a newly-allocated string that is going to be shown as tooltip text.
the #GtkSourceMark
user data pointer which was passed to gtk_source_view_set_mark_category_tooltip_func()
Same as gtk_text_iter_backward_search(), but supports case insensitive
searching.
whether a match was found.
a #GtkTextIter where the search begins.
search string.
bitmask of flags affecting the search.
return location for start of match, or %NULL.
return location for end of match, or %NULL.
location of last possible @match_start, or %NULL for start of buffer.
Searches forward for @str. Any match is returned by setting
first character after the match. The search will not continue past
may wish to use @limit to avoid locking up your UI on large
buffers.
If the #GTK_SOURCE_SEARCH_VISIBLE_ONLY flag is present, the match may
have invisible text interspersed in @str. i.e. @str will be a
possibly-noncontiguous subsequence of the matched range. similarly,
if you specify #GTK_SOURCE_SEARCH_TEXT_ONLY, the match may have
pixbufs or child widgets mixed inside the matched range. If these
flags are not given, the match must be exact; the special 0xFFFC
character in @str will match embedded pixbufs or child widgets.
If you specify the #GTK_SOURCE_SEARCH_CASE_INSENSITIVE flag, the text will
be matched regardless of what case it is in.
Same as gtk_text_iter_forward_search(), but supports case insensitive
searching.
whether a match was found.
start of search.
a search string.
flags affecting how the search is done.
return location for start of match, or %NULL.
return location for end of match, or %NULL.
bound for the search, or %NULL for the end of the buffer.