-static EvOrientation
-pdf_document_get_orientation (EvDocument *document)
-{
- EvOrientation result;
- PdfDocument *pdf_document = PDF_DOCUMENT (document);
-
- if (!pdf_document->orientation_set) {
- pdf_document->orientation = get_document_orientation (pdf_document);
- }
-
- switch (pdf_document->orientation) {
- case POPPLER_ORIENTATION_PORTRAIT:
- result = EV_ORIENTATION_PORTRAIT;
- break;
- case POPPLER_ORIENTATION_LANDSCAPE:
- result = EV_ORIENTATION_LANDSCAPE;
- break;
- case POPPLER_ORIENTATION_UPSIDEDOWN:
- result = EV_ORIENTATION_UPSIDEDOWN;
- break;
- case POPPLER_ORIENTATION_SEASCAPE:
- result = EV_ORIENTATION_SEASCAPE;
- break;
- default:
- g_assert_not_reached ();
- }
-
- return result;
-}
-
-static void
-pdf_document_set_orientation (EvDocument *document, EvOrientation orientation)
-{
- PdfDocument *pdf_document = PDF_DOCUMENT (document);
- PopplerOrientation poppler_orientation;
-
- switch (orientation) {
- case EV_ORIENTATION_PORTRAIT:
- poppler_orientation = POPPLER_ORIENTATION_PORTRAIT;
- break;
- case EV_ORIENTATION_LANDSCAPE:
- poppler_orientation = POPPLER_ORIENTATION_LANDSCAPE;
- break;
- case EV_ORIENTATION_UPSIDEDOWN:
- poppler_orientation = POPPLER_ORIENTATION_UPSIDEDOWN;
- break;
- case EV_ORIENTATION_SEASCAPE:
- poppler_orientation = POPPLER_ORIENTATION_SEASCAPE;
- break;
- default:
- g_assert_not_reached ();
- }
-
- pdf_document->orientation = poppler_orientation;
- pdf_document->orientation_set = TRUE;
-}
-