Debian Codegraph @

servers/text/text_server_dummy.h

raw symbols SCIP
1 /**************************************************************************/
2 /* text_server_dummy.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "servers/text/text_server_extension.h"
34
35 /*************************************************************************/
36
37 class TextServerDummy : public TextServerExtension {
38 GDCLASS(TextServerDummy, TextServerExtension);
39 _THREAD_SAFE_CLASS_
40
41 public:
42 virtual bool has_feature(Feature p_feature) const override { return false; }
43 virtual String get_name() const override { return "Dummy"; }
44 virtual int64_t get_features() const override { return 0; }
45 virtual void free_rid(const RID &p_rid) override {}
46 virtual bool has(const RID &p_rid) override { return false; }
47
48 virtual RID create_font() override { return RID(); }
49 virtual void font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) override {}
50 virtual int64_t font_get_fixed_size(const RID &p_font_rid) const override { return 0; }
51 virtual void font_set_fixed_size_scale_mode(const RID &p_font_rid, TextServer::FixedSizeScaleMode p_fixed_size_scale_mode) override {}
52 virtual TextServer::FixedSizeScaleMode font_get_fixed_size_scale_mode(const RID &p_font_rid) const override { return FIXED_SIZE_SCALE_DISABLE; }
53 virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override { return TypedArray<Vector2i>(); }
54 virtual TypedArray<Dictionary> font_get_size_cache_info(const RID &p_font_rid) const override { return TypedArray<Dictionary>(); }
55 virtual void font_clear_size_cache(const RID &p_font_rid) override {}
56 virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override {}
57 virtual void font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) override {}
58 virtual double font_get_ascent(const RID &p_font_rid, int64_t p_size) const override { return 0; }
59 virtual void font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) override {}
60 virtual double font_get_descent(const RID &p_font_rid, int64_t p_size) const override { return 0; }
61 virtual void font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) override {}
62 virtual double font_get_underline_position(const RID &p_font_rid, int64_t p_size) const override { return 0; }
63 virtual void font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) override {}
64 virtual double font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const override { return 0; }
65 virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override {}
66 virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override { return 0; }
67 virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override { return 0; }
68 virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override {}
69 virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override {}
70 virtual void font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) override {}
71 virtual Ref<Image> font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override { return Ref<Image>(); }
72 virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override { return PackedInt32Array(); }
73 virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override {}
74 virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override {}
75 virtual Vector2 font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const override { return Vector2(); }
76 virtual void font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) override {}
77 virtual Vector2 font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return Vector2(); }
78 virtual void font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) override {}
79 virtual Vector2 font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return Vector2(); }
80 virtual void font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) override {}
81 virtual Rect2 font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return Rect2(); }
82 virtual void font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) override {}
83 virtual int64_t font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return 0; }
84 virtual void font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) override {}
85 virtual RID font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return RID(); }
86 virtual Size2 font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const override { return Size2(); }
87 virtual int64_t font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const override { return 0; }
88 virtual int64_t font_get_char_from_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_glyph_index) const override { return 0; }
89 virtual bool font_has_char(const RID &p_font_rid, int64_t p_char) const override { return false; }
90 virtual String font_get_supported_chars(const RID &p_font_rid) const override { return String(); }
91 virtual PackedInt32Array font_get_supported_glyphs(const RID &p_font_rid) const override { return PackedInt32Array(); }
92 virtual void font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color, float p_oversampling) const override {}
93 virtual void font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color, float p_oversampling) const override {}
94
95 virtual RID create_shaped_text(TextServer::Direction p_direction, TextServer::Orientation p_orientation) override { return RID(); }
96 virtual void shaped_text_clear(const RID &p_shaped) override {}
97 virtual RID shaped_text_duplicate(const RID &p_shaped) override { return RID(); }
98 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, const String &p_language, const Variant &p_meta) override { return false; }
99 virtual bool 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) override { return false; }
100 virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align, double p_baseline) override { return false; }
101 virtual bool shaped_text_has_object(const RID &p_shaped, const Variant &p_key) const override { return false; }
102 virtual int64_t shaped_get_span_count(const RID &p_shaped) const override { return 0; }
103 virtual Variant shaped_get_span_meta(const RID &p_shaped, int64_t p_index) const override { return Variant(); }
104 virtual Variant shaped_get_span_embedded_object(const RID &p_shaped, int64_t p_index) const override { return Variant(); }
105 virtual void shaped_set_span_update_font(const RID &p_shaped, int64_t p_index, const TypedArray<RID> &p_fonts, int64_t p_size, const Dictionary &p_opentype_features) override {}
106 virtual RID shaped_text_substr(const RID &p_shaped, int64_t p_start, int64_t p_length) const override { return RID(); }
107 virtual RID shaped_text_get_parent(const RID &p_shaped) const override { return RID(); }
108 virtual bool shaped_text_shape(const RID &p_shaped) override { return false; }
109 virtual bool shaped_text_is_ready(const RID &p_shaped) const override { return false; }
110 virtual const Glyph *shaped_text_get_glyphs(const RID &p_shaped) const override { return nullptr; }
111 virtual const Glyph *shaped_text_sort_logical(const RID &p_shaped) override { return nullptr; }
112 virtual int64_t shaped_text_get_glyph_count(const RID &p_shaped) const override { return 0; }
113 virtual Vector2i shaped_text_get_range(const RID &p_shaped) const override { return Vector2i(); }
114 virtual int64_t shaped_text_get_trim_pos(const RID &p_shaped) const override { return -1; }
115 virtual int64_t shaped_text_get_ellipsis_pos(const RID &p_shaped) const override { return -1; }
116 virtual const Glyph *shaped_text_get_ellipsis_glyphs(const RID &p_shaped) const override { return nullptr; }
117 virtual int64_t shaped_text_get_ellipsis_glyph_count(const RID &p_shaped) const override { return -1; }
118 virtual Array shaped_text_get_objects(const RID &p_shaped) const override { return Array(); }
119 virtual Rect2 shaped_text_get_object_rect(const RID &p_shaped, const Variant &p_key) const override { return Rect2(); }
120 virtual Vector2i shaped_text_get_object_range(const RID &p_shaped, const Variant &p_key) const override { return Vector2i(); }
121 virtual int64_t shaped_text_get_object_glyph(const RID &p_shaped, const Variant &p_key) const override { return -1; }
122 virtual Size2 shaped_text_get_size(const RID &p_shaped) const override { return Size2(); }
123 virtual double shaped_text_get_ascent(const RID &p_shaped) const override { return 0; }
124 virtual double shaped_text_get_descent(const RID &p_shaped) const override { return 0; }
125 virtual double shaped_text_get_width(const RID &p_shaped) const override { return 0; }
126 virtual double shaped_text_get_underline_position(const RID &p_shaped) const override { return 0; }
127 virtual double shaped_text_get_underline_thickness(const RID &p_shaped) const override { return 0; }
128 };