|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r48671 - in sandbox/guigl: boost/guigl boost/guigl/view boost/guigl/view/impl boost/guigl/widget libs/guigl/build/xcodeide/guigl.xcodeproj
From: stipe_at_[hidden]
Date: 2008-09-08 16:20:22
Author: srajko
Date: 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
New Revision: 48671
URL: http://svn.boost.org/trac/boost/changeset/48671
Log:
guigl components, example expanded
Text files modified:
sandbox/guigl/boost/guigl/view/active_colored.hpp | 9 ++++++++-
sandbox/guigl/boost/guigl/view/base.hpp | 3 ---
sandbox/guigl/boost/guigl/view/clickable.hpp | 5 +++++
sandbox/guigl/boost/guigl/view/colored.hpp | 3 ++-
sandbox/guigl/boost/guigl/view/compound.hpp | 2 +-
sandbox/guigl/boost/guigl/view/draggable.hpp | 6 ++++--
sandbox/guigl/boost/guigl/view/impl/colored.hpp | 6 ------
sandbox/guigl/boost/guigl/view/impl/compound.hpp | 5 -----
sandbox/guigl/boost/guigl/view/impl/draggable.hpp | 12 ------------
sandbox/guigl/boost/guigl/view/impl/labeled.hpp | 6 ------
sandbox/guigl/boost/guigl/view/impl/solid_background.hpp | 6 ------
sandbox/guigl/boost/guigl/view/impl/window.hpp | 6 ------
sandbox/guigl/boost/guigl/view/labeled.hpp | 2 +-
sandbox/guigl/boost/guigl/view/positioned.hpp | 11 ++++++++++-
sandbox/guigl/boost/guigl/view/solid_background.hpp | 8 +++++++-
sandbox/guigl/boost/guigl/view/window.hpp | 2 +-
sandbox/guigl/boost/guigl/widget/button.hpp | 1 +
sandbox/guigl/boost/guigl/widget/slider.hpp | 6 ++++++
sandbox/guigl/boost/guigl/window.hpp | 6 +++++-
sandbox/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj | 6 +++++-
20 files changed, 56 insertions(+), 55 deletions(-)
Modified: sandbox/guigl/boost/guigl/view/active_colored.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/active_colored.hpp (original)
+++ sandbox/guigl/boost/guigl/view/active_colored.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -13,23 +13,30 @@
namespace boost { namespace guigl { namespace view {
+/// Behavior adding a modifiable active color which can be used for drawing.
template<typename BaseView=base>
class active_colored : public BaseView
{
typedef BaseView base_type;
public:
+ /** Sets the active color to the _active_color named parameter. */
template<typename ArgumentPack>
active_colored(const ArgumentPack &args)
: base_type(args)
, m_active_color(args[_active_color])
{}
+ /** Returns the active color. */
const color_type &active_color() const
{ return m_active_color; }
- const void active_color(const color_type &color)
+ /** Sets the active color. */
+ const void set_active_color(const color_type &color)
{ m_active_color = color; }
+
protected:
+ /** Sets the OpenGL drawing color to the active color. */
void use_active_color();
+
private:
color_type m_active_color;
};
Modified: sandbox/guigl/boost/guigl/view/base.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/base.hpp (original)
+++ sandbox/guigl/boost/guigl/view/base.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -50,9 +50,6 @@
}}}
-#define BOOST_GUIGL_DRAW \
- void draw_prologue(); \
- void draw_epilogue(); \
#define BOOST_GUIGL_WIDGET_DRAW \
friend class ::boost::guigl::access; \
Modified: sandbox/guigl/boost/guigl/view/clickable.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/clickable.hpp (original)
+++ sandbox/guigl/boost/guigl/view/clickable.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -20,6 +20,11 @@
}
+/// Behavior capturing clicking.
+/** clickable adds clicking behavior to the view.
+ The Derived class must have the method clickable_on_click(), which
+ will be called when the user completes a click in the view.
+*/
template<typename Derived, typename BaseView=base>
class clickable : public BaseView
{
Modified: sandbox/guigl/boost/guigl/view/colored.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/colored.hpp (original)
+++ sandbox/guigl/boost/guigl/view/colored.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -28,8 +28,9 @@
{ return m_color; }
const void set_color(const color_type &color)
{ m_color = color; }
+
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
private:
color_type m_color;
Modified: sandbox/guigl/boost/guigl/view/compound.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/compound.hpp (original)
+++ sandbox/guigl/boost/guigl/view/compound.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -46,7 +46,7 @@
{ return m_children; }
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
ptr_vector<positioned<> > &children()
{ return m_children; }
Modified: sandbox/guigl/boost/guigl/view/draggable.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/draggable.hpp (original)
+++ sandbox/guigl/boost/guigl/view/draggable.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -21,6 +21,10 @@
}
+/// Behavior capturing dragging.
+/** Behavior capturing dragging (moving the mouse over the view with the button
+ held down).
+*/
template<typename Derived, typename BaseView=base>
class draggable : public mouse_tracking<BaseView>
{
@@ -32,8 +36,6 @@
{}
protected:
- BOOST_GUIGL_DRAW
-
bool on_event(const event_type &event_info);
private:
Modified: sandbox/guigl/boost/guigl/view/impl/colored.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/colored.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/colored.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -21,12 +21,6 @@
BaseView::draw_prologue();
glColor3d(m_color[0], m_color[1], m_color[2]);
}
-
-template<typename BaseView>
-inline void colored<BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
}}}
Modified: sandbox/guigl/boost/guigl/view/impl/compound.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/compound.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/compound.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -26,11 +26,6 @@
access::draw(*it);
}
-template<typename BaseView>
-inline void compound<BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
namespace detail {
Modified: sandbox/guigl/boost/guigl/view/impl/draggable.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/draggable.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/draggable.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -16,18 +16,6 @@
namespace boost { namespace guigl { namespace view {
-template<typename Derived, typename BaseView>
-inline void draggable<Derived, BaseView>::draw_prologue()
-{
- BaseView::draw_prologue();
-}
-
-template<typename Derived, typename BaseView>
-inline void draggable<Derived, BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
-
namespace detail {
template<typename Derived, typename BaseView>
Modified: sandbox/guigl/boost/guigl/view/impl/labeled.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/labeled.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/labeled.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -25,12 +25,6 @@
for (std::string::const_iterator it=m_label.begin(); it!=m_label.end(); it++)
glutBitmapCharacter(GLUT_BITMAP_9_BY_15, *it);
}
-
-template<typename BaseView>
-inline void labeled<BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
}}}
Modified: sandbox/guigl/boost/guigl/view/impl/solid_background.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/solid_background.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/solid_background.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -25,12 +25,6 @@
glRectd(0.0, 0.0, solid_background::size().x, solid_background::size().y);
}
-template<typename BaseView>
-inline void solid_background<BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
-
}}}
#endif // BOOST__GUIGL__VIEW__IMPL__SOLID_BACKGROUND_HPP
\ No newline at end of file
Modified: sandbox/guigl/boost/guigl/view/impl/window.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/impl/window.hpp (original)
+++ sandbox/guigl/boost/guigl/view/impl/window.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -32,12 +32,6 @@
glClear(GL_COLOR_BUFFER_BIT);
}
-template<typename BaseView>
-inline void window<BaseView>::draw_epilogue()
-{
- BaseView::draw_epilogue();
-}
-
}}}
#endif // BOOST__GUIGL__VIEW__IMPL__WINDOW_HPP
\ No newline at end of file
Modified: sandbox/guigl/boost/guigl/view/labeled.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/labeled.hpp (original)
+++ sandbox/guigl/boost/guigl/view/labeled.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -28,7 +28,7 @@
{ return m_label; }
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
private:
std::string m_label;
Modified: sandbox/guigl/boost/guigl/view/positioned.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/positioned.hpp (original)
+++ sandbox/guigl/boost/guigl/view/positioned.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -23,6 +23,11 @@
struct is_positioned<base> : public mpl::false_
{};
+/// Behavior adding a position to the view.
+/** positioned adds a position to the inheriting view. Since it is intended for
+ views that are positioned inside other views, it also has a pointer to
+ a possible parent view.
+*/
template<typename BaseView=base>
class positioned : public BaseView
{
@@ -35,9 +40,12 @@
, m_parent(0)
{}
+ /** Returns the position */
const position_type &position() const
{ return m_position; }
+ /** Returns the topmost ancestor, as defined by following the parent pointer
+ as long as the parent is also a positioned<> view. */
const base *root() const
{
const base *root = this;
@@ -48,7 +56,8 @@
}
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
+ void draw_epilogue();
friend class access;
void parent(base &parent)
Modified: sandbox/guigl/boost/guigl/view/solid_background.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/solid_background.hpp (original)
+++ sandbox/guigl/boost/guigl/view/solid_background.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -15,6 +15,7 @@
namespace boost { namespace guigl { namespace view {
+/// Behavior adding a solid background color over the area of the view.
template<typename BaseView=base>
class solid_background : public BaseView
{
@@ -27,11 +28,16 @@
, m_background_color(args[_background])
{}
+ /** Returns the bacground color. */
const color_type &background_color() const
{ return m_background_color; }
+ /** Sets the background color. */
+ void set_background_color(const color_type &color)
+ { m_background_color = color; }
+
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
private:
color_type m_background_color;
Modified: sandbox/guigl/boost/guigl/view/window.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/view/window.hpp (original)
+++ sandbox/guigl/boost/guigl/view/window.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -29,7 +29,7 @@
{ return m_background_color; }
protected:
- BOOST_GUIGL_DRAW
+ void draw_prologue();
private:
color_type m_background_color;
Modified: sandbox/guigl/boost/guigl/widget/button.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/widget/button.hpp (original)
+++ sandbox/guigl/boost/guigl/widget/button.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -26,6 +26,7 @@
view::positioned<>
> > > button_base_type;
+/// A button which sends a signal when clicked.
class button : public button_base_type
{
typedef button_base_type base_type;
Modified: sandbox/guigl/boost/guigl/widget/slider.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/widget/slider.hpp (original)
+++ sandbox/guigl/boost/guigl/widget/slider.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -26,6 +26,7 @@
view::positioned<>
> > > slider_base_type;
+/// A slider storing a floating point value, changable by dragging in the GUI.
class slider : public slider_base_type
{
typedef slider_base_type base_type;
@@ -36,9 +37,14 @@
, m_value(0)
{}
+ /// Signal emitting changed values.
boost::signal<void(const double &)> on_value_change;
+
+ /// Returns the value of the slider.
double value()
{ return m_value; }
+
+ /// Sets the value of the slider.
void set_value(double value)
{
m_value = value;
Modified: sandbox/guigl/boost/guigl/window.hpp
==============================================================================
--- sandbox/guigl/boost/guigl/window.hpp (original)
+++ sandbox/guigl/boost/guigl/window.hpp 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -22,13 +22,17 @@
namespace boost { namespace guigl {
+/// A window placed on the user's desktop.
class window : public guigl::widget::window, boost::noncopyable
{
typedef argument_pack<tag::label, tag::size, tag::position, tag::background>::type
argument_pack_type;
public:
- window(const argument_pack_type &map);
+ /// Constructor taking named parameters.
+ /** \param args A pack of named parameters (accepts _label, _size, _position, _background).
+ */
+ window(const argument_pack_type &args);
~window();
static void redraw(const view::positioned<> &v);
Modified: sandbox/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj
==============================================================================
--- sandbox/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj (original)
+++ sandbox/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj 2008-09-08 16:20:20 EDT (Mon, 08 Sep 2008)
@@ -96,6 +96,8 @@
081B078D0E5FF94A00EF7F91 /* draggable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = draggable.hpp; sourceTree = "<group>"; };
081B07900E5FF9B000EF7F91 /* draggable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = draggable.hpp; sourceTree = "<group>"; };
081B07930E5FFBEC00EF7F91 /* mouse_tracking.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = mouse_tracking.hpp; sourceTree = "<group>"; };
+ 088513240E689E650089DAD3 /* Jamfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.jam; path = Jamfile; sourceTree = "<group>"; };
+ 0885132B0E68AEC70089DAD3 /* guigl.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = guigl.qbk; sourceTree = "<group>"; };
0885D4290E539AF600DFFA5D /* test_field_map_compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_field_map_compilation.cpp; sourceTree = "<group>"; };
0885D4300E539B5F00DFFA5D /* test_parameter_compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_parameter_compilation.cpp; sourceTree = "<group>"; };
0885D46A0E539F7000DFFA5D /* test_parameter_dispatch_compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_parameter_dispatch_compilation.cpp; sourceTree = "<group>"; };
@@ -357,6 +359,8 @@
08FD5DE40C1BA60700F00877 /* doc */ = {
isa = PBXGroup;
children = (
+ 088513240E689E650089DAD3 /* Jamfile */,
+ 0885132B0E68AEC70089DAD3 /* guigl.qbk */,
);
name = doc;
path = ../../doc;
@@ -462,7 +466,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "style=`echo $BUILD_STYLE | sed 'y/DR/dr/'` \ncd ../../doc\nbjam --v2 --toolset=darwin $style";
+ shellScript = "style=`echo $BUILD_STYLE | sed 'y/DR/dr/'` \ncd ../../doc\nbjam $style";
};
08FD5E6E0C1BA8BC00F00877 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk