mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
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:
@ -13,20 +13,20 @@
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class IOSOperator;
|
||||
class IEventReceiver;
|
||||
class IOSOperator;
|
||||
class IEventReceiver;
|
||||
|
||||
namespace io
|
||||
{
|
||||
class IReadFile;
|
||||
class IWriteFile;
|
||||
class IFileSystem;
|
||||
} // end namespace io
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class ITexture;
|
||||
} // end namespace video
|
||||
namespace io
|
||||
{
|
||||
class IReadFile;
|
||||
class IWriteFile;
|
||||
class IFileSystem;
|
||||
} // end namespace io
|
||||
namespace video
|
||||
{
|
||||
class IVideoDriver;
|
||||
class ITexture;
|
||||
} // end namespace video
|
||||
|
||||
namespace gui
|
||||
{
|
||||
@ -58,11 +58,10 @@ class IGUIWindow;
|
||||
class IGUIEnvironment : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Draws all gui elements by traversing the GUI environment starting at the root node.
|
||||
/** \param When true ensure the GuiEnvironment (aka the RootGUIElement) has the same size as the current driver screensize.
|
||||
Can be set to false to control that size yourself, p.E when not the full size should be used for UI. */
|
||||
virtual void drawAll(bool useScreenSize=true) = 0;
|
||||
Can be set to false to control that size yourself, p.E when not the full size should be used for UI. */
|
||||
virtual void drawAll(bool useScreenSize = true) = 0;
|
||||
|
||||
//! Sets the focus to an element.
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a
|
||||
@ -70,11 +69,11 @@ public:
|
||||
then the focus will not be changed.
|
||||
\param element Pointer to the element which shall get the focus.
|
||||
\return True on success, false on failure */
|
||||
virtual bool setFocus(IGUIElement* element) = 0;
|
||||
virtual bool setFocus(IGUIElement *element) = 0;
|
||||
|
||||
//! Returns the element which holds the focus.
|
||||
/** \return Pointer to the element with focus. */
|
||||
virtual IGUIElement* getFocus() const = 0;
|
||||
virtual IGUIElement *getFocus() const = 0;
|
||||
|
||||
//! Returns the element which was last under the mouse cursor
|
||||
/** NOTE: This information is updated _after_ the user-eventreceiver
|
||||
@ -82,32 +81,32 @@ public:
|
||||
mouse events you have to use instead:
|
||||
IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos);
|
||||
\return Pointer to the element under the mouse. */
|
||||
virtual IGUIElement* getHovered() const = 0;
|
||||
virtual IGUIElement *getHovered() const = 0;
|
||||
|
||||
//! Removes the focus from an element.
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed
|
||||
then the focus will not be changed.
|
||||
\param element Pointer to the element which shall lose the focus.
|
||||
\return True on success, false on failure */
|
||||
virtual bool removeFocus(IGUIElement* element) = 0;
|
||||
virtual bool removeFocus(IGUIElement *element) = 0;
|
||||
|
||||
//! Returns whether the element has focus
|
||||
/** \param element Pointer to the element which is tested.
|
||||
\param checkSubElements When true and focus is on a sub-element of element then it will still count as focused and return true
|
||||
\return True if the element has focus, else false. */
|
||||
virtual bool hasFocus(const IGUIElement* element, bool checkSubElements=false) const = 0;
|
||||
virtual bool hasFocus(const IGUIElement *element, bool checkSubElements = false) const = 0;
|
||||
|
||||
//! Returns the current video driver.
|
||||
/** \return Pointer to the video driver. */
|
||||
virtual video::IVideoDriver* getVideoDriver() const = 0;
|
||||
virtual video::IVideoDriver *getVideoDriver() const = 0;
|
||||
|
||||
//! Returns the file system.
|
||||
/** \return Pointer to the file system. */
|
||||
virtual io::IFileSystem* getFileSystem() const = 0;
|
||||
virtual io::IFileSystem *getFileSystem() const = 0;
|
||||
|
||||
//! returns a pointer to the OS operator
|
||||
/** \return Pointer to the OS operator. */
|
||||
virtual IOSOperator* getOSOperator() const = 0;
|
||||
virtual IOSOperator *getOSOperator() const = 0;
|
||||
|
||||
//! Removes all elements from the environment.
|
||||
virtual void clear() = 0;
|
||||
@ -117,17 +116,17 @@ public:
|
||||
use this method, it is used by the engine internally.
|
||||
\param event The event to post.
|
||||
\return True if succeeded, else false. */
|
||||
virtual bool postEventFromUser(const SEvent& event) = 0;
|
||||
virtual bool postEventFromUser(const SEvent &event) = 0;
|
||||
|
||||
//! This sets a new event receiver for gui events.
|
||||
/** Usually you do not have to
|
||||
use this method, it is used by the engine internally.
|
||||
\param evr Pointer to the new receiver. */
|
||||
virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
|
||||
virtual void setUserEventReceiver(IEventReceiver *evr) = 0;
|
||||
|
||||
//! Returns pointer to the current gui skin.
|
||||
/** \return Pointer to the GUI skin. */
|
||||
virtual IGUISkin* getSkin() const = 0;
|
||||
virtual IGUISkin *getSkin() const = 0;
|
||||
|
||||
//! Sets a new GUI Skin
|
||||
/** You can use this to change the appearance of the whole GUI
|
||||
@ -142,7 +141,7 @@ public:
|
||||
\endcode
|
||||
\param skin New skin to use.
|
||||
*/
|
||||
virtual void setSkin(IGUISkin* skin) = 0;
|
||||
virtual void setSkin(IGUISkin *skin) = 0;
|
||||
|
||||
//! Creates a new GUI Skin based on a template.
|
||||
/** Use setSkin() to set the created skin.
|
||||
@ -150,8 +149,7 @@ public:
|
||||
\return Pointer to the created skin.
|
||||
If you no longer need it, you should call IGUISkin::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
|
||||
|
||||
virtual IGUISkin *createSkin(EGUI_SKIN_TYPE type) = 0;
|
||||
|
||||
//! Creates the image list from the given texture.
|
||||
/** \param texture Texture to split into images
|
||||
@ -160,9 +158,9 @@ public:
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIImageList* createImageList( video::ITexture* texture,
|
||||
core::dimension2d<s32> imageSize,
|
||||
bool useAlphaChannel ) = 0;
|
||||
virtual IGUIImageList *createImageList(video::ITexture *texture,
|
||||
core::dimension2d<s32> imageSize,
|
||||
bool useAlphaChannel) = 0;
|
||||
|
||||
//! Returns pointer to the font with the specified filename.
|
||||
/** Loads the font if it was not loaded before.
|
||||
@ -170,7 +168,7 @@ public:
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIFont* getFont(const io::path& filename) = 0;
|
||||
virtual IGUIFont *getFont(const io::path &filename) = 0;
|
||||
|
||||
//! Adds an externally loaded font to the font list.
|
||||
/** This method allows to attach an already loaded font to the list of
|
||||
@ -178,29 +176,29 @@ public:
|
||||
\param name Name the font should be stored as.
|
||||
\param font Pointer to font to add.
|
||||
\return Pointer to the font stored. This can differ from given parameter if the name previously existed. */
|
||||
virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0;
|
||||
virtual IGUIFont *addFont(const io::path &name, IGUIFont *font) = 0;
|
||||
|
||||
//! remove loaded font
|
||||
virtual void removeFont(IGUIFont* font) = 0;
|
||||
virtual void removeFont(IGUIFont *font) = 0;
|
||||
|
||||
//! Returns the default built-in font.
|
||||
/** \return Pointer to the default built-in font.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIFont* getBuiltInFont() const = 0;
|
||||
virtual IGUIFont *getBuiltInFont() const = 0;
|
||||
|
||||
//! Returns pointer to the sprite bank which was added with addEmptySpriteBank
|
||||
/** TODO: This should load files in the future, but not implemented so far.
|
||||
\param filename Name of a spritebank added with addEmptySpriteBank
|
||||
\return Pointer to the sprite bank. Returns 0 if it could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0;
|
||||
virtual IGUISpriteBank *getSpriteBank(const io::path &filename) = 0;
|
||||
|
||||
//! Adds an empty sprite bank to the manager
|
||||
/** \param name Name of the new sprite bank.
|
||||
\return Pointer to the sprite bank.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0;
|
||||
virtual IGUISpriteBank *addEmptySpriteBank(const io::path &name) = 0;
|
||||
|
||||
//! Returns the root gui element.
|
||||
/** This is the first gui element, the (direct or indirect) parent of all
|
||||
@ -209,7 +207,7 @@ public:
|
||||
\return Pointer to the root element of the GUI. The returned pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IGUIElement* getRootGUIElement() = 0;
|
||||
virtual IGUIElement *getRootGUIElement() = 0;
|
||||
|
||||
//! Adds a button element.
|
||||
/** \param rectangle Rectangle specifying the borders of the button.
|
||||
@ -220,8 +218,8 @@ public:
|
||||
\return Pointer to the created button. Returns 0 if an error occurred.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIButton* addButton(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
|
||||
virtual IGUIButton *addButton(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0, const wchar_t *tooltiptext = 0) = 0;
|
||||
|
||||
//! Adds a scrollbar.
|
||||
/** \param horizontal Specifies if the scroll bar is drawn horizontal
|
||||
@ -232,8 +230,8 @@ public:
|
||||
\return Pointer to the created scrollbar. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
virtual IGUIScrollBar *addScrollBar(bool horizontal, const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1) = 0;
|
||||
|
||||
//! Adds an image element.
|
||||
/** \param image Image to be displayed.
|
||||
@ -247,8 +245,8 @@ public:
|
||||
\return Pointer to the created image element. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
|
||||
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
virtual IGUIImage *addImage(video::ITexture *image, core::position2d<s32> pos,
|
||||
bool useAlphaChannel = true, IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0) = 0;
|
||||
|
||||
//! Adds an image element.
|
||||
/** Use IGUIImage::setImage later to set the image to be displayed.
|
||||
@ -261,8 +259,8 @@ public:
|
||||
\return Pointer to the created image element. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0;
|
||||
virtual IGUIImage *addImage(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0, bool useAlphaChannel = true) = 0;
|
||||
|
||||
//! Adds a checkbox element.
|
||||
/** \param checked Define the initial state of the check box.
|
||||
@ -273,8 +271,8 @@ public:
|
||||
\return Pointer to the created check box. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
virtual IGUICheckBox *addCheckBox(bool checked, const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1, const wchar_t *text = 0) = 0;
|
||||
|
||||
//! Adds a list box element.
|
||||
/** \param rectangle Rectangle specifying the borders of the list box.
|
||||
@ -284,8 +282,8 @@ public:
|
||||
\return Pointer to the created list box. Returns 0 if an error occurred.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
|
||||
virtual IGUIListBox *addListBox(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1, bool drawBackground = false) = 0;
|
||||
|
||||
//! Adds a file open dialog.
|
||||
/** \param title Text to be displayed as the title of the dialog.
|
||||
@ -301,9 +299,9 @@ public:
|
||||
\return Pointer to the created file open dialog. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
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) = 0;
|
||||
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) = 0;
|
||||
|
||||
//! Adds a static text.
|
||||
/** \param text Text to be displayed. Can be altered after creation by SetText().
|
||||
@ -317,9 +315,9 @@ public:
|
||||
\return Pointer to the created static text. Returns 0 if an error
|
||||
occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
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 fillBackground = false) = 0;
|
||||
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 fillBackground = false) = 0;
|
||||
|
||||
//! Adds an edit box.
|
||||
/** Supports Unicode input from every keyboard around the world,
|
||||
@ -336,8 +334,8 @@ public:
|
||||
\return Pointer to the created edit box. Returns 0 if an error occurred.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
bool border=true, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
virtual IGUIEditBox *addEditBox(const wchar_t *text, const core::rect<s32> &rectangle,
|
||||
bool border = true, IGUIElement *parent = 0, s32 id = -1) = 0;
|
||||
|
||||
//! Adds a tab control to the environment.
|
||||
/** \param rectangle Rectangle specifying the borders of the tab control.
|
||||
@ -352,9 +350,9 @@ public:
|
||||
\return Pointer to the created tab control element. Returns 0 if an
|
||||
error occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, bool fillbackground=false,
|
||||
bool border=true, s32 id=-1) = 0;
|
||||
virtual IGUITabControl *addTabControl(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, bool fillbackground = false,
|
||||
bool border = true, s32 id = -1) = 0;
|
||||
|
||||
//! Adds tab to the environment.
|
||||
/** You can use this element to group other elements. This is not used
|
||||
@ -367,8 +365,8 @@ public:
|
||||
\return Pointer to the created tab. Returns 0 if an
|
||||
error occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
virtual IGUITab *addTab(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1) = 0;
|
||||
|
||||
//! Adds a combo box to the environment.
|
||||
/** \param rectangle Rectangle specifying the borders of the combo box.
|
||||
@ -378,8 +376,8 @@ public:
|
||||
\return Pointer to the created combo box. Returns 0 if an
|
||||
error occurred. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
virtual IGUIComboBox *addComboBox(const core::rect<s32> &rectangle,
|
||||
IGUIElement *parent = 0, s32 id = -1) = 0;
|
||||
|
||||
//! Find the next element which would be selected when pressing the tab-key
|
||||
/** If you set the focus for the result you can manually force focus-changes like they
|
||||
@ -387,7 +385,7 @@ public:
|
||||
\param reverse When true it will search backward (toward lower TabOrder numbers, like shift+tab)
|
||||
\param group When true it will search for the next tab-group (like ctrl+tab)
|
||||
*/
|
||||
virtual IGUIElement* getNextElement(bool reverse=false, bool group=false) = 0;
|
||||
virtual IGUIElement *getNextElement(bool reverse = false, bool group = false) = 0;
|
||||
|
||||
//! Set the way the gui will handle automatic focus changes
|
||||
/** The default is (EFF_SET_ON_LMOUSE_DOWN | EFF_SET_ON_TAB).
|
||||
@ -409,9 +407,8 @@ public:
|
||||
Note that in general just calling IGUIElement::remove() is enough.
|
||||
Unless you create your own GUI elements removing themselves you won't need it.
|
||||
\param element: Element to remove */
|
||||
virtual void addToDeletionQueue(IGUIElement* element) = 0;
|
||||
virtual void addToDeletionQueue(IGUIElement *element) = 0;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user