X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=libdocument%2Fev-document.h;h=63d2a8ec7e71c561240de009f7c9db6bdd67aa4f;hb=aeadd8e191190c43e94999fef077ebea69e966c9;hp=32cdc1fdac8b96b52d067a11882dd6f7ea7e2c49;hpb=c218c0fc841709a869f41e538ccf38df4d48d175;p=evince.git diff --git a/libdocument/ev-document.h b/libdocument/ev-document.h index 32cdc1fd..63d2a8ec 100644 --- a/libdocument/ev-document.h +++ b/libdocument/ev-document.h @@ -15,7 +15,7 @@ * * 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. * * $Id$ */ @@ -49,9 +49,6 @@ typedef struct _EvDocument EvDocument; typedef struct _EvDocumentClass EvDocumentClass; typedef struct _EvDocumentPrivate EvDocumentPrivate; -typedef struct _EvPageCache EvPageCache; -typedef struct _EvPageCacheClass EvPageCacheClass; - #define EV_DOCUMENT_ERROR ev_document_error_quark () #define EV_DOC_MUTEX_LOCK (ev_document_doc_mutex_lock ()) #define EV_DOC_MUTEX_UNLOCK (ev_document_doc_mutex_unlock ()) @@ -68,6 +65,20 @@ typedef struct { } EvPoint; typedef struct _EvRectangle EvRectangle; +typedef struct _EvMapping EvMapping; + +typedef struct _EvDocumentBackendInfo EvDocumentBackendInfo; +struct _EvDocumentBackendInfo +{ + const gchar *name; + const gchar *version; +}; + +typedef struct { + const gchar *filename; + gint line; + gint col; +} EvSourceLink; struct _EvDocument { @@ -99,6 +110,9 @@ struct _EvDocumentClass cairo_surface_t * (* render) (EvDocument *document, EvRenderContext *rc); EvDocumentInfo * (* get_info) (EvDocument *document); + gboolean (* get_backend_info)(EvDocument *document, + EvDocumentBackendInfo *info); + gboolean (* support_synctex) (EvDocument *document); }; GType ev_document_get_type (void) G_GNUC_CONST; @@ -117,6 +131,8 @@ void ev_document_fc_mutex_unlock (void); gboolean ev_document_fc_mutex_trylock (void); EvDocumentInfo *ev_document_get_info (EvDocument *document); +gboolean ev_document_get_backend_info (EvDocument *document, + EvDocumentBackendInfo *info); gboolean ev_document_load (EvDocument *document, const char *uri, GError **error); @@ -140,12 +156,26 @@ gboolean ev_document_is_page_size_uniform (EvDocument *document); void ev_document_get_max_page_size (EvDocument *document, gdouble *width, gdouble *height); +void ev_document_get_min_page_size (EvDocument *document, + gdouble *width, + gdouble *height); gboolean ev_document_check_dimensions (EvDocument *document); gint ev_document_get_max_label_len (EvDocument *document); gboolean ev_document_has_text_page_labels (EvDocument *document); gboolean ev_document_find_page_by_label (EvDocument *document, const gchar *page_label, gint *page_index); +gboolean ev_document_has_synctex (EvDocument *document); + +EvSourceLink *ev_document_synctex_backward_search + (EvDocument *document, + gint page_index, + gfloat x, + gfloat y); + +EvMapping *ev_document_synctex_forward_search + (EvDocument *document, + EvSourceLink *source_link); gint ev_rect_cmp (EvRectangle *a, EvRectangle *b); @@ -164,6 +194,11 @@ EvRectangle *ev_rectangle_new (void); EvRectangle *ev_rectangle_copy (EvRectangle *ev_rect); void ev_rectangle_free (EvRectangle *ev_rect); +struct _EvMapping { + EvRectangle area; + gpointer data; +}; + /* convenience macro to ease interface addition in the CODE * section of EV_BACKEND_REGISTER_WITH_CODE (this macro relies on * the g_define_type_id present within EV_BACKEND_REGISTER_WITH_CODE()). @@ -263,56 +298,6 @@ type_name##_get_type (void) return g_define_type_id__volatile; \ } -/* A convenience macro for GTypeInterface definitions, which declares - * a default vtable initialization function and defines a *_get_type() - * function. - * - * The macro expects the interface initialization function to have the - * name t_n ## _default_init, and the interface - * structure to have the name TN ## Interface. - */ -#define EV_DEFINE_INTERFACE(TypeName, type_name, TYPE_PREREQ) \ -static void type_name##_class_init (TypeName##Iface *klass); \ - \ -GType \ -type_name##_get_type (void) \ -{ \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_type_register_static_simple (G_TYPE_INTERFACE, \ - g_intern_static_string (#TypeName), \ - sizeof (TypeName##Iface), \ - (GClassInitFunc)type_name##_class_init, \ - 0, \ - (GInstanceInitFunc)NULL, \ - (GTypeFlags) 0); \ - if (TYPE_PREREQ) \ - g_type_interface_add_prerequisite (g_define_type_id, TYPE_PREREQ); \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ - } \ - return g_define_type_id__volatile; \ -} - -/* - * A convenience macro for boxed type implementations, which defines a - * type_name_get_type() function registering the boxed type. - */ -#define EV_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) \ -GType \ -type_name##_get_type (void) \ -{ \ - static volatile gsize g_define_type_id__volatile = 0; \ - if (g_once_init_enter (&g_define_type_id__volatile)) { \ - GType g_define_type_id = \ - g_boxed_type_register_static (g_intern_static_string (#TypeName), \ - (GBoxedCopyFunc) copy_func, \ - (GBoxedFreeFunc) free_func); \ - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); \ - } \ - return g_define_type_id__volatile; \ -} - G_END_DECLS #endif /* EV_DOCUMENT_H */