Top | Description | Object Hierarchy | Properties | ![]() |
![]() |
![]() |
![]() |
#include <gtksourceview/gtksource.h> GtkSourceSearchSettings; GtkSourceSearchSettings * gtk_source_search_settings_new (void
); const gchar * gtk_source_search_settings_get_search_text (GtkSourceSearchSettings *settings
); void gtk_source_search_settings_set_search_text (GtkSourceSearchSettings *settings
,const gchar *search_text
); gboolean gtk_source_search_settings_get_case_sensitive (GtkSourceSearchSettings *settings
); void gtk_source_search_settings_set_case_sensitive (GtkSourceSearchSettings *settings
,gboolean case_sensitive
); gboolean gtk_source_search_settings_get_at_word_boundaries (GtkSourceSearchSettings *settings
); void gtk_source_search_settings_set_at_word_boundaries (GtkSourceSearchSettings *settings
,gboolean at_word_boundaries
); gboolean gtk_source_search_settings_get_wrap_around (GtkSourceSearchSettings *settings
); void gtk_source_search_settings_set_wrap_around (GtkSourceSearchSettings *settings
,gboolean wrap_around
); gboolean gtk_source_search_settings_get_regex_enabled (GtkSourceSearchSettings *settings
); void gtk_source_search_settings_set_regex_enabled (GtkSourceSearchSettings *settings
,gboolean regex_enabled
);
"at-word-boundaries" gboolean : Read / Write / Construct "case-sensitive" gboolean : Read / Write / Construct "regex-enabled" gboolean : Read / Write / Construct "search-text" gchar* : Read / Write / Construct "wrap-around" gboolean : Read / Write / Construct
A GtkSourceSearchSettings object represents the settings of a search. The search settings can be associated with one or several GtkSourceSearchContexts.
GtkSourceSearchSettings * gtk_source_search_settings_new
(void
);
Creates a new search settings object.
Returns : |
a new search settings object. |
Since 3.10
const gchar * gtk_source_search_settings_get_search_text
(GtkSourceSearchSettings *settings
);
Gets the text to search. The return value must not be freed.
You may be interested to call gtk_source_utils_escape_search_text()
after
this function.
|
a GtkSourceSearchSettings. |
Returns : |
the text to search, or NULL if the search is disabled. |
Since 3.10
void gtk_source_search_settings_set_search_text (GtkSourceSearchSettings *settings
,const gchar *search_text
);
Sets the text to search. If text
is NULL
or is empty, the search will be
disabled. A copy of text
will be made, so you can safely free text
after
a call to this function.
You may be interested to call gtk_source_utils_unescape_search_text()
before
this function.
|
a GtkSourceSearchSettings. |
|
the nul-terminated text to search, or NULL to disable the search. [allow-none]
|
Since 3.10
gboolean gtk_source_search_settings_get_case_sensitive
(GtkSourceSearchSettings *settings
);
|
a GtkSourceSearchSettings. |
Returns : |
whether the search is case sensitive. |
Since 3.10
void gtk_source_search_settings_set_case_sensitive (GtkSourceSearchSettings *settings
,gboolean case_sensitive
);
Enables or disables the case sensitivity for the search.
|
a GtkSourceSearchSettings. |
|
the setting. |
Since 3.10
gboolean gtk_source_search_settings_get_at_word_boundaries
(GtkSourceSearchSettings *settings
);
|
a GtkSourceSearchSettings. |
Returns : |
whether to search at word boundaries. |
Since 3.10
void gtk_source_search_settings_set_at_word_boundaries (GtkSourceSearchSettings *settings
,gboolean at_word_boundaries
);
Change whether the search is done at word boundaries. If at_word_boundaries
is TRUE
, a search match must start and end a word. The match can span
multiple words. See also gtk_text_iter_starts_word()
and
gtk_text_iter_ends_word()
.
|
a GtkSourceSearchSettings. |
|
the setting. |
Since 3.10
gboolean gtk_source_search_settings_get_wrap_around
(GtkSourceSearchSettings *settings
);
|
a GtkSourceSearchSettings. |
Returns : |
whether to wrap around the search. |
Since 3.10
void gtk_source_search_settings_set_wrap_around (GtkSourceSearchSettings *settings
,gboolean wrap_around
);
Enables or disables the wrap around search. If wrap_around
is TRUE
, the
forward search continues at the beginning of the buffer if no search
occurrences are found. Similarly, the backward search continues to search at
the end of the buffer.
|
a GtkSourceSearchSettings. |
|
the setting. |
Since 3.10
gboolean gtk_source_search_settings_get_regex_enabled
(GtkSourceSearchSettings *settings
);
|
a GtkSourceSearchSettings. |
Returns : |
whether to search by regular expressions. |
Since 3.10
void gtk_source_search_settings_set_regex_enabled (GtkSourceSearchSettings *settings
,gboolean regex_enabled
);
Enables or disables whether to search by regular expressions. If enabled, the "search-text" property contains the pattern of the regular expression.
|
a GtkSourceSearchSettings. |
|
the setting. |
Since 3.10
"at-word-boundaries"
property"at-word-boundaries" gboolean : Read / Write / Construct
If TRUE
, a search match must start and end a word. The match can
span multiple words.
Default value: FALSE
Since 3.10
"case-sensitive"
property"case-sensitive" gboolean : Read / Write / Construct
Whether the search is case sensitive.
Default value: FALSE
Since 3.10
"regex-enabled"
property"regex-enabled" gboolean : Read / Write / Construct
Search by regular expressions with "search-text" as the pattern.
Default value: FALSE
Since 3.10
"search-text"
property"search-text" gchar* : Read / Write / Construct
A search string, or NULL
if the search is disabled. If the regular
expression search is enabled, "search-text" is
the pattern.
Default value: NULL
Since 3.10
"wrap-around"
property"wrap-around" gboolean : Read / Write / Construct
For a forward search, continue at the beginning of the buffer if no search occurrence is found. For a backward search, continue at the end of the buffer.
Default value: FALSE
Since 3.10