summaryrefslogtreecommitdiff
path: root/modules/gdnative/include
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdnative/include')
-rw-r--r--modules/gdnative/include/nativescript/godot_nativescript.h8
-rw-r--r--modules/gdnative/include/text/godot_text.h158
-rw-r--r--modules/gdnative/include/xr/godot_xr.h98
3 files changed, 102 insertions, 162 deletions
diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h
index c97f5f0389..09eac2492f 100644
--- a/modules/gdnative/include/nativescript/godot_nativescript.h
+++ b/modules/gdnative/include/nativescript/godot_nativescript.h
@@ -39,12 +39,8 @@ extern "C" {
typedef enum {
GODOT_METHOD_RPC_MODE_DISABLED,
- GODOT_METHOD_RPC_MODE_REMOTE,
- GODOT_METHOD_RPC_MODE_MASTER,
- GODOT_METHOD_RPC_MODE_PUPPET,
- GODOT_METHOD_RPC_MODE_REMOTESYNC,
- GODOT_METHOD_RPC_MODE_MASTERSYNC,
- GODOT_METHOD_RPC_MODE_PUPPETSYNC,
+ GODOT_METHOD_RPC_MODE_ANY,
+ GODOT_METHOD_RPC_MODE_AUTHORITY,
} godot_nativescript_method_rpc_mode;
typedef enum {
diff --git a/modules/gdnative/include/text/godot_text.h b/modules/gdnative/include/text/godot_text.h
index 6428f2f149..940cfd11f8 100644
--- a/modules/gdnative/include/text/godot_text.h
+++ b/modules/gdnative/include/text/godot_text.h
@@ -60,68 +60,109 @@ typedef struct {
typedef struct {
godot_gdnative_api_version version;
+
void *(*constructor)(godot_object *);
void (*destructor)(void *);
+
godot_string (*get_name)(const void *);
godot_bool (*has_feature)(const void *, godot_int);
+
+ void (*free)(void *, godot_rid *);
+ bool (*has)(void *, godot_rid *);
+
bool (*load_support_data)(void *, const godot_string *);
godot_string (*get_support_data_filename)(const void *);
godot_string (*get_support_data_info)(const void *);
bool (*save_support_data)(void *, const godot_string *);
+
bool (*is_locale_right_to_left)(void *, const godot_string *);
- void (*free)(void *, godot_rid *);
- bool (*has)(void *, godot_rid *);
- godot_rid (*create_font_system)(void *, const godot_string *, int);
- godot_rid (*create_font_resource)(void *, const godot_string *, int);
- godot_rid (*create_font_memory)(void *, const uint8_t *, size_t, godot_string *, int);
- godot_rid (*create_font_bitmap)(void *, float, float, int);
- void (*font_bitmap_add_texture)(void *, godot_rid *, const godot_object *);
- void (*font_bitmap_add_char)(void *, godot_rid *, char32_t, int, const godot_rect2 *, const godot_vector2 *, float);
- void (*font_bitmap_add_kerning_pair)(void *, godot_rid *, char32_t, char32_t, int);
- float (*font_get_height)(void *, godot_rid *, int);
- float (*font_get_ascent)(void *, godot_rid *, int);
- float (*font_get_descent)(void *, godot_rid *, int);
- float (*font_get_underline_position)(void *, godot_rid *, int);
- float (*font_get_underline_thickness)(void *, godot_rid *, int);
- int (*font_get_spacing_space)(void *, godot_rid *);
- void (*font_set_spacing_space)(void *, godot_rid *, int);
- int (*font_get_spacing_glyph)(void *, godot_rid *);
- void (*font_set_spacing_glyph)(void *, godot_rid *, int);
+ int32_t (*name_to_tag)(const void *, const godot_string *);
+ godot_string (*tag_to_name)(const void *, int32_t);
+
+ godot_rid (*create_font)(void *);
+ void (*font_set_data)(void *, godot_rid *, const godot_packed_byte_array *);
+ void (*font_set_data_ptr)(void *, godot_rid *, const uint8_t *, size_t);
void (*font_set_antialiased)(void *, godot_rid *, bool);
- bool (*font_get_antialiased)(void *, godot_rid *);
- godot_dictionary (*font_get_feature_list)(void *, godot_rid *);
- godot_dictionary (*font_get_variation_list)(void *, godot_rid *);
- void (*font_set_variation)(void *, godot_rid *, const godot_string *, double);
- double (*font_get_variation)(void *, godot_rid *, const godot_string *);
- void (*font_set_distance_field_hint)(void *, godot_rid *, bool);
- bool (*font_get_distance_field_hint)(void *, godot_rid *);
- void (*font_set_hinting)(void *, godot_rid *, godot_int);
- godot_int (*font_get_hinting)(void *, godot_rid *);
+ bool (*font_is_antialiased)(const void *, godot_rid *);
+ void (*font_set_multichannel_signed_distance_field)(void *, godot_rid *, bool);
+ bool (*font_is_multichannel_signed_distance_field)(const void *, godot_rid *);
+ void (*font_set_msdf_pixel_range)(void *, godot_rid *, godot_int);
+ godot_int (*font_get_msdf_pixel_range)(const void *, godot_rid *);
+ void (*font_set_msdf_size)(void *, godot_rid *, godot_int);
+ godot_int (*font_get_msdf_size)(const void *, godot_rid *);
+ void (*font_set_fixed_size)(void *, godot_rid *, godot_int);
+ godot_int (*font_get_fixed_size)(const void *, godot_rid *);
void (*font_set_force_autohinter)(void *, godot_rid *, bool);
- bool (*font_get_force_autohinter)(void *, godot_rid *);
- bool (*font_has_char)(void *, godot_rid *, char32_t);
- godot_string (*font_get_supported_chars)(void *, godot_rid *);
- bool (*font_has_outline)(void *, godot_rid *);
- int (*font_get_base_size)(void *, godot_rid *);
- bool (*font_is_language_supported)(void *, godot_rid *, const godot_string *);
+ bool (*font_is_force_autohinter)(const void *, godot_rid *);
+ void (*font_set_hinting)(void *, godot_rid *, godot_int);
+ godot_int (*font_get_hinting)(const void *, godot_rid *);
+ void (*font_set_variation_coordinates)(void *, godot_rid *, const godot_dictionary *);
+ godot_dictionary (*font_get_variation_coordinates)(const void *, godot_rid *);
+ void (*font_set_oversampling)(void *, godot_rid *, godot_real_t);
+ godot_real_t (*font_get_oversampling)(const void *, godot_rid *);
+ godot_array (*font_get_size_cache_list)(const void *, godot_rid *);
+ void (*font_clear_size_cache)(void *, godot_rid *);
+ void (*font_remove_size_cache)(void *, godot_rid *, const godot_vector2i *);
+ void (*font_set_ascent)(void *, godot_rid *, godot_int, godot_real_t);
+ godot_real_t (*font_get_ascent)(const void *, godot_rid *, godot_int);
+ void (*font_set_descent)(void *, godot_rid *, godot_int, godot_real_t);
+ godot_real_t (*font_get_descent)(const void *, godot_rid *, godot_int);
+ void (*font_set_underline_position)(void *, godot_rid *, godot_int, godot_real_t);
+ godot_real_t (*font_get_underline_position)(const void *, godot_rid *, godot_int);
+ void (*font_set_underline_thickness)(void *, godot_rid *, godot_int, godot_real_t);
+ godot_real_t (*font_get_underline_thickness)(const void *, godot_rid *, godot_int);
+ void (*font_set_scale)(void *, godot_rid *, godot_int, godot_real_t);
+ godot_real_t (*font_get_scale)(const void *, godot_rid *, godot_int);
+ void (*font_set_spacing)(void *, godot_rid *, godot_int, godot_int, godot_int);
+ godot_int (*font_get_spacing)(const void *, godot_rid *, godot_int, godot_int);
+ godot_int (*font_get_texture_count)(const void *, godot_rid *, const godot_vector2i *);
+ void (*font_clear_textures)(void *, godot_rid *, const godot_vector2i *);
+ void (*font_remove_texture)(void *, godot_rid *, const godot_vector2i *, godot_int);
+ void (*font_set_texture_image)(void *, godot_rid *, const godot_vector2i *, godot_int, const godot_object *);
+ godot_object *(*font_get_texture_image)(const void *, godot_rid *, const godot_vector2i *, godot_int);
+ void (*font_set_texture_offsets)(void *, godot_rid *, const godot_vector2i *, godot_int, const godot_packed_int32_array *);
+ godot_packed_int32_array (*font_get_texture_offsets)(const void *, godot_rid *, const godot_vector2i *, godot_int);
+ godot_array (*font_get_glyph_list)(const void *, godot_rid *, const godot_vector2i *);
+ void (*font_clear_glyphs)(void *, godot_rid *, const godot_vector2i *);
+ void (*font_remove_glyph)(void *, godot_rid *, const godot_vector2i *, int32_t);
+ godot_vector2 (*font_get_glyph_advance)(const void *, godot_rid *, godot_int, int32_t);
+ void (*font_set_glyph_advance)(void *, godot_rid *, godot_int, int32_t, const godot_vector2 *);
+ godot_vector2 (*font_get_glyph_offset)(const void *, godot_rid *, const godot_vector2i *, int32_t);
+ void (*font_set_glyph_offset)(void *, godot_rid *, const godot_vector2i *, int32_t, const godot_vector2 *);
+ godot_vector2 (*font_get_glyph_size)(const void *, godot_rid *, const godot_vector2i *, int32_t);
+ void (*font_set_glyph_size)(void *, godot_rid *, const godot_vector2i *, int32_t, const godot_vector2 *);
+ godot_rect2 (*font_get_glyph_uv_rect)(const void *, godot_rid *, const godot_vector2i *, int32_t);
+ void (*font_set_glyph_uv_rect)(void *, godot_rid *, const godot_vector2i *, int32_t, const godot_rect2 *);
+ godot_int (*font_get_glyph_texture_idx)(const void *, godot_rid *, const godot_vector2i *, int32_t);
+ void (*font_set_glyph_texture_idx)(void *, godot_rid *, const godot_vector2i *, int32_t, godot_int);
+ bool (*font_get_glyph_contours)(const void *, godot_rid *, godot_int, int32_t, godot_packed_vector3_array *, godot_packed_int32_array *, bool *);
+ godot_array (*font_get_kerning_list)(const void *, godot_rid *, godot_int);
+ void (*font_clear_kerning_map)(void *, godot_rid *, godot_int);
+ void (*font_remove_kerning)(void *, godot_rid *, godot_int, const godot_vector2i *);
+ void (*font_set_kerning)(void *, godot_rid *, godot_int, const godot_vector2i *, const godot_vector2 *);
+ godot_vector2 (*font_get_kerning)(const void *, godot_rid *, godot_int, const godot_vector2i *);
+ int32_t (*font_get_glyph_index)(const void *, godot_rid *, godot_int, char32_t, char32_t);
+ bool (*font_has_char)(const void *, godot_rid *, char32_t);
+ godot_string (*font_get_supported_chars)(const void *, godot_rid *);
+ void (*font_render_range)(void *, godot_rid *, const godot_vector2i *, char32_t, char32_t);
+ void (*font_render_glyph)(void *, godot_rid *, const godot_vector2i *, int32_t);
+ void (*font_draw_glyph)(const void *, godot_rid *, godot_rid *, godot_int, const godot_vector2 *, int32_t, const godot_color *);
+ void (*font_draw_glyph_outline)(const void *, godot_rid *, godot_rid *, godot_int, godot_int, const godot_vector2 *, int32_t, const godot_color *);
+ bool (*font_is_language_supported)(const void *, godot_rid *, const godot_string *);
void (*font_set_language_support_override)(void *, godot_rid *, const godot_string *, bool);
- bool (*font_get_language_support_override)(void *, godot_rid *, const godot_string *);
+ bool (*font_get_language_support_override)(const void *, godot_rid *, const godot_string *);
void (*font_remove_language_support_override)(void *, godot_rid *, const godot_string *);
- godot_packed_string_array (*font_get_language_support_overrides)(void *, godot_rid *);
- bool (*font_is_script_supported)(void *, godot_rid *, const godot_string *);
+ godot_packed_string_array (*font_get_language_support_overrides)(const void *, godot_rid *);
+ bool (*font_is_script_supported)(const void *, godot_rid *, const godot_string *);
void (*font_set_script_support_override)(void *, godot_rid *, const godot_string *, bool);
- bool (*font_get_script_support_override)(void *, godot_rid *, const godot_string *);
+ bool (*font_get_script_support_override)(const void *, godot_rid *, const godot_string *);
void (*font_remove_script_support_override)(void *, godot_rid *, const godot_string *);
- godot_packed_string_array (*font_get_script_support_overrides)(void *, godot_rid *);
- uint32_t (*font_get_glyph_index)(void *, godot_rid *, char32_t, char32_t);
- godot_vector2 (*font_get_glyph_advance)(void *, godot_rid *, uint32_t, int);
- godot_vector2 (*font_get_glyph_kerning)(void *, godot_rid *, uint32_t, uint32_t, int);
- godot_vector2 (*font_draw_glyph)(void *, godot_rid *, godot_rid *, int, const godot_vector2 *, uint32_t, const godot_color *);
- godot_vector2 (*font_draw_glyph_outline)(void *, godot_rid *, godot_rid *, int, int, const godot_vector2 *, uint32_t, const godot_color *);
- bool (*font_get_glyph_contours)(void *, godot_rid *, int, uint32_t, godot_packed_vector3_array *, godot_packed_int32_array *, bool *);
- float (*font_get_oversampling)(void *);
- void (*font_set_oversampling)(void *, float);
- godot_packed_string_array (*get_system_fonts)(void *);
+ godot_packed_string_array (*font_get_script_support_overrides)(const void *, godot_rid *);
+ godot_dictionary (*font_supported_feature_list)(const void *, godot_rid *);
+ godot_dictionary (*font_supported_variation_list)(const void *, godot_rid *);
+ godot_real_t (*font_get_global_oversampling)(const void *);
+ void (*font_set_global_oversampling)(void *, godot_real_t);
+
godot_rid (*create_shaped_text)(void *, godot_int, godot_int);
void (*shaped_text_clear)(void *, godot_rid *);
void (*shaped_text_set_direction)(void *, godot_rid *, godot_int);
@@ -138,27 +179,28 @@ typedef struct {
bool (*shaped_text_resize_object)(void *, godot_rid *, const godot_variant *, const godot_vector2 *, godot_int);
godot_rid (*shaped_text_substr)(void *, godot_rid *, godot_int, godot_int);
godot_rid (*shaped_text_get_parent)(void *, godot_rid *);
- float (*shaped_text_fit_to_width)(void *, godot_rid *, float, uint8_t);
- float (*shaped_text_tab_align)(void *, godot_rid *, godot_packed_float32_array *);
+ godot_real_t (*shaped_text_fit_to_width)(void *, godot_rid *, godot_real_t, uint8_t);
+ godot_real_t (*shaped_text_tab_align)(void *, godot_rid *, godot_packed_float32_array *);
bool (*shaped_text_shape)(void *, godot_rid *);
bool (*shaped_text_update_breaks)(void *, godot_rid *);
bool (*shaped_text_update_justification_ops)(void *, godot_rid *);
- void (*shaped_text_overrun_trim_to_width)(void *, godot_rid *, float, uint8_t);
+ void (*shaped_text_overrun_trim_to_width)(void *, godot_rid *, godot_real_t, uint8_t);
bool (*shaped_text_is_ready)(void *, godot_rid *);
godot_packed_glyph_array (*shaped_text_get_glyphs)(void *, godot_rid *);
godot_vector2i (*shaped_text_get_range)(void *, godot_rid *);
godot_packed_glyph_array (*shaped_text_sort_logical)(void *, godot_rid *);
godot_packed_vector2i_array (*shaped_text_get_line_breaks_adv)(void *, godot_rid *, godot_packed_float32_array *, int, bool, uint8_t);
- godot_packed_vector2i_array (*shaped_text_get_line_breaks)(void *, godot_rid *, float, int, uint8_t);
+ godot_packed_vector2i_array (*shaped_text_get_line_breaks)(void *, godot_rid *, godot_real_t, int, uint8_t);
godot_packed_vector2i_array (*shaped_text_get_word_breaks)(void *, godot_rid *, int);
godot_array (*shaped_text_get_objects)(void *, godot_rid *);
godot_rect2 (*shaped_text_get_object_rect)(void *, godot_rid *, const godot_variant *);
godot_vector2 (*shaped_text_get_size)(void *, godot_rid *);
- float (*shaped_text_get_ascent)(void *, godot_rid *);
- float (*shaped_text_get_descent)(void *, godot_rid *);
- float (*shaped_text_get_width)(void *, godot_rid *);
- float (*shaped_text_get_underline_position)(void *, godot_rid *);
- float (*shaped_text_get_underline_thickness)(void *, godot_rid *);
+ godot_real_t (*shaped_text_get_ascent)(void *, godot_rid *);
+ godot_real_t (*shaped_text_get_descent)(void *, godot_rid *);
+ godot_real_t (*shaped_text_get_width)(void *, godot_rid *);
+ godot_real_t (*shaped_text_get_underline_position)(void *, godot_rid *);
+ godot_real_t (*shaped_text_get_underline_thickness)(void *, godot_rid *);
+
godot_string (*format_number)(void *, const godot_string *, const godot_string *);
godot_string (*parse_number)(void *, const godot_string *, const godot_string *);
godot_string (*percent_sign)(void *, const godot_string *);
@@ -185,8 +227,8 @@ void GDAPI godot_glyph_set_flags(godot_glyph *p_self, godot_int p_flags);
godot_vector2 GDAPI godot_glyph_get_offset(const godot_glyph *p_self);
void GDAPI godot_glyph_set_offset(godot_glyph *p_self, const godot_vector2 *p_offset);
-godot_float GDAPI godot_glyph_get_advance(const godot_glyph *p_self);
-void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_float p_advance);
+godot_real_t GDAPI godot_glyph_get_advance(const godot_glyph *p_self);
+void GDAPI godot_glyph_set_advance(godot_glyph *p_self, godot_real_t p_advance);
godot_rid GDAPI godot_glyph_get_font(const godot_glyph *p_self);
void GDAPI godot_glyph_set_font(godot_glyph *p_self, godot_rid *p_font);
diff --git a/modules/gdnative/include/xr/godot_xr.h b/modules/gdnative/include/xr/godot_xr.h
deleted file mode 100644
index 53cb830cbb..0000000000
--- a/modules/gdnative/include/xr/godot_xr.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************/
-/* godot_xr.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2021 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_NATIVEXR_H
-#define GODOT_NATIVEXR_H
-
-#include <gdnative/gdnative.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// For future versions of the API we should only add new functions at the end of the structure and use the
-// version info to detect whether a call is available
-
-// Use these to populate version in your plugin
-#define GODOTVR_API_MAJOR 4
-#define GODOTVR_API_MINOR 0
-
-typedef struct {
- godot_gdnative_api_version version; /* version of our API */
- void *(*constructor)(godot_object *);
- void (*destructor)(void *);
- godot_string (*get_name)(const void *);
- godot_int (*get_capabilities)(const void *);
- godot_bool (*get_anchor_detection_is_enabled)(const void *);
- void (*set_anchor_detection_is_enabled)(void *, godot_bool);
- godot_int (*get_view_count)(const void *);
- godot_bool (*is_initialized)(const void *);
- godot_bool (*initialize)(void *);
- void (*uninitialize)(void *);
- godot_vector2 (*get_render_targetsize)(const void *);
-
- godot_transform3d (*get_camera_transform)(void *);
- godot_transform3d (*get_transform_for_view)(void *, godot_int, godot_transform3d *);
- void (*fill_projection_for_view)(void *, godot_real_t *, godot_int, godot_real_t, godot_real_t, godot_real_t);
- void (*commit_views)(void *, godot_rid *, godot_rect2 *);
-
- void (*process)(void *);
- void (*notification)(void *, godot_int);
- godot_int (*get_camera_feed_id)(void *);
-
- // possibly deprecate but adding/keeping as a reminder these are in Godot 3
- void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *);
- godot_int (*get_external_texture_for_eye)(void *, godot_int);
- godot_int (*get_external_depth_for_eye)(void *, godot_int);
-} godot_xr_interface_gdnative;
-
-void GDAPI godot_xr_register_interface(const godot_xr_interface_gdnative *p_interface);
-
-// helper functions to access XRServer data
-godot_real_t GDAPI godot_xr_get_worldscale();
-godot_transform3d GDAPI godot_xr_get_reference_frame();
-
-// helper functions for rendering
-void GDAPI godot_xr_blit(godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_rect);
-godot_int GDAPI godot_xr_get_texid(godot_rid *p_render_target);
-
-// helper functions for updating XR controllers
-godot_int GDAPI godot_xr_add_controller(char *p_device_name, godot_int p_hand, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
-void GDAPI godot_xr_remove_controller(godot_int p_controller_id);
-void GDAPI godot_xr_set_controller_transform(godot_int p_controller_id, godot_transform3d *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position);
-void GDAPI godot_xr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed);
-void GDAPI godot_xr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real_t p_value, godot_bool p_can_be_negative);
-godot_real_t GDAPI godot_xr_get_controller_rumble(godot_int p_controller_id);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !GODOT_NATIVEXR_H */