Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-05-29 07:27:23 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-05-29 07:27:23 (GMT)
commit8e94fdff19bd0fec3d8932ec750b7386fc1c151b (patch)
treeec87cd61f0403bd6ad4e3895d81c42e683f8cd1e /backend
parent560a7e43fe1f899e72130cb4ab1175d325f8e43c (diff)
modify the expose handling to get the shadows.
Sat May 28 07:38:03 2005 Jonathan Blandford <jrb@redhat.com> * shell/ev-view.c (draw_one_page): modify the expose handling to get the shadows. * shell/ev-window.c (update_action_sensitivity): Respect permissions field. Kowtow to the man. * pdf/ev-poppler.cc: Get the permissions field. * tiff/*c: Make a tiny bit more robust.
Diffstat (limited to 'backend')
-rw-r--r--backend/ev-document-info.h15
-rw-r--r--backend/ev-document.h1
-rw-r--r--backend/ev-page-cache.c13
-rw-r--r--backend/ev-page-cache.h1
4 files changed, 30 insertions, 0 deletions
diff --git a/backend/ev-document-info.h b/backend/ev-document-info.h
index 15d27d0..02ea5b1 100644
--- a/backend/ev-document-info.h
+++ b/backend/ev-document-info.h
@@ -60,6 +60,19 @@ typedef enum
EV_DOCUMENT_UI_HINT_DIRECTION_RTL = 1 << 6,
} EvDocumentUIHints;
+
+typedef enum
+{
+ EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT = 1 << 0,
+ EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY = 1 << 1,
+ EV_DOCUMENT_PERMISSIONS_OK_TO_COPY = 1 << 2,
+ EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3,
+ EV_DOCUMENT_PERMISSIONS_FULL = (EV_DOCUMENT_PERMISSIONS_OK_TO_PRINT
+ | EV_DOCUMENT_PERMISSIONS_OK_TO_MODIFY
+ | EV_DOCUMENT_PERMISSIONS_OK_TO_COPY
+ | EV_DOCUMENT_PERMISSIONS_OK_TO_ADD_NOTES),
+} EvDocumentPermissions;
+
typedef enum
{
EV_DOCUMENT_INFO_TITLE = 1 << 0,
@@ -71,6 +84,7 @@ typedef enum
EV_DOCUMENT_INFO_START_MODE = 1 << 6,
EV_DOCUMENT_INFO_CREATION_DATE = 1 << 7,
EV_DOCUMENT_INFO_UI_HINTS = 1 << 8,
+ EV_DOCUMENT_INFO_PERMISSIONS = 1 << 9,
} EvDocumentInfoFields;
struct _EvDocumentInfo
@@ -84,6 +98,7 @@ struct _EvDocumentInfo
EvDocumentMode mode;
GDate creation_date;
guint ui_hints;
+ guint permissions;
/* Mask of all the valid fields */
guint fields_mask;
diff --git a/backend/ev-document.h b/backend/ev-document.h
index da38283..6ff356f 100644
--- a/backend/ev-document.h
+++ b/backend/ev-document.h
@@ -99,6 +99,7 @@ EvPageCache *ev_document_get_page_cache (EvDocument *document);
GMutex *ev_document_get_doc_mutex (void);
void ev_document_doc_mutex_lock (void);
void ev_document_doc_mutex_unlock (void);
+
EvDocumentInfo *ev_document_get_info (EvDocument *document);
gboolean ev_document_load (EvDocument *document,
const char *uri,
diff --git a/backend/ev-page-cache.c b/backend/ev-page-cache.c
index 6302c42..36adf93 100644
--- a/backend/ev-page-cache.c
+++ b/backend/ev-page-cache.c
@@ -32,6 +32,7 @@ struct _EvPageCache
double max_height_page_height;
EvPageCacheInfo *size_cache;
+ EvDocumentInfo *page_info;
};
struct _EvPageCacheClass
@@ -91,6 +92,7 @@ ev_page_cache_finalize (GObject *object)
g_free (page_cache->title);
g_free (page_cache->size_cache);
+ ev_document_info_free (page_cache->page_info);
}
EvPageCache *
@@ -180,6 +182,8 @@ _ev_page_cache_new (EvDocument *document)
}
}
+ page_cache->page_info = ev_document_get_info (document);
+
/* make some sanity check assertions */
if (! page_cache->uniform)
g_assert (page_cache->size_cache != NULL);
@@ -366,6 +370,15 @@ ev_page_cache_has_nonnumeric_page_labels (EvPageCache *page_cache)
return page_cache->has_labels;
}
+const EvDocumentInfo *
+ev_page_cache_get_info (EvPageCache *page_cache)
+{
+ g_return_val_if_fail (EV_IS_PAGE_CACHE (page_cache), NULL);
+
+ return page_cache->page_info;
+}
+
+
gboolean
ev_page_cache_next_page (EvPageCache *page_cache)
{
diff --git a/backend/ev-page-cache.h b/backend/ev-page-cache.h
index 6b9db53..fc1111b 100644
--- a/backend/ev-page-cache.h
+++ b/backend/ev-page-cache.h
@@ -50,6 +50,7 @@ void ev_page_cache_get_max_height_size (EvPageCache *page_cache,
char *ev_page_cache_get_page_label (EvPageCache *page_cache,
gint page);
gboolean ev_page_cache_has_nonnumeric_page_labels (EvPageCache *page_cache);
+const EvDocumentInfo *ev_page_cache_get_info (EvPageCache *page_cache);
/* Navigation */
gint ev_page_cache_get_current_page (EvPageCache *page_cache);