From 9317aeb2e299d6fdf18dbf22b6a4707e4d149dd5 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 22 Dec 2004 04:37:26 +0000 Subject: add marshaler-generator thingy. I'm sure there's a better way to do this 2004-12-21 Havoc Pennington * backend/ev-backend-marshal.c, backend/ev-backend-marshalers.list, backend/Makefile.am: add marshaler-generator thingy. I'm sure there's a better way to do this in the modern world. * backend/ev-document.h (struct _EvDocumentIface): add begin_find, end_find methods and "found" signal. * configure.ac: find glib-genmarshal --- (limited to 'backend/ev-document.c') diff --git a/backend/ev-document.c b/backend/ev-document.c index 3ed1181..02c2442 100644 --- a/backend/ev-document.c +++ b/backend/ev-document.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */ /* * Copyright (C) 2004 Marco Pesenti Gritti * @@ -20,6 +21,7 @@ #include "config.h" #include "ev-document.h" +#include "ev-backend-marshal.c" static void ev_document_base_init (gpointer g_class); @@ -48,6 +50,22 @@ ev_document_get_type (void) static void ev_document_base_init (gpointer g_class) { + static gboolean initialized = FALSE; + + if (!initialized) { + g_signal_new ("found", + EV_TYPE_DOCUMENT, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EvDocumentIface, found), + NULL, NULL, + _ev_backend_marshal_VOID__POINTER_INT_DOUBLE, + G_TYPE_NONE, 3, + G_TYPE_POINTER, + G_TYPE_INT, + G_TYPE_DOUBLE); + + initialized = TRUE; + } } gboolean @@ -118,3 +136,19 @@ ev_document_render (EvDocument *document, EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); iface->render (document, clip_x, clip_y, clip_width, clip_height); } + +void +ev_document_begin_find (EvDocument *document, + const char *search_string, + gboolean case_sensitive) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + iface->begin_find (document, search_string, case_sensitive); +} + +void +ev_document_end_find (EvDocument *document) +{ + EvDocumentIface *iface = EV_DOCUMENT_GET_IFACE (document); + iface->end_find (document); +} -- cgit v0.9.1