Merge pull request #25 from marcelofg55/update_headers2

Updated headers
This commit is contained in:
Thomas Herzog
2018-07-20 11:06:20 +02:00
committed by GitHub
3 changed files with 92 additions and 1 deletions

54
android/godot_android.h Normal file
View File

@@ -0,0 +1,54 @@
/*************************************************************************/
/* godot_android.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef GODOT_ANDROID_GDN_H
#define GODOT_ANDROID_GDN_H
#include <gdnative/gdnative.h>
#ifdef __ANDROID__
#include <jni.h>
#else
#define JNIEnv void
#define jobject void *
#endif
#ifdef __cplusplus
extern "C" {
#endif
JNIEnv *GDAPI godot_android_get_env();
jobject GDAPI godot_android_get_activity();
#ifdef __cplusplus
}
#endif
#endif /* !GODOT_ANDROID_GDN_H */

View File

@@ -5961,12 +5961,35 @@
}
]
},
{
"name": "android",
"type": "ANDROID",
"version": {
"major": 1,
"minor": 0
},
"next": null,
"api": [
{
"name": "godot_android_get_env",
"return_type": "JNIEnv*",
"arguments": [
]
},
{
"name": "godot_android_get_activity",
"return_type": "jobject",
"arguments": [
]
}
]
},
{
"name": "arvr",
"type": "ARVR",
"version": {
"major": 1,
"minor": 0
"minor": 1
},
"next": null,
"api": [

View File

@@ -3,6 +3,7 @@
#define GODOT_GDNATIVE_API_STRUCT_H
#include <gdnative/gdnative.h>
#include <android/godot_android.h>
#include <arvr/godot_arvr.h>
#include <nativescript/godot_nativescript.h>
#include <pluginscript/godot_pluginscript.h>
@@ -11,6 +12,7 @@
extern const godot_gdnative_core_api_struct *_gdnative_wrapper_api_struct; \
extern const godot_gdnative_ext_nativescript_api_struct *_gdnative_wrapper_nativescript_api_struct; \
extern const godot_gdnative_ext_pluginscript_api_struct *_gdnative_wrapper_pluginscript_api_struct; \
extern const godot_gdnative_ext_android_api_struct *_gdnative_wrapper_android_api_struct; \
extern const godot_gdnative_ext_arvr_api_struct *_gdnative_wrapper_arvr_api_struct; \
_gdnative_wrapper_api_struct = options->api_struct; \
for (unsigned int i = 0; i < _gdnative_wrapper_api_struct->num_extensions; i++) { \
@@ -21,6 +23,9 @@
case GDNATIVE_EXT_PLUGINSCRIPT: \
_gdnative_wrapper_pluginscript_api_struct = (godot_gdnative_ext_pluginscript_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_ANDROID: \
_gdnative_wrapper_android_api_struct = (godot_gdnative_ext_android_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
case GDNATIVE_EXT_ARVR: \
_gdnative_wrapper_arvr_api_struct = (godot_gdnative_ext_arvr_api_struct *) _gdnative_wrapper_api_struct->extensions[i]; \
break; \
@@ -36,6 +41,7 @@ enum GDNATIVE_API_TYPES {
GDNATIVE_CORE,
GDNATIVE_EXT_NATIVESCRIPT,
GDNATIVE_EXT_PLUGINSCRIPT,
GDNATIVE_EXT_ANDROID,
GDNATIVE_EXT_ARVR,
};
@@ -76,6 +82,14 @@ typedef struct godot_gdnative_ext_pluginscript_api_struct {
void (*godot_pluginscript_register_language)(const godot_pluginscript_language_desc *language_desc);
} godot_gdnative_ext_pluginscript_api_struct;
typedef struct godot_gdnative_ext_android_api_struct {
unsigned int type;
godot_gdnative_api_version version;
const godot_gdnative_api_struct *next;
JNIEnv*(*godot_android_get_env)();
jobject (*godot_android_get_activity)();
} godot_gdnative_ext_android_api_struct;
typedef struct godot_gdnative_ext_arvr_api_struct {
unsigned int type;
godot_gdnative_api_version version;