Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51831 - in sandbox-branches/andreo/guigl: boost/guigl/view/impl boost/guigl/view/impl/detail libs/guigl/build/xcodeide/guigl.xcodeproj libs/guigl/example
From: andreytorba_at_[hidden]
Date: 2009-03-18 07:45:57


Author: andreo
Date: 2009-03-18 07:45:55 EDT (Wed, 18 Mar 2009)
New Revision: 51831
URL: http://svn.boost.org/trac/boost/changeset/51831

Log:
modified event propagation order so the events are processed in the reverse order of the child widgets being drawn
Text files modified:
   sandbox-branches/andreo/guigl/boost/guigl/view/impl/detail/algorithm.hpp | 14 ++++++++++++++
   sandbox-branches/andreo/guigl/boost/guigl/view/impl/static_compound.hpp | 4 ++--
   sandbox-branches/andreo/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj | 2 ++
   sandbox-branches/andreo/guigl/libs/guigl/example/Jamfile | 3 ++-
   4 files changed, 20 insertions(+), 3 deletions(-)

Modified: sandbox-branches/andreo/guigl/boost/guigl/view/impl/detail/algorithm.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/view/impl/detail/algorithm.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/view/impl/detail/algorithm.hpp 2009-03-18 07:45:55 EDT (Wed, 18 Mar 2009)
@@ -15,6 +15,7 @@
 #include <boost/fusion/include/is_sequence.hpp>
 #include <boost/fusion/include/for_each.hpp>
 #include <boost/fusion/include/accumulate.hpp>
+#include <boost/fusion/view/reverse_view.hpp>
 #include <boost/utility/enable_if.hpp>
 
 //#include <boost/range/algorithm.hpp>
@@ -53,6 +54,19 @@
         return std::accumulate(sequence.begin(), sequence.end(), init, boost::bind(f,_2,_1));
     }
 
+ template<typename Sequence, typename Init, typename F>
+ typename boost::enable_if<fusion::traits::is_sequence<Sequence>, Init >::type
+ reverse_accumulate(Sequence &sequence, const Init &init, const F&f)
+ {
+ return fusion::accumulate(fusion::reverse_view<Sequence>(sequence), init, f);
+ }
+
+ template<typename Sequence, typename Init, typename F>
+ typename boost::disable_if<fusion::traits::is_sequence<Sequence>, Init >::type
+ reverse_accumulate(Sequence &sequence, const Init &init, const F&f)
+ {
+ return std::accumulate(sequence.rbegin(), sequence.rend(), init, boost::bind(f,_2,_1));
+ }
 }
 
 }}}

Modified: sandbox-branches/andreo/guigl/boost/guigl/view/impl/static_compound.hpp
==============================================================================
--- sandbox-branches/andreo/guigl/boost/guigl/view/impl/static_compound.hpp (original)
+++ sandbox-branches/andreo/guigl/boost/guigl/view/impl/static_compound.hpp 2009-03-18 07:45:55 EDT (Wed, 18 Mar 2009)
@@ -177,12 +177,12 @@
 
             access::on_event(*view.m_button_focus_child, translated_event_info);
         }
- return detail::accumulate(view.children(), false, propagate_button_event<static_compound_event_visitor>(*this, event_info));
+ return detail::reverse_accumulate(view.children(), false, propagate_button_event<static_compound_event_visitor>(*this, event_info));
     }
     
     bool operator()(const movement_event &event_info) const
     {
- return detail::accumulate(view.children(), false, propagate_movement_event<static_compound_event_visitor>(*this, event_info));
+ return detail::reverse_accumulate(view.children(), false, propagate_movement_event<static_compound_event_visitor>(*this, event_info));
     }
 
     bool operator()(const entry_exit_event &event_info) const

Modified: sandbox-branches/andreo/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/build/xcodeide/guigl.xcodeproj/project.pbxproj 2009-03-18 07:45:55 EDT (Wed, 18 Mar 2009)
@@ -87,6 +87,7 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXFileReference section */
+ 08177B6C0F703A48003A0028 /* overlapping_example.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = overlapping_example.cpp; sourceTree = "<group>"; };
                 081B05C30E5FCCB600EF7F91 /* clickable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clickable.hpp; sourceTree = "<group>"; };
                 081B05CA0E5FCE1300EF7F91 /* clickable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = clickable.hpp; sourceTree = "<group>"; };
                 081B06720E5FD90300EF7F91 /* labeled_button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = labeled_button.cpp; sourceTree = "<group>"; };
@@ -230,6 +231,7 @@
                                 089C81F20E7D949400CE0901 /* two_buttons.cpp */,
                                 089D7E0E0F3B75C800590295 /* custom_example.cpp */,
                                 08A19B410F3F7D930003AC68 /* window_only_example.cpp */,
+ 08177B6C0F703A48003A0028 /* overlapping_example.cpp */,
                         );
                         name = example;
                         path = ../../example;

Modified: sandbox-branches/andreo/guigl/libs/guigl/example/Jamfile
==============================================================================
--- sandbox-branches/andreo/guigl/libs/guigl/example/Jamfile (original)
+++ sandbox-branches/andreo/guigl/libs/guigl/example/Jamfile 2009-03-18 07:45:55 EDT (Wed, 18 Mar 2009)
@@ -25,9 +25,10 @@
 
 exe custom_example : custom_example.cpp ;
 exe window_only_example : window_only_example.cpp ;
+exe overlapping_example : overlapping_example.cpp ;
 
 install window_example_stage
- : window_example custom_example window_only_example
+ : window_example custom_example window_only_example overlapping_example
     : <install-dependencies>on <install-type>EXE
       <install-type>LIB <location>$(TOP)/bin/stage/window_example
     ;


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