summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-01-16 21:26:25 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-01-18 17:07:55 +0000
commit347bb132e0a3efc82211d4e53bf0aa25ad817cf4 (patch)
treeb763a90ec623143683306adacd62c0e8a53bb556 /vcl
parentd3f17ac97d1d90069fd66ccc63caab0f0472dc7d (diff)
android: tweak headless, expand docs, and start custom android backend
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/android/androidinst.cxx82
-rw-r--r--vcl/headless/svpdummies.cxx8
-rw-r--r--vcl/inc/android/androidinst.hxx46
-rw-r--r--vcl/inc/generic/gendata.hxx3
-rw-r--r--vcl/inc/headless/svpdummies.hxx15
6 files changed, 142 insertions, 14 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 8668a0e9e988..647bb2edb2c8 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -458,7 +458,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/generic/fontmanager/fontmanager \
vcl/generic/fontmanager/helper \
vcl/generic/fontmanager/parseAFM \
- vcl/unx/generic/plugadapt/salplug \
+ vcl/android/androidinst \
vcl/unx/generic/printer/jobdata \
vcl/unx/generic/printer/ppdparser \
vcl/null/printerinfomanager \
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
new file mode 100644
index 000000000000..3ce5d5b8c6d0
--- /dev/null
+++ b/vcl/android/androidinst.cxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Novell, Inc.
+ * Michael Meeks <michael.meeks@suse.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#include <android/androidinst.hxx>
+#include <headless/svpdummies.hxx>
+#include <generic/gendata.hxx>
+#include <android/log.h>
+
+AndroidSalInstance::AndroidSalInstance( SalYieldMutex *pMutex )
+ : SvpSalInstance( pMutex )
+{
+ fprintf (stderr, "created Android Sal Instance\n");
+}
+
+AndroidSalInstance::~AndroidSalInstance()
+{
+ fprintf (stderr, "destroyed Android Sal Instance\n");
+}
+
+class AndroidSalSystem : public SvpSalSystem {
+public:
+ AndroidSalSystem() : SvpSalSystem() {}
+ virtual ~AndroidSalSystem() {}
+ virtual int ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton )
+ {
+ (void)rButtons; (void)nDefButton;
+ __android_log_print(ANDROID_LOG_INFO, "LibreOffice - dialog '%s': '%s'",
+ rtl::OUStringToOString(rTitle, RTL_TEXTENCODING_ASCII_US).getStr(),
+ rtl::OUStringToOString(rMessage, RTL_TEXTENCODING_ASCII_US).getStr());
+ return 0;
+ }
+};
+
+SalSystem *AndroidSalInstance::CreateSalSystem()
+{
+ return new AndroidSalSystem();
+}
+
+class AndroidSalData : public SalGenericData
+{
+public:
+ AndroidSalData( SalInstance *pInstance ) : SalGenericData( SAL_DATA_ANDROID, pInstance ) {}
+ virtual void ErrorTrapPush() {}
+ virtual bool ErrorTrapPop( bool ) { return false; }
+};
+
+SalInstance *CreateSalInstance()
+{
+ SvpSalInstance* pInstance = new SvpSalInstance( new SalYieldMutex() );
+ new AndroidSalData( pInstance );
+ return pInstance;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpdummies.cxx b/vcl/headless/svpdummies.cxx
index a4125f951abe..47f6875b1921 100644
--- a/vcl/headless/svpdummies.cxx
+++ b/vcl/headless/svpdummies.cxx
@@ -91,10 +91,10 @@ rtl::OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
return aBuf.makeStringAndClear();
}
-int SvpSalSystem::ShowNativeMessageBox( const rtl::OUString&,
- const rtl::OUString&,
- int,
- int )
+int SvpSalSystem::ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton )
{
return 0;
}
diff --git a/vcl/inc/android/androidinst.hxx b/vcl/inc/android/androidinst.hxx
new file mode 100644
index 000000000000..fda916baadcc
--- /dev/null
+++ b/vcl/inc/android/androidinst.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Novell, Inc.
+ * Michael Meeks <michael.meeks@suse.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef ANDROID_SALINST_H
+#define ANDROID_SALINST_H
+
+#include <headless/svpinst.hxx>
+
+class AndroidSalInstance : public SvpSalInstance
+{
+public:
+ AndroidSalInstance( SalYieldMutex *pMutex );
+ virtual ~AndroidSalInstance();
+
+ virtual SalSystem* CreateSalSystem();
+};
+
+#endif // ANDROID_SALINST_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx
index c52e8919f16a..eb45fd9eafa9 100644
--- a/vcl/inc/generic/gendata.hxx
+++ b/vcl/inc/generic/gendata.hxx
@@ -39,7 +39,8 @@ class SalDisplay;
class GtkSalDisplay;
enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE3, SAL_DATA_KDE4,
- SAL_DATA_UNX, SAL_DATA_SVP };
+ SAL_DATA_UNX, SAL_DATA_SVP,
+ SAL_DATA_ANDROID, SAL_DATA_IOS };
class VCL_DLLPUBLIC SalGenericData : public SalData
{
diff --git a/vcl/inc/headless/svpdummies.hxx b/vcl/inc/headless/svpdummies.hxx
index e1fb22c36341..14f6e166d781 100644
--- a/vcl/inc/headless/svpdummies.hxx
+++ b/vcl/inc/headless/svpdummies.hxx
@@ -29,7 +29,7 @@
#ifndef _SVP_SVPDUMMIES_HXX
#include <vcl/sysdata.hxx>
-
+#include <generic/gensys.h>
#include <salobj.hxx>
#include <salimestatus.hxx>
#include <salsys.hxx>
@@ -74,9 +74,9 @@ class SvpImeStatus : public SalI18NImeStatus
virtual void toggle();
};
-class SvpSalSystem : public SalSystem
+class SvpSalSystem : public SalGenericSystem
{
- public:
+public:
SvpSalSystem() {}
virtual ~SvpSalSystem();
// get info about the display
@@ -85,11 +85,10 @@ class SvpSalSystem : public SalSystem
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen );
-
- virtual int ShowNativeMessageBox( const rtl::OUString& rTitle,
- const rtl::OUString& rMessage,
- int nButtonCombination,
- int nDefaultButton);
+ virtual int ShowNativeDialog( const rtl::OUString& rTitle,
+ const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtons,
+ int nDefButton );
};