summaryrefslogtreecommitdiff
path: root/include/osl
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-04-20 07:23:12 +0200
committerDavid Tardon <dtardon@redhat.com>2013-04-24 05:17:49 +0000
commit25ea7f0b5e81b0242ec6e6a761f874db16383d22 (patch)
tree96128c7185500cbe2a8d6a93f5ac576435ffc47e /include/osl
parent9ccd994d445c797a48cb89ce2b7449adc68b1007 (diff)
move sal_inc headers to include/
Change-Id: I840c681b7c500640d3983e05e9895f3fa8bb1313 Reviewed-on: https://gerrit.libreoffice.org/3501 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'include/osl')
-rw-r--r--include/osl/detail/android-bootstrap.h53
-rw-r--r--include/osl/detail/component-mapping.h42
-rw-r--r--include/osl/detail/file.h57
-rw-r--r--include/osl/detail/ios-bootstrap.h62
4 files changed, 214 insertions, 0 deletions
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 <jni.h>
+#include <dirent.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <osl/detail/component-mapping.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);
+
+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 <sys/stat.h>
+
+#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 <premac.h>
+#include <CoreGraphics/CoreGraphics.h>
+#include <postmac.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <osl/detail/component-mapping.h>
+
+/* 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: */