Readme updated, PDF Page interface

presentation
Andreas Butti 7 years ago
parent ccb7abb1ad
commit 1bdf1419ea
  1. 9
      README.md
  2. 8
      src/gui/dialog/backgroundSelect/PdfElementView.cpp
  3. 6
      src/gui/dialog/backgroundSelect/PdfElementView.h
  4. 11
      src/pdf/base/XojPdfPage.cpp
  5. 32
      src/pdf/base/XojPdfPage.h
  6. 4
      src/pdf/popplerdirect/poppler/XojPopplerPage.h
  7. 5
      src/util/XournalTypeList.h

@ -98,12 +98,6 @@ To install all needed files execute:
```bash
make install
```
If you want to install desktop file and thumbnailer execute:
```bash
make desktop-install
```
## Code documentation
The code documentation is generated using Doxygen.
@ -120,9 +114,6 @@ The documentation can be found in `doc/html` and `doc/latex`. Conveniently displ
documentation with `python3 -m http.server 8000` and visit the shown URL to view the
documentation.
The website https://cypax.net/tutorials/doxygen/ provides a good introduction to Doxygen
and how to document code with it.
## Fileformat
The fileformat *.xopp is an XML which is .gz compressed. PDFs are not embedded
into the file, so if the PDF is deleted, the background is lost.

@ -2,11 +2,13 @@
#include "PdfPagesDialog.h"
#include "pdf/popplerdirect/poppler/XojPopplerPage.h"
#include "pdf/base/XojPdfPage.h"
PdfElementView::PdfElementView(int id, XojPopplerPage* page, PdfPagesDialog* dlg)
: BaseElementView(id, dlg), page(page), used(false)
PdfElementView::PdfElementView(int id, XojPdfPage* page, PdfPagesDialog* dlg)
: BaseElementView(id, dlg),
page(page),
used(false)
{
XOJ_INIT_TYPE(PdfElementView);
}

@ -15,13 +15,13 @@
#include <XournalType.h>
class XojPopplerPage;
class XojPdfPage;
class PdfPagesDialog;
class PdfElementView : public BaseElementView
{
public:
PdfElementView(int id, XojPopplerPage* page, PdfPagesDialog* dlg);
PdfElementView(int id, XojPdfPage* page, PdfPagesDialog* dlg);
~PdfElementView();
protected:
@ -49,7 +49,7 @@ public:
private:
XOJ_TYPE_ATTRIB;
XojPopplerPage* page;
XojPdfPage* page;
/**
* This page is already used as background

@ -0,0 +1,11 @@
#include "XojPdfPage.h"
XojPdfPage::XojPdfPage()
{
XOJ_INIT_TYPE(XojPdfPage);
}
XojPdfPage::~XojPdfPage()
{
XOJ_RELEASE_TYPE(XojPdfPage);
}

@ -0,0 +1,32 @@
/*
* Xournal++
*
* PDF Page Abstraction Interface
*
* @author Xournal++ Team
* https://github.com/xournalpp/xournalpp
*
* @license GNU GPLv2 or later
*/
#pragma once
#include <XournalType.h>
#include <cairo/cairo.h>
class XojPdfPage
{
public:
XojPdfPage();
virtual ~XojPdfPage();
public:
virtual double getWidth() = 0;
virtual double getHeight() = 0;
virtual void render(cairo_t* cr, bool forPrinting = false) = 0;
private:
XOJ_TYPE_ATTRIB;
};

@ -17,7 +17,9 @@
#include <poppler/OptionalContent.h>
#include <poppler/PDFDoc.h>
#include <poppler/TextOutputDev.h>
#include "pdf/popplerdirect/workaround/workaround.h"
#include "pdf/base/XojPdfPage.h"
#include <StringUtils.h>
#include <XournalType.h>
@ -29,7 +31,7 @@ class TextPage;
class Annots;
class XojPopplerImage;
class XojPopplerPage
class XojPopplerPage : public XojPdfPage
{
private:
XojPopplerPage(PDFDoc* doc, GMutex* docMutex, CairoOutputDev* outputDev, Page* page, int index);

@ -245,3 +245,8 @@ XOJ_DECLARE_TYPE(DottedBackgroundPainter, 233);
XOJ_DECLARE_TYPE(BaseBackgroundPainter, 234);
XOJ_DECLARE_TYPE(BackgroundConfig, 235);
XOJ_DECLARE_TYPE(RotateUndoAction, 236);
XOJ_DECLARE_TYPE(XojPdfPage, 237);

Loading…
Cancel
Save