diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /editor/editor_help.h | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'editor/editor_help.h')
| -rw-r--r-- | editor/editor_help.h | 97 |
1 files changed, 39 insertions, 58 deletions
diff --git a/editor/editor_help.h b/editor/editor_help.h index 909226f40..06b64edf7 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -30,24 +30,23 @@ #define EDITOR_HELP_H #include "editor/editor_plugin.h" -#include "scene/gui/tab_container.h" -#include "scene/gui/text_edit.h" -#include "scene/gui/split_container.h" #include "scene/gui/menu_button.h" -#include "scene/gui/rich_text_label.h" #include "scene/gui/panel_container.h" +#include "scene/gui/rich_text_label.h" +#include "scene/gui/split_container.h" +#include "scene/gui/tab_container.h" +#include "scene/gui/text_edit.h" #include "scene/gui/tree.h" -#include "scene/main/timer.h" #include "editor/code_editor.h" #include "editor/doc/doc_data.h" - +#include "scene/main/timer.h" class EditorNode; class EditorHelpSearch : public ConfirmationDialog { - GDCLASS(EditorHelpSearch,ConfirmationDialog ) + GDCLASS(EditorHelpSearch, ConfirmationDialog) EditorNode *editor; LineEdit *search_box; @@ -56,56 +55,51 @@ class EditorHelpSearch : public ConfirmationDialog { void _update_search(); - void _sbox_input(const InputEvent& p_ie); + void _sbox_input(const InputEvent &p_ie); void _confirmed(); - void _text_changed(const String& p_newtext); - + void _text_changed(const String &p_newtext); protected: - void _notification(int p_what); static void _bind_methods(); -public: +public: void popup(); - void popup(const String& p_term); + void popup(const String &p_term); EditorHelpSearch(); }; class EditorHelpIndex : public ConfirmationDialog { - GDCLASS( EditorHelpIndex, ConfirmationDialog ); + GDCLASS(EditorHelpIndex, ConfirmationDialog); LineEdit *search_box; Tree *class_list; - HashMap<String,TreeItem*> tree_item_map; + HashMap<String, TreeItem *> tree_item_map; void _tree_item_selected(); - void _text_changed(const String& p_text); - void _sbox_input(const InputEvent& p_ie); + void _text_changed(const String &p_text); + void _sbox_input(const InputEvent &p_ie); void _update_class_list(); - void add_type(const String& p_type,HashMap<String,TreeItem*>& p_types,TreeItem *p_root); -protected: + void add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root); +protected: void _notification(int p_what); static void _bind_methods(); public: - - void select_class(const String& p_class); + void select_class(const String &p_class); void popup(); EditorHelpIndex(); }; - class EditorHelp : public VBoxContainer { - GDCLASS( EditorHelp, VBoxContainer ); - + GDCLASS(EditorHelp, VBoxContainer); enum Page { @@ -118,7 +112,6 @@ class EditorHelp : public VBoxContainer { }; - bool select_locked; String prev_search; @@ -126,63 +119,55 @@ class EditorHelp : public VBoxContainer { String edited_class; EditorNode *editor; - Map<String,int> method_line; - Map<String,int> signal_line; - Map<String,int> property_line; - Map<String,int> theme_property_line; - Map<String,int> constant_line; + Map<String, int> method_line; + Map<String, int> signal_line; + Map<String, int> property_line; + Map<String, int> theme_property_line; + Map<String, int> constant_line; int description_line; - RichTextLabel *class_desc; HSplitContainer *h_split; static DocData *doc; - ConfirmationDialog *search_dialog; LineEdit *search; - String base_path; + void _help_callback(const String &p_topic); - void _help_callback(const String& p_topic); - - void _add_text(const String& p_text); + void _add_text(const String &p_text); bool scroll_locked; //void _button_pressed(int p_idx); - void _add_type(const String& p_type); + void _add_type(const String &p_type); void _scroll_changed(double p_scroll); - void _class_list_select(const String& p_select); - void _class_desc_select(const String& p_select); - void _class_desc_input(const InputEvent& p_input); + void _class_list_select(const String &p_select); + void _class_desc_select(const String &p_select); + void _class_desc_input(const InputEvent &p_input); - Error _goto_desc(const String& p_class, int p_vscr=-1); + Error _goto_desc(const String &p_class, int p_vscr = -1); //void _update_history_buttons(); void _update_doc(); - void _request_help(const String& p_string); - void _search(const String& p_str); + void _request_help(const String &p_string); + void _search(const String &p_str); void _search_cbk(); - void _unhandled_key_input(const InputEvent& p_ev); - - + void _unhandled_key_input(const InputEvent &p_ev); protected: - - void _notification(int p_what); static void _bind_methods(); -public: +public: static void generate_doc(); static DocData *get_doc_data() { return doc; } - void go_to_help(const String& p_help); - void go_to_class(const String& p_class,int p_scroll=0); + void go_to_help(const String &p_help); + void go_to_class(const String &p_class, int p_scroll = 0); void popup_search(); void search_again(); @@ -198,24 +183,20 @@ public: ~EditorHelp(); }; - - class EditorHelpBit : public Panel { - GDCLASS( EditorHelpBit, Panel); + GDCLASS(EditorHelpBit, Panel); RichTextLabel *rich_text; void _go_to_help(String p_what); void _meta_clicked(String p_what); - protected: - static void _bind_methods(); void _notification(int p_what); -public: - void set_text(const String& p_text); +public: + void set_text(const String &p_text); EditorHelpBit(); }; |
