Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/libdocument
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2008-08-27 09:01:41 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2008-08-27 09:01:41 (GMT)
commitc86fea736694b17beb9fb621fceac7e2970afe08 (patch)
treea56d037212de681d3ee29d4c09a2f75688e416ca /libdocument
parent8d5f4e92b97b9ebee0ec3a805e511c60c606e715 (diff)
Removed
2008-08-27 Carlos Garcia Campos <carlosgc@gnome.org> * backend/djvu/Makefile.am: * backend/djvu/djvu-document-private.h: * backend/djvu/djvu-document.c: (djvu_document_find_find_text), (djvu_document_find_iface_init): * backend/djvu/djvu-text-page.[ch]: * backend/djvu/djvu-text.[ch]: Removed * backend/pdf/ev-poppler.cc: (pdf_document_find_find_text), (pdf_document_find_iface_init): * libdocument/ev-document-find.[ch]: (ev_document_find_find_text): * shell/ev-jobs.[ch]: (ev_job_find_init), (ev_job_find_dispose), (ev_job_find_run), (ev_job_find_class_init), (ev_job_find_new), (ev_job_find_get_n_results), (ev_job_find_get_progress), (ev_job_find_has_results), (ev_job_find_get_results): * shell/ev-view-private.h: * shell/ev-view.[ch]: (ev_view_expose_event), (highlight_find_results), (ev_view_finalize), (ev_view_get_property), (ev_view_class_init), (page_changed_cb), (ev_view_set_document), (ev_view_find_get_n_results), (ev_view_find_get_result), (jump_to_find_result), (jump_to_find_page), (ev_view_find_changed), (ev_view_find_next), (ev_view_find_previous), (ev_view_find_search_changed), (ev_view_find_set_highlight_search), (ev_view_find_cancel): * shell/ev-window.c: (ev_window_update_actions), (page_changed_cb), (ev_window_setup_document), (ev_window_update_find_status_message), (ev_window_find_job_finished_cb), (ev_window_find_job_updated_cb), (ev_window_clear_find_job), (find_bar_close_cb), (find_bar_search_changed_cb), (find_bar_visibility_changed_cb), (ev_window_dispose), (ev_window_init): Rework find interface. The find logic has been moved from backends to the shell avoiding a lot of duplicated code in the backends and making easier to implement the find interface in the backends. svn path=/trunk/; revision=3123
Diffstat (limited to 'libdocument')
-rw-r--r--libdocument/ev-document-find.c85
-rw-r--r--libdocument/ev-document-find.h63
2 files changed, 21 insertions, 127 deletions
diff --git a/libdocument/ev-document-find.c b/libdocument/ev-document-find.c
index 02fbae2..59b8755 100644
--- a/libdocument/ev-document-find.c
+++ b/libdocument/ev-document-find.c
@@ -21,9 +21,6 @@
#include "config.h"
#include "ev-document-find.h"
-#include "ev-backend-marshalers.h"
-
-static void ev_document_find_base_init (gpointer g_class);
GType
ev_document_find_get_type (void)
@@ -35,7 +32,7 @@ ev_document_find_get_type (void)
const GTypeInfo our_info =
{
sizeof (EvDocumentFindIface),
- ev_document_find_base_init,
+ NULL,
NULL,
};
@@ -47,80 +44,14 @@ ev_document_find_get_type (void)
return type;
}
-static void
-ev_document_find_base_init (gpointer g_class)
-{
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- g_signal_new ("find_changed",
- EV_TYPE_DOCUMENT_FIND,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EvDocumentFindIface, find_changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
-
- initialized = TRUE;
- }
-}
-
-void
-ev_document_find_begin (EvDocumentFind *document_find,
- int page,
- const char *search_string,
- gboolean case_sensitive)
+GList *
+ev_document_find_find_text (EvDocumentFind *document_find,
+ EvPage *page,
+ const gchar *text,
+ gboolean case_sensitive)
{
EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
-
- g_return_if_fail (search_string != NULL);
-
- iface->begin (document_find, page, search_string, case_sensitive);
-}
-
-void
-ev_document_find_cancel (EvDocumentFind *document_find)
-{
- EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
- iface->cancel (document_find);
+
+ return iface->find_text (document_find, page, text, case_sensitive);
}
-int
-ev_document_find_page_has_results (EvDocumentFind *document_find,
- int page)
-{
- EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
- return iface->page_has_results (document_find, page);
-}
-
-int
-ev_document_find_get_n_results (EvDocumentFind *document_find,
- int page)
-{
- EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
- return iface->get_n_results (document_find, page);
-}
-
-gboolean
-ev_document_find_get_result (EvDocumentFind *document_find,
- int page,
- int n_result,
- EvRectangle *rectangle)
-{
- EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
- return iface->get_result (document_find, page, n_result, rectangle);
-}
-
-double
-ev_document_find_get_progress (EvDocumentFind *document_find)
-{
- EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
- return iface->get_progress (document_find);
-}
-
-void
-ev_document_find_changed (EvDocumentFind *document_find, int page)
-{
- g_signal_emit_by_name (document_find, "find_changed", page);
-}
diff --git a/libdocument/ev-document-find.h b/libdocument/ev-document-find.h
index f365df1..40db017 100644
--- a/libdocument/ev-document-find.h
+++ b/libdocument/ev-document-find.h
@@ -24,9 +24,8 @@
#include <glib-object.h>
#include <glib.h>
-#include <gdk/gdk.h>
-#include "ev-document.h" /* For EvRectangle */
+#include "ev-document.h"
G_BEGIN_DECLS
@@ -37,62 +36,26 @@ G_BEGIN_DECLS
#define EV_IS_DOCUMENT_FIND_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_DOCUMENT_FIND))
#define EV_DOCUMENT_FIND_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_DOCUMENT_FIND, EvDocumentFindIface))
-typedef struct _EvDocumentFind EvDocumentFind;
-typedef struct _EvDocumentFindIface EvDocumentFindIface;
+typedef struct _EvDocumentFind EvDocumentFind;
+typedef struct _EvDocumentFindIface EvDocumentFindIface;
struct _EvDocumentFindIface
{
GTypeInterface base_iface;
/* Methods */
-
- void (* begin) (EvDocumentFind *document_find,
- int page,
- const char *search_string,
- gboolean case_sensitive);
- void (* cancel) (EvDocumentFind *document_find);
- int (* page_has_results) (EvDocumentFind *document_find,
- int page);
- int (* get_n_results) (EvDocumentFind *document_find,
- int page);
- gboolean (* get_result) (EvDocumentFind *document_find,
- int page,
- int n_result,
- EvRectangle *rectangle);
- double (* get_progress) (EvDocumentFind *document_find);
-
- /* Signals */
-
- void (* find_changed) (EvDocumentFind *document_find,
- int page);
+ GList *(* find_text) (EvDocumentFind *document_find,
+ EvPage *page,
+ const gchar *text,
+ gboolean case_sensitive);
};
-GType ev_document_find_get_type (void);
-void ev_document_find_begin (EvDocumentFind *document_find,
- int page,
- const char *search_string,
- gboolean case_sensitive);
-void ev_document_find_cancel (EvDocumentFind *document_find);
-int ev_document_find_page_has_results (EvDocumentFind *document_find,
- int page);
-int ev_document_find_get_n_results (EvDocumentFind *document_find,
- int page);
-gboolean ev_document_find_get_result (EvDocumentFind *document_find,
- int page,
- int n_result,
- EvRectangle *rectangle);
-double ev_document_find_get_progress (EvDocumentFind *document_find);
-void ev_document_find_changed (EvDocumentFind *document_find,
- int page);
-
-/* How this interface works:
- *
- * begin() begins a new search, canceling any previous search.
- *
- * cancel() cancels a search if any, otherwise does nothing.
- *
- */
+GType ev_document_find_get_type (void) G_GNUC_CONST;
+GList *ev_document_find_find_text (EvDocumentFind *document_find,
+ EvPage *page,
+ const gchar *text,
+ gboolean case_sensitive);
G_END_DECLS
-#endif
+#endif /* EV_DOCUMENT_FIND_H */