From ae6a79781ff5126c19c84570277376f43158ec86 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 29 Jan 2005 17:50:09 +0000 Subject: Enanche the find interface to be really able to do multi page find. 2005-01-29 Marco Pesenti Gritti * backend/ev-backend-marshalers.list: * backend/ev-document-find.c: (ev_document_find_base_init), (ev_document_find_cancel), (ev_document_find_page_has_results), (ev_document_find_get_n_results), (ev_document_find_get_result), (ev_document_find_get_progress), (ev_document_find_changed): * backend/ev-document-find.h: Enanche the find interface to be really able to do multi page find. * pdf/xpdf/pdf-document.cc: Implement * shell/ev-view.c: (ev_view_finalize), (highlight_find_results), (expose_bin_window), (ev_view_init), (ev_view_get_find_status_message), (find_changed_cb), (ev_view_set_document), (set_document_page): Adapt to the new interface. A few things are regressed sorry, I will finish it soon. --- (limited to 'backend/ev-document-find.h') diff --git a/backend/ev-document-find.h b/backend/ev-document-find.h index 112faf2..d17b9de 100644 --- a/backend/ev-document-find.h +++ b/backend/ev-document-find.h @@ -28,12 +28,6 @@ G_BEGIN_DECLS -typedef struct -{ - int page_num; - GdkRectangle highlight_area; -} EvFindResult; - #define EV_TYPE_DOCUMENT_FIND (ev_document_find_get_type ()) #define EV_DOCUMENT_FIND(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_DOCUMENT_FIND, EvDocumentFind)) #define EV_DOCUMENT_FIND_IFACE(k) (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_DOCUMENT_FIND, EvDocumentFindIface)) @@ -50,29 +44,38 @@ struct _EvDocumentFindIface /* Methods */ - void (* begin) (EvDocumentFind *document_find, - const char *search_string, - gboolean case_sensitive); - void (* cancel) (EvDocumentFind *document_find); + void (* begin) (EvDocumentFind *document_find, + 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); + gboolean (* get_result) (EvDocumentFind *document_find, + int n_result, + GdkRectangle *rectangle); + void (* get_progress) (EvDocumentFind *document_find, + double percent_complete); /* Signals */ - void (* found) (EvDocumentFind *document_find, - const EvFindResult *results, - int n_results, - double percent_complete); + void (* find_changed) (EvDocumentFind *document_find); }; -GType ev_document_find_get_type (void); - -void ev_document_find_begin (EvDocumentFind *document_find, - const char *search_string, - gboolean case_sensitive); -void ev_document_find_cancel (EvDocumentFind *document_find); -void ev_document_find_found (EvDocumentFind *document_find, - const EvFindResult *results, - int n_results, - double percent_complete); +GType ev_document_find_get_type (void); +void ev_document_find_begin (EvDocumentFind *document_find, + 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); +gboolean ev_document_find_get_result (EvDocumentFind *document_find, + int n_result, + GdkRectangle *rectangle); +void ev_document_find_get_progress (EvDocumentFind *document_find, + double percent_complete); +void ev_document_find_changed (EvDocumentFind *document_find); /* How this interface works: @@ -81,14 +84,6 @@ void ev_document_find_found (EvDocumentFind *document_find, * * cancel() cancels a search if any, otherwise does nothing. * - * If begin() has been called and cancel() has not, then the - * "found" signal can be emitted at any time. - * The results given in the "found" signal are always all-inclusive, - * that is, the array will contain all results found so far. - * There are no guarantees about the ordering of the array, - * or consistency of ordering between "found" signal emissions. - * - * When cancel() is called, "found" will always be emitted with NULL,0 */ G_END_DECLS -- cgit v0.9.1