Boost logo

Boost-Commit :

From: stipe_at_[hidden]
Date: 2007-12-24 20:10:22


Author: srajko
Date: 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
New Revision: 42287
URL: http://svn.boost.org/trac/boost/changeset/42287

Log:
first version of GUI done
Added:
   sandbox/SOC/2007/signals/libs/dataflow/doc/blueprint_screenshot.png (contents, props changed)
   sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/gui_example.qbk (contents, props changed)
Text files modified:
   sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj | 2
   sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk | 8 ++
   sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk | 22 ++++--
   sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/introduction.qbk | 21 +++++
   sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/vtk_example.qbk | 121 +++++++++++----------------------------
   sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk | 47 ++++++++++----
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx | 30 +++++++++
   sandbox/SOC/2007/signals/libs/dataflow/example/VTK/vtk_dataflow_support.hpp | 50 +++++++--------
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintBank.cpp | 2
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.cpp | 39 ++++++++++-
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.hpp | 14 +++
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.cpp | 104 +++++++++++++++++++++++++++++++++
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.hpp | 17 +++++
   sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/fltk_gui_example.cpp | 90 +++++++++++++++++++++-------
   sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp | 4
   15 files changed, 393 insertions(+), 178 deletions(-)

Modified: sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/build/xcodeide/signal_network.xcodeproj/project.pbxproj 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -230,6 +230,7 @@
                 08F59F820D01C122007CD201 /* support.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = support.qbk; sourceTree = "<group>"; };
                 08F5FF070D07082200FDBAEE /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Jamfile.v2; sourceTree = "<group>"; };
                 08F5FF130D070A1400FDBAEE /* test_port.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_port.cpp; sourceTree = "<group>"; };
+ 08F687D30D20415C006DB5BB /* gui_example.qbk */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gui_example.qbk; sourceTree = "<group>"; };
                 08F71D3E0CA3547C0010099E /* Jamfile.v2 */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Jamfile.v2; sourceTree = "<group>"; };
                 08F71D3F0CA3547C0010099E /* test_bind_object.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_bind_object.cpp; sourceTree = "<group>"; };
                 08F71D400CA3547C0010099E /* test_branching.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = test_branching.cpp; sourceTree = "<group>"; };
@@ -548,6 +549,7 @@
                                 08F264790CEA9DE800DA01C9 /* gil_example.qbk */,
                                 08F2647A0CEA9DE800DA01C9 /* vtk_example.qbk */,
                                 08F3593B0CED23C100E2BBFB /* blueprint_example.qbk */,
+ 08F687D30D20415C006DB5BB /* gui_example.qbk */,
                         );
                         path = introduction;
                         sourceTree = "<group>";

Added: sandbox/SOC/2007/signals/libs/dataflow/doc/blueprint_screenshot.png
==============================================================================
Binary file. No diff available.

Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/dataflow.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -56,7 +56,9 @@
 [template PhoenixConsumer[] [link dataflow.support.concepts.phoenix.phoenixproducer [^PhoenixConsumer]]]
 
 [template vtk_example[text] [link dataflow.introduction.examples.new_layer [text]]]
+[template gui_example[text] [link dataflow.introduction.examples.fltk_gui [text]]]
 [template how_to_use[text] [link dataflow.introduction.how_to_use [text]]]
+
 [template DataflowSignals[] [link dataflow.signals Dataflow.Signals]]
 [template DataflowBlueprint[] [link dataflow.blueprint Dataflow.Blueprint]]
 [template DataflowPhoenix[] [link dataflow.phoenix Dataflow.Phoenix]]
