Reformat the code, using:

find -type f |  # list all regular files
  grep -E '\.(h|cpp|mm)$' |  # filter for source files
  grep -v '/mt_' |  # filter out generated files
  grep -v '/vendor/' | # and vendored GL
  grep -v '/test/image_loader_test.cpp' |  # and this file (has giant literals arrays)
  xargs -n 1 -P $(nproc) clang-format -i  # reformat everything

Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
Desour
2024-03-20 19:35:52 +01:00
parent eb4dec46c2
commit 2bf1d12353
292 changed files with 37376 additions and 42421 deletions

View File

@ -19,9 +19,8 @@ namespace gui
class CGUIEnvironment : public IGUIEnvironment, public IGUIElement
{
public:
//! constructor
CGUIEnvironment(io::IFileSystem* fs, video::IVideoDriver* driver, IOSOperator* op);
CGUIEnvironment(io::IFileSystem *fs, video::IVideoDriver *driver, IOSOperator *op);
//! destructor
virtual ~CGUIEnvironment();
@ -30,131 +29,131 @@ public:
void drawAll(bool useScreenSize) override;
//! returns the current video driver
video::IVideoDriver* getVideoDriver() const override;
video::IVideoDriver *getVideoDriver() const override;
//! returns pointer to the filesystem
io::IFileSystem* getFileSystem() const override;
io::IFileSystem *getFileSystem() const override;
//! returns a pointer to the OS operator
IOSOperator* getOSOperator() const override;
IOSOperator *getOSOperator() const override;
//! posts an input event to the environment
bool postEventFromUser(const SEvent& event) override;
bool postEventFromUser(const SEvent &event) override;
//! This sets a new event receiver for gui events. Usually you do not have to
//! use this method, it is used by the internal engine.
void setUserEventReceiver(IEventReceiver* evr) override;
void setUserEventReceiver(IEventReceiver *evr) override;
//! removes all elements from the environment
void clear() override;
//! called if an event happened.
bool OnEvent(const SEvent& event) override;
bool OnEvent(const SEvent &event) override;
//! returns the current gui skin
IGUISkin* getSkin() const override;
IGUISkin *getSkin() const override;
//! Sets a new GUI Skin
void setSkin(IGUISkin* skin) override;
void setSkin(IGUISkin *skin) override;
//! Creates a new GUI Skin based on a template.
/** \return Returns a pointer to the created skin.
If you no longer need the skin, you should call IGUISkin::drop().
See IReferenceCounted::drop() for more information. */
IGUISkin* createSkin(EGUI_SKIN_TYPE type) override;
IGUISkin *createSkin(EGUI_SKIN_TYPE type) override;
//! Creates the image list from the given texture.
virtual IGUIImageList* createImageList(video::ITexture* texture,
core::dimension2d<s32> imageSize, bool useAlphaChannel) override;
virtual IGUIImageList *createImageList(video::ITexture *texture,
core::dimension2d<s32> imageSize, bool useAlphaChannel) override;
//! returns the font
IGUIFont* getFont(const io::path& filename) override;
IGUIFont *getFont(const io::path &filename) override;
//! add an externally loaded font
IGUIFont* addFont(const io::path& name, IGUIFont* font) override;
IGUIFont *addFont(const io::path &name, IGUIFont *font) override;
//! remove loaded font
void removeFont(IGUIFont* font) override;
void removeFont(IGUIFont *font) override;
//! returns default font
IGUIFont* getBuiltInFont() const override;
IGUIFont *getBuiltInFont() const override;
//! returns the sprite bank
IGUISpriteBank* getSpriteBank(const io::path& filename) override;
IGUISpriteBank *getSpriteBank(const io::path &filename) override;
//! returns the sprite bank
IGUISpriteBank* addEmptySpriteBank(const io::path& name) override;
IGUISpriteBank *addEmptySpriteBank(const io::path &name) override;
//! adds an button. The returned pointer must not be dropped.
IGUIButton* addButton(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext = 0) override;
IGUIButton *addButton(const core::rect<s32> &rectangle, IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0, const wchar_t *tooltiptext = 0) override;
//! adds a scrollbar. The returned pointer must not be dropped.
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) override;
virtual IGUIScrollBar *addScrollBar(bool horizontal, const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1) override;
//! Adds an image element.
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) override;
virtual IGUIImage *addImage(video::ITexture *image, core::position2d<s32> pos,
bool useAlphaChannel = true, IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0) override;
//! adds an image. The returned pointer must not be dropped.
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) override;
virtual IGUIImage *addImage(const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0, bool useAlphaChannel = true) override;
//! adds a checkbox
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) override;
virtual IGUICheckBox *addCheckBox(bool checked, const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0) override;
//! adds a list box
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) override;
virtual IGUIListBox *addListBox(const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1, bool drawBackground = false) override;
//! Adds a file open dialog.
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
bool modal=true, IGUIElement* parent=0, s32 id=-1,
bool restoreCWD=false, io::path::char_type* startDir=0) override;
virtual IGUIFileOpenDialog *addFileOpenDialog(const wchar_t *title = 0,
bool modal = true, IGUIElement *parent = 0, s32 id = -1,
bool restoreCWD = false, io::path::char_type *startDir = 0) override;
//! adds a static text. The returned pointer must not be dropped.
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) override;
virtual IGUIStaticText *addStaticText(const wchar_t *text, const core::rect<s32> &rectangle,
bool border = false, bool wordWrap = true, IGUIElement *parent = 0, s32 id = -1, bool drawBackground = false) override;
//! Adds an edit box. The returned pointer must not be dropped.
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
bool border=false, IGUIElement* parent=0, s32 id=-1) override;
virtual IGUIEditBox *addEditBox(const wchar_t *text, const core::rect<s32> &rectangle,
bool border = false, IGUIElement *parent = 0, s32 id = -1) override;
//! Adds a tab control to the environment.
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
IGUIElement* parent=0, bool fillbackground=false, bool border=true, s32 id=-1) override;
virtual IGUITabControl *addTabControl(const core::rect<s32> &rectangle,
IGUIElement *parent = 0, bool fillbackground = false, bool border = true, s32 id = -1) override;
//! Adds tab to the environment.
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) override;
virtual IGUITab *addTab(const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1) override;
//! Adds a combo box to the environment.
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
IGUIElement* parent=0, s32 id=-1) override;
virtual IGUIComboBox *addComboBox(const core::rect<s32> &rectangle,
IGUIElement *parent = 0, s32 id = -1) override;
//! sets the focus to an element
bool setFocus(IGUIElement* element) override;
bool setFocus(IGUIElement *element) override;
//! removes the focus from an element
bool removeFocus(IGUIElement* element) override;
bool removeFocus(IGUIElement *element) override;
//! Returns if the element has focus
bool hasFocus(const IGUIElement* element, bool checkSubElements=false) const override;
bool hasFocus(const IGUIElement *element, bool checkSubElements = false) const override;
//! Returns the element with the focus
IGUIElement* getFocus() const override;
IGUIElement *getFocus() const override;
//! Returns the element last known to be under the mouse
IGUIElement* getHovered() const override;
IGUIElement *getHovered() const override;
//! Returns the root gui element.
IGUIElement* getRootGUIElement() override;
IGUIElement *getRootGUIElement() override;
void OnPostRender( u32 time ) override;
void OnPostRender(u32 time) override;
//! Find the next element which would be selected when pressing the tab-key
IGUIElement* getNextElement(bool reverse=false, bool group=false) override;
IGUIElement *getNextElement(bool reverse = false, bool group = false) override;
//! Set the way the gui will handle focus changes
void setFocusBehavior(u32 flags) override;
@ -163,10 +162,9 @@ public:
u32 getFocusBehavior() const override;
//! Adds a IGUIElement to deletion queue.
void addToDeletionQueue(IGUIElement* element) override;
void addToDeletionQueue(IGUIElement *element) override;
private:
//! clears the deletion queue
void clearDeletionQueue();
@ -177,9 +175,9 @@ private:
struct SFont
{
io::SNamedPath NamedPath;
IGUIFont* Font;
IGUIFont *Font;
bool operator < (const SFont& other) const
bool operator<(const SFont &other) const
{
return (NamedPath < other.NamedPath);
}
@ -188,9 +186,9 @@ private:
struct SSpriteBank
{
io::SNamedPath NamedPath;
IGUISpriteBank* Bank;
IGUISpriteBank *Bank;
bool operator < (const SSpriteBank& other) const
bool operator<(const SSpriteBank &other) const
{
return (NamedPath < other.NamedPath);
}
@ -198,7 +196,7 @@ private:
struct SToolTip
{
IGUIStaticText* Element;
IGUIStaticText *Element;
u32 LastTime;
u32 EnterTime;
u32 LaunchTime;
@ -209,17 +207,17 @@ private:
core::array<SFont> Fonts;
core::array<SSpriteBank> Banks;
video::IVideoDriver* Driver;
IGUIElement* Hovered;
IGUIElement* HoveredNoSubelement; // subelements replaced by their parent, so you only have 'real' elements here
IGUIElement* Focus;
video::IVideoDriver *Driver;
IGUIElement *Hovered;
IGUIElement *HoveredNoSubelement; // subelements replaced by their parent, so you only have 'real' elements here
IGUIElement *Focus;
core::position2d<s32> LastHoveredMousePos;
IGUISkin* CurrentSkin;
io::IFileSystem* FileSystem;
IEventReceiver* UserReceiver;
IOSOperator* Operator;
IGUISkin *CurrentSkin;
io::IFileSystem *FileSystem;
IEventReceiver *UserReceiver;
IOSOperator *Operator;
u32 FocusFlags;
core::array<IGUIElement*> DeletionQueue;
core::array<IGUIElement *> DeletionQueue;
static const io::path DefaultFontName;
};