[poppler] 3 commits - configure.ac qt4/CMakeLists.txt qt4/demos qt4/Makefile.am

Pino Toscano pino at kemper.freedesktop.org
Fri Feb 15 15:33:05 PST 2008


 configure.ac              |    1 +
 qt4/CMakeLists.txt        |    1 +
 qt4/Makefile.am           |    2 +-
 qt4/demos/CMakeLists.txt  |   17 +++++++++++++++++
 qt4/demos/Makefile.am     |   28 ++++++++++++++++++++++++++++
 qt4/demos/main_viewer.cpp |   29 +++++++++++++++++++++++++++++
 qt4/demos/viewer.cpp      |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 qt4/demos/viewer.h        |   45 +++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 168 insertions(+), 1 deletion(-)

New commits:
commit 14c88853a5675f40efb72f3ef01f49eb06ab846c
Author: Pino Toscano <pino at kde.org>
Date:   Sat Feb 16 00:32:30 2008 +0100

    Compile the poppler_qt4viewer.

diff --git a/qt4/demos/CMakeLists.txt b/qt4/demos/CMakeLists.txt
index 7b1950f..17367bb 100644
--- a/qt4/demos/CMakeLists.txt
+++ b/qt4/demos/CMakeLists.txt
@@ -8,3 +8,10 @@ include_directories(
   ${QT4_INCLUDE_DIR}
 )
 
+set(poppler_qt4viewer_SRCS
+  main_viewer.cpp
+  viewer.cpp
+)
+qt4_automoc(${poppler_qt4viewer_SRCS})
+poppler_add_test(poppler_qt4viewer BUILD_QT4_TESTS ${poppler_qt4viewer_SRCS})
+target_link_libraries(poppler_qt4viewer poppler-qt4)
diff --git a/qt4/demos/Makefile.am b/qt4/demos/Makefile.am
index 3d1cf43..a93adb7 100644
--- a/qt4/demos/Makefile.am
+++ b/qt4/demos/Makefile.am
@@ -14,7 +14,15 @@ LDADDS =					\
 
 SUFFIXES: .moc
 
-# This rule lets GNU make create any moc_*.cpp from the equivalent *.h
-moc_%.cpp: %.h
+# This rule lets GNU make create any *.moc from the equivalent *.h
+%.moc: %.h
 	moc $< -o $@
 
+noinst_PROGRAMS = poppler_qt4viewer
+
+poppler_qt4viewer_SOURCES =			\
+	main_viewer.cpp				\
+	viewer.cpp				\
+	viewer.moc
+
+poppler_qt4viewer_LDADD = $(LDADDS)
commit aeb591f015d5e7a2643ed75d872358d2b1256b99
Author: Pino Toscano <pino at kde.org>
Date:   Sat Feb 16 00:31:46 2008 +0100

    Add a very minimal base PDF viewer.
    
    So minimal that it does nothing at the moment...

