ardour
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Gtkmm2ext::DnDVBox< T > Class Template Reference

#include <dndvbox.h>

Inheritance diagram for Gtkmm2ext::DnDVBox< T >:

Public Member Functions

 DnDVBox ()
 
virtual ~DnDVBox ()
 
void add_child (T *child)
 
std::list< T * > children ()
 
std::list< T * > selection () const
 
void set_active (T *c)
 
bool selected (T *child) const
 
void clear ()
 
void select_all ()
 
void select_none ()
 
std::pair< T *, double > get_child_at_position (int y) const
 
void set_spacing (int s)
 
void remove_placeholder ()
 
int add_placeholder (double y)
 

Public Attributes

sigc::signal< void > Reordered
 
sigc::signal< bool,
GdkEventButton *, T * > 
ButtonPress
 
sigc::signal< bool,
GdkEventButton *, T * > 
ButtonRelease
 
sigc::signal< void, DnDVBox
*, T *, Glib::RefPtr
< Gdk::DragContext > const & > 
DropFromAnotherBox
 
sigc::signal< void > SelectionChanged
 

Private Member Functions

double bottom_of_child_ignoring_placeholder (T *child) const
 
double get_children_around_position (int y, T **before, T **at, T **after) const
 
void drag_begin (Glib::RefPtr< Gdk::DragContext > const &context, T *child)
 
bool icon_expose (GdkEventExpose *)
 
void drag_data_get (Glib::RefPtr< Gdk::DragContext > const &, Gtk::SelectionData &selection_data, guint, guint, T *child)
 
void drag_data_received (Glib::RefPtr< Gdk::DragContext > const &context, int, int y, Gtk::SelectionData const &selection_data, guint, guint time)
 
void drag_end (Glib::RefPtr< Gdk::DragContext > const &, T *)
 
int create_or_update_placeholder (double c)
 
bool drag_motion (Glib::RefPtr< Gdk::DragContext > const &, int, int y, guint)
 
void drag_leave (Glib::RefPtr< Gdk::DragContext > const &, guint)
 
bool button_press (GdkEventButton *ev, T *child)
 
bool button_release (GdkEventButton *ev, T *child)
 
void setup_child_state (T *c)
 
void clear_selection ()
 
void add_to_selection (T *child)
 
void remove_from_selection (T *child)
 
T * child_from_widget (Gtk::Widget const *w) const
 

Private Attributes

Gtk::VBox _internal_vbox
 
std::list< Gtk::TargetEntry > _targets
 
std::list< T * > _children
 
std::list< T * > _selection
 
T * _active
 
Gtk::Window * _drag_icon
 
bool _expecting_unwanted_button_event
 
Gtk::Label * _placeholder
 
T * _drag_child
 

Static Private Attributes

static DnDVBox_drag_source = 0
 

Detailed Description

template<class T>
class Gtkmm2ext::DnDVBox< T >

A VBox whose contents can be dragged and dropped

Definition at line 51 of file dndvbox.h.

Constructor & Destructor Documentation

template<class T>
Gtkmm2ext::DnDVBox< T >::DnDVBox ( )
inline

Definition at line 54 of file dndvbox.h.

template<class T>
virtual Gtkmm2ext::DnDVBox< T >::~DnDVBox ( )
inlinevirtual

Definition at line 76 of file dndvbox.h.

Member Function Documentation

template<class T>
void Gtkmm2ext::DnDVBox< T >::add_child ( T *  child)
inline

Add a child at the end of the widget. The DnDVBox will take responsibility for deleting the child

Definition at line 84 of file dndvbox.h.

template<class T>
int Gtkmm2ext::DnDVBox< T >::add_placeholder ( double  y)
inline

Add a placeholder where a child would be put if it were added at the given y position.

Parameters
yy position within the DnDVBox.
Returns
index of child that the placeholder represents, or -1 if it is at the end of all children.

Definition at line 205 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::add_to_selection ( T *  child)
inlineprivate

Definition at line 569 of file dndvbox.h.

template<class T>
double Gtkmm2ext::DnDVBox< T >::bottom_of_child_ignoring_placeholder ( T *  child) const
inlineprivate
Returns
the bottom y position of a child, pretending any placeholder is not there.

Definition at line 230 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::button_press ( GdkEventButton *  ev,
T *  child 
)
inlineprivate

Definition at line 467 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::button_release ( GdkEventButton *  ev,
T *  child 
)
inlineprivate

Definition at line 539 of file dndvbox.h.

template<class T>
T* Gtkmm2ext::DnDVBox< T >::child_from_widget ( Gtk::Widget const *  w) const
inlineprivate

Definition at line 587 of file dndvbox.h.

template<class T>
std::list<T*> Gtkmm2ext::DnDVBox< T >::children ( )
inline
Returns
Children, sorted into the order that they are currently being displayed in the widget

Definition at line 100 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::clear ( )
inline

Clear all children from the widget

Definition at line 144 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::clear_selection ( )
inlineprivate

Definition at line 560 of file dndvbox.h.

template<class T>
int Gtkmm2ext::DnDVBox< T >::create_or_update_placeholder ( double  c)
inlineprivate

Insert a placeholder at a given fractional child position, creating it if necessary.

Parameters
cFractional child position.
Returns
index of child that the placeholder represents, or -1 if it is at the end of all children.

Definition at line 410 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::drag_begin ( Glib::RefPtr< Gdk::DragContext > const &  context,
T *  child 
)
inlineprivate

Definition at line 297 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::drag_data_get ( Glib::RefPtr< Gdk::DragContext > const &  ,
Gtk::SelectionData &  selection_data,
guint  ,
guint  ,
T *  child 
)
inlineprivate

