]> www.fi.muni.cz Git - evince.git/blobdiff - libdocument/ev-document-find.c
[dualscreen] fix crash on ctrl+w and fix control window closing
[evince.git] / libdocument / ev-document-find.c
index 02fbae2e122ff3b3eae4a85a2a6fe219374c29c4..0b5fac011ce70dbe20641628d0045ddda89a485a 100644 (file)
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  *
  */
 
 #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)
-{
-       static GType type = 0;
-
-       if (G_UNLIKELY (type == 0))
-       {
-               const GTypeInfo our_info =
-               {
-                       sizeof (EvDocumentFindIface),
-                       ev_document_find_base_init,
-                       NULL,
-               };
-
-               type = g_type_register_static (G_TYPE_INTERFACE,
-                                              "EvDocumentFind",
-                                              &our_info, (GTypeFlags)0);
-       }
-
-       return type;
-}
+G_DEFINE_INTERFACE (EvDocumentFind, ev_document_find, 0)
 
 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)
-{
-       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)
+ev_document_find_default_init (EvDocumentFindInterface *klass)
 {
-       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)
+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);
-       return iface->page_has_results (document_find, page);
+       EvDocumentFindInterface *iface = EV_DOCUMENT_FIND_GET_IFACE (document_find);
+       
+       return iface->find_text (document_find, page, text, case_sensitive);
 }
 
-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);
-}