Adding meta-data to a document
- From: Jonathan Blandford <jrb redhat com>
- To: evince-list gnome org
- Subject: Adding meta-data to a document
- Date: 13 Apr 2005 01:31:24 -0400
We need a way to pass back meta-information from the document. We need
this both for the properties dialog, as well as for setting up the
document initially.
I wrote a quick proposed header to handle this, and will implement it
for the pdf backend at some point. None of these fields are mandatory,
and even most PDFs won't support them all. It will let us do cool
things like go into full-screen mode immediately with presentations. I
got most of these fields from the PDF spec. If any of the other formats
support anything interesting, we should add them as well.
Suggestions?
-Jonathan
? shell/refdbg.log
Index: backend/Makefile.am
===================================================================
RCS file: /cvs/gnome/evince/backend/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- backend/Makefile.am 23 Mar 2005 11:07:31 -0000 1.13
+++ backend/Makefile.am 13 Apr 2005 05:29:30 -0000
@@ -23,6 +23,7 @@ libevbackend_la_SOURCES= \
ev-document-security.h \
ev-document-find.c \
ev-document-find.h \
+ ev-document-info.h \
ev-job-queue.h \
ev-job-queue.c \
ev-jobs.h \
Index: backend/ev-document-info.h
===================================================================
RCS file: backend/ev-document-info.h
diff -N backend/ev-document-info.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ backend/ev-document-info.h 13 Apr 2005 05:29:30 -0000
@@ -0,0 +1,93 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
+/*
+ * Copyright (C) 2000-2003 Marco Pesenti Gritti
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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.
+ *
+ */
+
+#ifndef EV_DOCUMENT_INFO_H
+#define EV_DOCUMENT_INFO_H
+
+#include <glib-object.h>
+#include <glib.h>
+#include "ev-link.h"
+
+G_BEGIN_DECLS
+
+typedef struct _EvDocumentInfo EvDocumentInfo;
+
+typedef enum
+{
+ EV_DOCUMENT_LAYOUT_SINGLE_PAGE,
+ EV_DOCUMENT_LAYOUT_ONE_COLUMN,
+ EV_DOCUMENT_LAYOUT_TWO_COLUMN_LEFT,
+ EV_DOCUMENT_LAYOUT_TWO_COLUMN_RIGHT,
+ EV_DOCUMENT_LAYOUT_TWO_PAGE_LEFT,
+ EV_DOCUMENT_LAYOUT_TWO_PAGE_RIGHT,
+} EvDocumentLayout;
+
+typedef enum
+{
+ EV_DOCUMENT_START_NONE,
+ EV_DOCUMENT_START_USE_OUTLINES,
+ EV_DOCUMENT_START_USE_THUMBS,
+ EV_DOCUMENT_START_FULL_SCREEN,
+ EV_DOCUMENT_START_PRESENTATION = EV_DOCUMENT_START_FULL_SCREEN /* Will these be different? */
+} EvDocumentStartMode;
+
+typedef enum
+{
+ EV_DOCUMENT_UI_HINT_HIDE_TOOLBAR = 1 << 0,
+ EV_DOCUMENT_UI_HINT_HIDE_MENUBAR = 1 << 1,
+ EV_DOCUMENT_UI_HINT_HIDE_WINDOWUI = 1 << 2,
+ EV_DOCUMENT_UI_HINT_FIT_WINDOW = 1 << 3,
+ EV_DOCUMENT_UI_HINT_CENTER_WINDOW = 1 << 4,
+ EV_DOCUMENT_UI_HINT_DISPLAY_DOC_TITLE = 1 << 5,
+ EV_DOCUMENT_UI_HINT_DIRECTION = 1 << 6,
+} EvDocumentUiHints;
+
+typedef enum
+{
+ EV_DOCUMENT_INFO_TITLE = 1 << 0,
+ EV_DOCUMENT_INFO_FORMAT = 1 << 1,
+ EV_DOCUMENT_INFO_AUTHOR = 1 << 2,
+ EV_DOCUMENT_INFO_SUBJECT = 1 << 3,
+ EV_DOCUMENT_INFO_KEYWORDS = 1 << 4,
+ EV_DOCUMENT_INFO_LAYOUT = 1 << 5,
+ EV_DOCUMENT_INFO_START_MODE = 1 << 6,
+ EV_DOCUMENT_INFO_CREATION_DATE = 1 << 7,
+ EV_DOCUMENT_INFO_UI_HINTS = 1 << 8,
+} EvDocumentInfoFields;
+
+struct _EvDocumentInfo
+{
+ const char *title;
+ const char *format; /* eg, "pdf-1.5" */
+ const char *author;
+ const char *subject;
+ const char *keywords;
+ EvDocumentLayout layout;
+ EvDocumentStartMode start_mode;
+ GDate *creation_date;
+ guint ui_hints;
+
+ /* Mask of all the valid fields */
+ guint fields_mask;
+};
+
+G_END_DECLS
+
+#endif /* EV_DOCUMENT_INFO_H */
Index: backend/ev-document.h
===================================================================
RCS file: /cvs/gnome/evince/backend/ev-document.h,v
retrieving revision 1.20
diff -u -p -r1.20 ev-document.h
--- backend/ev-document.h 5 Apr 2005 00:40:57 -0000 1.20
+++ backend/ev-document.h 13 Apr 2005 05:29:30 -0000
@@ -27,6 +27,7 @@
#include <gdk/gdk.h>
#include "ev-link.h"
+#include "ev-document-info.h"
G_BEGIN_DECLS
@@ -95,6 +96,7 @@ EvPageCache *ev_document_get_page_cache
GMutex *ev_document_get_doc_mutex (void);
+EvDocumentInfo *ev_document_get_info (EvDocument *document);
gboolean ev_document_load (EvDocument *document,
const char *uri,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]