selector.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PAPYRUSSELECTOR_H
00021 #define PAPYRUSSELECTOR_H
00022
00023 #include <papyrus/drawablecontroller.h>
00024 #include <papyrus/group.h>
00025
00026 namespace Papyrus
00027 {
00028
00044 class Selector : public DrawableController
00045 {
00046 protected:
00047
00048 Selector( const Glib::ustring& id,
00049 DrawableSet::pointer drawables,
00050 Group::pointer select_from_group = Group::pointer(),
00051 SelectionMode mode = SELECT_PRESS,
00052 int selection_depth = 1 );
00053
00054 public:
00055
00056 typedef PapyrusPointer<Selector> pointer;
00057
00058 static pointer create( Group::pointer select_from_group = Group::pointer(),
00059 SelectionMode mode = SELECT_PRESS,
00060 int selection_depth = 1 );
00061
00062 static pointer create( const Glib::ustring& id,
00063 DrawableSet::pointer selected,
00064 Group::pointer select_from_group = Group::pointer(),
00065 SelectionMode mode = SELECT_PRESS,
00066 int selection_depth = 1 );
00067
00068 static pointer create( const Glib::ustring& id,
00069 Group::pointer select_from_group = Group::pointer(),
00070 SelectionMode mode = SELECT_PRESS,
00071 int selection_depth = 1 );
00072
00073 static pointer create( DrawableSet::pointer selected,
00074 Group::pointer select_from_group,
00075 SelectionMode mode = SELECT_PRESS,
00076 int selection_depth = 1 );
00077
00078 virtual ~Selector();
00079
00080 Group::pointer select_from_group();
00081
00082 void set_select_from_group( Group::pointer select_from_group );
00083
00084 void set_select_mode( unsigned mode );
00085
00086 void enable_select_mode( unsigned mode );
00087
00088 void disable_select_mode( unsigned mode );
00089
00090 unsigned select_mode();
00091
00092 int selection_depth();
00093
00094 void set_selection_depth( int selection_depth );
00095
00096 const Drawables& selection();
00097
00098 protected:
00099 unsigned m_select_mode;
00100 int m_selection_depth;
00101 Group::pointer m_select_from_group;
00102 bool m_add_drawable_only;
00103 Drawable::pointer m_picked;
00104 double m_last_position[ 2 ];
00105
00106 virtual bool on_button_press( const Event::ButtonPress& event );
00107 virtual bool on_button_release( const Event::ButtonRelease& event );
00108 virtual bool on_motion( const Event::Motion& event );
00109
00110 };
00111
00112 }
00113
00114 #endif