diff --git a/qt4/demos/main_viewer.cpp b/qt4/demos/main_viewer.cpp
new file mode 100644
index 0000000..724c4c3
--- /dev/null
+++ b/qt4/demos/main_viewer.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2008, Pino Toscano <pino at kde.org>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "viewer.h"
+
+#include <QtGui/QApplication>
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+    PdfViewer *viewer = new PdfViewer();
+    viewer->show();
+    return app.exec();
+}
diff --git a/qt4/demos/viewer.cpp b/qt4/demos/viewer.cpp
new file mode 100644
index 0000000..a726bd3
--- /dev/null
+++ b/qt4/demos/viewer.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008, Pino Toscano <pino at kde.org>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "viewer.h"
+
+#include <poppler-qt4.h>
+
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QMenu>
+#include <QtGui/QMenuBar>
+
+PdfViewer::PdfViewer()
+    : QMainWindow(), m_doc(0)
+{
+    // setup the menus
+    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));
+    m_fileOpenAct = fileMenu->addAction(tr("&Open"));
+    fileMenu->addAction(tr("&Quit"), qApp, SLOT(closeAllWindows()));
+}
+
+PdfViewer::~PdfViewer()
+{
+    delete m_doc;
+}
+
+void PdfViewer::loadDocument(const QString &file)
+{
+}
+
+#include "viewer.moc"
diff --git a/qt4/demos/viewer.h b/qt4/demos/viewer.h
new file mode 100644
index 0000000..02f7f9b
--- /dev/null
+++ b/qt4/demos/viewer.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2008, Pino Toscano <pino at kde.org>
+ *
+ * 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef PDFVIEWER_H
+#define PDFVIEWER_H
+
+#include <QtGui/QMainWindow>
+
+class QAction;
+namespace Poppler {
+class Document;
+}
+
+class PdfViewer : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    PdfViewer();
+    ~PdfViewer();
+
+    void loadDocument(const QString &file);
+
+private:
+    QAction *m_fileOpenAct;
+
+    Poppler::Document *m_doc;
+};
+
+#endif
commit 8da490b090487c4c37290b63bdc9abcfaf6d6940
Author: Pino Toscano <pino at kde.org>
Date:   Fri Feb 15 23:59:39 2008 +0100

    Add a skeleton of directory where PopplerQt4 demos will be.

diff --git a/configure.ac b/configure.ac
index 99ffbda..9e8e508 100644
--- a/configure.ac
+++ b/configure.ac
@@ -338,6 +338,7 @@ qt/Makefile
 qt4/Makefile
 qt4/src/Makefile
 qt4/tests/Makefile
+qt4/demos/Makefile
 poppler.pc
 poppler-cairo.pc
 poppler-splash.pc
diff --git a/qt4/CMakeLists.txt b/qt4/CMakeLists.txt
index fdfb8f4..a364abf 100644
--- a/qt4/CMakeLists.txt
+++ b/qt4/CMakeLists.txt
@@ -1,2 +1,3 @@
 add_subdirectory(src)
 add_subdirectory(tests)
+add_subdirectory(demos)
diff --git a/qt4/Makefile.am b/qt4/Makefile.am
index a459377..69a10cb 100644
--- a/qt4/Makefile.am
+++ b/qt4/Makefile.am
@@ -1 +1 @@
-SUBDIRS = src tests
+SUBDIRS = src tests demos
diff --git a/qt4/demos/CMakeLists.txt b/qt4/demos/CMakeLists.txt
new file mode 100644
index 0000000..7b1950f
--- /dev/null
+++ b/qt4/demos/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_definitions(${QT4_DEFINITIONS})
+
+include_directories(
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_SOURCE_DIR}/../src
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}/qt # for PageTransition
+  ${QT4_INCLUDE_DIR}
+)
+
diff --git a/qt4/demos/Makefile.am b/qt4/demos/Makefile.am
new file mode 100644
index 0000000..3d1cf43
--- /dev/null
+++ b/qt4/demos/Makefile.am
@@ -0,0 +1,20 @@
+INCLUDES =					\
+	-I$(top_srcdir)				\
+	-I$(top_srcdir)/poppler			\
+	-I$(top_srcdir)/qt4/src			\
+	-I$(top_srcdir)/qt				\
+	$(FONTCONFIG_CFLAGS)			\
+	$(POPPLER_QT4_CFLAGS)
+
+LDADDS =					\
+	$(top_builddir)/poppler/libpoppler.la	\
+	$(top_builddir)/qt4/src/libpoppler-qt4.la	\
+	$(FONTCONFIG_LIBS)				\
+	$(POPPLER_QT4_LIBS)
+
+SUFFIXES: .moc
+
+# This rule lets GNU make create any moc_*.cpp from the equivalent *.h
+moc_%.cpp: %.h
+	moc $< -o $@
+


More information about the poppler mailing list