Definition at line 343 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::drag_data_received ( Glib::RefPtr< Gdk::DragContext > const &  context,
int  ,
int  y,
Gtk::SelectionData const &  selection_data,
guint  ,
guint  time 
)
inlineprivate

Definition at line 348 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::drag_end ( Glib::RefPtr< Gdk::DragContext > const &  ,
T *   
)
inlineprivate

Definition at line 395 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::drag_leave ( Glib::RefPtr< Gdk::DragContext > const &  ,
guint   
)
inlineprivate

Definition at line 462 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::drag_motion ( Glib::RefPtr< Gdk::DragContext > const &  ,
int  ,
int  y,
guint   
)
inlineprivate

Definition at line 424 of file dndvbox.h.

template<class T>
std::pair<T*, double> Gtkmm2ext::DnDVBox< T >::get_child_at_position ( int  y) const
inline
Parameters
yy coordinate.
Returns
Pair consisting of the child under y (or 0) and the (fractional) index of the child under y (or -1)

Definition at line 177 of file dndvbox.h.

template<class T>
double Gtkmm2ext::DnDVBox< T >::get_children_around_position ( int  y,
T **  before,
T **  at,
T **  after 
) const
inlineprivate

Look at a y coordinate and find the children below y, and the ones either side.

Parameters
yy position.
beforeFilled in with the child before, or 0.
atFilled in with the child under y, or 0.
afterFilled in with the child after, or 0.
Returns
Fractional position in terms of child height, or -1 if not over a child.

Definition at line 252 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::icon_expose ( GdkEventExpose *  )
inlineprivate

Definition at line 325 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::remove_from_selection ( T *  child)
inlineprivate

Definition at line 577 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::remove_placeholder ( )
inline

Definition at line 193 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::select_all ( )
inline

Definition at line 157 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::select_none ( )
inline

Definition at line 167 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::selected ( T *  child) const
inline
Parameters
childChild
Returns
true if the child is selected, otherwise false.

Definition at line 139 of file dndvbox.h.

template<class T>
std::list<T*> Gtkmm2ext::DnDVBox< T >::selection ( ) const
inline
Returns
Selected children

Definition at line 117 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::set_active ( T *  c)
inline

Set the `active' child; this is simply a child which is set to have the visual state "active" for whatever purposes the client may have.

Parameters
cChild, or 0 for none.

Definition at line 125 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::set_spacing ( int  s)
inline

Definition at line 189 of file dndvbox.h.

template<class T>
void Gtkmm2ext::DnDVBox< T >::setup_child_state ( T *  c)
inlineprivate

Setup a child's visual state correctly

Definition at line 554 of file dndvbox.h.

Member Data Documentation

template<class T>
T* Gtkmm2ext::DnDVBox< T >::_active
private

Definition at line 605 of file dndvbox.h.

template<class T>
std::list<T*> Gtkmm2ext::DnDVBox< T >::_children
private

Definition at line 603 of file dndvbox.h.

template<class T>
T* Gtkmm2ext::DnDVBox< T >::_drag_child
private

Our child being dragged, or 0

Definition at line 613 of file dndvbox.h.

template<class T>
Gtk::Window* Gtkmm2ext::DnDVBox< T >::_drag_icon
private

Definition at line 606 of file dndvbox.h.

template<class T>
DnDVBox< T > * Gtkmm2ext::DnDVBox< T >::_drag_source = 0
staticprivate

Definition at line 615 of file dndvbox.h.

template<class T>
bool Gtkmm2ext::DnDVBox< T >::_expecting_unwanted_button_event
private

Definition at line 607 of file dndvbox.h.

template<class T>
Gtk::VBox Gtkmm2ext::DnDVBox< T >::_internal_vbox
private

Definition at line 601 of file dndvbox.h.

template<class T>
Gtk::Label* Gtkmm2ext::DnDVBox< T >::_placeholder
private

A blank label used as a placeholder to indicate where an item would go if it were dropped or inserted "now".

Definition at line 611 of file dndvbox.h.

template<class T>
std::list<T*> Gtkmm2ext::DnDVBox< T >::_selection
private

Definition at line 604 of file dndvbox.h.

template<class T>
std::list<Gtk::TargetEntry> Gtkmm2ext::DnDVBox< T >::_targets
private

Definition at line 602 of file dndvbox.h.

template<class T>
sigc::signal<bool, GdkEventButton*, T*> Gtkmm2ext::DnDVBox< T >::ButtonPress

A button has been pressed over the widget

Definition at line 214 of file dndvbox.h.

template<class T>
sigc::signal<bool, GdkEventButton*, T*> Gtkmm2ext::DnDVBox< T >::ButtonRelease

A button has been release over the widget

Definition at line 217 of file dndvbox.h.

template<class T>
sigc::signal<void, DnDVBox*, T*, Glib::RefPtr<Gdk::DragContext> const & > Gtkmm2ext::DnDVBox< T >::DropFromAnotherBox

A child has been dropped onto this DnDVBox from another one; Parameters are the source DnDVBox, our child which the other one was dropped on (or 0) and the DragContext.

Definition at line 222 of file dndvbox.h.

template<class T>
sigc::signal<void> Gtkmm2ext::DnDVBox< T >::Reordered

Children have been reordered by a drag

Definition at line 211 of file dndvbox.h.

template<class T>
sigc::signal<void> Gtkmm2ext::DnDVBox< T >::SelectionChanged

Definition at line 223 of file dndvbox.h.


The documentation for this class was generated from the following file: