summaryrefslogtreecommitdiffstats
path: root/include/osl/detail
diff options
context:
space:
mode:
Diffstat (limited to 'include/osl/detail')
-rw-r--r--include/osl/detail/android-bootstrap.h59
-rw-r--r--include/osl/detail/component-defines.h47
-rw-r--r--include/osl/detail/component-mapping.h48
-rw-r--r--include/osl/detail/file.h32
4 files changed, 186 insertions, 0 deletions
diff --git a/include/osl/detail/android-bootstrap.h b/include/osl/detail/android-bootstrap.h
new file mode 100644
index 000000000..169f3efaf
--- /dev/null
+++ b/include/osl/detail/android-bootstrap.h
@@ -0,0 +1,59 @@
+/* -*- 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_ANDROID_BOOTSTRAP_H
+#define INCLUDED_OSL_DETAIL_ANDROID_BOOTSTRAP_H
+
+#if defined(ANDROID)
+
+#include <jni.h>
+#include <dirent.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <osl/detail/component-mapping.h>
+#include <android/asset_manager.h>
+
+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);
+
+/// "libreofficekit_" prefix, because it is exported from the .so, when we are
+/// initializing the JNI externally.
+void libreofficekit_set_javavm(JavaVM *vm);
+
+JavaVM *lo_get_javavm(void);
+
+const char *lo_get_app_data_dir(void);
+
+AAssetManager *lo_get_native_assetmgr(void);
+
+int setup_cdir(void);
+int setup_assets_tree(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // ANDROID
+
+#endif // ANDROID_BOOTSTRAP_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/osl/detail/component-defines.h b/include/osl/detail/component-defines.h
new file mode 100644
index 000000000..9a31cee93
--- /dev/null
+++ b/include/osl/detail/component-defines.h
@@ -0,0 +1,47 @@
+/* -*- 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_COMPONENT_DEFINES_H
+#define INCLUDED_OSL_DETAIL_COMPONENT_DEFINES_H
+
+/* Experimental direct constructor calls, under construction */
+
+/* FIXME: Rather than hardcoded, this should be generated from
+ solenv/bin/native-code.py */
+
+#define LO_URE_CURRENT_ENV 1 /*TODO*/
+
+// sax/source/expatwrap/expwrap.component
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_FastParser com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser 1 /*TODO*/
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_xml_dot_sax_dot_Parser com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation
+// sfx2/util/sfx.component
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_document_dot_DocumentProperties 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_document_dot_DocumentProperties SfxDocumentMetaData_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_frame_dot_OfficeFrameLoader 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_frame_dot_OfficeFrameLoader com_sun_star_comp_office_FrameLoader_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_frame_dot_SynchronousFrameLoader 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_frame_dot_SynchronousFrameLoader com_sun_star_comp_office_FrameLoader_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_frame_dot_DocumentTemplates 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_frame_dot_DocumentTemplates com_sun_star_comp_sfx2_DocumentTemplates_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_frame_dot_GlobalEventBroadcaster 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_frame_dot_GlobalEventBroadcaster com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_frame_dot_theGlobalEventBroadcaster 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_frame_dot_theGlobalEventBroadcaster com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation
+// svtools/util/svt_dot_component
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_graphic_dot_GraphicProvider 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_graphic_dot_GraphicProvider com_sun_star_comp_graphic_GraphicProvider_get_implementation
+// svx/util/svx_dot_component
+#define LO_URE_CTOR_ENV_com_dot_sun_dot_star_dot_drawing_dot_CustomShapeEngine 1
+#define LO_URE_CTOR_FUN_com_dot_sun_dot_star_dot_drawing_dot_CustomShapeEngine com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation
+
+#endif
+
+/* 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 000000000..4d4264180
--- /dev/null
+++ b/include/osl/detail/component-mapping.h
@@ -0,0 +1,48 @@
+/* -*- 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_COMPONENT_MAPPING_H
+#define INCLUDED_OSL_DETAIL_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 component 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 *name;
+ void * (*component_getFactory_function)(const char *, void *, void *);
+} lib_to_factory_mapping;
+
+typedef struct {
+ const char *name;
+ void * (*constructor_function)(void *, void *);
+} lib_to_constructor_mapping;
+
+const lib_to_factory_mapping *lo_get_factory_map(void);
+const lib_to_constructor_mapping *lo_get_constructor_map(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DISABLE_DYNLOADING */
+
+#endif // INCLUDED_OSL_DETAIL_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 000000000..acc308b8f
--- /dev/null
+++ b/include/osl/detail/file.h
@@ -0,0 +1,32 @@
+/* -*- 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"
+
+/** @cond INTERNAL */
+
+/* Some additions to the osl file functions for LibreOffice internal
+ use. Needed for details in the Android support.
+ */
+
+/* More flags needed for semantics that match the open() call that
+ used to be in SvFileStream::Open(), and for temp files:
+*/
+#define osl_File_OpenFlag_Trunc 0x00000010L
+#define osl_File_OpenFlag_NoExcl 0x00000020L
+#define osl_File_OpenFlag_Private 0x00000040L
+
+/** @endcond */
+
+#endif /* INCLUDED_OSL_DETAIL_FILE_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */