Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
c3e615e2
Unverified
Commit
c3e615e2
authored
May 31, 2020
by
bruvzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GDNative: merge API structs, bump version of merged structs.
parent
cbcc0eac
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
60 deletions
+58
-60
gdnative_api.json
modules/gdnative/gdnative_api.json
+0
-0
gdnative_builders.py
modules/gdnative/gdnative_builders.py
+10
-1
godot_nativescript.h
modules/gdnative/include/nativescript/godot_nativescript.h
+31
-42
godot_nativescript.cpp
modules/gdnative/nativescript/godot_nativescript.cpp
+7
-7
nativescript.cpp
modules/gdnative/nativescript/nativescript.cpp
+1
-1
nativescript.h
modules/gdnative/nativescript/nativescript.h
+9
-9
No files found.
modules/gdnative/gdnative_api.json
View file @
c3e615e2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
modules/gdnative/gdnative_builders.py
View file @
c3e615e2
...
...
@@ -228,7 +228,16 @@ def _build_gdnative_api_struct_source(api):
"extern const godot_gdnative_core_api_struct api_struct = {"
,
"
\t
GDNATIVE_"
+
api
[
"core"
][
"type"
]
+
","
,
"
\t
{"
+
str
(
api
[
"core"
][
"version"
][
"major"
])
+
", "
+
str
(
api
[
"core"
][
"version"
][
"minor"
])
+
"},"
,
"
\t
(const godot_gdnative_api_struct *)&api_1_1,"
,
"
\t
"
+
(
"nullptr, "
if
not
api
[
"core"
][
"next"
]
else
(
"(const godot_gdnative_api_struct *)& api_{0}_{1},"
.
format
(
api
[
"core"
][
"next"
][
"version"
][
"major"
],
api
[
"core"
][
"next"
][
"version"
][
"minor"
]
)
)
),
"
\t
"
+
str
(
len
(
api
[
"extensions"
]))
+
","
,
"
\t
gdnative_extensions_pointers,"
,
]
...
...
modules/gdnative/include/nativescript/godot_nativescript.h
View file @
c3e615e2
...
...
@@ -45,7 +45,7 @@ typedef enum {
GODOT_METHOD_RPC_MODE_REMOTESYNC
,
GODOT_METHOD_RPC_MODE_MASTERSYNC
,
GODOT_METHOD_RPC_MODE_PUPPETSYNC
,
}
godot_method_rpc_mode
;
}
godot_
nativescript_
method_rpc_mode
;
typedef
enum
{
GODOT_PROPERTY_HINT_NONE
,
///< no hint provided.
...
...
@@ -82,7 +82,7 @@ typedef enum {
GODOT_PROPERTY_HINT_PROPERTY_OF_INSTANCE
,
///< a property of an instance
GODOT_PROPERTY_HINT_PROPERTY_OF_SCRIPT
,
///< a property of a script & base
GODOT_PROPERTY_HINT_MAX
,
}
godot_property_hint
;
}
godot_
nativescript_
property_hint
;
typedef
enum
{
...
...
@@ -106,71 +106,80 @@ typedef enum {
GODOT_PROPERTY_USAGE_DEFAULT
=
GODOT_PROPERTY_USAGE_STORAGE
|
GODOT_PROPERTY_USAGE_EDITOR
|
GODOT_PROPERTY_USAGE_NETWORK
,
GODOT_PROPERTY_USAGE_DEFAULT_INTL
=
GODOT_PROPERTY_USAGE_STORAGE
|
GODOT_PROPERTY_USAGE_EDITOR
|
GODOT_PROPERTY_USAGE_NETWORK
|
GODOT_PROPERTY_USAGE_INTERNATIONALIZED
,
GODOT_PROPERTY_USAGE_NOEDITOR
=
GODOT_PROPERTY_USAGE_STORAGE
|
GODOT_PROPERTY_USAGE_NETWORK
,
}
godot_property_usage_flags
;
}
godot_
nativescript_
property_usage_flags
;
typedef
struct
{
godot_method_rpc_mode
rset_type
;
godot_
nativescript_
method_rpc_mode
rset_type
;
godot_int
type
;
godot_property_hint
hint
;
godot_
nativescript_
property_hint
hint
;
godot_string
hint_string
;
godot_property_usage_flags
usage
;
godot_
nativescript_
property_usage_flags
usage
;
godot_variant
default_value
;
}
godot_property_attributes
;
}
godot_
nativescript_
property_attributes
;
typedef
struct
{
// instance pointer, method_data - return user data
GDCALLINGCONV
void
*
(
*
create_func
)(
godot_object
*
,
void
*
);
void
*
method_data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_instance_create_func
;
}
godot_
nativescript_
instance_create_func
;
typedef
struct
{
// instance pointer, method data, user data
GDCALLINGCONV
void
(
*
destroy_func
)(
godot_object
*
,
void
*
,
void
*
);
void
*
method_data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_instance_destroy_func
;
}
godot_
nativescript_
instance_destroy_func
;
void
GDAPI
godot_nativescript_register_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
instance_create_func
p_create_func
,
godo
t_instance_destroy_func
p_destroy_func
);
void
GDAPI
godot_nativescript_register_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
nativescript_instance_create_func
p_create_func
,
godot_nativescrip
t_instance_destroy_func
p_destroy_func
);
void
GDAPI
godot_nativescript_register_tool_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
instance_create_func
p_create_func
,
godo
t_instance_destroy_func
p_destroy_func
);
void
GDAPI
godot_nativescript_register_tool_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
nativescript_instance_create_func
p_create_func
,
godot_nativescrip
t_instance_destroy_func
p_destroy_func
);
typedef
struct
{
godot_method_rpc_mode
rpc_type
;
}
godot_method_attributes
;
godot_nativescript_method_rpc_mode
rpc_type
;
}
godot_nativescript_method_attributes
;
typedef
struct
{
godot_string
name
;
godot_variant_type
type
;
godot_nativescript_property_hint
hint
;
godot_string
hint_string
;
}
godot_nativescript_method_argument
;
typedef
struct
{
// instance pointer, method data, user data, num args, args - return result as varaint
GDCALLINGCONV
godot_variant
(
*
method
)(
godot_object
*
,
void
*
,
void
*
,
int
,
godot_variant
**
);
void
*
method_data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_instance_method
;
}
godot_
nativescript_
instance_method
;
void
GDAPI
godot_nativescript_register_method
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
godot_method_attributes
p_attr
,
godot_instance_method
p_method
);
void
GDAPI
godot_nativescript_register_method
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
godot_nativescript_method_attributes
p_attr
,
godot_nativescript_instance_method
p_method
);
void
GDAPI
godot_nativescript_set_method_argument_information
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
int
p_num_args
,
const
godot_nativescript_method_argument
*
p_args
);
typedef
struct
{
// instance pointer, method data, user data, value
GDCALLINGCONV
void
(
*
set_func
)(
godot_object
*
,
void
*
,
void
*
,
godot_variant
*
);
void
*
method_data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_property_set_func
;
}
godot_
nativescript_
property_set_func
;
typedef
struct
{
// instance pointer, method data, user data, value
GDCALLINGCONV
godot_variant
(
*
get_func
)(
godot_object
*
,
void
*
,
void
*
);
void
*
method_data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_property_get_func
;
}
godot_
nativescript_
property_get_func
;
void
GDAPI
godot_nativescript_register_property
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_path
,
godot_
property_attributes
*
p_attr
,
godot_property_set_func
p_set_func
,
godo
t_property_get_func
p_get_func
);
void
GDAPI
godot_nativescript_register_property
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_path
,
godot_
nativescript_property_attributes
*
p_attr
,
godot_nativescript_property_set_func
p_set_func
,
godot_nativescrip
t_property_get_func
p_get_func
);
typedef
struct
{
godot_string
name
;
godot_int
type
;
godot_property_hint
hint
;
godot_
nativescript_
property_hint
hint
;
godot_string
hint_string
;
godot_property_usage_flags
usage
;
godot_
nativescript_
property_usage_flags
usage
;
godot_variant
default_value
;
}
godot_nativescript_signal_argument
;
...
...
@@ -186,26 +195,6 @@ void GDAPI godot_nativescript_register_signal(void *p_gdnative_handle, const cha
void
GDAPI
*
godot_nativescript_get_userdata
(
godot_object
*
p_instance
);
/*
*
*
* NativeScript 1.1
*
*
*/
// method registering with argument names
typedef
struct
{
godot_string
name
;
godot_variant_type
type
;
godot_property_hint
hint
;
godot_string
hint_string
;
}
godot_method_arg
;
void
GDAPI
godot_nativescript_set_method_argument_information
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
int
p_num_args
,
const
godot_method_arg
*
p_args
);
// documentation
void
GDAPI
godot_nativescript_set_class_documentation
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
godot_string
p_documentation
);
...
...
@@ -230,9 +219,9 @@ typedef struct {
GDCALLINGCONV
bool
(
*
refcount_decremented_instance_binding
)(
void
*
,
godot_object
*
);
void
*
data
;
GDCALLINGCONV
void
(
*
free_func
)(
void
*
);
}
godot_instance_binding_functions
;
}
godot_
nativescript_
instance_binding_functions
;
int
GDAPI
godot_nativescript_register_instance_binding_data_functions
(
godot_instance_binding_functions
p_binding_functions
);
int
GDAPI
godot_nativescript_register_instance_binding_data_functions
(
godot_
nativescript_
instance_binding_functions
p_binding_functions
);
void
GDAPI
godot_nativescript_unregister_instance_binding_data_functions
(
int
p_idx
);
void
GDAPI
*
godot_nativescript_get_instance_binding_data
(
int
p_idx
,
godot_object
*
p_object
);
...
...
modules/gdnative/nativescript/godot_nativescript.cpp
View file @
c3e615e2
...
...
@@ -51,7 +51,7 @@ extern "C" void _native_script_hook() {
// Script API
void
GDAPI
godot_nativescript_register_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
instance_create_func
p_create_func
,
godo
t_instance_destroy_func
p_destroy_func
)
{
void
GDAPI
godot_nativescript_register_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
nativescript_instance_create_func
p_create_func
,
godot_nativescrip
t_instance_destroy_func
p_destroy_func
)
{
String
*
s
=
(
String
*
)
p_gdnative_handle
;
Map
<
StringName
,
NativeScriptDesc
>
*
classes
=
&
NSL
->
library_classes
[
*
s
];
...
...
@@ -83,7 +83,7 @@ void GDAPI godot_nativescript_register_class(void *p_gdnative_handle, const char
classes
->
insert
(
p_name
,
desc
);
}
void
GDAPI
godot_nativescript_register_tool_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
instance_create_func
p_create_func
,
godo
t_instance_destroy_func
p_destroy_func
)
{
void
GDAPI
godot_nativescript_register_tool_class
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_base
,
godot_
nativescript_instance_create_func
p_create_func
,
godot_nativescrip
t_instance_destroy_func
p_destroy_func
)
{
String
*
s
=
(
String
*
)
p_gdnative_handle
;
Map
<
StringName
,
NativeScriptDesc
>
*
classes
=
&
NSL
->
library_classes
[
*
s
];
...
...
@@ -116,7 +116,7 @@ void GDAPI godot_nativescript_register_tool_class(void *p_gdnative_handle, const
classes
->
insert
(
p_name
,
desc
);
}
void
GDAPI
godot_nativescript_register_method
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
godot_
method_attributes
p_attr
,
godo
t_instance_method
p_method
)
{
void
GDAPI
godot_nativescript_register_method
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
godot_
nativescript_method_attributes
p_attr
,
godot_nativescrip
t_instance_method
p_method
)
{
String
*
s
=
(
String
*
)
p_gdnative_handle
;
Map
<
StringName
,
NativeScriptDesc
>::
Element
*
E
=
NSL
->
library_classes
[
*
s
].
find
(
p_name
);
...
...
@@ -135,7 +135,7 @@ void GDAPI godot_nativescript_register_method(void *p_gdnative_handle, const cha
E
->
get
().
methods
.
insert
(
p_function_name
,
method
);
}
void
GDAPI
godot_nativescript_register_property
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_path
,
godot_
property_attributes
*
p_attr
,
godot_property_set_func
p_set_func
,
godo
t_property_get_func
p_get_func
)
{
void
GDAPI
godot_nativescript_register_property
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_path
,
godot_
nativescript_property_attributes
*
p_attr
,
godot_nativescript_property_set_func
p_set_func
,
godot_nativescrip
t_property_get_func
p_get_func
)
{
String
*
s
=
(
String
*
)
p_gdnative_handle
;
Map
<
StringName
,
NativeScriptDesc
>::
Element
*
E
=
NSL
->
library_classes
[
*
s
].
find
(
p_name
);
...
...
@@ -221,7 +221,7 @@ void GDAPI *godot_nativescript_get_userdata(godot_object *p_instance) {
*
*/
void
GDAPI
godot_nativescript_set_method_argument_information
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
int
p_num_args
,
const
godot_
method_arg
*
p_args
)
{
void
GDAPI
godot_nativescript_set_method_argument_information
(
void
*
p_gdnative_handle
,
const
char
*
p_name
,
const
char
*
p_function_name
,
int
p_num_args
,
const
godot_
nativescript_method_argument
*
p_args
)
{
String
*
s
=
(
String
*
)
p_gdnative_handle
;
Map
<
StringName
,
NativeScriptDesc
>::
Element
*
E
=
NSL
->
library_classes
[
*
s
].
find
(
p_name
);
...
...
@@ -235,7 +235,7 @@ void GDAPI godot_nativescript_set_method_argument_information(void *p_gdnative_h
List
<
PropertyInfo
>
args
;
for
(
int
i
=
0
;
i
<
p_num_args
;
i
++
)
{
godot_
method_arg
arg
=
p_args
[
i
];
godot_
nativescript_method_argument
arg
=
p_args
[
i
];
String
name
=
*
(
String
*
)
&
arg
.
name
;
String
hint_string
=
*
(
String
*
)
&
arg
.
hint_string
;
...
...
@@ -329,7 +329,7 @@ const void GDAPI *godot_nativescript_get_type_tag(const godot_object *p_object)
return
nullptr
;
}
int
GDAPI
godot_nativescript_register_instance_binding_data_functions
(
godot_instance_binding_functions
p_binding_functions
)
{
int
GDAPI
godot_nativescript_register_instance_binding_data_functions
(
godot_
nativescript_
instance_binding_functions
p_binding_functions
)
{
return
NativeScriptLanguage
::
get_singleton
()
->
register_binding_functions
(
p_binding_functions
);
}
...
...
modules/gdnative/nativescript/nativescript.cpp
View file @
c3e615e2
...
...
@@ -1498,7 +1498,7 @@ void NativeScriptLanguage::profiling_add_data(StringName p_signature, uint64_t p
#endif
}
int
NativeScriptLanguage
::
register_binding_functions
(
godot_instance_binding_functions
p_binding_functions
)
{
int
NativeScriptLanguage
::
register_binding_functions
(
godot_
nativescript_
instance_binding_functions
p_binding_functions
)
{
// find index
int
idx
=
-
1
;
...
...
modules/gdnative/nativescript/nativescript.h
View file @
c3e615e2
...
...
@@ -48,7 +48,7 @@
struct
NativeScriptDesc
{
struct
Method
{
godot_instance_method
method
;
godot_
nativescript_
instance_method
method
;
MethodInfo
info
;
int
rpc_mode
;
uint16_t
rpc_method_id
;
...
...
@@ -56,8 +56,8 @@ struct NativeScriptDesc {
};
struct
Property
{
godot_property_set_func
setter
;
godot_property_get_func
getter
;
godot_
nativescript_
property_set_func
setter
;
godot_
nativescript_
property_get_func
getter
;
PropertyInfo
info
;
Variant
default_value
;
int
rset_mode
;
...
...
@@ -78,8 +78,8 @@ struct NativeScriptDesc {
StringName
base
;
StringName
base_native_type
;
NativeScriptDesc
*
base_data
;
godot_instance_create_func
create_func
;
godot_instance_destroy_func
destroy_func
;
godot_
nativescript_
instance_create_func
create_func
;
godot_
nativescript_
instance_destroy_func
destroy_func
;
String
documentation
;
...
...
@@ -88,8 +88,8 @@ struct NativeScriptDesc {
bool
is_tool
;
inline
NativeScriptDesc
()
{
zeromem
(
&
create_func
,
sizeof
(
godot_instance_create_func
));
zeromem
(
&
destroy_func
,
sizeof
(
godot_instance_destroy_func
));
zeromem
(
&
create_func
,
sizeof
(
godot_
nativescript_
instance_create_func
));
zeromem
(
&
destroy_func
,
sizeof
(
godot_
nativescript_
instance_destroy_func
));
}
};
...
...
@@ -267,7 +267,7 @@ private:
void
call_libraries_cb
(
const
StringName
&
name
);
Vector
<
Pair
<
bool
,
godot_instance_binding_functions
>>
binding_functions
;
Vector
<
Pair
<
bool
,
godot_
nativescript_
instance_binding_functions
>>
binding_functions
;
Set
<
Vector
<
void
*>
*>
binding_instances
;
Map
<
int
,
HashMap
<
StringName
,
const
void
*>>
global_type_tags
;
...
...
@@ -360,7 +360,7 @@ public:
virtual
int
profiling_get_accumulated_data
(
ProfilingInfo
*
p_info_arr
,
int
p_info_max
);
virtual
int
profiling_get_frame_data
(
ProfilingInfo
*
p_info_arr
,
int
p_info_max
);
int
register_binding_functions
(
godot_instance_binding_functions
p_binding_functions
);
int
register_binding_functions
(
godot_
nativescript_
instance_binding_functions
p_binding_functions
);
void
unregister_binding_functions
(
int
p_idx
);
void
*
get_instance_binding_data
(
int
p_idx
,
Object
*
p_object
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment