From 2e457d96e8095020bce006fd633382bde6c6ae26 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 13:42:53 +0200 Subject: WINTERMUTE: Make some members of UIObject private --- engines/wintermute/ui/ui_object.h | 44 +++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 5d9508c2cf..bcd90082d1 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -41,7 +41,6 @@ class UIObject : public BaseObject { public: bool getTotalOffset(int *offsetX, int *offsetY); - bool _canFocus; bool focus(); virtual bool handleMouse(TMouseEvent event, TMouseButton button); bool isFocused(); @@ -52,20 +51,11 @@ public: virtual bool display(int offsetX) { return display(offsetX, 0); } virtual bool display(int offsetX, int offsetY); virtual void correctSize(); - bool _sharedFonts; - bool _sharedImages; void setText(const char *text); - char *_text; - BaseFont *_font; - bool _visible; + UITiledImage *_back; - bool _disable; UIObject(BaseGame *inGame = nullptr); virtual ~UIObject(); - int32 _width; - int32 _height; - TUIObjectType _type; - BaseSprite *_image; void setListener(BaseScriptHolder *object, BaseScriptHolder *listenerObject, uint32 listenerParam); BaseScriptHolder *_listenerParamObject; uint32 _listenerParamDWORD; @@ -78,6 +68,38 @@ public: virtual bool scSetProperty(const char *name, ScValue *value) override; virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) override; virtual const char *scToString() override; + TUIObjectType _type; + + int32 getWidth(); + int32 getHeight(); + void setHeight(int32 height); + void setWidth(int32 width); + bool isDisabled(); + void setDisabled(bool disable); + bool isVisible(); + void setVisible(bool visible); + bool hasSharedFonts(); + void setSharedFonts(bool shared); + bool hasSharedImages(); + void setSharedImages(bool shared); + BaseSprite *getImage(); + void putImage(BaseSprite *image); + void putFont(BaseFont *font); + BaseFont *getFont(); + bool canFocus(); + +protected: + BaseSprite *_image; + BaseFont *_font; + bool _sharedFonts; + bool _sharedImages; + char *_text; + bool _visible; + bool _disable; + int32 _width; + int32 _height; + bool _canFocus; + }; } // End of namespace Wintermute -- cgit v1.2.3 From aafe8c1f0d45aef7429331b5e00f74d2e42b0ce7 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 13:57:36 +0200 Subject: WINTERMUTE: Add getListener() --- engines/wintermute/ui/ui_object.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index bcd90082d1..6d1f6ae895 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -57,9 +57,8 @@ public: UIObject(BaseGame *inGame = nullptr); virtual ~UIObject(); void setListener(BaseScriptHolder *object, BaseScriptHolder *listenerObject, uint32 listenerParam); - BaseScriptHolder *_listenerParamObject; - uint32 _listenerParamDWORD; - BaseScriptHolder *_listenerObject; + BaseScriptHolder *getListener(); + UIObject *_focusedWidget; virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent) override; @@ -89,6 +88,9 @@ public: bool canFocus(); protected: + BaseScriptHolder *_listenerParamObject; + uint32 _listenerParamDWORD; + BaseScriptHolder *_listenerObject; BaseSprite *_image; BaseFont *_font; bool _sharedFonts; -- cgit v1.2.3 From 252e0c17ec711c13ac5ef3bd6af68646275d63d6 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 13:58:17 +0200 Subject: WINTERMUTE: Make _parentNotify private in UIObject --- engines/wintermute/ui/ui_object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 6d1f6ae895..4132d9576a 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -44,7 +44,7 @@ public: bool focus(); virtual bool handleMouse(TMouseEvent event, TMouseButton button); bool isFocused(); - bool _parentNotify; + DECLARE_PERSISTENT(UIObject, BaseObject) UIObject *_parent; virtual bool display() override { return display(0, 0); } @@ -101,7 +101,7 @@ protected: int32 _width; int32 _height; bool _canFocus; - + bool _parentNotify; }; } // End of namespace Wintermute -- cgit v1.2.3 From 91ebad46d3adc4cf48a14f0f1bbfa9e41e28ecad Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 13:59:37 +0200 Subject: WINTERMUTE: Keep _back private in UIObject --- engines/wintermute/ui/ui_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 4132d9576a..6eaade4b4b 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -53,7 +53,6 @@ public: virtual void correctSize(); void setText(const char *text); - UITiledImage *_back; UIObject(BaseGame *inGame = nullptr); virtual ~UIObject(); void setListener(BaseScriptHolder *object, BaseScriptHolder *listenerObject, uint32 listenerParam); @@ -102,6 +101,7 @@ protected: int32 _height; bool _canFocus; bool _parentNotify; + UITiledImage *_back; }; } // End of namespace Wintermute -- cgit v1.2.3 From 5b8a6885c67fe2e1af3dab0e634da1938f8e544c Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 23:03:16 +0200 Subject: WINTERMUTE: s/put/set/ in setters --- engines/wintermute/ui/ui_object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 6eaade4b4b..8451479455 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -81,8 +81,8 @@ public: bool hasSharedImages(); void setSharedImages(bool shared); BaseSprite *getImage(); - void putImage(BaseSprite *image); - void putFont(BaseFont *font); + void setImage(BaseSprite *image); + void setFont(BaseFont *font); BaseFont *getFont(); bool canFocus(); -- cgit v1.2.3 From 1023ac4b33158905b900585c27dfa1f2e368d4f3 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Fri, 20 Sep 2013 23:32:56 +0200 Subject: WINTERMUTE: const'ify getters --- engines/wintermute/ui/ui_object.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 8451479455..d9be29ba9a 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -56,7 +56,7 @@ public: UIObject(BaseGame *inGame = nullptr); virtual ~UIObject(); void setListener(BaseScriptHolder *object, BaseScriptHolder *listenerObject, uint32 listenerParam); - BaseScriptHolder *getListener(); + BaseScriptHolder *getListener() const; UIObject *_focusedWidget; virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent) override; @@ -68,8 +68,8 @@ public: virtual const char *scToString() override; TUIObjectType _type; - int32 getWidth(); - int32 getHeight(); + int32 getWidth() const; + int32 getHeight() const; void setHeight(int32 height); void setWidth(int32 width); bool isDisabled(); @@ -80,10 +80,10 @@ public: void setSharedFonts(bool shared); bool hasSharedImages(); void setSharedImages(bool shared); - BaseSprite *getImage(); + BaseSprite *getImage() const; void setImage(BaseSprite *image); void setFont(BaseFont *font); - BaseFont *getFont(); + BaseFont *getFont() const; bool canFocus(); protected: -- cgit v1.2.3 From 5afb297e396fa3ad40559e552008741c6cd6ba66 Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 30 Sep 2013 11:12:25 +0200 Subject: WINTERMUTE: Constify some getters in TransparentSurface, UIObject and UIWindow --- engines/wintermute/ui/ui_object.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index d9be29ba9a..56d22a0b18 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -72,19 +72,19 @@ public: int32 getHeight() const; void setHeight(int32 height); void setWidth(int32 width); - bool isDisabled(); + bool isDisabled() const; void setDisabled(bool disable); - bool isVisible(); + bool isVisible() const; void setVisible(bool visible); - bool hasSharedFonts(); + bool hasSharedFonts() const; void setSharedFonts(bool shared); - bool hasSharedImages(); + bool hasSharedImages() const; void setSharedImages(bool shared); BaseSprite *getImage() const; void setImage(BaseSprite *image); void setFont(BaseFont *font); - BaseFont *getFont() const; - bool canFocus(); + BaseFont *getFont(); + bool canFocus() const; protected: BaseScriptHolder *_listenerParamObject; -- cgit v1.2.3 From 12e7cb401f80d8e1dee1af67817333d897508dfb Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Mon, 30 Sep 2013 11:18:54 +0200 Subject: WINTERMUTE: Formatting with Astyle (UIButton, UIEdit, UIObject, UIWindow, TransparentSurface) --- engines/wintermute/ui/ui_object.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/wintermute/ui/ui_object.h') diff --git a/engines/wintermute/ui/ui_object.h b/engines/wintermute/ui/ui_object.h index 56d22a0b18..8d14d8a6a4 100644 --- a/engines/wintermute/ui/ui_object.h +++ b/engines/wintermute/ui/ui_object.h @@ -89,7 +89,7 @@ public: protected: BaseScriptHolder *_listenerParamObject; uint32 _listenerParamDWORD; - BaseScriptHolder *_listenerObject; + BaseScriptHolder *_listenerObject; BaseSprite *_image; BaseFont *_font; bool _sharedFonts; -- cgit v1.2.3