Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7779 in orxonox.OLD


Ignore:
Timestamp:
May 23, 2006, 10:04:17 PM (18 years ago)
Author:
bensch
Message:

3088 linews changed :): trunk: namespaces

Location:
trunk/src
Files:
45 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui.h

    r5359 r7779  
    66#ifndef _GLGUI_H
    77#define _GLGUI_H
    8 
    98#include "glgui_widget.h"
    109
     10namespace OrxGui
     11{
     12
     13};
    1114
    1215
  • trunk/src/lib/gui/gl_gui/glgui_bar.cc

    r7073 r7779  
    1818#include "glgui_bar.h"
    1919
    20 using namespace std;
    2120
    22 /**
    23  * @brief standard constructor
    24 */
    25 GLGuiBar::GLGuiBar ()
     21namespace OrxGui
    2622{
    27   this->init();
    2823
    29 }
     24  /**
     25   * @brief standard constructor
     26  */
     27  GLGuiBar::GLGuiBar ()
     28  {
     29    this->init();
     30
     31  }
    3032
    3133
    32 /**
    33  * @brief standard deconstructor
    34  */
    35 GLGuiBar::~GLGuiBar()
    36 {
     34  /**
     35   * @brief standard deconstructor
     36   */
     37  GLGuiBar::~GLGuiBar()
     38  {
     39  }
    3740
     41  /**
     42   * @brief initializes the GUI-element
     43   */
     44  void GLGuiBar::init()
     45  {
     46    this->setClassID(CL_GLGUI_BAR, "GLGuiBar");
     47
     48    this->frontMat.setDiffuse(1,1,1);
     49
     50    this->setSize2D(50, 10);
     51
     52    this->value = 0.5f;
     53    this->minimum = 0.0f;
     54    this->maximum = 1.0f;
     55  }
     56
     57  /**
     58   * @brief draws the GLGuiBar
     59   */
     60  void GLGuiBar::draw() const
     61  {
     62    this->startDraw();
     63
     64    GLGuiWidget::draw();
     65
     66    this->frontMat.select();
     67    glBegin(GL_QUADS);
     68
     69    glTexCoord2f(0,0);
     70    glVertex2f(3.0, 3.0);
     71    glTexCoord2f(0, value/maximum);
     72    glVertex2f(3.0, (this->getSizeY2D()-3.0)* (value/maximum));
     73    glTexCoord2f(1, value/maximum);
     74    glVertex2f(this->getSizeX2D()-3.0, (this->getSizeY2D()-3.0) * (value/maximum));
     75    glTexCoord2f(1,0);
     76    glVertex2f(this->getSizeX2D()-3.0, 3.0);
     77
     78    glEnd();
     79    this->endDraw();
     80  }
    3881}
    39 
    40 /**
    41  * @brief initializes the GUI-element
    42  */
    43 void GLGuiBar::init()
    44 {
    45   this->setClassID(CL_GLGUI_BAR, "GLGuiBar");
    46 
    47   this->frontMat.setDiffuse(1,1,1);
    48 
    49   this->setSize2D(50, 10);
    50 
    51   this->value = 0.5f;
    52   this->minimum = 0.0f;
    53   this->maximum = 1.0f;
    54 }
    55 
    56 /**
    57  * @brief draws the GLGuiBar
    58  */
    59 void GLGuiBar::draw() const
    60 {
    61   this->startDraw();
    62 
    63   GLGuiWidget::draw();
    64 
    65   this->frontMat.select();
    66   glBegin(GL_QUADS);
    67 
    68   glTexCoord2f(0,0);
    69   glVertex2f(3.0, 3.0);
    70   glTexCoord2f(0, value/maximum);
    71   glVertex2f(3.0, (this->getSizeY2D()-3.0)* (value/maximum));
    72   glTexCoord2f(1, value/maximum);
    73   glVertex2f(this->getSizeX2D()-3.0, (this->getSizeY2D()-3.0) * (value/maximum));
    74   glTexCoord2f(1,0);
    75   glVertex2f(this->getSizeX2D()-3.0, 3.0);
    76 
    77   glEnd();
    78   this->endDraw();
    79 }
  • trunk/src/lib/gui/gl_gui/glgui_bar.h

    r6287 r7779  
    1010#include "glgui_widget.h"
    1111
    12 // FORWARD DECLARATION
    1312
    14 //! This is Bar part of the openglGUI class
    15 /**
    16  * The Bar shows the part value.
    17  */
    18 class GLGuiBar : public GLGuiWidget {
     13namespace OrxGui
     14{
    1915
    20  public:
    21   GLGuiBar();
    22   virtual ~GLGuiBar();
    2316
    24   void setValue(float value) { this->value = value; };
    25   void setMinimum(float minimum) { this->minimum = minimum; };
    26   void setMaximum(float maximum) { this->maximum = maximum; };
     17  //! This is Bar part of the openglGUI class
     18  /**
     19   * The Bar shows the part value.
     20   */
     21  class GLGuiBar : public GLGuiWidget
     22  {
    2723
    28   float getValue() const { return this->value; };
    29   float getMinimum() const { return this->minimum; };
    30   float getMaximum() const { return this->maximum; };
     24  public:
     25    GLGuiBar();
     26    virtual ~GLGuiBar();
    3127
    32   virtual void update() { };
    33   virtual void draw() const;
     28    void setValue(float value) { this->value = value; };
     29    void setMinimum(float minimum) { this->minimum = minimum; };
     30    void setMaximum(float maximum) { this->maximum = maximum; };
    3431
    35  private:
    36    void init();
     32    float getValue() const { return this->value; };
     33    float getMinimum() const { return this->minimum; };
     34    float getMaximum() const { return this->maximum; };
     35
     36    virtual void update() { };
     37    virtual void draw() const;
     38
     39  private:
     40    void init();
    3741
    3842  private:
     
    4145    float minimum;
    4246    float maximum;
    43 };
    44 
     47  };
     48}
    4549#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_box.cc

    r7130 r7779  
    1818#include "glgui_box.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
     22  /**
     23   * standard constructor
     24  */
     25  GLGuiBox::GLGuiBox (BoxType type)
     26  {
     27    this->init();
    2128
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiBox::GLGuiBox (GLGuiBoxType type)
    26 {
    27   this->init();
    28 
    29   this->setType (type);
    30 }
     29    this->setType (type);
     30  }
    3131
    3232
    33 /**
    34  * standard deconstructor
    35 */
    36 GLGuiBox::~GLGuiBox()
    37 {
    38 }
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGuiBox::~GLGuiBox()
     37  {}
    3938
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiBox::init()
    44 {
    45   this->setClassID(CL_GLGUI_BOX, "GLGuiBox");
    46 }
     39  /**
     40   * initializes the GUI-element
     41   */
     42  void GLGuiBox::init()
     43  {
     44    this->setClassID(CL_GLGUI_BOX, "GLGuiBox");
     45  }
    4746
    48 void GLGuiBox::pack(GLGuiWidget* widget)
    49 {
    50   if (widget == NULL)
    51     return;
     47  void GLGuiBox::pack(GLGuiWidget* widget)
     48  {
     49    if (widget == NULL)
     50      return;
    5251
    53   this->children.push_back(widget);
    54 }
     52    this->children.push_back(widget);
     53  }
    5554
    5655
    57 void GLGuiBox::unpack(GLGuiWidget* widget)
    58 {
    59   if (widget == NULL)
     56  void GLGuiBox::unpack(GLGuiWidget* widget)
    6057  {
    61     this->children.clear();
     58    if (widget == NULL)
     59    {
     60      this->children.clear();
     61    }
     62    else
     63    {
     64      this->children.remove(widget);
     65    }
    6266  }
    63   else
     67
     68  void GLGuiBox::showAll()
    6469  {
    65     this->children.remove(widget);
     70    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
     71    while (itC != this->children.end())
     72    {
     73      if ((*itC)->isA(CL_GLGUI_CONTAINER))
     74        static_cast<GLGuiContainer*>(*itC)->showAll();
     75      else
     76        (*itC)->show();
     77      itC++;
     78    }
     79
     80    this->show();
     81
     82  }
     83
     84  void GLGuiBox::hideAll()
     85  {
     86    std::list<GLGuiWidget*>::iterator itC = this->children.begin();
     87    while (itC != this->children.end())
     88    {
     89      if ((*itC)->isA(CL_GLGUI_CONTAINER))
     90        static_cast<GLGuiContainer*>(*itC)->hideAll();
     91      else
     92        (*itC)->hide();
     93      itC++;
     94    }
     95
     96    this->hide();
     97  }
     98
     99
     100  /**
     101   * draws the GLGuiBox
     102   */
     103  void GLGuiBox::draw() const
     104  {
    66105  }
    67106}
    68 
    69 void GLGuiBox::showAll()
    70 {
    71   std::list<GLGuiWidget*>::iterator itC = this->children.begin();
    72   while (itC != this->children.end())
    73   {
    74     if ((*itC)->isA(CL_GLGUI_CONTAINER))
    75       static_cast<GLGuiContainer*>(*itC)->showAll();
    76     else
    77       (*itC)->show();
    78     itC++;
    79   }
    80 
    81   this->show();
    82 
    83 }
    84 
    85 void GLGuiBox::hideAll()
    86 {
    87   std::list<GLGuiWidget*>::iterator itC = this->children.begin();
    88   while (itC != this->children.end())
    89   {
    90     if ((*itC)->isA(CL_GLGUI_CONTAINER))
    91       static_cast<GLGuiContainer*>(*itC)->hideAll();
    92     else
    93       (*itC)->hide();
    94     itC++;
    95   }
    96 
    97   this->hide();
    98 }
    99 
    100 
    101 /**
    102  * draws the GLGuiBox
    103  */
    104 void GLGuiBox::draw() const
    105 {
    106 
    107 }
  • trunk/src/lib/gui/gl_gui/glgui_box.h

    r7130 r7779  
    1010#include "glgui_container.h"
    1111
    12 // FORWARD DECLARATION
    1312
    14 typedef enum
     13namespace OrxGui
    1514{
    16   GLGuiBox_H,
    17   GLGuiBox_V,
    18 } GLGuiBoxType;
     15  typedef enum
     16  {
     17    Box_H,
     18    Box_V,
     19  } BoxType;
    1920
    20 //! This is BOX part of the openglGUI class
    21 /**
    22  *
    23  */
    24 class GLGuiBox : public GLGuiContainer {
     21  //! This is BOX part of the openglGUI class
     22  /**
     23   *
     24   */
     25  class GLGuiBox : public GLGuiContainer
     26  {
    2527
    26  public:
    27   GLGuiBox(GLGuiBoxType type = GLGuiBox_H);
    28   virtual ~GLGuiBox();
     28  public:
     29    GLGuiBox(BoxType type = Box_H);
     30    virtual ~GLGuiBox();
    2931
    30   void init();
    31   void setType(GLGuiBoxType type) { this->type = type; };
     32    void init();
     33    void setType(BoxType type) { this->type = type; };
    3234
    33   virtual void pack(GLGuiWidget* widget);
    34   virtual void unpack(GLGuiWidget* widget);
    35   virtual void showAll();
    36   virtual void hideAll();
     35    virtual void pack(GLGuiWidget* widget);
     36    virtual void unpack(GLGuiWidget* widget);
     37    virtual void showAll();
     38    virtual void hideAll();
    3739
    38   virtual void draw() const;
     40    virtual void draw() const;
    3941
    40  private:
    41    GLGuiBoxType             type;
    42    std::list<GLGuiWidget*>  children;
    43 };
    44 
     42  private:
     43    BoxType                  type;
     44    std::list<GLGuiWidget*>  children;
     45  };
     46}
    4547#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_button.cc

    r7221 r7779  
    2020#include "text.h"
    2121
    22 using namespace std;
    2322
    24 /**
    25  * standard constructor
    26 */
    27 GLGuiButton::GLGuiButton ()
     23namespace OrxGui
    2824{
    29   this->init();
     25  /**
     26   * standard constructor
     27  */
     28  GLGuiButton::GLGuiButton ()
     29  {
     30    this->init();
    3031
    31 }
     32  }
    3233
    3334
    34 /**
    35  * standard deconstructor
    36 */
    37 GLGuiButton::~GLGuiButton()
    38 {
    39   /* this does not have to be done, since the Label is a child,
    40    * and will be deleted by Element2D's deletion Process
    41    * delete this->label;
     35  /**
     36   * standard deconstructor
    4237  */
    43 }
     38  GLGuiButton::~GLGuiButton()
     39  {
     40    /* this does not have to be done, since the Label is a child,
     41     * and will be deleted by Element2D's deletion Process
     42     * delete this->label;
     43    */
     44  }
    4445
    45 /**
    46  * initializes the GUI-element
    47  */
    48 void GLGuiButton::init()
    49 {
    50   this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
     46  /**
     47   * initializes the GUI-element
     48   */
     49  void GLGuiButton::init()
     50  {
     51    this->setClassID(CL_GLGUI_BUTTON, "GLGuiButton");
    5152
    52   this->label = new Text();
    53   this->label->setParent2D(this);
    54 }
     53    this->label = new Text();
     54    this->label->setParent2D(this);
     55  }
    5556
    56 void GLGuiButton::setLabel(const std::string& label)
    57 {
    58   this->label->setText(label);
    59   this->label->setRelCoor2D(5, 5);
    60   this->setSize2D(this->label->getSizeX2D()+10, this->label->getSizeY2D()+10);
    61 }
     57  void GLGuiButton::setLabel(const std::string& label)
     58  {
     59    this->label->setText(label);
     60    this->label->setRelCoor2D(5, 5);
     61    this->setSize2D(this->label->getSizeX2D()+10, this->label->getSizeY2D()+10);
     62  }
    6263
    6364
    64 /**
    65  * draws the GLGuiButton
    66  */
    67 void GLGuiButton::draw() const
    68 {
    69   GLGuiWidget::draw();
     65  /**
     66   * draws the GLGuiButton
     67   */
     68  void GLGuiButton::draw() const
     69  {
     70    GLGuiWidget::draw();
     71  }
    7072}
  • trunk/src/lib/gui/gl_gui/glgui_button.h

    r7221 r7779  
    1010#include "glgui_widget.h"
    1111
    12 typedef enum
    13 {
    14   GLGui_Button_Active,
    15   GLGui_Button_Inactive,
    16   GLGui_Button_Pressed,
    17   GLGui_Button_Released,
    18   GLGui_Button_Activating,
    19   GLGui_Button_Deactivating,
    20 
    21 } GLGui_ButtonState;
    22 
    23 // FORWARD DECLARATION
    2412class Text;
    2513
    26 //! This is part of the openglGUI class
    27 /**
    28  *
    29  */
    30 class GLGuiButton : public GLGuiWidget {
     14namespace OrxGui
     15{
     16  typedef enum
     17  {
     18    Button_Active,
     19    Button_Inactive,
     20    Button_Pressed,
     21    Button_Released,
     22    Button_Activating,
     23    Button_Deactivating,
    3124
    32  public:
    33    GLGuiButton();
    34    virtual ~GLGuiButton();
     25  } ButtonState;
    3526
    36    void init();
    37    void setLabel(const std::string& label);
     27  //! This is part of the openglGUI class
     28  /**
     29   *
     30   */
     31  class GLGuiButton : public GLGuiWidget
     32  {
    3833
    39    virtual void draw() const;
     34  public:
     35    GLGuiButton();
     36    virtual ~GLGuiButton();
     37
     38    void init();
     39    void setLabel(const std::string& label);
     40
     41    virtual void draw() const;
    4042
    4143  protected:
     
    4345
    4446  private:
    45     GLGui_ButtonState    state;
    46 };
    47 
     47    ButtonState          state;
     48  };
     49}
    4850#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc

    r6287 r7779  
    2020#include "text.h"
    2121
    22 using namespace std;
    23 
    24 /**
    25  * standard constructor
    26 */
    27 GLGuiCheckButton::GLGuiCheckButton ()
     22namespace OrxGui
    2823{
    29   this->init();
    30 
    31 }
    3224
    3325
    34 /**
    35  * standard deconstructor
    36 */
    37 GLGuiCheckButton::~GLGuiCheckButton()
    38 {
     26  /**
     27   * standard constructor
     28  */
     29  GLGuiCheckButton::GLGuiCheckButton ()
     30  {
     31    this->init();
    3932
     33  }
     34
     35
     36  /**
     37   * standard deconstructor
     38  */
     39  GLGuiCheckButton::~GLGuiCheckButton()
     40  {
     41  }
     42
     43  /**
     44   * initializes the GUI-element
     45   */
     46  GLGuiCheckButton::init()
     47  {
     48    this->setClassID(CL_GLGUI_CHECKBUTTON, "GLGuiCheckButton");
     49
     50  }
     51
     52  /**
     53   * draws the GLGuiCheckButton
     54   */
     55  void GLGuiCheckButton::draw() const
     56  {
     57  }
    4058}
    41 
    42 /**
    43  * initializes the GUI-element
    44  */
    45 GLGuiCheckButton::init()
    46 {
    47   this->setClassID(CL_GLGUI_CHECKBUTTON, "GLGuiCheckButton");
    48 
    49 }
    50 
    51 /**
    52  * draws the GLGuiCheckButton
    53  */
    54 void GLGuiCheckButton::draw() const
    55 {
    56 
    57 }
  • trunk/src/lib/gui/gl_gui/glgui_checkbutton.h

    r6287 r7779  
    1010#include "glgui_button.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
    1314
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiCheckButton : public GLGuiButton {
     15  // FORWARD DECLARATION
    1916
    20  public:
    21   GLGuiCheckButton();
    22   virtual ~GLGuiCheckButton();
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiCheckButton : public GLGuiButton
     22  {
    2323
    24   void init();
     24  public:
     25    GLGuiCheckButton();
     26    virtual ~GLGuiCheckButton();
    2527
    26   bool    isActive() { return this->bActive; };
    27   void    setActivity(bool bActive);
     28    void init();
    2829
    29   virtual void draw() const;
    30   virtual void update() {};
     30    bool    isActive() { return this->bActive; };
     31    void    setActivity(bool bActive);
    3132
    32  private:
    33    bool             bActive;
     33    virtual void draw() const;
     34    virtual void update() {};
    3435
    35 };
     36  private:
     37    bool             bActive;
     38
     39  };
     40}
    3641
    3742#endif /* _GLGUI_CHECKBUTTON_H */
  • trunk/src/lib/gui/gl_gui/glgui_colorselector.cc

    r5360 r7779  
    1818#include "glgui_.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGui::GLGui ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGui::GLGui ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGui::~GLGui()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGui::~GLGui()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  GLGui::init()
     44  {
     45    this->setClassID(CL_GLGUI_, "GLGui");
     46
     47  }
     48
     49  /**
     50   * draws the GLGui
     51   */
     52  void GLGui::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 GLGui::init()
    44 {
    45   this->setClassID(CL_GLGUI_, "GLGui");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGui
    51  */
    52 void GLGui::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_colorselector.h

    r5360 r7779  
    1010#include "base_object.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
    1314
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGui : public GLGui {
     15  // FORWARD DECLARATION
    1916
    20  public:
    21   GLGui();
    22   virtual ~GLGui();
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGui : public GLGui
     22  {
    2323
    24   void init();
     24  public:
     25    GLGui();
     26    virtual ~GLGui();
    2527
    26   virtual void draw();
     28    void init();
    2729
    28  private:
     30    virtual void draw();
    2931
    30 };
     32  private:
    3133
     34  };
     35}
    3236#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_container.cc

    r5393 r7779  
    1818#include "glgui_container.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiContainer::GLGuiContainer ()
    26 {
    27   this->init();
    28 }
     23  /**
     24   * standard constructor
     25  */
     26  GLGuiContainer::GLGuiContainer ()
     27  {
     28    this->init();
     29  }
    2930
    3031
    31 /**
    32  * standard deconstructor
    33 */
    34 GLGuiContainer::~GLGuiContainer()
    35 {
    36 }
     32  /**
     33   * standard deconstructor
     34  */
     35  GLGuiContainer::~GLGuiContainer()
     36  {}
    3737
    38 /**
    39  * initializes the GUI-element
    40  */
    41 void GLGuiContainer::init()
    42 {
    43   this->setClassID(CL_GLGUI_CONTAINER, "GLGuiContainer");
     38  /**
     39   * initializes the GUI-element
     40   */
     41  void GLGuiContainer::init()
     42  {
     43    this->setClassID(CL_GLGUI_CONTAINER, "GLGuiContainer");
    4444
    45 }
     45  }
    4646
    4747
    48 /**
    49  * draws the GLGuiContainer
    50  */
    51 void GLGuiContainer::draw()
    52 {
    53 
     48  /**
     49   * draws the GLGuiContainer
     50   */
     51  void GLGuiContainer::draw()
     52  {
     53  }
    5454}
  • trunk/src/lib/gui/gl_gui/glgui_container.h

    r5393 r7779  
    1010#include "glgui_widget.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
     14  // FORWARD DECLARATION
    1315
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiContainer : public GLGuiWidget {
     16  //! This is part of the openglGUI class
     17  /**
     18   *
     19   */
     20  class GLGuiContainer : public GLGuiWidget
     21  {
    1922
    20  public:
    21   GLGuiContainer();
    22   virtual ~GLGuiContainer();
     23  public:
     24    GLGuiContainer();
     25    virtual ~GLGuiContainer();
    2326
    24   void init();
     27    void init();
    2528
    2629
    27   void setBorderWidth(float borderwidth);
     30    void setBorderWidth(float borderwidth);
    2831
    2932
    30   virtual void pack(GLGuiWidget* widget) = 0;
    31   /** unpacks a Widget from this container. @param widget the GLGuiWidget to unpack, if NULL all subwidgets will be unpackt. */
    32   virtual void unpack(GLGuiWidget* widget) = 0;
    33   virtual void hideAll() = 0;
    34   virtual void showAll() = 0;
     33    virtual void pack(GLGuiWidget* widget) = 0;
     34    /** unpacks a Widget from this container. @param widget the GLGuiWidget to unpack, if NULL all subwidgets will be unpackt. */
     35    virtual void unpack(GLGuiWidget* widget) = 0;
     36    virtual void hideAll() = 0;
     37    virtual void showAll() = 0;
    3538
    3639
    37   virtual void draw();
     40    virtual void draw();
    3841
    39  private:
     42  private:
    4043
    41 };
    42 
     44  };
     45}
    4346#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_cursor.cc

    r5360 r7779  
    1818#include "glgui_.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGui::GLGui ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGui::GLGui ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGui::~GLGui()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGui::~GLGui()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  GLGui::init()
     44  {
     45    this->setClassID(CL_GLGUI_, "GLGui");
     46
     47  }
     48
     49  /**
     50   * draws the GLGui
     51   */
     52  void GLGui::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 GLGui::init()
    44 {
    45   this->setClassID(CL_GLGUI_, "GLGui");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGui
    51  */
    52 void GLGui::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_cursor.h

    r5360 r7779  
    1010#include "base_object.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
     14  // FORWARD DECLARATION
    1315
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGui : public GLGui {
     16  //! This is part of the openglGUI class
     17  /**
     18   *
     19   */
     20  class GLGui : public GLGui
     21  {
    1922
    20  public:
    21   GLGui();
    22   virtual ~GLGui();
     23  public:
     24    GLGui();
     25    virtual ~GLGui();
    2326
    24   void init();
     27    void init();
    2528
    26   virtual void draw();
     29    virtual void draw();
    2730
    28  private:
     31  private:
    2932
    30 };
    31 
     33  };
     34}
    3235#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_element.cc

    r5360 r7779  
    1818#include "glgui_.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGui::GLGui ()
    26 {
    27   this->init();
     23  /**
     24  * standard constructor
     25  */
     26  GLGui::GLGui ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGui::~GLGui()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGui::~GLGui()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  GLGui::init()
     44  {
     45    this->setClassID(CL_GLGUI_, "GLGui");
     46
     47  }
     48
     49  /**
     50   * draws the GLGui
     51   */
     52  void GLGui::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 GLGui::init()
    44 {
    45   this->setClassID(CL_GLGUI_, "GLGui");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGui
    51  */
    52 void GLGui::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_element.h

    r5360 r7779  
    1010#include "base_object.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
     14  // FORWARD DECLARATION
    1315
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGui : public GLGui {
     16  //! This is part of the openglGUI class
     17  /**
     18   *
     19   */
     20  class GLGui : public GLGui
     21  {
    1922
    20  public:
    21   GLGui();
    22   virtual ~GLGui();
     23  public:
     24    GLGui();
     25    virtual ~GLGui();
    2326
    24   void init();
     27    void init();
    2528
    26   virtual void draw();
     29    virtual void draw();
    2730
    28  private:
     31  private:
    2932
    30 };
    31 
     33  };
     34}
    3235#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_frame.cc

    r5393 r7779  
    1919
    2020#include "debug.h"
     21namespace OrxGui
     22{
    2123
    22 using namespace std;
     24  /**
     25   * standard constructor
     26  */
     27  GLGuiFrame::GLGuiFrame ()
     28  {
     29    this->init();
    2330
    24 /**
    25  * standard constructor
    26 */
    27 GLGuiFrame::GLGuiFrame ()
    28 {
    29   this->init();
    30 
    31 }
     31  }
    3232
    3333
    34 /**
    35  * standard deconstructor
    36 */
    37 GLGuiFrame::~GLGuiFrame()
    38 {
     34  /**
     35   * standard deconstructor
     36  */
     37  GLGuiFrame::~GLGuiFrame()
     38  {
     39  }
    3940
    40 }
     41  /**
     42   * initializes the GUI-element
     43   */
     44  void GLGuiFrame::init()
     45  {
     46    this->setClassID(CL_GLGUI_FRAME, "GLGuiFrame");
     47    this->child = NULL;
     48  }
    4149
    42 /**
    43  * initializes the GUI-element
    44  */
    45 void GLGuiFrame::init()
    46 {
    47   this->setClassID(CL_GLGUI_FRAME, "GLGuiFrame");
    48   this->child = NULL;
    49 }
     50  void GLGuiFrame::pack(GLGuiWidget* widget)
     51  {
     52    if (widget == NULL)
     53      return;
    5054
    51 void GLGuiFrame::pack(GLGuiWidget* widget)
    52 {
    53   if (widget == NULL)
    54     return;
     55    if (this->child == NULL)
     56      this->child = widget;
     57    else
     58    {
     59      PRINTF(2)("Frame %s is already filled, not filling with %s\n", this->getName(), widget->getName());
     60    }
     61  }
    5562
    56   if (this->child == NULL)
    57     this->child = widget;
    58   else
     63  void GLGuiFrame::unpack(GLGuiWidget* widget)
    5964  {
    60     PRINTF(2)("Frame %s is already filled, not filling with %s\n", this->getName(), widget->getName());
     65    if (widget == NULL || widget == this->child)
     66      this->child = NULL;
     67  }
     68
     69  void GLGuiFrame::showAll()
     70  {
     71    if (this->child != NULL)
     72    {
     73      if (this->child->isA(CL_GLGUI_CONTAINER))
     74        static_cast<GLGuiContainer*>(this->child)->showAll();
     75      else
     76        this->child->show();
     77    }
     78    this->show();
     79  }
     80
     81  void GLGuiFrame::hideAll()
     82  {
     83    if (this->child != NULL)
     84    {
     85      if (this->child->isA(CL_GLGUI_CONTAINER))
     86        static_cast<GLGuiContainer*>(this->child)->hideAll();
     87      else
     88        this->child->hide();
     89    }
     90    this->hide();
     91  }
     92
     93
     94  /**
     95   * draws the GLGuiFrame
     96   */
     97  void GLGuiFrame::draw()
     98  {
    6199  }
    62100}
    63 
    64 void GLGuiFrame::unpack(GLGuiWidget* widget)
    65 {
    66   if (widget == NULL || widget == this->child)
    67     this->child = NULL;
    68 }
    69 
    70 void GLGuiFrame::showAll()
    71 {
    72   if (this->child != NULL)
    73   {
    74     if (this->child->isA(CL_GLGUI_CONTAINER))
    75       static_cast<GLGuiContainer*>(this->child)->showAll();
    76     else
    77       this->child->show();
    78   }
    79   this->show();
    80 }
    81 
    82 void GLGuiFrame::hideAll()
    83 {
    84   if (this->child != NULL)
    85   {
    86     if (this->child->isA(CL_GLGUI_CONTAINER))
    87       static_cast<GLGuiContainer*>(this->child)->hideAll();
    88     else
    89       this->child->hide();
    90   }
    91   this->hide();
    92 }
    93 
    94 
    95 /**
    96  * draws the GLGuiFrame
    97  */
    98 void GLGuiFrame::draw()
    99 {
    100 
    101 }
  • trunk/src/lib/gui/gl_gui/glgui_frame.h

    r5393 r7779  
    1010#include "glgui_container.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
     14  // FORWARD DECLARATION
    1315
    14 //! This is Frame part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiFrame : public GLGuiContainer {
     16  //! This is Frame part of the openglGUI class
     17  /**
     18   *
     19   */
     20  class GLGuiFrame : public GLGuiContainer
     21  {
    1922
    20  public:
    21   GLGuiFrame();
    22   virtual ~GLGuiFrame();
     23  public:
     24    GLGuiFrame();
     25    virtual ~GLGuiFrame();
    2326
    24   void init();
     27    void init();
    2528
    26   virtual void pack(GLGuiWidget* widget);
    27   virtual void unpack(GLGuiWidget* widget);
    28   virtual void showAll();
    29   virtual void hideAll();
     29    virtual void pack(GLGuiWidget* widget);
     30    virtual void unpack(GLGuiWidget* widget);
     31    virtual void showAll();
     32    virtual void hideAll();
    3033
    31   virtual void draw();
     34    virtual void draw();
    3235
    33  private:
    34    GLGuiWidget*           child;
     36  private:
     37    GLGuiWidget*           child;
    3538
    36 };
    37 
     39  };
     40}
    3841#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_handler.cc

    r5406 r7779  
    2121#include "glgui_mainwidget.h"
    2222
    23 using namespace std;
     23namespace OrxGui
     24{
    2425
    25 /**
    26  * standard constructor
    27  */
    28 GLGuiHandler::GLGuiHandler ()
    29 {
    30    this->setClassID(CL_GLGUI_HANDLER, "GLGuiHandler");
    31    this->setName("GLGuiHandler");
     26  /**
     27   * standard constructor
     28   */
     29  GLGuiHandler::GLGuiHandler ()
     30  {
     31    this->setClassID(CL_GLGUI_HANDLER, "GLGuiHandler");
     32    this->setName("GLGuiHandler");
    3233
    33 }
     34  }
    3435
    35 /**
    36  *  the singleton reference to this class
    37  */
    38 GLGuiHandler* GLGuiHandler::singletonRef = NULL;
     36  /**
     37   *  the singleton reference to this class
     38   */
     39  GLGuiHandler* GLGuiHandler::singletonRef = NULL;
    3940
    40 /**
    41    @brief standard deconstructor
    42  */
    43 GLGuiHandler::~GLGuiHandler ()
    44 {
    45   GLGuiHandler::singletonRef = NULL;
    46 }
     41  /**
     42     @brief standard deconstructor
     43   */
     44  GLGuiHandler::~GLGuiHandler ()
     45  {
     46    GLGuiHandler::singletonRef = NULL;
     47  }
    4748
    48 void GLGuiHandler::activate()
    49 {
    50   EventHandler::getInstance()->pushState(ES_MENU);
     49  void GLGuiHandler::activate()
     50  {
     51    EventHandler::getInstance()->pushState(ES_MENU);
    5152
    52 }
     53  }
    5354
    54 void GLGuiHandler::deactivate()
    55 {
    56   EventHandler::getInstance()->popState();
     55  void GLGuiHandler::deactivate()
     56  {
     57    EventHandler::getInstance()->popState();
    5758
    58 }
     59  }
    5960
    6061
    61 void GLGuiHandler::process(const Event &event)
    62 {
     62  void GLGuiHandler::process(const Event &event)
     63  {
    6364
    6465
     66  }
    6567
    66 }
    67 
    68 void GLGuiHandler::draw()
    69 {
    70   GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
    71 }
     68  void GLGuiHandler::draw()
     69  {
     70    GLGuiMainWidget::getInstance()->draw2D(E2D_LAYER_TOP);
     71  }
    7272
    7373
    74 void GLGuiHandler::tick(float dt)
    75 {
    76 
     74  void GLGuiHandler::tick(float dt)
     75  {
     76  }
    7777}
  • trunk/src/lib/gui/gl_gui/glgui_handler.h

    r5406 r7779  
    99#include "event_listener.h"
    1010
    11 // FORWARD DECLARATION
     11namespace OrxGui
     12{
     13  // FORWARD DECLARATION
    1214
    13 //! A singleton class for the GLGui-Handler
    14 class GLGuiHandler : public EventListener {
     15  //! A singleton class for the GLGui-Handler
     16  class GLGuiHandler : public EventListener
     17  {
    1518
    16  public:
    17   virtual ~GLGuiHandler(void);
    18   /** @returns a Pointer to the only object of this Class */
    19   inline static GLGuiHandler* getInstance(void) { if (!GLGuiHandler::singletonRef) GLGuiHandler::singletonRef = new GLGuiHandler();  return GLGuiHandler::singletonRef; };
     19  public:
     20    virtual ~GLGuiHandler(void);
     21    /** @returns a Pointer to the only object of this Class */
     22    inline static GLGuiHandler* getInstance(void) { if (!GLGuiHandler::singletonRef) GLGuiHandler::singletonRef = new GLGuiHandler();  return GLGuiHandler::singletonRef; };
    2023
    21   void activate();
    22   void deactivate();
     24    void activate();
     25    void deactivate();
    2326
    2427
    25   virtual void process(const Event &event);
    26   void draw();
    27   void tick(float dt);
     28    virtual void process(const Event &event);
     29    void draw();
     30    void tick(float dt);
    2831
    29  private:
    30   GLGuiHandler(void);
    31   static GLGuiHandler* singletonRef;
     32  private:
     33    GLGuiHandler(void);
     34    static GLGuiHandler* singletonRef;
    3235
    3336
    34   bool                 isActive;
    35 };
     37    bool                 isActive;
     38  };
     39}
    3640
    3741#endif /* _GLGUI_HANDLER_H */
  • trunk/src/lib/gui/gl_gui/glgui_image.cc

    r5366 r7779  
    1818#include "glgui_image.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiImage::GLGuiImage ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGuiImage::GLGuiImage ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGuiImage::~GLGuiImage()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGuiImage::~GLGuiImage()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  void GLGuiImage::init()
     44  {
     45    this->setClassID(CL_GLGUI_, "GLGuiImage");
     46
     47  }
     48
     49  /**
     50   * draws the GLGuiImage
     51   */
     52  void GLGuiImage::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiImage::init()
    44 {
    45   this->setClassID(CL_GLGUI_, "GLGuiImage");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGuiImage
    51  */
    52 void GLGuiImage::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_image.h

    r5392 r7779  
    1212// FORWARD DECLARATION
    1313struct SDL_Surface;
     14namespace OrxGui
     15{
    1416
    15 //! This is Image part of the openglGUI class
    16 /**
    17  *
    18  */
    19 class GLGuiImage : public GLGuiWidget {
     17  //! This is Image part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiImage : public GLGuiWidget
     22  {
    2023
    21  public:
    22   GLGuiImage();
    23   virtual ~GLGuiImage();
     24  public:
     25    GLGuiImage();
     26    virtual ~GLGuiImage();
    2427
    25   void init();
    26   void loadImageFromFile(const char* fileName);
    27   void loadImageFromSDLSurface(SDL_Surface* surface);
    28   void loadImageFromDisplayList(GLuint displayList);
     28    void init();
     29    void loadImageFromFile(const char* fileName);
     30    void loadImageFromSDLSurface(SDL_Surface* surface);
     31    void loadImageFromDisplayList(GLuint displayList);
    2932
    30   virtual void draw();
     33    virtual void draw();
    3134
    32  private:
     35  private:
    3336
    34 };
    35 
     37  };
     38}
    3639#endif /* _GLGUI_IMAGE_H */
  • trunk/src/lib/gui/gl_gui/glgui_mainwidget.cc

    r5384 r7779  
    1818#include "glgui_mainwidget.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    2223
    23 /**
    24  * standard constructor
    25  */
    26 GLGuiMainWidget::GLGuiMainWidget()
    27 {
    28   this->setClassID(CL_GLGUI_MAIN_WIDGET, "GLGuiMainWidget");
    29   this->setName("GLGuiMainWidget");
     24  /**
     25   * standard constructor
     26   */
     27  GLGuiMainWidget::GLGuiMainWidget()
     28  {
     29    this->setClassID(CL_GLGUI_MAIN_WIDGET, "GLGuiMainWidget");
     30    this->setName("GLGuiMainWidget");
     31  }
     32
     33  /**
     34   *  the singleton reference to this class
     35   */
     36  GLGuiMainWidget* GLGuiMainWidget::singletonRef = NULL;
     37
     38  /**
     39   * standard deconstructor
     40   */
     41  GLGuiMainWidget::~GLGuiMainWidget ()
     42  {
     43    GLGuiMainWidget::singletonRef = NULL;
     44  }
    3045}
    31 
    32 /**
    33  *  the singleton reference to this class
    34  */
    35 GLGuiMainWidget* GLGuiMainWidget::singletonRef = NULL;
    36 
    37 /**
    38  * standard deconstructor
    39  */
    40 GLGuiMainWidget::~GLGuiMainWidget ()
    41 {
    42   GLGuiMainWidget::singletonRef = NULL;
    43 }
  • trunk/src/lib/gui/gl_gui/glgui_mainwidget.h

    r5405 r7779  
    99#include "glgui_widget.h"
    1010
    11 // FORWARD DECLARATION
     11namespace OrxGui
     12{
    1213
    13 //! A default singleton class.
    14 class GLGuiMainWidget : public GLGuiWidget {
     14  //! A default singleton class.
     15  class GLGuiMainWidget : public GLGuiWidget
     16  {
    1517
    16  public:
    17   virtual ~GLGuiMainWidget(void);
    18   /** @returns a Pointer to the only object of this Class */
    19   inline static GLGuiMainWidget* getInstance(void) { if (!GLGuiMainWidget::singletonRef) GLGuiMainWidget::singletonRef = new GLGuiMainWidget();  return GLGuiMainWidget::singletonRef; };
     18  public:
     19    virtual ~GLGuiMainWidget(void);
     20    /** @returns a Pointer to the only object of this Class */
     21    inline static GLGuiMainWidget* getInstance(void) { if (!GLGuiMainWidget::singletonRef) GLGuiMainWidget::singletonRef = new GLGuiMainWidget();  return GLGuiMainWidget::singletonRef; };
    2022
    2123  virtual void update() {};
    22   virtual void draw() const {};
     24    virtual void draw() const {};
    2325
    24  private:
    25   GLGuiMainWidget(void);
    26   static GLGuiMainWidget*       singletonRef;
    27 };
     26  private:
     27    GLGuiMainWidget(void);
     28    static GLGuiMainWidget*       singletonRef;
     29  };
     30}
    2831
    2932#endif /* _GLGUI_MAINWIDGET_H */
  • trunk/src/lib/gui/gl_gui/glgui_menu.cc

    r5366 r7779  
    1818#include "glgui_.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiMenu::GLGuiMenu ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGuiMenu::GLGuiMenu ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGuiMenu::~GLGuiMenu()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGuiMenu::~GLGuiMenu()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  void GLGuiMenu::init()
     44  {
     45    this->setClassID(CL_GLGUI_MENU, "GLGuiMenu");
     46
     47  }
     48
     49  /**
     50   * draws the GLGuiMenu
     51   */
     52  void GLGuiMenu::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiMenu::init()
    44 {
    45   this->setClassID(CL_GLGUI_MENU, "GLGuiMenu");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGuiMenu
    51  */
    52 void GLGuiMenu::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_menu.h

    r7221 r7779  
    99
    1010#include "base_object.h"
     11namespace OrxGui
     12{
    1113
    12 // FORWARD DECLARATION
    13 template<class T>  class tList;
    14 //! This is Menu part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiMenu : public GLGuiMenu {
     14  // FORWARD DECLARATION
     15  //! This is Menu part of the openglGUI class
     16  /**
     17   *
     18   */
     19  class GLGuiMenu : public GLGuiMenu
     20  {
    1921
    20  public:
    21   GLGuiMenu();
    22   virtual ~GLGuiMenu();
     22  public:
     23    GLGuiMenu();
     24    virtual ~GLGuiMenu();
    2325
    24   void init();
     26    void init();
    2527
    26   void addItem(const std::string& itemName);
    27   void removeItem(const std::string& itemName);
    28   void removeItem(unsigned int itemNumber);
    29   void selectItem(const std::string& itemName);
    30   void selectItem(unsigned int itemNumber);
     28    void addItem(const std::string& itemName);
     29    void removeItem(const std::string& itemName);
     30    void removeItem(unsigned int itemNumber);
     31    void selectItem(const std::string& itemName);
     32    void selectItem(unsigned int itemNumber);
    3133
    32   virtual void draw();
     34    virtual void draw();
    3335
    34  private:
    35    tList<char>*           itemList;
     36  private:
     37    std::list<std::string>         itemList;
    3638
    37 };
    38 
     39  };
     40}
    3941#endif /* _GLGUI_MENU_H */
  • trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r6295 r7779  
    2121#include "material.h"
    2222
    23 using namespace std;
     23namespace OrxGui
     24{
    2425
    25 /**
    26  * standard constructor
    27 */
    28 GLGuiPushButton::GLGuiPushButton ()
    29 {
    30   this->init();
    31 }
     26  /**
     27   * standard constructor
     28  */
     29  GLGuiPushButton::GLGuiPushButton ()
     30  {
     31    this->init();
     32  }
    3233
    3334
    34 /**
    35  * standard deconstructor
    36 */
    37 GLGuiPushButton::~GLGuiPushButton()
    38 {
     35  /**
     36   * standard deconstructor
     37  */
     38  GLGuiPushButton::~GLGuiPushButton()
     39  {
     40  }
    3941
     42  /**
     43   * initializes the GUI-element
     44   */
     45  void GLGuiPushButton::init()
     46  {
     47    this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton");
     48    this->frontMat.setDiffuse(1,0,0);
     49    //  this->label->setRelCoor2D(10, 10);
     50  }
     51
     52  /**
     53   * draws the GLGuiPushButton
     54   */
     55  void GLGuiPushButton::draw() const
     56  {
     57    this->startDraw();
     58
     59    //  GLGuiButton::draw();
     60
     61    this->frontMat.select();
     62    glBegin(GL_QUADS);
     63
     64    glVertex2d(0,0);
     65    glVertex2d(0, this->getSizeY2D());
     66    glVertex2d(this->getSizeX2D(), this->getSizeY2D());
     67    glVertex2d(this->getSizeX2D(),0);
     68
     69    glEnd();
     70
     71    this->endDraw();
     72    //   this->label->draw();
     73    //  printf("test");
     74  }
     75
     76  /**
     77   * updates the GLGuiPushButton
     78   */
     79  void GLGuiPushButton::update()
     80  {
     81
     82  }
    4083}
    41 
    42 /**
    43  * initializes the GUI-element
    44  */
    45 void GLGuiPushButton::init()
    46 {
    47   this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton");
    48   this->frontMat.setDiffuse(1,0,0);
    49 //  this->label->setRelCoor2D(10, 10);
    50 }
    51 
    52 /**
    53  * draws the GLGuiPushButton
    54  */
    55 void GLGuiPushButton::draw() const
    56 {
    57   this->startDraw();
    58 
    59 //  GLGuiButton::draw();
    60 
    61   this->frontMat.select();
    62   glBegin(GL_QUADS);
    63 
    64   glVertex2d(0,0);
    65   glVertex2d(0, this->getSizeY2D());
    66   glVertex2d(this->getSizeX2D(), this->getSizeY2D());
    67   glVertex2d(this->getSizeX2D(),0);
    68 
    69   glEnd();
    70 
    71   this->endDraw();
    72 //   this->label->draw();
    73 //  printf("test");
    74 }
    75 
    76 /**
    77  * updates the GLGuiPushButton
    78  */
    79 void GLGuiPushButton::update()
    80 {
    81 
    82 
    83 }
  • trunk/src/lib/gui/gl_gui/glgui_pushbutton.h

    r5395 r7779  
    1010#include "glgui_button.h"
    1111
    12 // FORWARD DECLARATION
     12namespace OrxGui
     13{
    1314
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiPushButton : public GLGuiButton {
     15  // FORWARD DECLARATION
    1916
    20  public:
    21   GLGuiPushButton();
    22   virtual ~GLGuiPushButton();
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiPushButton : public GLGuiButton
     22  {
    2323
    24   void init();
     24  public:
     25    GLGuiPushButton();
     26    virtual ~GLGuiPushButton();
    2527
    26   virtual void draw() const;
    27   virtual void update();
    28  private:
     28    void init();
    2929
    30 };
     30    virtual void draw() const;
     31    virtual void update();
     32  private:
    3133
     34  };
     35}
    3236#endif /* _GLGUI_PUSHBUTTON_H */
  • trunk/src/lib/gui/gl_gui/glgui_slider.cc

    r5365 r7779  
    1818#include "glgui_slider.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiSlider::GLGuiSlider ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGuiSlider::GLGuiSlider ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGuiSlider::~GLGuiSlider()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGuiSlider::~GLGuiSlider()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  void GLGuiSlider::init()
     44  {
     45    this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider");
     46
     47  }
     48
     49  /**
     50   * draws the GLGuiSlider
     51   */
     52  void GLGuiSlider::draw()
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiSlider::init()
    44 {
    45   this->setClassID(CL_GLGUI_SLIDER, "GLGuiSlider");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGuiSlider
    51  */
    52 void GLGuiSlider::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_slider.h

    r5365 r7779  
    1010#include "base_object.h"
    1111
    12 // FORWARD DECLARATION
    1312
    14 //! This is part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiSlider : public GLGuiSlider {
     13namespace OrxGui
     14{
     15  // FORWARD DECLARATION
    1916
    20  public:
    21   GLGuiSlider();
    22   virtual ~GLGuiSlider();
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiSlider : public GLGuiSlider
     22  {
    2323
    24   void init();
     24  public:
     25    GLGuiSlider();
     26    virtual ~GLGuiSlider();
    2527
    26   virtual void draw();
     28    void init();
    2729
    28  private:
     30    virtual void draw();
    2931
    30 };
     32  private:
    3133
     34  };
     35}
    3236#endif /* _GLGUI_SLIDER_H */
  • trunk/src/lib/gui/gl_gui/glgui_text.cc

    r5365 r7779  
    2020#include "text.h"
    2121
    22 using namespace std;
     22namespace OrxGui
     23{
     24  /**
     25   * standard constructor
     26  */
     27  GLGuiText::GLGuiText ()
     28  {
     29    this->init();
    2330
    24 /**
    25  * standard constructor
    26 */
    27 GLGuiText::GLGuiText ()
    28 {
    29   this->init();
    30 
    31 }
     31  }
    3232
    3333
    34 /**
    35  * standard deconstructor
    36 */
    37 GLGuiText::~GLGuiText()
    38 {
     34  /**
     35   * standard deconstructor
     36  */
     37  GLGuiText::~GLGuiText()
     38  {
     39  }
    3940
     41  /**
     42   * initializes the GUI-element
     43   */
     44  void GLGuiText::init()
     45  {
     46    this->setClassID(CL_GLGUI_, "GLGuiText");
     47
     48  }
     49
     50  /**
     51   * draws the GLGuiText
     52   */
     53  void GLGuiText::draw()
     54  {
     55  }
    4056}
    41 
    42 /**
    43  * initializes the GUI-element
    44  */
    45 void GLGuiText::init()
    46 {
    47   this->setClassID(CL_GLGUI_, "GLGuiText");
    48 
    49 }
    50 
    51 /**
    52  * draws the GLGuiText
    53  */
    54 void GLGuiText::draw()
    55 {
    56 
    57 }
  • trunk/src/lib/gui/gl_gui/glgui_text.h

    r5365 r7779  
    1212// FORWARD DECLARATION
    1313class Text;
     14namespace OrxGui
     15{
    1416
    15 //! This is part of the openglGUI class
    16 /**
    17  *
    18  */
    19 class GLGuiText : public GLWidget {
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiText : public GLWidget
     22  {
    2023
    21  public:
    22   GLGuiText();
    23   virtual ~GLGuiText();
     24  public:
     25    GLGuiText();
     26    virtual ~GLGuiText();
    2427
    25   void init();
     28    void init();
    2629
    27   virtual void draw();
     30    virtual void draw();
    2831
    29  private:
    30   Text*             text;
    31 };
     32  private:
     33    Text*             text;
     34  };
     35}
    3236
    3337#endif /* _GLGUI_TEXT_H */
  • trunk/src/lib/gui/gl_gui/glgui_textfield.cc

    r5365 r7779  
    1717
    1818#include "glgui_textfield_.h"
     19namespace OrxGui
     20{
    1921
    20 using namespace std;
     22  /**
     23   * standard constructor
     24  */
     25  GLGuiTextfield::GLGuiTextfield ()
     26  {
     27    this->init();
    2128
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiTextfield::GLGuiTextfield ()
    26 {
    27   this->init();
    28 
    29 }
     29  }
    3030
    3131
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGuiTextfield::~GLGuiTextfield()
    36 {
     32  /**
     33   * standard deconstructor
     34  */
     35  GLGuiTextfield::~GLGuiTextfield()
     36  {
     37  }
    3738
     39  /**
     40   * initializes the GUI-element
     41   */
     42  void GLGuiTextfield::init()
     43  {
     44    this->setClassID(CL_GLGUI_, "GLGuiTextfield");
     45
     46  }
     47
     48  /**
     49   * draws the GLGuiTextfield
     50   */
     51  void GLGuiTextfield::draw()
     52  {
     53  }
    3854}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiTextfield::init()
    44 {
    45   this->setClassID(CL_GLGUI_, "GLGuiTextfield");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGuiTextfield
    51  */
    52 void GLGuiTextfield::draw()
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_textfield.h

    r5365 r7779  
    1212// FORWARD DECLARATION
    1313class Text;
    14 template<class T> class tList;
     14namespace OrxGui
     15{
    1516
    16 //! This is part of the openglGUI class
    17 /**
    18  *
    19  */
    20 class GLGuiTextfield : public GLGuiWidget {
     17  //! This is part of the openglGUI class
     18  /**
     19   *
     20   */
     21  class GLGuiTextfield : public GLGuiWidget
     22  {
    2123
    22  public:
    23   GLGuiTextfield();
    24   virtual ~GLGuiTextfield();
     24  public:
     25    GLGuiTextfield();
     26    virtual ~GLGuiTextfield();
    2527
    26   void init();
     28    void init();
    2729
    28   virtual void draw();
     30    virtual void draw();
    2931
    30  private:
    31   tList<Text>*      textLines;
     32  private:
     33    std::list<Text*>      textLines;
    3234
    33 };
    34 
     35  };
     36}
    3537#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r7062 r7779  
    2222#include "debug.h"
    2323
    24 using namespace std;
     24namespace OrxGui
     25{
    2526
    26 /**
    27  * standard constructor
    28 */
    29 GLGuiWidget::GLGuiWidget ( )
    30 {
    31   this->init();
    32 }
     27  /**
     28   * standard constructor
     29  */
     30  GLGuiWidget::GLGuiWidget ( )
     31  {
     32    this->init();
     33  }
    3334
    3435
    35 /**
    36  * standard deconstructor
    37  */
    38 GLGuiWidget::~GLGuiWidget()
    39 {
     36  /**
     37   * standard deconstructor
     38   */
     39  GLGuiWidget::~GLGuiWidget()
     40  {
     41  }
     42
     43
     44  /**
     45   * initializes the GUI-element
     46   */
     47  void GLGuiWidget::init()
     48  {
     49    this->setClassID(CL_GLGUI_WIDGET, "GLGuiWidget");
     50
     51    this->focusable = true;
     52    this->clickable = true;
     53    this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
     54    //  this->setParent2D((Element2D*)NULL);
     55
     56    this->backMat.setDiffuse(1.0, 1.0, 1.0);
     57
     58    this->frontModel = 0;
     59
     60    this->widgetSignals.resize(GLGuiSignalCount, NULL);
     61  }
     62
     63
     64  bool GLGuiWidget::focusOverWidget(float x, float y)
     65  {
     66    if (this->getAbsCoor2D().x < x && this->getAbsCoor2D().x+ this->getSizeX2D() > x &&
     67        this->getAbsCoor2D().y < y && this->getAbsCoor2D().y+ this->getSizeX2D() > y)
     68      return true;
     69    else
     70      return false;
     71  }
     72
     73  /**
     74   * @brief connects a Signal to the Gui-Elements' Event.
     75   * @param sinalType the Type of Signal to set. @see GLGuiSignalType
     76   * @param signal the name of the Signal
     77   */
     78  void GLGuiWidget::connectSignal(GLGuiSignalType signalType, BaseObject*, const Executor* signal)
     79  {
     80    if (signalType >= GLGuiSignalCount)
     81      return;
     82
     83    if (this->widgetSignals[signalType] != NULL)
     84      PRINTF(2)("Already connected a Signal to '%s::%s' type %s... overwriting\n", this->getClassName(), this->getName(), "TEST");
     85
     86    //this->widgetSignals[signalType] = ;
     87  }
     88
     89  /**
     90   * @brief removes a Signal from a Gui-ELements' Event
     91   * @param signalType the type of Signal to remove.
     92   */
     93  void GLGuiWidget::disconnectSignal(GLGuiSignalType signalType)
     94  {
     95    if (signalType > GLGuiSignalCount)
     96      return;
     97
     98    this->widgetSignals[signalType] = NULL;
     99  }
     100
     101
     102  void GLGuiWidget::show()
     103  {
     104    this->setVisibility(true);
     105  }
     106
     107  void GLGuiWidget::hide()
     108  {
     109    this->setVisibility(false);
     110  }
     111
     112
     113  void GLGuiWidget::draw() const
     114  {
     115    this->backMat.select();
     116
     117    glBegin(GL_QUADS);
     118    glTexCoord2i(0,1); glVertex2d(0, 0);
     119    glTexCoord2i(0,0); glVertex2d(0, this->getSizeY2D());
     120    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D(), this->getSizeY2D());
     121    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D(), 0);
     122    glEnd();
     123  }
    40124
    41125}
    42 
    43 
    44 /**
    45  * initializes the GUI-element
    46  */
    47 void GLGuiWidget::init()
    48 {
    49   this->setClassID(CL_GLGUI_WIDGET, "GLGuiWidget");
    50 
    51   this->focusable = true;
    52   this->clickable = true;
    53   this->setVisibility(GLGUI_WIDGET_DEFAULT_VISIBLE);
    54 //  this->setParent2D((Element2D*)NULL);
    55 
    56   this->backMat.setDiffuse(1.0, 1.0, 1.0);
    57 
    58   this->frontModel = 0;
    59 
    60   for (unsigned int i = 0; i < GLGuiSignalCount; i++)
    61     this->widgetSignals[i] = NULL;
    62 }
    63 
    64 
    65 bool GLGuiWidget::focusOverWidget(float x, float y)
    66 {
    67   if (this->getAbsCoor2D().x < x && this->getAbsCoor2D().x+ this->getSizeX2D() > x &&
    68       this->getAbsCoor2D().y < y && this->getAbsCoor2D().y+ this->getSizeX2D() > y)
    69     return true;
    70   else
    71     return false;
    72 }
    73 
    74 /**
    75  * @brief connects a Signal to the Gui-Elements' Event.
    76  * @param sinalType the Type of Signal to set. @see GLGuiSignalType
    77  * @param signal the name of the Signal
    78  */
    79 void GLGuiWidget::connectSignal(GLGuiSignalType signalType, const Executor& signal)
    80 {
    81   if (signalType >= GLGuiSignalCount)
    82     return;
    83 
    84   if (this->widgetSignals[signalType] != NULL)
    85     PRINTF(2)("Already connected a Signal to %s (%s) type %s... overwriting\n");
    86 
    87   this->widgetSignals[signalType] = signal.clone();
    88 }
    89 
    90 /**
    91  * @brief removes a Signal from a Gui-ELements' Event
    92  * @param signalType the type of Signal to remove.
    93  */
    94 void GLGuiWidget::disconnectSignal(GLGuiSignalType signalType)
    95 {
    96   if (signalType > GLGuiSignalCount)
    97     return;
    98 
    99   this->widgetSignals[signalType] = NULL;
    100 }
    101 
    102 
    103 void GLGuiWidget::show()
    104 {
    105   this->setVisibility(true);
    106 }
    107 
    108 void GLGuiWidget::hide()
    109 {
    110   this->setVisibility(false);
    111 }
    112 
    113 
    114 void GLGuiWidget::draw() const
    115 {
    116   this->backMat.select();
    117 
    118   glBegin(GL_QUADS);
    119    glTexCoord2i(0,1); glVertex2d(0, 0);
    120    glTexCoord2i(0,0); glVertex2d(0, this->getSizeY2D());
    121    glTexCoord2i(1,0); glVertex2d(this->getSizeX2D(), this->getSizeY2D());
    122    glTexCoord2i(1,1); glVertex2d(this->getSizeX2D(), 0);
    123   glEnd();
    124 }
    125 
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r7221 r7779  
    99#include "element_2d.h"
    1010#include "event.h"
    11 
    1211#include "material.h"
    1312
    1413#include "glincl.h"
    15 #include "executor/executor.h"
     14#include "signal_connector.h"
    1615
    1716// FORWARD DECLARATION
    1817class Material;
    1918
    20 typedef enum
     19namespace OrxGui
    2120{
    22   GLGuiSignal_click     = 0,
    23   GLGuiSignal_release,
    24   GLGuiSignal_rollOn,
    25   GLGuiSignal_rollOff,
    26   GLGuiSignal_open,
    27   GLGuiSignal_close,
    28   GLGuiSignal_destroy,
    2921
    30   GLGuiSignalCount,
    31 } GLGuiSignalType;
     22  typedef enum
     23  {
     24    GLGuiSignal_click     = 0,
     25    GLGuiSignal_release,
     26    GLGuiSignal_rollOn,
     27    GLGuiSignal_rollOff,
     28    GLGuiSignal_open,
     29    GLGuiSignal_close,
     30    GLGuiSignal_destroy,
    3231
    33 //! if the Element should be visible by default.
     32    GLGuiSignalCount,
     33  } GLGuiSignalType;
     34
     35  //! if the Element should be visible by default.
    3436#define GLGUI_WIDGET_DEFAULT_VISIBLE       false
    3537
    36 //! This is widget part of the openglGUI class
    37 /**
    38  * A widget is the main class of all the elements of th GUI.
    39  */
    40 class GLGuiWidget : public Element2D {
     38  //! This is widget part of the openglGUI class
     39  /**
     40   * A widget is the main class of all the elements of th GUI.
     41   */
     42  class GLGuiWidget : public Element2D
     43  {
     44  private:
     45
    4146  public:
    4247    GLGuiWidget();
    4348    virtual ~GLGuiWidget();
    4449
    45     void init();
    46     /** @returns a new char-array containing a string with the options. Delete with delete[]; */
    47     virtual char* save() {};
    48     /** loads options of the Widget. @param loadString a string containing the Options */
    49     virtual void load(const std::string& loadString) {};
    50 
    5150    void show();
    5251    void hide();
    5352
    54     void connectSignal(GLGuiSignalType signalType, const Executor& signal);
     53    void connectSignal(GLGuiSignalType signalType, BaseObject* obj, const Executor* signal);
    5554    void disconnectSignal(GLGuiSignalType signalType);
    5655    bool focusOverWidget(float x, float y);
     
    7372    inline void endDraw() const { glPopMatrix(); };
    7473
     74  private:
     75    void init();
     76
    7577  protected:
    76     Material              backMat;
    77     GLuint                backModel;
     78    Material               backMat;
     79    GLuint                 backModel;
    7880
    79     Material              frontMat;
    80     GLuint                frontModel;
     81    Material               frontMat;
     82    GLuint                 frontModel;
    8183
    8284  private:
    83     Executor*             widgetSignals[GLGuiSignalCount];
     85    std::vector<SignalConnector*> widgetSignals;
    8486
    85     bool                  focusable;        //!< If this widget can receive focus.
    86     bool                  clickable;        //!< if this widget can be clicked upon.
    87 };
    88 
     87    bool                   focusable;        //!< If this widget can receive focus.
     88    bool                   clickable;        //!< if this widget can be clicked upon.
     89  };
     90}
    8991#endif /* _GLGUI_WIDGET_H */
  • trunk/src/lib/gui/gl_gui/glgui_window.cc

    r6287 r7779  
    1818#include "glgui_window.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 /**
    23  * standard constructor
    24 */
    25 GLGuiWindow::GLGuiWindow ()
    26 {
    27   this->init();
     23  /**
     24   * standard constructor
     25  */
     26  GLGuiWindow::GLGuiWindow ()
     27  {
     28    this->init();
    2829
    29 }
     30  }
    3031
    3132
    32 /**
    33  * standard deconstructor
    34 */
    35 GLGuiWindow::~GLGuiWindow()
    36 {
     33  /**
     34   * standard deconstructor
     35  */
     36  GLGuiWindow::~GLGuiWindow()
     37  {
     38  }
    3739
     40  /**
     41   * initializes the GUI-element
     42   */
     43  void GLGuiWindow::init()
     44  {
     45    this->setClassID(CL_GLGUI_WINDOW, "GLGuiWindow");
     46
     47  }
     48
     49  /**
     50   * draws the GLGuiWindow
     51   */
     52  void GLGuiWindow::draw() const
     53  {
     54  }
    3855}
    39 
    40 /**
    41  * initializes the GUI-element
    42  */
    43 void GLGuiWindow::init()
    44 {
    45   this->setClassID(CL_GLGUI_WINDOW, "GLGuiWindow");
    46 
    47 }
    48 
    49 /**
    50  * draws the GLGuiWindow
    51  */
    52 void GLGuiWindow::draw() const
    53 {
    54 
    55 }
  • trunk/src/lib/gui/gl_gui/glgui_window.h

    r6287 r7779  
    1111
    1212// FORWARD DECLARATION
     13namespace OrxGui
     14{
    1315
    14 //! This is window part of the openglGUI class
    15 /**
    16  *
    17  */
    18 class GLGuiWindow : public GLGuiContainer {
     16  //! This is window part of the openglGUI class
     17  /**
     18   *
     19   */
     20  class GLGuiWindow : public GLGuiContainer
     21  {
    1922
    20  public:
    21   GLGuiWindow();
    22   virtual ~GLGuiWindow();
     23  public:
     24    GLGuiWindow();
     25    virtual ~GLGuiWindow();
    2326
    24   void init();
     27    void init();
    2528
    26   virtual void draw() const;
     29    virtual void draw() const;
    2730
    28  private:
     31  private:
    2932
    30 };
    31 
     33  };
     34}
    3235#endif /* _GLGUI__H */
  • trunk/src/lib/gui/gl_gui/signal_connector.cc

    r7778 r7779  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "signal_connector.h"
    1919
    20 using namespace std;
     20namespace OrxGui
     21{
    2122
    22 
    23 /**
    24  * standard constructor
    25  * @todo this constructor is not jet implemented - do it
    26 */
    27 ProtoClass::ProtoClass ()
    28 {
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
    30 
    31    /* If you make a new class, what is most probably the case when you write this file
    32       don't forget to:
    33        1. Add the new file new_class.cc to the ./src/Makefile.am
    34        2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS
    35 
    36       Advanced Topics:
    37       - if you want to let your object be managed via the ObjectManager make sure to read
    38         the object_manager.h header comments. You will use this most certanly only if you
    39         make many objects of your class, like a weapon bullet.
    40    */
     23  SignalConnector::SignalConnector(BaseObject* object, const Executor* executor)
     24      : object(object), exec(exec)
     25  {};
    4126}
    42 
    43 
    44 /**
    45  * standard deconstructor
    46 */
    47 ProtoClass::~ProtoClass ()
    48 {
    49   // delete what has to be deleted here
    50 }
  • trunk/src/lib/gui/gl_gui/signal_connector.h

    r7778 r7779  
    11/*!
    2  * @file proto_class.h
     2 * @file signal_connector.h
    33 * @brief Definition of ...
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _SIGNAL_CONNECTOR_H
     7#define _SIGNAL_CONNECTOR_H
    88
    9 #include "base_object.h"
     9#include "executor/executor.h"
    1010
    11 // FORWARD DECLARATION
     11namespace OrxGui
     12{
     13  //! A class for ...
     14  class SignalConnector
     15  {
     16  public:
     17    SignalConnector(BaseObject* object, const Executor* exec);
     18    SignalConnector(const SignalConnector& signalConnector);
     19    ~SignalConnector() { delete exec; }
    1220
     21    SignalConnector& operator=(const SignalConnector& signalConnector);
    1322
    14 
    15 //! A class for ...
    16 class ProtoClass : public BaseObject {
    17 
    18  public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
    21 
    22 
    23  private:
    24 
    25 };
    26 
    27 #endif /* _PROTO_CLASS_H */
     23  private:
     24    const Executor*     exec;
     25    BaseObject*         object;
     26  };
     27}
     28#endif /* _SIGNAL_CONNECTOR_H */
  • trunk/src/lib/lang/base_object.h

    r7661 r7779  
    2828 public:
    2929   BaseObject (const std::string& objectName = "");
     30
    3031  virtual ~BaseObject ();
    3132
  • trunk/src/util/hud.h

    r7062 r7779  
    1515
    1616//! A class that renders a HUD.
    17 class Hud : public GLGuiWidget
     17class Hud : public OrxGui::GLGuiWidget
    1818{
    1919
  • trunk/src/world_entities/weapons/weapon.cc

    r7729 r7779  
    307307}
    308308
    309 GLGuiWidget* Weapon::getEnergyWidget()
     309OrxGui::GLGuiWidget* Weapon::getEnergyWidget()
    310310{
    311311  if (this->energyWidget == NULL)
    312312  {
    313     this->energyWidget = new GLGuiBar;
     313    this->energyWidget = new OrxGui::GLGuiBar;
    314314    this->energyWidget->setSize2D( 20, 100);
    315315    this->energyWidget->setMaximum(this->getEnergyMax());
  • trunk/src/world_entities/weapons/weapon.h

    r7460 r7779  
    2525class TiXmlElement;
    2626class FastFactory;
     27namespace OrxGui{ class GLGuiWidget; }
    2728template<class T> class tFastFactory;
    28 class GLGuiWidget;
    2929
    3030//! An enumerator defining Actions a Weapon can take
     
    156156    Animation3D* copyAnimation(WeaponState from, WeaponState to);
    157157
    158     GLGuiWidget* getEnergyWidget();
     158    OrxGui::GLGuiWidget* getEnergyWidget();
    159159
    160160    // FLOW
     
    211211    float                maxCharge;                        //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled)
    212212
    213     GLGuiBar*            energyWidget;
     213    OrxGui::GLGuiBar*    energyWidget;
    214214
    215215    PNode*               defaultTarget;                    //!< A target for targeting Weapons.
  • trunk/src/world_entities/world_entity.cc

    r7711 r7779  
    406406  if (this->healthWidget == NULL)
    407407  {
    408     this->healthWidget = new GLGuiBar();
     408    this->healthWidget = new OrxGui::GLGuiBar();
    409409    this->healthWidget->setSize2D(30,400);
    410410    this->healthWidget->setAbsCoor2D(10,100);
     
    423423
    424424
    425 GLGuiWidget* WorldEntity::getHealthWidget()
     425OrxGui::GLGuiWidget* WorldEntity::getHealthWidget()
    426426{
    427427  this->createHealthWidget();
  • trunk/src/world_entities/world_entity.h

    r7711 r7779  
    1717// FORWARD DECLARATION
    1818namespace OrxSound { class SoundBuffer; class SoundSource; }
     19namespace OrxGui { class GLGuiWidget; class GLGuiBar; };
     20
    1921class BVTree;
    2022class Model;
    21 
    22 class GLGuiWidget;
    23 class GLGuiBar;
    2423
    2524//class CharacterAttributes;
     
    9190  float decreaseHealth(float health);
    9291  void increaseHealthMax(float increaseHealth);
    93   GLGuiWidget* getHealthWidget();
     92  OrxGui::GLGuiWidget* getHealthWidget();
    9493  bool hasHealthWidget() const { return this->healthWidget; };
    9594
     
    108107  float                   health;             //!< The Energy of this Entity, if the Entity has any energy at all.
    109108  float                   healthMax;          //!< The Maximal energy this entity can take.
    110   GLGuiBar*               healthWidget;       //!< The Slider (if wanted).
     109  OrxGui::GLGuiBar*       healthWidget;       //!< The Slider (if wanted).
    111110
    112111  std::vector<Model*>     models;             //!< The model that should be loaded for this entity.
Note: See TracChangeset for help on using the changeset viewer.