Fix text server GDExtension build.
This commit is contained in:
parent
1bd0b296e1
commit
bbc77b6d29
9 changed files with 30 additions and 30 deletions
|
@ -62,7 +62,7 @@ using namespace godot;
|
|||
|
||||
extern "C" {
|
||||
|
||||
GDExtensionBool GDN_EXPORT textserver_advanced_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||
GDExtensionBool GDE_EXPORT textserver_advanced_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||
GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
||||
|
||||
init_obj.register_initializer(&initialize_text_server_adv_module);
|
||||
|
|
|
@ -3893,7 +3893,7 @@ bool TextServerAdvanced::_shaped_text_add_string(const RID &p_shaped, const Stri
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TextServerAdvanced::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, float p_baseline) {
|
||||
bool TextServerAdvanced::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, double p_baseline) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
|
||||
ERR_FAIL_COND_V(!sd, false);
|
||||
|
@ -3924,7 +3924,7 @@ bool TextServerAdvanced::_shaped_text_add_object(const RID &p_shaped, const Vari
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TextServerAdvanced::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, float p_baseline) {
|
||||
bool TextServerAdvanced::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) {
|
||||
ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped);
|
||||
ERR_FAIL_COND_V(!sd, false);
|
||||
|
||||
|
@ -6274,7 +6274,7 @@ String TextServerAdvanced::_string_to_lower(const String &p_string, const String
|
|||
return String::utf16(lower.ptr(), len);
|
||||
}
|
||||
|
||||
PackedInt32Array TextServerAdvanced::_string_get_word_breaks(const String &p_string, const String &p_language, int p_chars_per_line) const {
|
||||
PackedInt32Array TextServerAdvanced::_string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const {
|
||||
const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
|
||||
// Convert to UTF-16.
|
||||
Char16String utf16 = p_string.utf16();
|
||||
|
|
|
@ -469,7 +469,7 @@ class TextServerAdvanced : public TextServerExtension {
|
|||
int pos = 0;
|
||||
InlineAlignment inline_align = INLINE_ALIGNMENT_CENTER;
|
||||
Rect2 rect;
|
||||
float baseline = 0;
|
||||
double baseline = 0;
|
||||
};
|
||||
HashMap<Variant, EmbeddedObject, VariantHasher, VariantComparator> objects;
|
||||
|
||||
|
@ -871,8 +871,8 @@ public:
|
|||
MODBIND2RC(int64_t, shaped_text_get_spacing, const RID &, SpacingType);
|
||||
|
||||
MODBIND7R(bool, shaped_text_add_string, const RID &, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &);
|
||||
MODBIND6R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t, float);
|
||||
MODBIND5R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment, float);
|
||||
MODBIND6R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t, double);
|
||||
MODBIND5R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment, double);
|
||||
|
||||
MODBIND1RC(int64_t, shaped_get_span_count, const RID &);
|
||||
MODBIND2RC(Variant, shaped_get_span_meta, const RID &, int64_t);
|
||||
|
@ -917,7 +917,7 @@ public:
|
|||
MODBIND2RC(String, parse_number, const String &, const String &);
|
||||
MODBIND1RC(String, percent_sign, const String &);
|
||||
|
||||
MODBIND3RC(PackedInt32Array, string_get_word_breaks, const String &, const String &, int);
|
||||
MODBIND3RC(PackedInt32Array, string_get_word_breaks, const String &, const String &, int64_t);
|
||||
|
||||
MODBIND2RC(int64_t, is_confusable, const String &, const PackedStringArray &);
|
||||
MODBIND1RC(bool, spoof_check, const String &);
|
||||
|
|
|
@ -62,7 +62,7 @@ using namespace godot;
|
|||
|
||||
extern "C" {
|
||||
|
||||
GDExtensionBool GDN_EXPORT textserver_fallback_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||
GDExtensionBool GDE_EXPORT textserver_fallback_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||
GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
||||
|
||||
init_obj.register_initializer(&initialize_text_server_fb_module);
|
||||
|
|
|
@ -2906,7 +2906,7 @@ bool TextServerFallback::_shaped_text_add_string(const RID &p_shaped, const Stri
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TextServerFallback::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, float p_baseline) {
|
||||
bool TextServerFallback::_shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, double p_baseline) {
|
||||
ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped);
|
||||
ERR_FAIL_COND_V(!sd, false);
|
||||
|
||||
|
@ -2938,7 +2938,7 @@ bool TextServerFallback::_shaped_text_add_object(const RID &p_shaped, const Vari
|
|||
return true;
|
||||
}
|
||||
|
||||
bool TextServerFallback::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, float p_baseline) {
|
||||
bool TextServerFallback::_shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) {
|
||||
ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped);
|
||||
ERR_FAIL_COND_V(!sd, false);
|
||||
|
||||
|
@ -4068,7 +4068,7 @@ String TextServerFallback::_string_to_lower(const String &p_string, const String
|
|||
return p_string.to_lower();
|
||||
}
|
||||
|
||||
PackedInt32Array TextServerFallback::_string_get_word_breaks(const String &p_string, const String &p_language, int p_chars_per_line) const {
|
||||
PackedInt32Array TextServerFallback::_string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const {
|
||||
PackedInt32Array ret;
|
||||
|
||||
int line_start = 0;
|
||||
|
|
|
@ -417,7 +417,7 @@ class TextServerFallback : public TextServerExtension {
|
|||
int pos = 0;
|
||||
InlineAlignment inline_align = INLINE_ALIGNMENT_CENTER;
|
||||
Rect2 rect;
|
||||
float baseline = 0;
|
||||
double baseline = 0;
|
||||
};
|
||||
HashMap<Variant, EmbeddedObject, VariantHasher, VariantComparator> objects;
|
||||
|
||||
|
@ -744,8 +744,8 @@ public:
|
|||
MODBIND2RC(int64_t, shaped_text_get_spacing, const RID &, SpacingType);
|
||||
|
||||
MODBIND7R(bool, shaped_text_add_string, const RID &, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &);
|
||||
MODBIND6R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t, float);
|
||||
MODBIND5R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment, float);
|
||||
MODBIND6R(bool, shaped_text_add_object, const RID &, const Variant &, const Size2 &, InlineAlignment, int64_t, double);
|
||||
MODBIND5R(bool, shaped_text_resize_object, const RID &, const Variant &, const Size2 &, InlineAlignment, double);
|
||||
|
||||
MODBIND1RC(int64_t, shaped_get_span_count, const RID &);
|
||||
MODBIND2RC(Variant, shaped_get_span_meta, const RID &, int64_t);
|
||||
|
@ -786,7 +786,7 @@ public:
|
|||
MODBIND1RC(double, shaped_text_get_underline_position, const RID &);
|
||||
MODBIND1RC(double, shaped_text_get_underline_thickness, const RID &);
|
||||
|
||||
MODBIND3RC(PackedInt32Array, string_get_word_breaks, const String &, const String &, int);
|
||||
MODBIND3RC(PackedInt32Array, string_get_word_breaks, const String &, const String &, int64_t);
|
||||
|
||||
MODBIND2RC(String, string_to_upper, const String &, const String &);
|
||||
MODBIND2RC(String, string_to_lower, const String &, const String &);
|
||||
|
|
|
@ -1041,13 +1041,13 @@ bool TextServerExtension::shaped_text_add_string(const RID &p_shaped, const Stri
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool TextServerExtension::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, float p_baseline) {
|
||||
bool TextServerExtension::shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, int64_t p_length, double p_baseline) {
|
||||
bool ret = false;
|
||||
GDVIRTUAL_CALL(_shaped_text_add_object, p_shaped, p_key, p_size, p_inline_align, p_length, p_baseline, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, float p_baseline) {
|
||||
bool TextServerExtension::shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) {
|
||||
bool ret = false;
|
||||
GDVIRTUAL_CALL(_shaped_text_resize_object, p_shaped, p_key, p_size, p_inline_align, p_baseline, ret);
|
||||
return ret;
|
||||
|
@ -1379,7 +1379,7 @@ TypedArray<Vector3i> TextServerExtension::parse_structured_text(StructuredTextPa
|
|||
return ret;
|
||||
}
|
||||
|
||||
PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language, int p_chars_per_line) const {
|
||||
PackedInt32Array TextServerExtension::string_get_word_breaks(const String &p_string, const String &p_language, int64_t p_chars_per_line) const {
|
||||
PackedInt32Array ret;
|
||||
GDVIRTUAL_CALL(_string_get_word_breaks, p_string, p_language, p_chars_per_line, ret);
|
||||
return ret;
|
||||
|
|
|
@ -111,12 +111,12 @@ public:
|
|||
|
||||
virtual void font_set_weight(const RID &p_font_rid, int64_t p_weight) override;
|
||||
virtual int64_t font_get_weight(const RID &p_font_rid) const override;
|
||||
GDVIRTUAL2(_font_set_weight, RID, int);
|
||||
GDVIRTUAL2(_font_set_weight, RID, int64_t);
|
||||
GDVIRTUAL1RC(int64_t, _font_get_weight, RID);
|
||||
|
||||
virtual void font_set_stretch(const RID &p_font_rid, int64_t p_stretch) override;
|
||||
virtual int64_t font_get_stretch(const RID &p_font_rid) const override;
|
||||
GDVIRTUAL2(_font_set_stretch, RID, int);
|
||||
GDVIRTUAL2(_font_set_stretch, RID, int64_t);
|
||||
GDVIRTUAL1RC(int64_t, _font_get_stretch, RID);
|
||||
|
||||
virtual void font_set_antialiasing(const RID &p_font_rid, TextServer::FontAntialiasing p_antialiasing) override;
|
||||
|
@ -395,11 +395,11 @@ public:
|
|||
GDVIRTUAL2RC(int64_t, _shaped_text_get_spacing, RID, SpacingType);
|
||||
|
||||
virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override;
|
||||
virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1, float p_baseline = 0.0) override;
|
||||
virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, float p_baseline = 0.0) override;
|
||||
virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1, double p_baseline = 0.0) override;
|
||||
virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, double p_baseline = 0.0) override;
|
||||
GDVIRTUAL7R(bool, _shaped_text_add_string, RID, const String &, const TypedArray<RID> &, int64_t, const Dictionary &, const String &, const Variant &);
|
||||
GDVIRTUAL6R(bool, _shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t, float);
|
||||
GDVIRTUAL5R(bool, _shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment, float);
|
||||
GDVIRTUAL6R(bool, _shaped_text_add_object, RID, const Variant &, const Size2 &, InlineAlignment, int64_t, double);
|
||||
GDVIRTUAL5R(bool, _shaped_text_resize_object, RID, const Variant &, const Size2 &, InlineAlignment, double);
|
||||
|
||||
virtual int64_t shaped_get_span_count(const RID &p_shaped) const override;
|
||||
virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override;
|
||||
|
@ -510,8 +510,8 @@ public:
|
|||
virtual String strip_diacritics(const String &p_string) const override;
|
||||
GDVIRTUAL1RC(String, _strip_diacritics, const String &);
|
||||
|
||||
virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "", int p_chars_per_line = 0) const override;
|
||||
GDVIRTUAL3RC(PackedInt32Array, _string_get_word_breaks, const String &, const String &, int);
|
||||
virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "", int64_t p_chars_per_line = 0) const override;
|
||||
GDVIRTUAL3RC(PackedInt32Array, _string_get_word_breaks, const String &, const String &, int64_t);
|
||||
|
||||
virtual bool is_valid_identifier(const String &p_string) const override;
|
||||
GDVIRTUAL1RC(bool, _is_valid_identifier, const String &);
|
||||
|
|
|
@ -421,8 +421,8 @@ public:
|
|||
virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const = 0;
|
||||
|
||||
virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) = 0;
|
||||
virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1, float p_baseline = 0.0) = 0;
|
||||
virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, float p_baseline = 0.0) = 0;
|
||||
virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1, double p_baseline = 0.0) = 0;
|
||||
virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, double p_baseline = 0.0) = 0;
|
||||
|
||||
virtual int64_t shaped_get_span_count(const RID &p_shaped) const = 0;
|
||||
virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const = 0;
|
||||
|
@ -494,7 +494,7 @@ public:
|
|||
virtual String percent_sign(const String &p_language = "") const = 0;
|
||||
|
||||
// String functions.
|
||||
virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "", int p_chars_per_line = 0) const = 0;
|
||||
virtual PackedInt32Array string_get_word_breaks(const String &p_string, const String &p_language = "", int64_t p_chars_per_line = 0) const = 0;
|
||||
|
||||
virtual int64_t is_confusable(const String &p_string, const PackedStringArray &p_dict) const { return -1; };
|
||||
virtual bool spoof_check(const String &p_string) const { return false; };
|
||||
|
|
Loading…
Reference in a new issue