]> git.tdb.fi Git - libs/gltk.git/commitdiff
typedef tweaks
authorMikko Rasa <tdb@tdb.fi>
Thu, 3 Feb 2011 11:48:09 +0000 (11:48 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 3 Feb 2011 11:48:09 +0000 (11:48 +0000)
source/panel.h
source/part.h
source/style.h
source/userinterface.h
source/widget.cpp

index 748ecb48d508c53c32a7186ede84472c581d7b85..54e75ef5309e9e23d62645fadaf5064cafa7fddb 100644 (file)
@@ -23,12 +23,15 @@ class Panel: public Container
 public:
        class Loader: public Widget::Loader
        {
+       public:
+               typedef std::map<std::string, Widget *> WidgetMap;
+
        private:
                Panel &pnl;
-               std::map<std::string, Widget *> &wdg_map;
+               WidgetMap &wdg_map;
        
        public:
-               Loader(Panel &, std::map<std::string, Widget *> &);
+               Loader(Panel &, WidgetMap &);
        private:
                template<typename T>
                void child(const std::string &);
index edc524c0b67b62d1807b46eb6f271983d92de090..a3c0dcf4a109eb045c162a4f007c5b937d911d81 100644 (file)
@@ -8,10 +8,8 @@ Distributed under the LGPL
 #ifndef MSP_GLTK_PART_H_
 #define MSP_GLTK_PART_H_
 
-#include <map>
 #include <string>
 #include <msp/datafile/loader.h>
-//#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<Part> PartSeq;
 
 } // namespace GLtk
 } // namespace Msp
index 8aeb61e8ef68f26a61b82acaf97d6e8398a14269..e1cbc3a40e43300cc36df44f6f9174a36d86e1df 100644 (file)
@@ -44,6 +44,8 @@ public:
                void part(const std::string &);
        };
 
+       typedef std::list<Part> PartSeq;
+
 private:
        const GL::Font *font;
        GL::Color font_color;
index c0750c003b5a15cc4e4bda9bf42d5f46ab91c329..9ce08c38e08f6e64dd568b282b38c40b81837dc3 100644 (file)
@@ -33,8 +33,10 @@ public:
                void root();
        };
 
+       typedef std::map<std::string, Widget *> WidgetMap;
+
 private:
-       std::map<std::string, Widget *> widgets;
+       WidgetMap widgets;
        Root root;
        Logic logic;
 
@@ -46,7 +48,7 @@ public:
        template<typename W>
        W &get_widget(const std::string &n) const
        {
-               std::map<std::string, Widget *>::const_iterator i = widgets.find(n);
+               WidgetMap::const_iterator i = widgets.find(n);
                if(i==widgets.end())
                        throw KeyError("Unknown widget", n);
 
index 9cd9066bc82663150daa9ad8fddc65b629650c02..c146d235c80602e061a02dd8d7a6ef832f507102 100644 (file)
@@ -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())
                {