Kaydet (Commit) 347bb132 authored tarafından Michael Meeks's avatar Michael Meeks

android: tweak headless, expand docs, and start custom android backend

üst d3f17ac9
...@@ -458,7 +458,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ ...@@ -458,7 +458,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/generic/fontmanager/fontmanager \ vcl/generic/fontmanager/fontmanager \
vcl/generic/fontmanager/helper \ vcl/generic/fontmanager/helper \
vcl/generic/fontmanager/parseAFM \ vcl/generic/fontmanager/parseAFM \
vcl/unx/generic/plugadapt/salplug \ vcl/android/androidinst \
vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/jobdata \
vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/printer/ppdparser \
vcl/null/printerinfomanager \ vcl/null/printerinfomanager \
......
/* -*- 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: */
...@@ -91,10 +91,10 @@ rtl::OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen ) ...@@ -91,10 +91,10 @@ rtl::OUString SvpSalSystem::GetDisplayScreenName( unsigned int nScreen )
return aBuf.makeStringAndClear(); return aBuf.makeStringAndClear();
} }
int SvpSalSystem::ShowNativeMessageBox( const rtl::OUString&, int SvpSalSystem::ShowNativeDialog( const rtl::OUString& rTitle,
const rtl::OUString&, const rtl::OUString& rMessage,
int, const std::list< rtl::OUString >& rButtons,
int ) int nDefButton )
{ {
return 0; return 0;
} }
......
/* -*- 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: */
...@@ -39,7 +39,8 @@ class SalDisplay; ...@@ -39,7 +39,8 @@ class SalDisplay;
class GtkSalDisplay; class GtkSalDisplay;
enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3, enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE3, SAL_DATA_KDE4, 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 class VCL_DLLPUBLIC SalGenericData : public SalData
{ {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef _SVP_SVPDUMMIES_HXX #ifndef _SVP_SVPDUMMIES_HXX
#include <vcl/sysdata.hxx> #include <vcl/sysdata.hxx>
#include <generic/gensys.h>
#include <salobj.hxx> #include <salobj.hxx>
#include <salimestatus.hxx> #include <salimestatus.hxx>
#include <salsys.hxx> #include <salsys.hxx>
...@@ -74,9 +74,9 @@ class SvpImeStatus : public SalI18NImeStatus ...@@ -74,9 +74,9 @@ class SvpImeStatus : public SalI18NImeStatus
virtual void toggle(); virtual void toggle();
}; };
class SvpSalSystem : public SalSystem class SvpSalSystem : public SalGenericSystem
{ {
public: public:
SvpSalSystem() {} SvpSalSystem() {}
virtual ~SvpSalSystem(); virtual ~SvpSalSystem();
// get info about the display // get info about the display
...@@ -85,11 +85,10 @@ class SvpSalSystem : public SalSystem ...@@ -85,11 +85,10 @@ class SvpSalSystem : public SalSystem
virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen ); virtual Rectangle GetDisplayScreenWorkAreaPosSizePixel( unsigned int nScreen );
virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen ); virtual rtl::OUString GetDisplayScreenName( unsigned int nScreen );
virtual int ShowNativeDialog( const rtl::OUString& rTitle,
virtual int ShowNativeMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage,
const rtl::OUString& rMessage, const std::list< rtl::OUString >& rButtons,
int nButtonCombination, int nDefButton );
int nDefaultButton);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment