From 25ea7f0b5e81b0242ec6e6a761f874db16383d22 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Sat, 20 Apr 2013 07:23:12 +0200 Subject: move sal_inc headers to include/ Change-Id: I840c681b7c500640d3983e05e9895f3fa8bb1313 Reviewed-on: https://gerrit.libreoffice.org/3501 Reviewed-by: David Tardon Tested-by: David Tardon --- include/osl/detail/android-bootstrap.h | 53 +++++++++++++++++++++++++++++ include/osl/detail/component-mapping.h | 42 +++++++++++++++++++++++ include/osl/detail/file.h | 57 +++++++++++++++++++++++++++++++ include/osl/detail/ios-bootstrap.h | 62 ++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+) create mode 100644 include/osl/detail/android-bootstrap.h create mode 100644 include/osl/detail/component-mapping.h create mode 100644 include/osl/detail/file.h create mode 100644 include/osl/detail/ios-bootstrap.h (limited to 'include/osl') diff --git a/include/osl/detail/android-bootstrap.h b/include/osl/detail/android-bootstrap.h new file mode 100644 index 000000000000..626447f36524 --- /dev/null +++ b/include/osl/detail/android-bootstrap.h @@ -0,0 +1,53 @@ +/* -*- 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/. + */ + +#ifndef ANDROID_BOOSTRAP_H +#define ANDROID_BOOSTRAP_H + +#if defined(ANDROID) + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef struct lo_apk_dir lo_apk_dir; + +void *lo_apkentry(const char *filename, + size_t *size); + +lo_apk_dir *lo_apk_opendir(const char *dirname); + +struct dirent *lo_apk_readdir(lo_apk_dir *dirp); + +int lo_apk_closedir(lo_apk_dir *dirp); + +int lo_apk_lstat(const char *path, struct stat *statp); + +int lo_dlcall_argc_argv(void *function, + int argc, + const char **argv); + +JavaVM *lo_get_javavm(void); + +const char *lo_get_app_data_dir(void); + +#ifdef __cplusplus +} +#endif + +#endif // ANDROID + +#endif // ANDROID_BOOTSTRAP_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/osl/detail/component-mapping.h b/include/osl/detail/component-mapping.h new file mode 100644 index 000000000000..4a0f4796a7b3 --- /dev/null +++ b/include/osl/detail/component-mapping.h @@ -0,0 +1,42 @@ +/* -*- 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/. + */ + +#ifndef COMPONENT_MAPPING_H +#define COMPONENT_MAPPING_H + +#ifdef DISABLE_DYNLOADING + +#ifdef __cplusplus +extern "C" { +#endif + +/* On iOS and perhaps Android static linking of the LO code into one + * executable (on Android, into one shared library) is used. In order to get + * the needed UNO coponent linked in, the "main" code for an app needs to + * implement the lo_get_libmap() function to map UNO component library names + * as produced in a build for iOS (like configmgr.uno.a or libsclo.a) to the + * corresponding component_getFactory functions. + */ + +typedef struct { + const char *lib; + void * (*component_getFactory_function)(const char *, void *, void *); +} lib_to_component_mapping; + +const lib_to_component_mapping *lo_get_libmap(void); + +#ifdef __cplusplus +} +#endif + +#endif /* DISABLE_DYNLOADING */ + +#endif /* COMPONENT_MAPPING_H */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/osl/detail/file.h b/include/osl/detail/file.h new file mode 100644 index 000000000000..aebec89088d1 --- /dev/null +++ b/include/osl/detail/file.h @@ -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/. + */ + +#ifndef INCLUDED_OSL_DETAIL_FILE_H +#define INCLUDED_OSL_DETAIL_FILE_H + +#include "sal/config.h" + +#include + +#include "sal/saldllapi.h" +#include "sal/types.h" + +/** @cond INTERNAL */ + +/* Some additions to the osl file functions for LibreOffice internal + use. Needed for details in the Android support. + */ + +#if defined __cplusplus +extern "C" { +#endif + +/* More flags needed for semantics that match the open() call that + used to be in SvFileStream::Open(). +*/ +#define osl_File_OpenFlag_Trunc 0x00000010L +#define osl_File_OpenFlag_NoExcl 0x00000020L + +SAL_DLLPUBLIC oslFileError SAL_CALL osl_openFilePath( + const char *cpFilePath, + oslFileHandle* pHandle, + sal_uInt32 uFlags ); + +/* Get the OS specific "handle" of an open file. */ +SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle( + oslFileHandle Handle, + sal_IntPtr *piFileHandle ); + +/* for unit testing. */ +SAL_DLLPUBLIC oslFileError SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle ); + +#if defined __cplusplus +} +#endif + +/** @endcond */ + +#endif /* INCLUDED_OSL_DETAIL_FILE_H */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/osl/detail/ios-bootstrap.h b/include/osl/detail/ios-bootstrap.h new file mode 100644 index 000000000000..fa3d0c85b460 --- /dev/null +++ b/include/osl/detail/ios-bootstrap.h @@ -0,0 +1,62 @@ +/* -*- 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/. + */ + +#ifndef IOS_BOOSTRAP_H +#define IOS_BOOSTRAP_H + +#if defined(IOS) + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* These functions are the interface between the upper GUI layers of a + * LibreOffice-based iOS app and the lower "core" layers, used in cases + * where the core parts need to call functions in the upper parts or + * vice versa. + * + * Thus there are two classes of functions here: + * + * 1) Those to be implemented in the upper layer and called by the + * lower layer + * + * 2) Those implmented in the lower layers to be called by the upper + * layer, in cases where we don't want to include a bunch of the + * "normal" LibreOffice C++ headers in an otherwise purely Objective-C + * CocoaTouch-based source file. Of course it depends on the case + * where that is wanted, and this all is work in progress. + */ + +/* 1) */ + +void lo_damaged(CGRect rect); + +/* 2) */ + +void lo_runMain(); +void lo_set_view_size(int width, int height); +void lo_render_windows(CGContextRef context, CGRect rect); +void lo_tap(int x, int y); +void lo_pan(int x, int y); +void lo_keyboard_input(int c); + +#ifdef __cplusplus +} +#endif + +#endif // IOS +#endif // IOS_BOOTSTRAP_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3