control.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. /*************************************************************************/
  2. /* control.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  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. #ifndef CONTROL_H
  31. #define CONTROL_H
  32. #include "core/input/shortcut.h"
  33. #include "core/math/transform_2d.h"
  34. #include "core/object/gdvirtual.gen.inc"
  35. #include "core/templates/rid.h"
  36. #include "scene/main/canvas_item.h"
  37. #include "scene/main/node.h"
  38. #include "scene/main/timer.h"
  39. #include "scene/resources/theme.h"
  40. class Viewport;
  41. class Label;
  42. class Panel;
  43. class Control : public CanvasItem {
  44. GDCLASS(Control, CanvasItem);
  45. OBJ_CATEGORY("GUI Nodes");
  46. public:
  47. enum Anchor {
  48. ANCHOR_BEGIN = 0,
  49. ANCHOR_END = 1
  50. };
  51. enum GrowDirection {
  52. GROW_DIRECTION_BEGIN,
  53. GROW_DIRECTION_END,
  54. GROW_DIRECTION_BOTH
  55. };
  56. enum FocusMode {
  57. FOCUS_NONE,
  58. FOCUS_CLICK,
  59. FOCUS_ALL
  60. };
  61. enum SizeFlags {
  62. SIZE_FILL = 1,
  63. SIZE_EXPAND = 2,
  64. SIZE_EXPAND_FILL = SIZE_EXPAND | SIZE_FILL,
  65. SIZE_SHRINK_CENTER = 4, //ignored by expand or fill
  66. SIZE_SHRINK_END = 8, //ignored by expand or fill
  67. };
  68. enum MouseFilter {
  69. MOUSE_FILTER_STOP,
  70. MOUSE_FILTER_PASS,
  71. MOUSE_FILTER_IGNORE
  72. };
  73. enum CursorShape {
  74. CURSOR_ARROW,
  75. CURSOR_IBEAM,
  76. CURSOR_POINTING_HAND,
  77. CURSOR_CROSS,
  78. CURSOR_WAIT,
  79. CURSOR_BUSY,
  80. CURSOR_DRAG,
  81. CURSOR_CAN_DROP,
  82. CURSOR_FORBIDDEN,
  83. CURSOR_VSIZE,
  84. CURSOR_HSIZE,
  85. CURSOR_BDIAGSIZE,
  86. CURSOR_FDIAGSIZE,
  87. CURSOR_MOVE,
  88. CURSOR_VSPLIT,
  89. CURSOR_HSPLIT,
  90. CURSOR_HELP,
  91. CURSOR_MAX
  92. };
  93. enum LayoutPreset {
  94. PRESET_TOP_LEFT,
  95. PRESET_TOP_RIGHT,
  96. PRESET_BOTTOM_LEFT,
  97. PRESET_BOTTOM_RIGHT,
  98. PRESET_CENTER_LEFT,
  99. PRESET_CENTER_TOP,
  100. PRESET_CENTER_RIGHT,
  101. PRESET_CENTER_BOTTOM,
  102. PRESET_CENTER,
  103. PRESET_LEFT_WIDE,
  104. PRESET_TOP_WIDE,
  105. PRESET_RIGHT_WIDE,
  106. PRESET_BOTTOM_WIDE,
  107. PRESET_VCENTER_WIDE,
  108. PRESET_HCENTER_WIDE,
  109. PRESET_WIDE
  110. };
  111. enum LayoutPresetMode {
  112. PRESET_MODE_MINSIZE,
  113. PRESET_MODE_KEEP_WIDTH,
  114. PRESET_MODE_KEEP_HEIGHT,
  115. PRESET_MODE_KEEP_SIZE
  116. };
  117. enum LayoutDirection {
  118. LAYOUT_DIRECTION_INHERITED,
  119. LAYOUT_DIRECTION_LOCALE,
  120. LAYOUT_DIRECTION_LTR,
  121. LAYOUT_DIRECTION_RTL
  122. };
  123. enum TextDirection {
  124. TEXT_DIRECTION_AUTO = TextServer::DIRECTION_AUTO,
  125. TEXT_DIRECTION_LTR = TextServer::DIRECTION_LTR,
  126. TEXT_DIRECTION_RTL = TextServer::DIRECTION_RTL,
  127. TEXT_DIRECTION_INHERITED,
  128. };
  129. enum StructuredTextParser {
  130. STRUCTURED_TEXT_DEFAULT,
  131. STRUCTURED_TEXT_URI,
  132. STRUCTURED_TEXT_FILE,
  133. STRUCTURED_TEXT_EMAIL,
  134. STRUCTURED_TEXT_LIST,
  135. STRUCTURED_TEXT_NONE,
  136. STRUCTURED_TEXT_CUSTOM
  137. };
  138. private:
  139. struct CComparator {
  140. bool operator()(const Control *p_a, const Control *p_b) const {
  141. if (p_a->get_canvas_layer() == p_b->get_canvas_layer()) {
  142. return p_b->is_greater_than(p_a);
  143. }
  144. return p_a->get_canvas_layer() < p_b->get_canvas_layer();
  145. }
  146. };
  147. struct Data {
  148. Point2 pos_cache;
  149. Size2 size_cache;
  150. Size2 minimum_size_cache;
  151. bool minimum_size_valid = false;
  152. Size2 last_minimum_size;
  153. bool updating_last_minimum_size = false;
  154. real_t offset[4] = { 0.0, 0.0, 0.0, 0.0 };
  155. real_t anchor[4] = { ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN };
  156. FocusMode focus_mode = FOCUS_NONE;
  157. GrowDirection h_grow = GROW_DIRECTION_END;
  158. GrowDirection v_grow = GROW_DIRECTION_END;
  159. LayoutDirection layout_dir = LAYOUT_DIRECTION_INHERITED;
  160. bool is_rtl_dirty = true;
  161. bool is_rtl = false;
  162. bool auto_translate = true;
  163. real_t rotation = 0.0;
  164. Vector2 scale = Vector2(1, 1);
  165. Vector2 pivot_offset;
  166. bool size_warning = true;
  167. int h_size_flags = SIZE_FILL;
  168. int v_size_flags = SIZE_FILL;
  169. real_t expand = 1.0;
  170. Point2 custom_minimum_size;
  171. MouseFilter mouse_filter = MOUSE_FILTER_STOP;
  172. bool clip_contents = false;
  173. bool block_minimum_size_adjust = false;
  174. bool disable_visibility_clip = false;
  175. Control *parent = nullptr;
  176. ObjectID drag_owner;
  177. Ref<Theme> theme;
  178. Control *theme_owner = nullptr;
  179. Window *theme_owner_window = nullptr;
  180. Window *parent_window = nullptr;
  181. StringName theme_type_variation;
  182. String tooltip;
  183. CursorShape default_cursor = CURSOR_ARROW;
  184. List<Control *>::Element *RI = nullptr;
  185. CanvasItem *parent_canvas_item = nullptr;
  186. NodePath focus_neighbor[4];
  187. NodePath focus_next;
  188. NodePath focus_prev;
  189. bool bulk_theme_override = false;
  190. HashMap<StringName, Ref<Texture2D>> icon_override;
  191. HashMap<StringName, Ref<StyleBox>> style_override;
  192. HashMap<StringName, Ref<Font>> font_override;
  193. HashMap<StringName, int> font_size_override;
  194. HashMap<StringName, Color> color_override;
  195. HashMap<StringName, int> constant_override;
  196. } data;
  197. static constexpr unsigned properties_managed_by_container_count = 11;
  198. static String properties_managed_by_container[properties_managed_by_container_count];
  199. void _window_find_focus_neighbor(const Vector2 &p_dir, Node *p_at, const Point2 *p_points, real_t p_min, real_t &r_closest_dist, Control **r_closest);
  200. Control *_get_focus_neighbor(Side p_side, int p_count = 0);
  201. void _set_anchor(Side p_side, real_t p_anchor);
  202. void _set_position(const Point2 &p_point);
  203. void _set_global_position(const Point2 &p_point);
  204. void _set_size(const Size2 &p_size);
  205. void _theme_changed();
  206. void _notify_theme_changed();
  207. void _update_minimum_size();
  208. void _clear_size_warning();
  209. void _compute_offsets(Rect2 p_rect, const real_t p_anchors[4], real_t (&r_offsets)[4]);
  210. void _compute_anchors(Rect2 p_rect, const real_t p_offsets[4], real_t (&r_anchors)[4]);
  211. void _size_changed();
  212. String _get_tooltip() const;
  213. void _override_changed();
  214. void _update_canvas_item_transform();
  215. Transform2D _get_internal_transform() const;
  216. friend class Viewport;
  217. void _call_gui_input(const Ref<InputEvent> &p_event);
  218. void _update_minimum_size_cache();
  219. friend class Window;
  220. static void _propagate_theme_changed(Node *p_at, Control *p_owner, Window *p_owner_window, bool p_assign = true);
  221. template <class T>
  222. static T get_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types);
  223. static bool has_theme_item_in_types(Control *p_theme_owner, Window *p_theme_owner_window, Theme::DataType p_data_type, const StringName &p_name, List<StringName> p_theme_types);
  224. _FORCE_INLINE_ void _get_theme_type_dependencies(const StringName &p_theme_type, List<StringName> *p_list) const;
  225. protected:
  226. virtual void add_child_notify(Node *p_child) override;
  227. virtual void remove_child_notify(Node *p_child) override;
  228. //virtual void _window_gui_input(InputEvent p_event);
  229. virtual Array structured_text_parser(StructuredTextParser p_theme_type, const Array &p_args, const String p_text) const;
  230. bool _set(const StringName &p_name, const Variant &p_value);
  231. bool _get(const StringName &p_name, Variant &r_ret) const;
  232. void _get_property_list(List<PropertyInfo> *p_list) const;
  233. void _notification(int p_notification);
  234. static void _bind_methods();
  235. virtual void _validate_property(PropertyInfo &property) const override;
  236. //bind helpers
  237. GDVIRTUAL1RC(bool, _has_point, Vector2)
  238. GDVIRTUAL2RC(Array, _structured_text_parser, Array, String)
  239. GDVIRTUAL0RC(Vector2, _get_minimum_size)
  240. GDVIRTUAL1RC(Variant, _get_drag_data, Vector2)
  241. GDVIRTUAL2RC(bool, _can_drop_data, Vector2, Variant)
  242. GDVIRTUAL2(_drop_data, Vector2, Variant)
  243. GDVIRTUAL1RC(Object *, _make_custom_tooltip, String)
  244. GDVIRTUAL1(_gui_input, Ref<InputEvent>)
  245. public:
  246. enum {
  247. /* NOTIFICATION_DRAW=30,
  248. NOTIFICATION_VISIBILITY_CHANGED=38*/
  249. NOTIFICATION_RESIZED = 40,
  250. NOTIFICATION_MOUSE_ENTER = 41,
  251. NOTIFICATION_MOUSE_EXIT = 42,
  252. NOTIFICATION_FOCUS_ENTER = 43,
  253. NOTIFICATION_FOCUS_EXIT = 44,
  254. NOTIFICATION_THEME_CHANGED = 45,
  255. NOTIFICATION_SCROLL_BEGIN = 47,
  256. NOTIFICATION_SCROLL_END = 48,
  257. NOTIFICATION_LAYOUT_DIRECTION_CHANGED = 49,
  258. };
  259. /* EDITOR */
  260. #ifdef TOOLS_ENABLED
  261. virtual Dictionary _edit_get_state() const override;
  262. virtual void _edit_set_state(const Dictionary &p_state) override;
  263. virtual void _edit_set_position(const Point2 &p_position) override;
  264. virtual Point2 _edit_get_position() const override;
  265. virtual void _edit_set_scale(const Size2 &p_scale) override;
  266. virtual Size2 _edit_get_scale() const override;
  267. virtual void _edit_set_rect(const Rect2 &p_edit_rect) override;
  268. virtual Rect2 _edit_get_rect() const override;
  269. virtual bool _edit_use_rect() const override;
  270. virtual void _edit_set_rotation(real_t p_rotation) override;
  271. virtual real_t _edit_get_rotation() const override;
  272. virtual bool _edit_use_rotation() const override;
  273. virtual void _edit_set_pivot(const Point2 &p_pivot) override;
  274. virtual Point2 _edit_get_pivot() const override;
  275. virtual bool _edit_use_pivot() const override;
  276. virtual Size2 _edit_get_minimum_size() const override;
  277. #endif
  278. virtual void gui_input(const Ref<InputEvent> &p_event);
  279. void accept_event();
  280. virtual Size2 get_minimum_size() const;
  281. virtual Size2 get_combined_minimum_size() const;
  282. virtual bool has_point(const Point2 &p_point) const;
  283. virtual void set_drag_forwarding(Object *p_target);
  284. virtual Variant get_drag_data(const Point2 &p_point);
  285. virtual bool can_drop_data(const Point2 &p_point, const Variant &p_data) const;
  286. virtual void drop_data(const Point2 &p_point, const Variant &p_data);
  287. void set_drag_preview(Control *p_control);
  288. void force_drag(const Variant &p_data, Control *p_control);
  289. void set_custom_minimum_size(const Size2 &p_custom);
  290. Size2 get_custom_minimum_size() const;
  291. Control *get_parent_control() const;
  292. Window *get_parent_window() const;
  293. void set_layout_direction(LayoutDirection p_direction);
  294. LayoutDirection get_layout_direction() const;
  295. virtual bool is_layout_rtl() const;
  296. void set_auto_translate(bool p_enable);
  297. bool is_auto_translating() const;
  298. _FORCE_INLINE_ String atr(const String p_string) const { return is_auto_translating() ? tr(p_string) : p_string; };
  299. /* POSITIONING */
  300. void set_anchors_preset(LayoutPreset p_preset, bool p_keep_offsets = true);
  301. void set_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resize_mode = PRESET_MODE_MINSIZE, int p_margin = 0);
  302. void set_anchors_and_offsets_preset(LayoutPreset p_preset, LayoutPresetMode p_resize_mode = PRESET_MODE_MINSIZE, int p_margin = 0);
  303. void set_anchor(Side p_side, real_t p_anchor, bool p_keep_offset = true, bool p_push_opposite_anchor = true);
  304. real_t get_anchor(Side p_side) const;
  305. void set_offset(Side p_side, real_t p_value);
  306. real_t get_offset(Side p_side) const;
  307. void set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos, bool p_push_opposite_anchor = true);
  308. void set_begin(const Point2 &p_point); // helper
  309. void set_end(const Point2 &p_point); // helper
  310. Point2 get_begin() const;
  311. Point2 get_end() const;
  312. void set_position(const Point2 &p_point, bool p_keep_offsets = false);
  313. void set_global_position(const Point2 &p_point, bool p_keep_offsets = false);
  314. Point2 get_position() const;
  315. Point2 get_global_position() const;
  316. Point2 get_screen_position() const;
  317. void set_size(const Size2 &p_size, bool p_keep_offsets = false);
  318. Size2 get_size() const;
  319. Rect2 get_rect() const;
  320. Rect2 get_global_rect() const;
  321. Rect2 get_screen_rect() const;
  322. Rect2 get_window_rect() const; ///< use with care, as it blocks waiting for the rendering server
  323. Rect2 get_anchorable_rect() const override;
  324. void set_rect(const Rect2 &p_rect); // Reset anchors to begin and set rect, for faster container children sorting.
  325. void set_rotation(real_t p_radians);
  326. real_t get_rotation() const;
  327. void set_h_grow_direction(GrowDirection p_direction);
  328. GrowDirection get_h_grow_direction() const;
  329. void set_v_grow_direction(GrowDirection p_direction);
  330. GrowDirection get_v_grow_direction() const;
  331. void set_pivot_offset(const Vector2 &p_pivot);
  332. Vector2 get_pivot_offset() const;
  333. void set_scale(const Vector2 &p_scale);
  334. Vector2 get_scale() const;
  335. void set_theme(const Ref<Theme> &p_theme);
  336. Ref<Theme> get_theme() const;
  337. void set_theme_type_variation(const StringName &p_theme_type);
  338. StringName get_theme_type_variation() const;
  339. void set_h_size_flags(int p_flags);
  340. int get_h_size_flags() const;
  341. void set_v_size_flags(int p_flags);
  342. int get_v_size_flags() const;
  343. void set_stretch_ratio(real_t p_ratio);
  344. real_t get_stretch_ratio() const;
  345. void minimum_size_changed();
  346. /* FOCUS */
  347. void set_focus_mode(FocusMode p_focus_mode);
  348. FocusMode get_focus_mode() const;
  349. bool has_focus() const;
  350. void grab_focus();
  351. void release_focus();
  352. Control *find_next_valid_focus() const;
  353. Control *find_prev_valid_focus() const;
  354. void set_focus_neighbor(Side p_side, const NodePath &p_neighbor);
  355. NodePath get_focus_neighbor(Side p_side) const;
  356. void set_focus_next(const NodePath &p_next);
  357. NodePath get_focus_next() const;
  358. void set_focus_previous(const NodePath &p_prev);
  359. NodePath get_focus_previous() const;
  360. Control *get_focus_owner() const;
  361. void set_mouse_filter(MouseFilter p_filter);
  362. MouseFilter get_mouse_filter() const;
  363. /* SKINNING */
  364. void begin_bulk_theme_override();
  365. void end_bulk_theme_override();
  366. void add_theme_icon_override(const StringName &p_name, const Ref<Texture2D> &p_icon);
  367. void add_theme_style_override(const StringName &p_name, const Ref<StyleBox> &p_style);
  368. void add_theme_font_override(const StringName &p_name, const Ref<Font> &p_font);
  369. void add_theme_font_size_override(const StringName &p_name, int p_font_size);
  370. void add_theme_color_override(const StringName &p_name, const Color &p_color);
  371. void add_theme_constant_override(const StringName &p_name, int p_constant);
  372. void remove_theme_icon_override(const StringName &p_name);
  373. void remove_theme_style_override(const StringName &p_name);
  374. void remove_theme_font_override(const StringName &p_name);
  375. void remove_theme_font_size_override(const StringName &p_name);
  376. void remove_theme_color_override(const StringName &p_name);
  377. void remove_theme_constant_override(const StringName &p_name);
  378. Ref<Texture2D> get_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  379. Ref<StyleBox> get_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  380. Ref<Font> get_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  381. int get_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  382. Color get_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  383. int get_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  384. bool has_theme_icon_override(const StringName &p_name) const;
  385. bool has_theme_stylebox_override(const StringName &p_name) const;
  386. bool has_theme_font_override(const StringName &p_name) const;
  387. bool has_theme_font_size_override(const StringName &p_name) const;
  388. bool has_theme_color_override(const StringName &p_name) const;
  389. bool has_theme_constant_override(const StringName &p_name) const;
  390. bool has_theme_icon(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  391. bool has_theme_stylebox(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  392. bool has_theme_font(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  393. bool has_theme_font_size(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  394. bool has_theme_color(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  395. bool has_theme_constant(const StringName &p_name, const StringName &p_theme_type = StringName()) const;
  396. static float fetch_theme_default_base_scale(Control *p_theme_owner, Window *p_theme_owner_window);
  397. static Ref<Font> fetch_theme_default_font(Control *p_theme_owner, Window *p_theme_owner_window);
  398. static int fetch_theme_default_font_size(Control *p_theme_owner, Window *p_theme_owner_window);
  399. float get_theme_default_base_scale() const;
  400. Ref<Font> get_theme_default_font() const;
  401. int get_theme_default_font_size() const;
  402. /* TOOLTIP */
  403. void set_tooltip(const String &p_tooltip);
  404. virtual String get_tooltip(const Point2 &p_pos) const;
  405. virtual Control *make_custom_tooltip(const String &p_text) const;
  406. /* CURSOR */
  407. void set_default_cursor_shape(CursorShape p_shape);
  408. CursorShape get_default_cursor_shape() const;
  409. virtual CursorShape get_cursor_shape(const Point2 &p_pos = Point2i()) const;
  410. virtual Transform2D get_transform() const override;
  411. bool is_top_level_control() const;
  412. Size2 get_parent_area_size() const;
  413. Rect2 get_parent_anchorable_rect() const;
  414. void grab_click_focus();
  415. void warp_mouse(const Point2 &p_to_pos);
  416. virtual bool is_text_field() const;
  417. Control *get_root_parent_control() const;
  418. void set_clip_contents(bool p_clip);
  419. bool is_clipping_contents();
  420. void set_block_minimum_size_adjust(bool p_block);
  421. bool is_minimum_size_adjust_blocked() const;
  422. void set_disable_visibility_clip(bool p_ignore);
  423. bool is_visibility_clip_disabled() const;
  424. virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
  425. TypedArray<String> get_configuration_warnings() const override;
  426. Control() {}
  427. };
  428. VARIANT_ENUM_CAST(Control::FocusMode);
  429. VARIANT_ENUM_CAST(Control::SizeFlags);
  430. VARIANT_ENUM_CAST(Control::CursorShape);
  431. VARIANT_ENUM_CAST(Control::LayoutPreset);
  432. VARIANT_ENUM_CAST(Control::LayoutPresetMode);
  433. VARIANT_ENUM_CAST(Control::MouseFilter);
  434. VARIANT_ENUM_CAST(Control::GrowDirection);
  435. VARIANT_ENUM_CAST(Control::Anchor);
  436. VARIANT_ENUM_CAST(Control::LayoutDirection);
  437. VARIANT_ENUM_CAST(Control::TextDirection);
  438. VARIANT_ENUM_CAST(Control::StructuredTextParser);
  439. #endif