From 068d7924ff6e10b457d7b686ed8df1f93e970656 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 31 Oct 2009 23:27:14 +0000 Subject: [PATCH] OK, I like camelCase --- include/gui2/ContainerWidget.hpp | 12 ++++++------ include/gui2/ILayout.hpp | 4 ++-- include/gui2/Label.hpp | 9 ++++----- include/gui2/Widget.hpp | 8 ++++---- layouts/demo.xml | 2 +- src/UIDemo.cpp | 12 ++++++------ src/gui2/ContainerWidget.cpp | 24 ++++++++++++------------ src/gui2/Label.cpp | 10 +++++----- src/gui2/Layout.cpp | 8 ++++---- src/gui2/Widget.cpp | 10 +++++----- 10 files changed, 49 insertions(+), 50 deletions(-) diff --git a/include/gui2/ContainerWidget.hpp b/include/gui2/ContainerWidget.hpp index b633600..c0b793c 100644 --- a/include/gui2/ContainerWidget.hpp +++ b/include/gui2/ContainerWidget.hpp @@ -31,23 +31,23 @@ namespace gui { ContainerWidget(const AttributeSet& attrs); virtual void render(RenderContext& rc) const; - virtual void adjust_for_theme(Theme& theme); + virtual void adjustForTheme(Theme& theme); - void add_child(Widget* w); + void addChild(Widget* w); - virtual void handle_click(int x, int y); + virtual void handleClick(int x, int y); protected: - virtual void child_added(Widget* w) {}; + virtual void childAdded(Widget* w) {}; typedef vector ChildList; ChildList::iterator begin() { return children.begin(); } ChildList::iterator end() { return children.end(); } - ChildList::const_iterator const_begin() const + ChildList::const_iterator constBegin() const { return children.begin(); } - ChildList::const_iterator const_end() const + ChildList::const_iterator constEnd() const { return children.end(); } private: diff --git a/include/gui2/ILayout.hpp b/include/gui2/ILayout.hpp index ee751d2..d6739d0 100644 --- a/include/gui2/ILayout.hpp +++ b/include/gui2/ILayout.hpp @@ -32,7 +32,7 @@ namespace gui { virtual ~ILayout() {} template - T& get_cast(const string& path) const + T& cast(const string& path) const { return dynamic_cast(get(path)); } @@ -45,7 +45,7 @@ namespace gui { typedef shared_ptr ILayoutPtr; - ILayoutPtr make_layout(const string& file_name); + ILayoutPtr makeLayout(const string& file_name); } diff --git a/include/gui2/Label.hpp b/include/gui2/Label.hpp index 43cec8a..c3c1b14 100644 --- a/include/gui2/Label.hpp +++ b/include/gui2/Label.hpp @@ -29,17 +29,16 @@ namespace gui { public: Label(const AttributeSet& attrs); - const string& text() const { return text_; } - void text(const string& t) { text_ = t; } + const string& text() const { return _text; } + void text(const string& t) { _text = t; } void format(const char* fmt, ...); void render(RenderContext& rc) const; - void adjust_for_theme(Theme& theme); + void adjustForTheme(Theme& theme); private: - string text_; + string _text; }; - } #endif diff --git a/include/gui2/Widget.hpp b/include/gui2/Widget.hpp index 210cce8..9b5507c 100644 --- a/include/gui2/Widget.hpp +++ b/include/gui2/Widget.hpp @@ -51,22 +51,22 @@ namespace gui { void connect(Signal sig, SignalHandler handler); virtual void render(RenderContext& rc) const = 0; - virtual void adjust_for_theme(Theme& theme) {} + virtual void adjustForTheme(Theme& theme) {} - virtual void handle_click(int x, int y); + virtual void handleClick(int x, int y); protected: void raise(Signal sig); private: - static string unique_name(); + static string uniqueName(); string name_; int x_, y_, width_, height_; map handlers; - static int unique_id; + static int ourUniqueId; }; } diff --git a/layouts/demo.xml b/layouts/demo.xml index 6bfe784..d397c44 100644 --- a/layouts/demo.xml +++ b/layouts/demo.xml @@ -8,7 +8,7 @@ x="5" y="35" width="80" height="25" />