Top |
gboolean | at-word-boundaries | Read / Write / Construct |
gboolean | case-sensitive | Read / Write / Construct |
gboolean | regex-enabled | Read / Write / Construct |
gchar * | search-text | Read / Write / Construct |
gboolean | wrap-around | 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.
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.
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.
settings |
||
search_text |
the nul-terminated text to search, or |
[allow-none] |
Since 3.10
gboolean
gtk_source_search_settings_get_case_sensitive
(GtkSourceSearchSettings *settings
);
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.
Since 3.10
gboolean
gtk_source_search_settings_get_at_word_boundaries
(GtkSourceSearchSettings *settings
);
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()
.
Since 3.10
gboolean
gtk_source_search_settings_get_wrap_around
(GtkSourceSearchSettings *settings
);
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.
Since 3.10
gboolean
gtk_source_search_settings_get_regex_enabled
(GtkSourceSearchSettings *settings
);
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.
Since 3.10
“at-word-boundaries”
property“at-word-boundaries” gboolean
If TRUE
, a search match must start and end a word. The match can
span multiple words.
Flags: Read / Write / Construct
Default value: FALSE
Since 3.10
“case-sensitive”
property“case-sensitive” gboolean
Whether the search is case sensitive.
Flags: Read / Write / Construct
Default value: FALSE
Since 3.10
“regex-enabled”
property“regex-enabled” gboolean
Search by regular expressions with “search-text” as the pattern.
Flags: Read / Write / Construct
Default value: FALSE
Since 3.10
“search-text”
property“search-text” gchar *
A search string, or NULL
if the search is disabled. If the regular
expression search is enabled, “search-text” is
the pattern.
Flags: Read / Write / Construct
Default value: NULL
Since 3.10
“wrap-around”
property“wrap-around” gboolean
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.
Flags: Read / Write / Construct
Default value: FALSE
Since 3.10