feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef CONTROL_H
|
||||
#define CONTROL_H
|
||||
#pragma once
|
||||
|
||||
#include "core/math/transform_2d.h"
|
||||
#include "core/object/gdvirtual.gen.inc"
|
||||
|
|
@ -65,7 +64,14 @@ public:
|
|||
enum FocusMode {
|
||||
FOCUS_NONE,
|
||||
FOCUS_CLICK,
|
||||
FOCUS_ALL
|
||||
FOCUS_ALL,
|
||||
FOCUS_ACCESSIBILITY,
|
||||
};
|
||||
|
||||
enum RecursiveBehavior {
|
||||
RECURSIVE_BEHAVIOR_INHERITED,
|
||||
RECURSIVE_BEHAVIOR_DISABLED,
|
||||
RECURSIVE_BEHAVIOR_ENABLED,
|
||||
};
|
||||
|
||||
enum SizeFlags {
|
||||
|
|
@ -191,6 +197,8 @@ private:
|
|||
real_t offset[4] = { 0.0, 0.0, 0.0, 0.0 };
|
||||
real_t anchor[4] = { ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN };
|
||||
FocusMode focus_mode = FOCUS_NONE;
|
||||
RecursiveBehavior parent_focus_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
RecursiveBehavior focus_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
GrowDirection h_grow = GROW_DIRECTION_END;
|
||||
GrowDirection v_grow = GROW_DIRECTION_END;
|
||||
|
||||
|
|
@ -219,6 +227,8 @@ private:
|
|||
// Input events and rendering.
|
||||
|
||||
MouseFilter mouse_filter = MOUSE_FILTER_STOP;
|
||||
RecursiveBehavior parent_mouse_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
RecursiveBehavior mouse_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
bool force_pass_scroll_events = true;
|
||||
|
||||
bool clip_contents = false;
|
||||
|
|
@ -291,6 +301,7 @@ private:
|
|||
|
||||
void _compute_offsets(Rect2 p_rect, const real_t p_anchors[4], real_t (&r_offsets)[4]);
|
||||
void _compute_anchors(Rect2 p_rect, const real_t p_offsets[4], real_t (&r_anchors)[4]);
|
||||
void _compute_edge_positions(Rect2 p_rect, real_t (&r_edge_positions)[4]);
|
||||
|
||||
void _set_layout_mode(LayoutMode p_mode);
|
||||
void _update_layout_mode();
|
||||
|
|
@ -312,10 +323,19 @@ private:
|
|||
|
||||
void _call_gui_input(const Ref<InputEvent> &p_event);
|
||||
|
||||
// Mouse Filter.
|
||||
|
||||
bool _is_parent_mouse_disabled() const;
|
||||
|
||||
// Focus.
|
||||
|
||||
void _window_find_focus_neighbor(const Vector2 &p_dir, Node *p_at, const Rect2 &p_rect, const Rect2 &p_clamp, real_t p_min, real_t &r_closest_dist_squared, Control **r_closest);
|
||||
Control *_get_focus_neighbor(Side p_side, int p_count = 0);
|
||||
bool _is_focus_disabled_recursively() const;
|
||||
void _propagate_focus_behavior_recursively(RecursiveBehavior p_focus_recursive_behavior, bool p_force);
|
||||
void _propagate_mouse_behavior_recursively(RecursiveBehavior p_focus_recursive_behavior, bool p_force);
|
||||
void _set_mouse_recursive_behavior_ignore_cache(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
void _set_focus_recursive_behavior_ignore_cache(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
|
||||
// Theming.
|
||||
|
||||
|
|
@ -327,8 +347,6 @@ private:
|
|||
|
||||
static int root_layout_direction;
|
||||
|
||||
String get_tooltip_text() const;
|
||||
|
||||
protected:
|
||||
// Dynamic properties.
|
||||
|
||||
|
|
@ -353,6 +371,12 @@ protected:
|
|||
void _notification(int p_notification);
|
||||
static void _bind_methods();
|
||||
|
||||
void _accessibility_action_foucs(const Variant &p_data);
|
||||
void _accessibility_action_blur(const Variant &p_data);
|
||||
void _accessibility_action_show_tooltip(const Variant &p_data);
|
||||
void _accessibility_action_hide_tooltip(const Variant &p_data);
|
||||
void _accessibility_action_scroll_into_view(const Variant &p_data);
|
||||
|
||||
// Exposed virtual methods.
|
||||
|
||||
GDVIRTUAL1RC(bool, _has_point, Vector2)
|
||||
|
|
@ -365,6 +389,8 @@ protected:
|
|||
GDVIRTUAL2(_drop_data, Vector2, Variant)
|
||||
GDVIRTUAL1RC(Object *, _make_custom_tooltip, String)
|
||||
|
||||
GDVIRTUAL0RC(String, _accessibility_get_contextual_info);
|
||||
|
||||
GDVIRTUAL1(_gui_input, Ref<InputEvent>)
|
||||
|
||||
public:
|
||||
|
|
@ -420,6 +446,7 @@ public:
|
|||
static void set_root_layout_direction(int p_root_dir);
|
||||
|
||||
PackedStringArray get_configuration_warnings() const override;
|
||||
PackedStringArray get_accessibility_configuration_warnings() const override;
|
||||
#ifdef TOOLS_ENABLED
|
||||
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
||||
#endif //TOOLS_ENABLED
|
||||
|
|
@ -428,8 +455,6 @@ public:
|
|||
|
||||
// Global relations.
|
||||
|
||||
bool is_top_level_control() const;
|
||||
|
||||
Control *get_parent_control() const;
|
||||
Window *get_parent_window() const;
|
||||
Control *get_root_parent_control() const;
|
||||
|
|
@ -516,6 +541,10 @@ public:
|
|||
|
||||
void set_mouse_filter(MouseFilter p_filter);
|
||||
MouseFilter get_mouse_filter() const;
|
||||
MouseFilter get_mouse_filter_with_recursive() const;
|
||||
|
||||
void set_mouse_recursive_behavior(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
RecursiveBehavior get_mouse_recursive_behavior() const;
|
||||
|
||||
void set_force_pass_scroll_events(bool p_force_pass_scroll_events);
|
||||
bool is_force_pass_scroll_events() const;
|
||||
|
|
@ -534,12 +563,17 @@ public:
|
|||
virtual void drop_data(const Point2 &p_point, const Variant &p_data);
|
||||
void set_drag_preview(Control *p_control);
|
||||
void force_drag(const Variant &p_data, Control *p_control);
|
||||
void accessibility_drag();
|
||||
void accessibility_drop();
|
||||
bool is_drag_successful() const;
|
||||
|
||||
// Focus.
|
||||
|
||||
void set_focus_mode(FocusMode p_focus_mode);
|
||||
FocusMode get_focus_mode() const;
|
||||
FocusMode get_focus_mode_with_recursive() const;
|
||||
void set_focus_recursive_behavior(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
RecursiveBehavior get_focus_recursive_behavior() const;
|
||||
bool has_focus() const;
|
||||
void grab_focus();
|
||||
void grab_click_focus();
|
||||
|
|
@ -607,6 +641,7 @@ public:
|
|||
Color get_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
|
||||
int get_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
|
||||
Variant get_theme_item(Theme::DataType p_data_type, const StringName &p_name, const StringName &p_theme_type = StringName()) const;
|
||||
Variant get_used_theme_item(const String &p_full_name, const StringName &p_theme_type = StringName()) const;
|
||||
#ifdef TOOLS_ENABLED
|
||||
Ref<Texture2D> get_editor_theme_icon(const StringName &p_name) const;
|
||||
#endif //TOOLS_ENABLED
|
||||
|
|
@ -648,15 +683,19 @@ public:
|
|||
|
||||
// Extra properties.
|
||||
|
||||
String get_tooltip_text() const;
|
||||
void set_tooltip_text(const String &text);
|
||||
virtual String get_tooltip(const Point2 &p_pos) const;
|
||||
virtual Control *make_custom_tooltip(const String &p_text) const;
|
||||
|
||||
virtual String accessibility_get_contextual_info() const;
|
||||
|
||||
Control();
|
||||
~Control();
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(Control::FocusMode);
|
||||
VARIANT_ENUM_CAST(Control::RecursiveBehavior);
|
||||
VARIANT_BITFIELD_CAST(Control::SizeFlags);
|
||||
VARIANT_ENUM_CAST(Control::CursorShape);
|
||||
VARIANT_ENUM_CAST(Control::LayoutPreset);
|
||||
|
|
@ -673,5 +712,3 @@ VARIANT_ENUM_CAST(Control::TextDirection);
|
|||
#define SET_DRAG_FORWARDING_CDU(from, to) from->set_drag_forwarding(Callable(), callable_mp(this, &to::_can_drop_data_fw).bind(from), callable_mp(this, &to::_drop_data_fw).bind(from));
|
||||
#define SET_DRAG_FORWARDING_GCD(from, to) from->set_drag_forwarding(callable_mp(this, &to::get_drag_data_fw).bind(from), callable_mp(this, &to::can_drop_data_fw).bind(from), callable_mp(this, &to::drop_data_fw).bind(from));
|
||||
#define SET_DRAG_FORWARDING_GCDU(from, to) from->set_drag_forwarding(callable_mp(this, &to::_get_drag_data_fw).bind(from), callable_mp(this, &to::_can_drop_data_fw).bind(from), callable_mp(this, &to::_drop_data_fw).bind(from));
|
||||
|
||||
#endif // CONTROL_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue