From: Mikko Rasa Date: Thu, 3 Feb 2011 11:48:09 +0000 (+0000) Subject: typedef tweaks X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2f70d404230954f0693a62a021b5d2ad1faed8fa;p=libs%2Fgltk.git typedef tweaks --- diff --git a/source/panel.h b/source/panel.h index 748ecb4..54e75ef 100644 --- a/source/panel.h +++ b/source/panel.h @@ -23,12 +23,15 @@ class Panel: public Container public: class Loader: public Widget::Loader { + public: + typedef std::map WidgetMap; + private: Panel &pnl; - std::map &wdg_map; + WidgetMap &wdg_map; public: - Loader(Panel &, std::map &); + Loader(Panel &, WidgetMap &); private: template void child(const std::string &); diff --git a/source/part.h b/source/part.h index edc524c..a3c0dcf 100644 --- a/source/part.h +++ b/source/part.h @@ -8,10 +8,8 @@ Distributed under the LGPL #ifndef MSP_GLTK_PART_H_ #define MSP_GLTK_PART_H_ -#include #include #include -//#include "alignment.h" #include "geometry.h" #include "state.h" @@ -60,7 +58,6 @@ public: const Alignment &get_alignment() const { return align; } void render(const Geometry &, State) const; }; -typedef std::list PartSeq; } // namespace GLtk } // namespace Msp diff --git a/source/style.h b/source/style.h index 8aeb61e..e1cbc3a 100644 --- a/source/style.h +++ b/source/style.h @@ -44,6 +44,8 @@ public: void part(const std::string &); }; + typedef std::list PartSeq; + private: const GL::Font *font; GL::Color font_color; diff --git a/source/userinterface.h b/source/userinterface.h index c0750c0..9ce08c3 100644 --- a/source/userinterface.h +++ b/source/userinterface.h @@ -33,8 +33,10 @@ public: void root(); }; + typedef std::map WidgetMap; + private: - std::map widgets; + WidgetMap widgets; Root root; Logic logic; @@ -46,7 +48,7 @@ public: template W &get_widget(const std::string &n) const { - std::map::const_iterator i = widgets.find(n); + WidgetMap::const_iterator i = widgets.find(n); if(i==widgets.end()) throw KeyError("Unknown widget", n); diff --git a/source/widget.cpp b/source/widget.cpp index 9cd9066..c146d23 100644 --- a/source/widget.cpp +++ b/source/widget.cpp @@ -128,7 +128,8 @@ void Widget::render() const GL::push_matrix(); GL::translate(geom.x, geom.y, 0); - for(PartSeq::const_iterator i=style->get_parts().begin(); i!=style->get_parts().end(); ++i) + const Style::PartSeq &parts = style->get_parts(); + for(Style::PartSeq::const_iterator i=parts.begin(); i!=parts.end(); ++i) { if(i->get_name().empty()) {