[gedit/wip/use-gsv-search-2] GeditDocument: deprecate search and replace API
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/use-gsv-search-2] GeditDocument: deprecate search and replace API
- Date: Fri, 12 Jul 2013 16:48:27 +0000 (UTC)
commit 02288adaa2a0176dc6c8191c8235e12779c5e355
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Jul 11 12:39:48 2013 +0200
GeditDocument: deprecate search and replace API
gedit/gedit-document.c | 47 +++++++++++++++++++++++++++++++++++++++++++++--
gedit/gedit-document.h | 16 +++++++++++++++-
2 files changed, 60 insertions(+), 3 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index 646ec30..c1f151f 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -538,21 +538,33 @@ gedit_document_class_init (GeditDocumentClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
+ /**
+ * GeditDocument:can-search-again:
+ *
+ * Deprecated: 3.10: Use the search and replace API in #GtkSourceBuffer.
+ */
g_object_class_install_property (object_class, PROP_CAN_SEARCH_AGAIN,
g_param_spec_boolean ("can-search-again",
"Can search again",
"Wheter it's possible to search again in the
document",
FALSE,
G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
+ G_PARAM_STATIC_STRINGS |
+ G_PARAM_DEPRECATED));
+ /**
+ * GeditDocument:enable-search-highlighting:
+ *
+ * Deprecated: 3.10: Use the search and replace API in #GtkSourceBuffer.
+ */
g_object_class_install_property (object_class, PROP_ENABLE_SEARCH_HIGHLIGHTING,
g_param_spec_boolean ("enable-search-highlighting",
"Enable Search Highlighting",
"Whether all the occurences of the searched
string must be highlighted",
FALSE,
G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
+ G_PARAM_STATIC_STRINGS |
+ G_PARAM_DEPRECATED));
/**
* GeditDocument:newline-type:
@@ -2123,6 +2135,8 @@ to_search_region_range (GeditDocument *doc,
* @doc:
* @text: (allow-none):
* @flags:
+ *
+ * Deprecated: 3.10: Use gtk_source_buffer_set_search_text() instead.
**/
void
gedit_document_set_search_text (GeditDocument *doc,
@@ -2190,6 +2204,8 @@ gedit_document_set_search_text (GeditDocument *doc,
* gedit_document_get_search_text:
* @doc:
* @flags: (allow-none):
+ *
+ * Deprecated: 3.10: Use gtk_source_buffer_get_search_text() instead.
*/
gchar *
gedit_document_get_search_text (GeditDocument *doc,
@@ -2219,6 +2235,8 @@ gedit_document_get_can_search_again (GeditDocument *doc)
* @end: (allow-none):
* @match_start: (allow-none):
* @match_end: (allow-none):
+ *
+ * Deprecated: 3.10: Use gtk_source_buffer_forward_search_async() instead.
**/
gboolean
gedit_document_search_forward (GeditDocument *doc,
@@ -2300,6 +2318,8 @@ gedit_document_search_forward (GeditDocument *doc,
* @end: (allow-none):
* @match_start: (allow-none):
* @match_end: (allow-none):
+ *
+ * Deprecated: 3.10: Use gtk_source_buffer_backward_search_async() instead.
**/
gboolean
gedit_document_search_backward (GeditDocument *doc,
@@ -2374,6 +2394,16 @@ gedit_document_search_backward (GeditDocument *doc,
return found;
}
+/**
+ * gedit_document_replace_all:
+ * @doc:
+ * @find:
+ * @replace:
+ * @flags:
+ *
+ * Deprecated: 3.10: Use gtk_source_buffer_search_replace_all() instead.
+ */
+
/* FIXME this is an issue for introspection regardning @find */
gint
gedit_document_replace_all (GeditDocument *doc,
@@ -2916,6 +2946,13 @@ _gedit_document_get_seconds_since_last_save_or_load (GeditDocument *doc)
return (current_time.tv_sec - doc->priv->time_of_last_save_or_load.tv_sec);
}
+/**
+ * gedit_document_set_enable_search_highlighting:
+ * @doc:
+ * @enable:
+ *
+ * Deprecated: 3.10
+ */
void
gedit_document_set_enable_search_highlighting (GeditDocument *doc,
gboolean enable)
@@ -2970,6 +3007,12 @@ gedit_document_set_enable_search_highlighting (GeditDocument *doc,
}
}
+/**
+ * gedit_document_get_enable_search_highlighting:
+ * @doc:
+ *
+ * Deprecated: 3.10
+ */
gboolean
gedit_document_get_enable_search_highlighting (GeditDocument *doc)
{
diff --git a/gedit/gedit-document.h b/gedit/gedit-document.h
index 9c2e98c..515bcb4 100644
--- a/gedit/gedit-document.h
+++ b/gedit/gedit-document.h
@@ -74,12 +74,19 @@ typedef enum
#define GEDIT_DOCUMENT_NEWLINE_TYPE_DEFAULT GEDIT_DOCUMENT_NEWLINE_TYPE_LF
#endif
+/**
+ * GeditSearchFlags:
+ * @GEDIT_SEARCH_DONT_SET_FLAGS:
+ * @GEDIT_SEARCH_ENTIRE_WORD:
+ * @GEDIT_SEARCH_CASE_SENSITIVE:
+ *
+ * Deprecated: 3.10: Use the search and replace API in #GtkSourceBuffer.
+ */
typedef enum
{
GEDIT_SEARCH_DONT_SET_FLAGS = 1 << 0,
GEDIT_SEARCH_ENTIRE_WORD = 1 << 1,
GEDIT_SEARCH_CASE_SENSITIVE = 1 << 2
-
} GeditSearchFlags;
/*
@@ -260,28 +267,33 @@ gboolean gedit_document_goto_line_offset(GeditDocument *doc,
gint line,
gint line_offset);
+G_DEPRECATED_FOR (gtk_source_buffer_set_search_text)
void gedit_document_set_search_text (GeditDocument *doc,
const gchar *text,
guint flags);
+G_DEPRECATED_FOR (gtk_source_buffer_get_search_text)
gchar *gedit_document_get_search_text (GeditDocument *doc,
guint *flags);
gboolean gedit_document_get_can_search_again
(GeditDocument *doc);
+G_DEPRECATED_FOR (gtk_source_buffer_forward_search_async)
gboolean gedit_document_search_forward (GeditDocument *doc,
const GtkTextIter *start,
const GtkTextIter *end,
GtkTextIter *match_start,
GtkTextIter *match_end);
+G_DEPRECATED_FOR (gtk_source_buffer_backward_search_async)
gboolean gedit_document_search_backward (GeditDocument *doc,
const GtkTextIter *start,
const GtkTextIter *end,
GtkTextIter *match_start,
GtkTextIter *match_end);
+G_DEPRECATED_FOR (gtk_source_buffer_search_replace_all)
gint gedit_document_replace_all (GeditDocument *doc,
const gchar *find,
const gchar *replace,
@@ -295,10 +307,12 @@ GtkSourceLanguage
const GeditEncoding
*gedit_document_get_encoding (GeditDocument *doc);
+G_DEPRECATED
void gedit_document_set_enable_search_highlighting
(GeditDocument *doc,
gboolean enable);
+G_DEPRECATED
gboolean gedit_document_get_enable_search_highlighting
(GeditDocument *doc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]