summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-13 11:20:15 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-06-25 13:04:32 +0100
commit0cea87d60cfdc2bbc7c6b5d5ee9918e283fc7b2c (patch)
tree6aced406e9e2089a571598a7364453211a56c01f /libreofficekit
parentff6a38b76df80d0f907f2f92cb851dea43c91d81 (diff)
Move gtktiledviewer into libreofficekit.
desktop is no longer the right place for it now that libreofficekit has its own directory. Change-Id: I207f1d642e7e35c460ff85bb57aa142cb98023c8
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/Executable_gtktiledviewer.mk49
-rw-r--r--libreofficekit/Module_libreofficekit.mk10
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx57
3 files changed, 115 insertions, 1 deletions
diff --git a/libreofficekit/Executable_gtktiledviewer.mk b/libreofficekit/Executable_gtktiledviewer.mk
new file mode 100644
index 000000000000..0ce922288165
--- /dev/null
+++ b/libreofficekit/Executable_gtktiledviewer.mk
@@ -0,0 +1,49 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,gtktiledviewer))
+
+$(eval $(call gb_Executable_set_include,gtktiledviewer,\
+ $$(INCLUDE) \
+ -I$(SRCDIR)/desktop/inc \
+))
+
+$(eval $(call gb_Executable_use_externals,gtktiledviewer,\
+ gtk \
+))
+
+$(eval $(call gb_Executable_use_libraries,gtktiledviewer,\
+ libreofficekitgtk \
+))
+
+$(eval $(call gb_Executable_use_static_libraries,gtktiledviewer,\
+ libreofficekit \
+))
+
+$(eval $(call gb_Executable_add_libs,gtktiledviewer,\
+ -lX11 \
+ -lXext \
+ -lXrender \
+ -lSM \
+ -lICE \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Executable_add_libs,gtktiledviewer,\
+ -lm \
+ -ldl \
+ -lpthread \
+))
+endif
+
+$(eval $(call gb_Executable_add_exception_objects,gtktiledviewer,\
+ libreofficekit/qa/gtktiledviewer/gtktiledviewer \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/libreofficekit/Module_libreofficekit.mk b/libreofficekit/Module_libreofficekit.mk
index 0412a33f9799..55136a4b3412 100644
--- a/libreofficekit/Module_libreofficekit.mk
+++ b/libreofficekit/Module_libreofficekit.mk
@@ -10,10 +10,18 @@
$(eval $(call gb_Module_Module,libreofficekit))
ifeq ($(OS),LINUX)
+
$(eval $(call gb_Module_add_targets,libreofficekit,\
StaticLibrary_libreofficekit \
Library_libreofficekitgtk \
))
-endif
+
+ifneq ($(ENABLE_GTK),)
+$(eval $(call gb_Module_add_targets,libreofficekit,\
+ Executable_gtktiledviewer \
+))
+endif # ($(ENABLE_GTK),)
+
+endif # ($(OS),LINUX)
# vim: set ts=4 sw=4 et:
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
new file mode 100644
index 000000000000..3549903b988a
--- /dev/null
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+
+#include <LibreOfficeKit/LibreOfficeKitGtk.h>
+
+static int help()
+{
+ fprintf( stderr, "Usage: gtktiledviewer <absolute-path-to-libreoffice-install> [path to document]\n" );
+ return 1;
+}
+
+int main( int argc, char* argv[] )
+{
+ if( argc < 2 ||
+ ( argc > 1 && ( !strcmp( argv[1], "--help" ) || !strcmp( argv[1], "-h" ) ) ) )
+ return help();
+
+ if ( argv[1][0] != '/' )
+ {
+ fprintf(stderr, "Absolute path required to libreoffice install\n");
+ return 1;
+ }
+
+ LibreOfficeKit* pOffice = lok_init( argv[1] );
+
+ gtk_init( &argc, &argv );
+
+ GtkWidget *pWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ gtk_window_set_title( GTK_WINDOW(pWindow), "LibreOffice GTK Tiled Viewer" );
+ gtk_window_set_default_size(GTK_WINDOW(pWindow), 800, 600);
+ g_signal_connect( pWindow, "destroy", G_CALLBACK(gtk_main_quit), NULL );
+
+
+ GtkWidget* pDocView = lok_docview_new( pOffice );
+ gtk_container_add( GTK_CONTAINER(pWindow), pDocView );
+
+ lok_docview_open_document( LOK_DOCVIEW(pDocView), argv[2] );
+
+ gtk_widget_show( pDocView );
+ gtk_widget_show( pWindow );
+
+ gtk_main();
+
+ return 0;
+} \ No newline at end of file