@@ -102,7 +104,8 @@
 [template BoostGIL[] [@http://opensource.adobe.com/gil/ Boost.GIL]]
 
 [template GNURadio[] [@http://www.gnu.org/software/gnuradio/ GNU Radio]]
-
+[template FLTK[] [@http://fltk.org/ FLTK2]]
+[template cppgui[] [@http://sourceforge.net/projects/cppgui cppgui]]
 [template WikiDataflow[] [@http://en.wikipedia.org/wiki/Dataflow_programming dataflow]]
 [template VTK[] [@http://www.vtk.org/ VTK]]
 [template vtkAlgorithm[] [@http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html ['vtkAlgorithm]]]
@@ -111,6 +114,7 @@
 [template vtkActor[] [@http://www.vtk.org/doc/nightly/html/classvtkActor.html ['vtkActor]]]
 [template vtkRenderer[] [@http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html ['vtkRenderer]]]
 
+[template future_work[] [link dataflow.future future_work]]
 [template blueprint[] [link dataflow.future.blueprint blueprint]]
 [template FuturePin[] [link dataflow.future.pin pin]]
 [template rationale[] [link dataflow.development.rationale rationale]]
@@ -161,6 +165,8 @@
 
 [import ../example/blueprint/blueprint_example.cpp]
 
+[import ../example/fltk_gui/fltk_gui_example.cpp]
+
 [include introduction/introduction.qbk]
 
 [include support/support.qbk]

Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/future.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -9,15 +9,13 @@
 The following features are planned for the future:
 
 * *Serialization* - It should be possible to serialize and deserialize a
- network blueprint. This could be used to store datafow programs, or to send
+ network blueprint. This could be used to store dataflow programs, or to send
   them over the network.
 
 * *Separation of network blueprint and network instance* - Right now the
   `network` class serves both as a blueprint and as an instance of the
   network. These two will be decoupled in the future.
   
-* *Component banks* - Banks of components which can be accessed at runtime.
-
 * *Dataflow support layer* - [DataflowBlueprint] ports, components and networks
   should model the generic dataflow [concepts]. This will allow the use of
   the common syntax, as well as the creation of blueprints of blueprints :-)
@@ -33,16 +31,22 @@
 
 Many dataflow-oriented frameworks have a visual programming environment.
 Examples are [@http://www.cycling74.com/products/maxmsp MAX/MSP] and
-[@http://www.ni.com/labview/ LabVIEW].
-
-The [@http://vcreatelogic.com/oss/vtkdesigner/index.html VTK Designer]
+[@http://www.ni.com/labview/ LabVIEW]. Also,
+the [@http://vcreatelogic.com/oss/vtkdesigner/index.html VTK Designer]
 has recently introduced a similar environment for C++ (and [VTK]),
 based on the [@http://vcreatelogic.com/oss/gcf/index.html Generic
 Component Framework] and is released under the GNU GPL license.
 
-Once the [DataflowBlueprint] layer is completed, it might be possible to integrate
-it with the Generic Component Framework to get a visual programming
-environment for the Dataflow library.
+I have started a small [gui_example example GUI dataflow editor] built
+on top of the [DataflowBlueprint] layer, showing that the Dataflow library
+is an adequate basis for such a visual programming environment. This
+will be developed more in time. In particular, I'm interested in
+
+* testing the GUI with frameworks other than [DataflowSignals]
+
+* incorporating saving/loading of designs
+
+
 
 [endsect]
 

Added: sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/gui_example.qbk
==============================================================================
--- (empty file)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/gui_example.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -0,0 +1,23 @@
+[section:fltk_gui A GUI dataflow editor]
+
+The Dataflow library contains an example GUI editor for dataflow networks.
+The editor is built on top of
+[DataflowBlueprint], it can be used for any framework with Dataflow support.
+The capabilities of the editor are fairly limited at the moment - it's purpose
+is mainly to verify that something useful can be built on top of
+[DataflowBlueprint] layer.
+
+The following is a screenshot of the editor:
+
+[$blueprint_screenshot.png]
+
+To build the GUI example, you will need to download [FLTK]. At some point
+I will probably develop another version for the [cppgui] library being
+developed.
+
+The main part of the code is as follows (the GUI classes can be found in
+the `examples/fltk_gui` directory):
+
+[fltk_gui_example]
+
+[endsect]
\ No newline at end of file

Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/introduction.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/introduction.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/introduction.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -255,6 +255,8 @@
 
 * The example on [link dataflow.introduction.examples.blueprint run-time
   reflection and connectivity modeling].
+* The example of [gui_example a GUI dataflow editor] built on top of
+ [DataflowBlueprint]
 * The [DataflowBlueprint] documentation.
 
 
@@ -365,6 +367,7 @@
 
 [include introduction/distributed_example.qbk]
 [include introduction/gil_example.qbk]
+[include introduction/gui_example.qbk]
 [include introduction/blueprint_example.qbk]
 [include introduction/vtk_example.qbk]
 
@@ -383,15 +386,27 @@
 
 Version 0.9.0 (under construction)
 
-* Revamped concepts one more time
+* added a component bank class
+* added [gui_example an example GUI dataflow editor]
+* Revamped [concepts] one more time
+* [DataflowSignals] components should now all be [Component]s.
 * added the port_adapter class to replace old ProxyPort functionality
 * slot_selector is now useless - replaced with just boost::function
 * Adapted the Dataflow.Signals layer, tests, and examples.
 * Started adding Doxygen-generated support layer reference.
 
-To Do:
+Short term to-do list:
 
-* Revise docs
+* keep working on docs, tests
+* Key used for [KeyedPort]s should be overridable (not always the [PortTraits])
+* binary_operation should take two [Tag] parameters
+* add support for cross-framework operations (`tag_adapter`?)
+* make dispatching possible on other than just the [PortTraits]
+* `port_adapter` should be renamed to `adapter`
+* [Invocable] should be a part of [UnaryOperable]
+* propagate return values where they should be
+
+See the [future_work] section for more information on what is planned.
 
 Version 0.8.1
  \[[@http://www.boost-consulting.com/vault/index.php?direction=&order=&directory=Dataflow& available in the Boost vault]\]

Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/vtk_example.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/vtk_example.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/introduction/vtk_example.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -40,22 +40,16 @@
     *cone >>= *coneMapper >>= *coneActor >>= *ren1 >>= *renWin;
 ```
 
-[note Going through the following pages, you might think that implementing a VTK
-support layer is a whole lot of effort for very little benefit. Please keep the
-following in mind:
-
-* The support layer needs to be implemented only once (per mechanism). Since
- this example takes care of [VTK], to get the
- benefits of the Dataflow library (which are admitedly few at the moment)
- all you need to do is include the provided header.
-
-* Once more things are implemented on top of the generic Dataflow layer, having
- Dataflow library support will be more beneficial.
-]
+Once we have the [VTK] support layer built, we can include it in any
+[VTK] application and start using the Dataflow library with [VTK] objects.
+In addition to
+the simpler syntax, this also allows us to use anything build on top of the
+generic layer - like [DataflowBlueprint], or
+the [gui_example GUI editor] currently under development.
 
 [heading Next]
 [link dataflow.introduction.examples.new_layer.tag
- Setting up the Mechanism]
+ Setting up the Tag]
 
 [section:tag Setting up the Tag]
 
@@ -65,7 +59,7 @@
 
 [vtk_tag]
 
-We will now use this tag in reference to the [VTK] dataflow framework.
+We can now use it to tag all of our [VTK] support classes.
 
 [heading Next]
 [link dataflow.introduction.examples.new_layer.producerconsumer
@@ -92,8 +86,10 @@
 
 Now that we have a producer [Port], we need a consumer [Port].
 [vtkAlgorithm] can accept incoming connections using the `AddInputConnection`
-and `SetInputConnection` member functions. The code below provides support
-for [vtkAlgorithm] accepting connections on its default input port:
+and `SetInputConnection` member functions. Since we will make [vtkAlgorithm]
+a [Component], we can't make it a [Port] directly - but we can use
+the [port_adapter] class to refer to the [Port] functionality of [vtkAlgorithm],
+so we set up a [PortTraits] class to represent this [Port] functionality:
 
 [vtk_algorithm_consumer]
 
@@ -120,20 +116,7 @@
 
 [heading What we can do with what we have so far]
 
-```
- // connect *cone to *coneMapper
- boost::dataflow::binary_operation<
- boost::dataflow::operation::connect,
- boost::dataflow::vtk::mechanism>
- (*cone->GetOutputPort(), *coneMapper);
-
- // make *cone the only thing connected to *coneMapper
- boost::dataflow::binary_operation<
- boost::dataflow::operation::connect_only,
- boost::dataflow::vtk::mechanism>
- (*cone->GetOutputPort(), *coneMapper);
-
-```
+[vtk_connect_unforwarded]
 
 [heading Next]
 [link dataflow.introduction.examples.new_layer.forwarding
@@ -150,57 +133,39 @@
 for this purpose.
 
 Including `<boost/dataflow/templates/binary_operation.hpp>` with `#define`d
-DATAFLOW_TEMPLATE_TAG and DATAFLOW_TEMPLATE_BINARY_OPERATION will
-define a forwarding function DATAFLOW_TEMPLATE_BINARY_OPERATION in the
+`DATAFLOW_TEMPLATE_TAG` and `DATAFLOW_TEMPLATE_BINARY_OPERATION` will
+define a forwarding function `DATAFLOW_TEMPLATE_BINARY_OPERATION` in the
 current namespace.
 
 Including `<boost/dataflow/templates/operator.hpp>` with `#define`d
-DATAFLOW_TEMPLATE_TAG, DATAFLOW_TEMPLATE_BINARY_OPERATION, and
-DATAFLOW_TEMPLATE_OPERATOR will define a forwarding operator in the current
+`DATAFLOW_TEMPLATE_TAG`, `DATAFLOW_TEMPLATE_BINARY_OPERATION`, and
+`DATAFLOW_TEMPLATE_OPERATOR` will define a forwarding operator in the current
 namespace.
 
 [vtk_specialize_connect]
 
 [heading What we can do with what we have so far]
 
-```
- // connect *cone to *coneMapper
- connect(*cone->GetOutputPort(), *coneMapper);
- // or
- *cone->GetOutputPort() >>= *coneMapper
-
- // make *cone the only thing connected to *coneMapper
- connect_only(*cone->GetOutputPort(), *coneMapper);
- // or
- *cone->GetOutputPort() ^= *coneMapper
-
-```
+[vtk_connect_unforwarded]
 
 [heading Next]
-[link dataflow.introduction.examples.new_layer.proxyproducer
- Setting up a ProxyProducer]
+[link dataflow.introduction.examples.new_layer.component
+ Setting up a Component]
 
 [endsect][/forwarding]
 
-[section:proxyproducer Setting up a ProxyPort]
+[section:component Setting up a Component]
 
 In the VTK example above, both `vtkConeSource` and `vtkPolyDataMapper`
-inherit [vtkAlgorithm].
-With the [vtkAlgorithmOutput] producer [Port] and
-[vtkAlgorithm] consumer [Port] we've set up,
-we can do things like `connect(cone->GetOutputPort(), *coneMapper);`.
-However, we would like to do `connect(*cone, *coneMapper)`.
+inherit [vtkAlgorithm]. We've set up [Port]s that we can get to, and
+connect. However, we would like to be able to connect the two components
+directly, with something like `connect(*cone, *coneMapper)`.
 
 To do that,
-we need to make [vtkAlgorithm] a producer [Port]. Since [vtkAlgorithm]
-forms its output connections using [vtkAlgorithmOutput] objects
-returned through the `GetOutputPort` member functions, and we've already
-configured [vtkAlgorithmOutput] as a producer [Port], we can make use
-of the [ProxyPort] concept provided by the dataflow library.
-In effect, we will make [vtkAlgorithm] delegate it's producer [Port]
-functionality to [vtkAlgorithmOutput]:
+we need to make [vtkAlgorithm] a [Component], which allows us to
+designate default ports to be used when, e.g., connecting:
 
-[vtk_algorithm_proxy_producer]
+[vtk_algorithm_component]
 
 Now, [vtkAlgorithm] is a producer [Port].
 
@@ -214,9 +179,9 @@
 [link dataflow.introduction.examples.new_layer.filter
     Setting up a filter (ProducerPort+ConsumerPort)]
 
-[endsect][/proxyproducer]
+[endsect][/component]
 
-[section:filter Setting up a Filter (Producer+Consumer)]
+[section:filter Setting up another Component]
 
 In a VTK pipeline, a [vtkActor] consumes data from a [vtkMapper], and produces
 data for a [vtkRenderer]. In this case, we can provide Dataflow support
@@ -239,9 +204,8 @@
 the same as connecting a [vtkMapper] to another [vtkAlgorithm].
 
 To accomodate such situations, the Dataflow library provides
-[KeyedPort]s, which are similar to [ProxyPort]s but
-the [Port] they delegate to is keyed on the
-[Port] they are being connected to.
+[KeyedPort]s, which delegate fuctionality to a [Port]
+determined by the [Port] they are being connected to.
 
 [vtk_mapper_producer]
 
@@ -251,33 +215,16 @@
 
 [endsect][/producermap]
 
-[section:remaining Setting up the remaining components (more of the same)]
+[section:remaining Setting up the remaining Components (more of the same)]
 
 [vtk_setup_rest]
 
 [heading Next]
-[link dataflow.introduction.examples.new_layer.pointers
- Supporting pointers]
-
-[endsect][/remaining]
-
-[section:pointers Supporting pointers]
-
-All of the concepts we adapted so far have been adapted for class types such
-as [vtkAlgorithm] and [vtkAlgorithmOutput]. But [VTK] seems to exclusively
-use pointers to class types rather than class types themselves. So, with what
-we have done so far, we can do `connect(*cone, *coneMapper)` but not
-`connect(cone, coneMapper)`. To provide support for pointers, we
-simply make them adhere to the [ProxyPort] concept, and delegate the
-functionality to the object they point to.
-
-[vtk_support_pointer]
-
-[heading Next]
 [link dataflow.introduction.examples.new_layer.using_support_layer
     Using the VTK support layer]
 
-[endsect][/pointers]
+[endsect][/remaining]
+
 
 [section:using_support_layer Using the VTK support layer]
 

Modified: sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/doc/rationale.qbk 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -6,18 +6,37 @@
   functionality of a dataflow framework. The reason I started with connection
   and extraction is that it is the single most uniformly present
   aspect of dataflow frameworks (going to the very definition of dataflow).
- While there are many other
- functionalities that can be part of a dataflow framework (such as memory
- management and different kinds of scheduling), these vary much more from
- one dataflow framework to another, and are much harder to capture in the
- generic layer. While concepts related to memory management and scheduling
- might be added to the generic layer in the future, I believe they are not
- essential in the first version of this library.
-
-* The only dataflow framework included is [DataflowSignals] for two reasons.
- One, a [BoostSignals]-based framework was the original focus of this project;
- And two, [DataflowSignals] makes use of existing Boost functionality to make
- the implementation of the dataflow framework extremely simple. There is no
+
+ * Much of current dataflow framework development is dedicated to framework-specific
+ visual programming
+ environments, and bindings to outside languages. Much of this
+ can be done in a generic fashion, given generic support for connecting
+ components and extracting data of the Dataflow library.
+
+ * While there are many other
+ functionalities that can be part of a dataflow framework (such as memory
+ management and different kinds of scheduling), these vary much more from
+ one dataflow framework to another, and are much harder to capture in the
+ generic layer. While concepts related to memory management and scheduling
+ might be added to the generic layer in the future, I believe they are not
+ essential in the first version of this library.
+
+* The only dataflow framework included at the moment
+ is [DataflowSignals] for three reasons:
+
+ * a [BoostSignals]-based framework was the original focus of this project;
+ * components in other frameworks (e.g., [VTK]) don't rely exclusively on
+ their framework's dataflow mechanisms to do their work
+ (e.g., apart from connecting
+ [VTK] components and moving data through [VTK]'s pipeline,
+ you can also call the components' methods to customize their
+ behavior). [BoostSignals], since it is based on function calls, can
+ then be used to access function calling behavior in a way that is
+ native to the Dataflow library.
+ * [DataflowSignals] makes use of existing Boost functionality to make
+ the implementation of the dataflow framework extremely simple.
+
+* There is no
   doubt that implementing other kinds of dataflow frameworks would be useful
   (e.g., the [FuturePin]-based approach proposed by Tobias Schwinger, or
   something like the simulation-oriented
@@ -31,7 +50,7 @@
 * I encountered the term /dataflow/ after starting this library. Although
   the information I can find about dataflow as
   a programming paradigm seems to be a little sub-par,
- it seems like the right name for this programming paradigm.
+ it seems like the right name for this library.
   As a part of developing this library and doing the accompanying research I
   can work on improving the information that is out there (on Wikipedia, etc.)
 * I chose /component/ to refer to a processing element of a dataflow network,
@@ -58,7 +77,7 @@
   [UnaryOperable], and [ComponentOperable] concepts) have been rolled into a
   single class
   template with the operation selected by type because of some shared
- functionality (e.g., [KeyedPort] resolution), and this way they can also be
+ functionality, and this way they can also be
   treated in a generic fashion in code built on top of the generic layer.
   
 [endsect]

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/Cone.cxx 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -120,4 +120,32 @@
   return 0;
 }
 
-//]
\ No newline at end of file
+//]
+
+void ignore_this()
+{
+ vtkConeSource *cone = vtkConeSource::New();
+ vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
+
+//[ vtk_connect_unforwarded
+ using namespace boost::dataflow;
+
+ // connect *cone to *coneMapper
+ binary_operation<operations::connect, vtk::tag>
+ (*cone->GetOutputPort(), vtk::vtk_algorithm_consumer_adapter(*coneMapper));
+
+ // make *cone the only thing connected to *coneMapper
+ binary_operation<operations::connect_only, vtk::tag>
+ (*cone->GetOutputPort(), vtk::vtk_algorithm_consumer_adapter(*coneMapper));
+//]
+
+//[ vtk_connect_forwarded
+ using namespace boost::dataflow;
+
+ // connect *cone to *coneMapper
+ connect(*cone->GetOutputPort(), vtk::vtk_algorithm_consumer_adapter(*coneMapper));
+
+ // make *cone the only thing connected to *coneMapper
+ connect(*cone->GetOutputPort(), vtk::vtk_algorithm_consumer_adapter(*coneMapper));
+//]
+}
\ No newline at end of file

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/VTK/vtk_dataflow_support.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/VTK/vtk_dataflow_support.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/VTK/vtk_dataflow_support.hpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -22,7 +22,7 @@
 #include <boost/fusion/container/map.hpp>
 #include <boost/type_traits/is_base_of.hpp>
 
-//[ vtk_mechanism
+//[ vtk_tag
 
 namespace boost { namespace dataflow { namespace vtk {
 
@@ -48,7 +48,7 @@
 // PortTraits, and also verifies that the PortTraits requirements are satisfied.
 // The traits_of template is used by the Dataflow library to associate
 // a Port with its PortTraits.
-DATAFLOW_TRAITS(vtkAlgorithmOutput *, vtk::vtk_algorithm_output_producer)
+DATAFLOW_TRAITS(vtkAlgorithmOutput, vtk::vtk_algorithm_output_producer)
 //]
 
 
@@ -58,14 +58,11 @@
 struct vtk_algorithm_consumer
     : public port_traits<ports::consumer, vtk::tag> {};
     
+typedef port_adapter<vtkAlgorithm, vtk::vtk_algorithm_consumer, vtk::tag>
+ vtk_algorithm_consumer_adapter;
+
 } } } // namespace boost::dataflow::vtk
 
-// Since vtkAlgorithm is typically inherited, we will specialize the
-// traits_of template for all its descendants.
-/*DATAFLOW_TRAITS_ENABLE_IF(
- T,
- boost::is_base_of<vtkAlgorithm BOOST_PP_COMMA() T>,
- vtk::vtk_algorithm_consumer)*/
 //]
 
 //[ vtk_connect_impl_algorithm
@@ -73,9 +70,9 @@
 
 // To implement Connectable, we specialize the binary_operation_impl
 // functor template. We specify three things:
-// operation (operations::connect)
 // producer PortTraits (vtk::vtk_algorithm_output_producer)
 // consumer PortTraits (vtk::vtk_algorithm_consumer)
+// operation (operations::connect)
 template<>
 struct binary_operation_impl<vtk::vtk_algorithm_output_producer, vtk::vtk_algorithm_consumer, operations::connect>
 {
@@ -84,7 +81,8 @@
     template<typename Producer, typename Consumer>
     void operator()(Producer &producer, Consumer &consumer)
     {
- get_object(consumer).AddInputConnection(get_object(producer));
+ // To interface with port_adaptor objects, we use get_object
+ get_object(consumer).AddInputConnection(&get_object(producer));
     }
 };
 
@@ -98,7 +96,7 @@
     template<typename Producer, typename Consumer>
     void operator()(Producer &producer, Consumer &consumer)
     {
- consumer.SetInputConnection(&producer);
+ get_object(consumer).SetInputConnection(&get_object(producer));
     }
 };
     
@@ -107,7 +105,7 @@
 //]
 
 
-//[ vtk_algorithm_proxy_producer
+//[ vtk_algorithm_component
 
 namespace boost { namespace dataflow { namespace vtk {
 
@@ -115,35 +113,35 @@
     
     typedef mpl::map<
                 mpl::pair<dataflow::default_port_selector
- <dataflow::directions::outgoing>,
+ <dataflow::args::left>,
                     mpl::int_<0> >,
                 mpl::pair<dataflow::default_port_selector
- <dataflow::directions::incoming>,
+ <dataflow::args::right>,
                     mpl::int_<1> >
>::type default_map;
 
 }
 
-// First we need a ProxyPortTraits type
+// First we need a ComponentTraits type
 template<typename T>
 struct vtk_algorithm_component_traits
     : public dataflow::fusion_component_traits<
         fusion::vector<
- vtkAlgorithmOutput *,
- dataflow::port_adapter<T, vtk_algorithm_consumer, tag> >,
+ vtkAlgorithmOutput &,
+ vtk_algorithm_consumer_adapter>,
         detail::default_map,
         tag>
 {
     template<typename Component>
     static typename vtk_algorithm_component_traits::fusion_ports get_ports(Component &c)
     {
- return typename vtk_algorithm_component_traits::fusion_ports(c.GetOutputPort(), c);
+ return typename vtk_algorithm_component_traits::fusion_ports(*c.GetOutputPort(), c);
     }
 };
 
 } } } // namespace boost::dataflow::vtk
 
-// Then we associate all descendants of vtkAlgorithm with the ProxyPortTraits.
+// Then we associate all descendants of vtkAlgorithm with the ComponentTraits.
 // vtkMapper is a descendant of vtkAlgorithm, but we want to exclude it's
 // descendants from this registration because they will be treated differently.
 DATAFLOW_TRAITS_ENABLE_IF(
@@ -204,17 +202,17 @@
 // Next, we define a fusion map type to hold the mapping between consumers
 // and Port types.
 typedef boost::fusion::map<
- boost::fusion::pair<vtk::vtk_algorithm_consumer, vtkAlgorithmOutput *>,
- boost::fusion::pair<vtk::vtk_actor_consumer, port_adapter<vtkMapper, vtk_mapper_producer> >
+ boost::fusion::pair<vtk::vtk_algorithm_consumer, vtkAlgorithmOutput &>,
+ boost::fusion::pair<vtk::vtk_actor_consumer, port_adapter<vtkMapper, vtk_mapper_producer, tag> >
> vtk_mapper_map;
 
-// ...And a ProxyPortTraits type...
+// ...And a ComponentTraits type...
 template<typename T>
 struct vtk_mapper_component_traits
     : public dataflow::fusion_component_traits<
         fusion::vector<
             fusion_keyed_port<ports::producer, vtk::vtk_mapper_map, tag>,
- dataflow::port_adapter<T, vtk_algorithm_consumer, tag> >,
+ vtk_algorithm_consumer_adapter >,
         detail::default_map,
         tag>
 {
@@ -222,9 +220,9 @@
     static typename vtk_mapper_component_traits::fusion_ports get_ports(Component &c)
     {
         return typename vtk_mapper_component_traits::fusion_ports(
- fusion_keyed_port<ports::producer, vtk::vtk_mapper_map, tag>(
- vtk::vtk_mapper_map(c.GetNumberOfOutputPorts() ? c.GetOutputPort() : (vtkAlgorithmOutput *)NULL,
- port_adapter<vtkMapper, vtk_mapper_producer>(c))),
+ fusion_keyed_port<dataflow::ports::producer, vtk::vtk_mapper_map, tag>(
+ vtk::vtk_mapper_map(c.GetNumberOfOutputPorts() ? *c.GetOutputPort() : *(vtkAlgorithmOutput *)NULL,
+ port_adapter<vtkMapper, vtk_mapper_producer, tag>(c))),
             c);
     }
 };

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintBank.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintBank.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintBank.cpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -12,7 +12,7 @@
 void BlueprintBank::button_callback(fltk::Widget* widget, void*b)
 {
     BlueprintBank *bank= static_cast<BlueprintBank *>(b);
- bank->m_blueprint->add_component(bank->m_bank.make(widget->label()), widget->label());
+ bank->m_blueprint->add_component(bank->m_bank[widget->label()], widget->label());
 }
     
 void BlueprintBank::rearrange()

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.cpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -17,13 +17,12 @@
         , m_invocable(invocable)
     {
         callback((fltk::Callback *)on_push, this);
-
     }
     int handle(int event);
 private:
     static void on_push(fltk::Widget *widget, BlueprintComponentCore *core)
     {
- if (core->m_invocable)
+ if (!core->m_dragged && core->m_invocable)
             core->component().invoke();
     }
     BlueprintComponent &component()
@@ -44,9 +43,6 @@
         push_y = fltk::event_y_root();
         m_dragged = event==fltk::DRAG;
         return fltk::Button::handle(event);
- case fltk::RELEASE:
- if (!m_dragged)
- return fltk::Button::handle(event);
     }
     return fltk::Button::handle(event);
 }
@@ -58,6 +54,7 @@
         case fltk::DND_RELEASE:
             return blueprint().register_drop(this);;
         case fltk::DND_ENTER:
+ case fltk::DND_LEAVE:
             return 1;
         case fltk::PASTE:
             blueprint().connect_dragged_with(this);
@@ -72,9 +69,38 @@
 
 BlueprintComponent::BlueprintComponent(int x, int y, int w, int h, const char *label, blueprint::component &c, id_type id)
     : fltk::Group(x, y, w, h)
- , m_component(c), m_id(id)
+{
+ BlueprintComponent_(label);
+ set_component(c, id);
+}
+
+BlueprintComponent::BlueprintComponent(int x, int y, int w, int h, const char *label)
+ : fltk::Group(x, y, w, h)
+{
+ BlueprintComponent_(label);
+}
+
+void BlueprintComponent::BlueprintComponent_(const char *label)
 {
     copy_label(label);
+ add(m_gui_group = new fltk::Group(0,80,100,60));
+ resize(100, 160);
+}
+
+void BlueprintComponent::gui_begin()
+{
+ m_gui_group->begin();
+}
+
+void BlueprintComponent::gui_end()
+{
+ m_gui_group->end();
+}
+
+void BlueprintComponent::set_component(blueprint::component &c, id_type id)
+{
+ m_component=&c;
+ m_id = id;
     add(new BlueprintComponentCore(20, 20, 60, 60, c.is_invocable()));
     
     int y_left = 20;
@@ -93,4 +119,5 @@
         }
 }
 
+
 } } }

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintComponent.hpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -16,12 +16,18 @@
     typedef blueprint::network::component_type id_type;
 public:
     BlueprintComponent(int x, int y, int w, int h, const char *label, blueprint::component &c, id_type id);
- void invoke() {m_component.invoke();}
+ BlueprintComponent(int x, int y, int w, int h, const char *label);
+ void set_component(blueprint::component &c, id_type id);
+ void gui_begin();
+ void gui_end();
+ void invoke() {m_component->invoke();}
     id_type id() {return m_id;}
 private:
- blueprint::component &m_component;
+ void BlueprintComponent_(const char *label);
+ blueprint::component *m_component;
     std::string m_name;
     id_type m_id;
+ fltk::Group *m_gui_group;
 };
 
 class BlueprintComponentPort : public fltk::Button
@@ -33,6 +39,10 @@
     int handle(int event);
     BlueprintComponent &component()
     { return *static_cast<BlueprintComponent *>(parent()); }
+ int center_x_root()
+ { return parent()->x() + center_x(); }
+ int center_y_root()
+ { return parent()->y() + center_y(); }
     size_t id() {return m_id;}
 private:
     BlueprintWindow &blueprint()

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.cpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -6,6 +6,8 @@
 #include "BlueprintWindow.hpp"
 #include "BlueprintComponent.hpp"
 //#include <fltk/MenuBar.hpp>
+#include <fltk/draw.h>
+#include <fltk/events.h>
 
 namespace boost { namespace dataflow { namespace fltk_gui {
 
@@ -13,7 +15,15 @@
     : fltk::Window(width, height)
 {
     copy_label(label);
- begin();
+ m_next_created_x = 100;
+ m_next_created_y = 50;
+ /*fltk::Group *box= new fltk::Group(width, height, 0, 0);
+ add(box);
+ box->hide();
+ resizable(box);*/
+
+
+// begin();
 /* fltk::MenuBar menubar(0,0,width,25);
     menubar.callback(callback);
     menubar.begin();
@@ -26,10 +36,33 @@
 
 void BlueprintWindow::add_component(std::auto_ptr<blueprint::component> c, const std::string &name)
 {
- BlueprintComponent *bc = new BlueprintComponent(100, 100, 100, 100, name.c_str(), *c, m_network.add_component(c));
+ BlueprintComponent *bc = new BlueprintComponent(m_next_created_x, m_next_created_y, 100, 100, name.c_str(), *c, m_network.add_component(c));
+ add_component_helper(bc);
+}
+
+void BlueprintWindow::add_component(boost::function<blueprint::component *()> f, const std::string &name)
+{
+ BlueprintComponent *bc = new BlueprintComponent(m_next_created_x, m_next_created_y, 100, 100, name.c_str());
+ bc->gui_begin();
+ std::auto_ptr<blueprint::component> c(f());
+ blueprint::network::component_type id = m_network.add_component(c);
+ bc->set_component(m_network[id], id);
+ bc->gui_end();
+ add_component_helper(bc);
+}
+
+void BlueprintWindow::add_component_helper(BlueprintComponent *bc)
+{
     add(bc);
     redraw();
+ m_next_created_x += 150;
+ if (m_next_created_x + 100 > w())
+ {
+ m_next_created_x = 100;
+ m_next_created_y += 150;
+ }
 }
+
 
 bool BlueprintWindow::register_drop(BlueprintComponentPort *port)
 {
@@ -39,6 +72,73 @@
 void BlueprintWindow::connect_dragged_with(BlueprintComponentPort *port)
 {
     m_network.add_connection(m_dragged->component().id(), m_dragged->id(), port->component().id(), port->id(), true);
+ m_connections.push_back(Connection(m_dragged, port));
+ redraw();
+}
+
+void BlueprintWindow::draw()
+{
+ fltk::Window::draw();
+ for (std::vector<Connection>::iterator it=m_connections.begin(); it!=m_connections.end(); it++)
+ {
+ fltk::setcolor(it == m_selected ? fltk::RED : fltk::GREEN);
+ fltk::drawline(
+ it->first->center_x_root(),
+ it->first->center_y_root(),
+ it->second->center_x_root(),
+ it->second->center_y_root());
+ }
+}
+
+namespace detail
+{
+ double distance(int x0, int y0, int x1, int y1)
+ {
+ int dx = x1 - x0;
+ int dy = y1 - y0;
+ return sqrt(dx*dx+dy*dy);
+ }
+
+ double distance(int x0, int y0, int x1, int y1, int xp, int yp)
+ {
+ int dx = x1 - x0;
+ int dy = y1 - y0;
+ if (dx==0 && dy==0)
+ return distance(x0, y0, xp, yp);
+
+ double r = double((xp - x0) * dx + (yp - y0) * dy) / (dx*dx + dy*dy);
+ if (r<0)
+ return distance(x0, y0, xp, yp);
+ else if (r>1)
+ return distance(x1, y1, xp, yp);
+ else
+ return distance((1-r)*x0 + r*x1, (1-r)*y0 + r*y1, xp, yp);
+ }
 }
 
+int BlueprintWindow::handle(int event)
+{
+ if (fltk::Window::handle(event))
+ return 1;
+ bool found=false;
+ if(event == fltk::PUSH)
+ for (std::vector<Connection>::iterator it=m_connections.begin(); it!=m_connections.end(); it++)
+ if (detail::distance(
+ it->first->center_x_root(),
+ it->first->center_y_root(),
+ it->second->center_x_root(),
+ it->second->center_y_root(),
+ fltk::event_x(),
+ fltk::event_y()) < 3)
+ {
+ m_selected = it;
+ found = true;
+ }
+ if (!found)
+ m_selected = std::vector<Connection>::iterator();
+ redraw();
+ return 0;
+}
+
+
 } } }
\ No newline at end of file

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.hpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.hpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/BlueprintWindow.hpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -16,11 +16,21 @@
 class BlueprintComponent;
 class BlueprintComponentPort;
 
+class Connection
+ : public std::pair<BlueprintComponentPort *, BlueprintComponentPort *>
+{
+public:
+ Connection(BlueprintComponentPort *p1, BlueprintComponentPort *p2)
+ : std::pair<BlueprintComponentPort *, BlueprintComponentPort *>(p1, p2)
+ {}
+};
+
 class BlueprintWindow : public fltk::Window
 {
 public:
     BlueprintWindow(int width, int height, const char *label = 0);
     void add_component(std::auto_ptr<blueprint::component> c, const std::string &name);
+ void add_component(boost::function<blueprint::component *()> f, const std::string &name);
     void register_drag(BlueprintComponentPort *port)
     {
         m_dragged = port;
@@ -28,9 +38,16 @@
     bool register_drop(BlueprintComponentPort *port);
     void connect_dragged_with(BlueprintComponentPort *port);
 private:
+ void add_component_helper(BlueprintComponent *bc);
+ virtual void draw();
+ virtual int handle(int event);
     blueprint::network m_network;
     std::vector<BlueprintComponent *> m_components;
     BlueprintComponentPort *m_dragged;
+ std::vector<Connection> m_connections;
+ std::vector<Connection>::iterator m_selected;
+ int m_next_created_x;
+ int m_next_created_y;
 };
 
 } } }

Modified: sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/fltk_gui_example.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/fltk_gui_example.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/example/fltk_gui/fltk_gui_example.cpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -1,3 +1,5 @@
+//[ fltk_gui_example
+
 // Copyright 2007 Stjepan Rajko.
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
@@ -6,70 +8,110 @@
 
 #include "BlueprintWindow.hpp"
 #include "BlueprintBank.hpp"
-#include <fltk/run.h>
-#include <fltk/Button.h>
-#include <fltk/ValueOutput.h>
 
+#include <boost/dataflow/signals/component/function.hpp>
 #include <boost/dataflow/signals/component/storage.hpp>
 #include <boost/dataflow/signals/runtime_support.hpp>
 
+#include <fltk/run.h>
+#include <fltk/Button.h>
+#include <fltk/ValueOutput.h>
+#include <fltk/ValueInput.h>
+
+#include <limits>
 #include <memory>
 
 namespace blueprint=boost::dataflow::blueprint;
 namespace signals=boost::signals;
 namespace df=boost::dataflow;
 
-class valuator : public boost::signals::filter<valuator, void(int), boost::mpl::vector<void(int)> >
+// A regular Dataflow.Signals component, sends and receives void(int)
+class output_valuator : public signals::filter<output_valuator, void(int), boost::mpl::vector<void(int)> >
 {
 public:
- valuator(const valuator &)
+ output_valuator(const output_valuator &)
+ { valuator_(); }
+ output_valuator()
+ { valuator_(); }
+ void operator()(int x)
     {
- m_window.reset(new fltk::Window(200, 200, "Valuator output"));
- m_window->add(output = new fltk::ValueOutput(50, 50, 100, 100));
- m_window->show();
+ m_output->value(x);
+ out(x);
     }
- valuator()
+public:
+ void valuator_()
     {
- m_window.reset(new fltk::Window(200, 200, "Valuator output"));
- m_window->add(output = new fltk::ValueOutput(50, 50, 100, 100));
- m_window->show();
+ // This component has a GUI element
+ m_output = new fltk::ValueOutput(20, 0, 60, 40);
     }
- void operator()(int x)
+ std::auto_ptr<fltk::Window> m_window;
+ fltk::ValueOutput *m_output;
+};
+
+// A regular Dataflow.Signals component, receives void(int)
+class input_valuator : public boost::signals::filter<input_valuator, void(int)>
+{
+public:
+ input_valuator(const input_valuator &)
+ { input_valuator_(); }
+ input_valuator()
+ { input_valuator_(); }
+public:
+ void input_valuator_()
     {
- output->value(x);
+ // This component has a GUI element
+ m_input = new fltk::ValueInput(20, 0, 60, 40);
+ m_input->callback((fltk::Callback *)callback, this);
+ m_input->step(1);
+ m_input->minimum(-std::numeric_limits<float>::max());
+ m_input->maximum(std::numeric_limits<float>::max());
+ }
+ static void callback(fltk::Widget *widget, input_valuator*iv)
+ {
+ iv->out(iv->m_input->value());
     }
-public:
     std::auto_ptr<fltk::Window> m_window;
- fltk::ValueOutput *output;
+ fltk::ValueInput *m_input;
 };
 
+// A component_bank with some components
 class example_bank : public blueprint::tag_component_bank<df::signals::tag>
 {
 public:
     example_bank()
     {
- add_component<signals::storage<void(int)> >("storage_int", 100);
- add_component<valuator>("valuator");
+ // A storage initialized with a value of 100
+ add_component<signals::storage<void(int)> >("storage", 100);
+ // Output and input components
+ add_component<output_valuator>("output");
+ add_component<input_valuator>("input");
+ // A filter that doubles
+ add_component<signals::function<void (int), int(int)> >
+ ("doubler", boost::function<int(int)>(boost::bind(std::multiplies<int>(), _1, 2)));
     }
 };
 
 int main()
 {
- //fltk::Button::default_style->box_ = fltk::RSHADOW_BOX;
- //fltk::Button::default_style->buttonbox_ = fltk::RSHADOW_BOX;
+ // set up the colors
     fltk::Button::default_style->buttoncolor_ = fltk::color(0, 0, 255);
     fltk::Window::default_style->color_ = fltk::GRAY75;
     using namespace boost::dataflow::fltk_gui;
 
- std::auto_ptr<df::fltk_gui::BlueprintWindow> window(new df::fltk_gui::BlueprintWindow(800, 600, "Blueprint"));
+ // create the blueprint and component windows
+ std::auto_ptr<BlueprintWindow> window(new BlueprintWindow(800, 600, "Blueprint"));
     std::auto_ptr<BlueprintBank> bank(new BlueprintBank(100, 600, "Components"));
 
+ // initialize the bank
     bank->set_bank(example_bank());
     bank->set_blueprint(*window);
-
- bank->show();
+
+ // show the windows and give control to FLTK
+ bank->show();
     window->show();
-
+
     fltk::run();
 }
 
+//]
+

Modified: sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp (original)
+++ sandbox/SOC/2007/signals/libs/dataflow/test/test_component.cpp 2007-12-24 20:10:20 EST (Mon, 24 Dec 2007)
@@ -25,10 +25,10 @@
>,
     mpl::map<
         mpl::pair<
- df::default_port_selector<df::directions::outgoing>,
+ df::default_port_selector<df::args::left>,
             mpl::int_<0> >,
         mpl::pair<
- df::default_port_selector<dataflow::directions::incoming>,
+ df::default_port_selector<dataflow::args::right>,
             mpl::int_<1> >
>
>


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