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.c') diff --git a/backend/ev-document-find.c b/backend/ev-document-find.c index 78c07c9..9dc05c4 100644 --- a/backend/ev-document-find.c +++ b/backend/ev-document-find.c @@ -53,16 +53,13 @@ ev_document_find_base_init (gpointer g_class) static gboolean initialized = FALSE; if (!initialized) { - g_signal_new ("found", + g_signal_new ("find_changed", EV_TYPE_DOCUMENT_FIND, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EvDocumentFindIface, found), + G_STRUCT_OFFSET (EvDocumentFindIface, find_changed), NULL, NULL, - _ev_backend_marshal_VOID__POINTER_INT_DOUBLE, - G_TYPE_NONE, 3, - G_TYPE_POINTER, - G_TYPE_INT, - G_TYPE_DOUBLE); + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); initialized = TRUE; } @@ -85,18 +82,43 @@ ev_document_find_cancel (EvDocumentFind *document_find) { EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find); iface->cancel (document_find); +} + +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) +{ + EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find); + return iface->get_n_results (document_find); +} + +gboolean +ev_document_find_get_result (EvDocumentFind *document_find, + int n_result, + GdkRectangle *rectangle) +{ + EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find); + return iface->get_result (document_find, n_result, rectangle); +} - ev_document_find_found (document_find, NULL, 0, 1.0); +void +ev_document_find_get_progress (EvDocumentFind *document_find, + double percent_complete) +{ + EvDocumentFindIface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find); + iface->get_progress (document_find, percent_complete); } void -ev_document_find_found (EvDocumentFind *document_find, - const EvFindResult *results, - int n_results, - double percent_complete) +ev_document_find_changed (EvDocumentFind *document_find) { - g_signal_emit_by_name (document_find, - "found", - results, n_results, percent_complete); + g_signal_emit_by_name (document_find, "find_changed"); } -- cgit v0.9.1