Ardour  9.0-3-gd16a029492
dndvbox.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2015 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2010-2012 Carl Hetherington <carl@carlh.net>
4  * Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
5  * Copyright (C) 2014 John Emmas <john@creativepost.co.uk>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 
22 #pragma once
23 
24 #include <ytkmm/window.h>
25 #include <ytkmm/box.h>
26 #include <ytkmm/eventbox.h>
27 #include <ytkmm/label.h>
28 
29 #include "gtkmm2ext/keyboard.h"
30 #include "gtkmm2ext/visibility.h"
31 #include "gtkmm2ext/widget_state.h"
32 
33 namespace Gtkmm2ext {
34 
36 class /*LIBGTKMM2EXT_API*/ DnDVBoxChild
37 {
38 public:
39  virtual ~DnDVBoxChild () {}
40 
42  virtual Gtk::Widget& widget () = 0;
43 
45  virtual Gtk::EventBox& action_widget () = 0;
46 
48  virtual std::string drag_text () const = 0;
49 
51  virtual void set_visual_state (VisualState, bool onoff) = 0;
52 
54  virtual bool is_selectable () const = 0;
55 
56  virtual bool drag_data_get (Glib::RefPtr<Gdk::DragContext> const, Gtk::SelectionData &) { return false; }
57 
58  virtual bool can_copy_state (DnDVBoxChild*) const = 0;
59 };
60 
62 template <class T>
63 class /*LIBGTKMM2EXT_API*/ DnDVBox : public Gtk::EventBox
64 {
65 public:
66  DnDVBox (std::list<Gtk::TargetEntry> targets, Gdk::DragAction actions = Gdk::ACTION_COPY)
67  : _targets (targets)
68  , _actions (actions)
69  , _active (0)
70  , _drag_icon (0)
72  , _placeholder (0)
73  , _drag_child (0)
74  {
75 
77  add_events (
81  );
82 
83  signal_button_press_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_press), (T *) 0));
84  signal_button_release_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_release), (T *) 0));
85  signal_drag_motion().connect (mem_fun (*this, &DnDVBox::drag_motion));
86  signal_drag_leave().connect (mem_fun (*this, &DnDVBox::drag_leave));
87 
89 
91  signal_drag_data_received().connect (mem_fun (*this, &DnDVBox::drag_data_received));
92  }
93 
94  virtual ~DnDVBox ()
95  {
96  clear ();
97 
98  delete _drag_icon;
99  }
100 
102  void add_child (T* child, std::list<Gtk::TargetEntry> targets = std::list<Gtk::TargetEntry>())
103  {
104  if (targets.empty ()) {
105  child->action_widget().drag_source_set (_targets, Gdk::MODIFIER_MASK, _actions);
106  } else {
107  child->action_widget().drag_source_set (targets, Gdk::MODIFIER_MASK, _actions);
108  }
109  child->action_widget().signal_drag_begin().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_begin), child));
110  child->action_widget().signal_drag_data_get().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_data_get), child));
111  child->action_widget().signal_drag_end().connect (sigc::bind (mem_fun (*this, &DnDVBox::drag_end), child));
112  child->action_widget().signal_button_press_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_press), child));
113  child->action_widget().signal_button_release_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_release), child));
114 
115  _internal_vbox.pack_start (child->widget(), false, false);
116 
117  _children.push_back (child);
118  child->widget().show ();
119  }
120 
122  std::list<T*> children ()
123  {
124  std::list<T*> sorted_children;
125 
126  std::list<Gtk::Widget*> widget_children = _internal_vbox.get_children ();
127  for (std::list<Gtk::Widget*>::iterator i = widget_children.begin(); i != widget_children.end(); ++i) {
128  T* c = child_from_widget (*i);
129 
130  if (c) {
131  sorted_children.push_back (c);
132  }
133  }
134 
135  return sorted_children;
136  }
137 
139  std::list<T*> selection (bool sorted = false) const {
140  if (!sorted) {
141  return _selection;
142  } else {
143  /* simple insertion-sort */
144  std::list<T*> rv;
145  for (typename std::list<T*>::const_iterator i = _children.begin(); i != _children.end(); ++i) {
146  if (selected (*i)) {
147  rv.push_back (*i);
148  }
149  }
150  return rv;
151  }
152  }
153 
158  void set_active (T* c) {
159  T* old_active = _active;
160  _active = c;
161  if (old_active) {
162  setup_child_state (old_active);
163  }
164  if (_active) {
166  }
167  }
168 
172  bool selected (T* child) const {
173  return (find (_selection.begin(), _selection.end(), child) != _selection.end());
174  }
175 
177  void clear ()
178  {
179  _selection.clear ();
180 
181  for (typename std::list<T*>::iterator i = _children.begin(); i != _children.end(); ++i) {
182  _internal_vbox.remove ((*i)->widget());
183  delete *i;
184  }
185 
186  _children.clear ();
187  _active = 0;
188  }
189 
190  void select_all ()
191  {
192  clear_selection ();
193  for (typename std::list<T*>::iterator i = _children.begin(); i != _children.end(); ++i) {
194  add_to_selection (*i);
195  }
196 
197  SelectionChanged (); /* EMIT SIGNAL */
198  }
199 
200  void select_none ()
201  {
202  clear_selection ();
203 
204  SelectionChanged (); /* EMIT SIGNAL */
205  }
206 
210  std::pair<T*, double> get_child_at_position (int y) const
211  {
212  T* before;
213  T* after;
214 
215  std::pair<T*, double> r;
216 
217  r.second = get_children_around_position (y, &before, &r.first, &after);
218 
219  return r;
220  }
221 
222  void set_spacing (int s) {
224  }
225 
227  {
228  if (_placeholder) {
230  _placeholder = 0;
231  }
232  }
233 
238  int add_placeholder (double y)
239  {
241  }
242 
244  sigc::signal<void> Reordered;
245 
247  sigc::signal<bool, GdkEventButton*, T*> ButtonPress;
248 
250  sigc::signal<bool, GdkEventButton*, T*> ButtonRelease;
251 
255  sigc::signal<void, DnDVBox*, T*, Glib::RefPtr<Gdk::DragContext> const & > DropFromAnotherBox;
256  sigc::signal<void, Gtk::SelectionData const &, T*, Glib::RefPtr<Gdk::DragContext> const & > DropFromExternal;
257  sigc::signal<void> SelectionChanged;
258  sigc::signal<void,T&> SelectionAdded;
259 
260  sigc::signal<bool, DnDVBox*, T*> DragRefuse;
261 
262 private:
263 
267  double bottom_of_child_ignoring_placeholder (T* child) const
268  {
269  Gtk::Allocation const a = child->widget().get_allocation ();
270  double bottom = a.get_y() + a.get_height();
271 
272  if (_placeholder) {
274  if (b.get_y() < a.get_y()) {
275  bottom -= (b.get_height () + _internal_vbox.get_spacing ());
276  }
277  }
278 
279  return bottom;
280  }
281 
289  double get_children_around_position (int y, T** before, T** at, T** after) const
290  {
291  if (_children.empty()) {
292  *before = *at = *after = 0;
293  return -1;
294  }
295 
296  *before = 0;
297 
298  typename std::list<T*>::const_iterator j = _children.begin ();
299 
300  /* index of current child */
301  int i = 0;
302  /* top of current child */
303  double top = 0;
304  /* bottom of current child */
305  double bottom = bottom_of_child_ignoring_placeholder (*j);
306 
307  while (y >= bottom && j != _children.end()) {
308 
309  top = bottom;
310 
311  *before = *j;
312  ++i;
313  ++j;
314 
315  if (j != _children.end()) {
317  }
318  }
319 
320  if (j == _children.end()) {
321  *at = 0;
322  *after = 0;
323  return -1;
324  }
325 
326  *at = *j;
327 
328  ++j;
329  *after = j != _children.end() ? *j : 0;
330 
331  return i + ((y - top) / (bottom - top));
332  }
333 
334  void drag_begin (Glib::RefPtr<Gdk::DragContext> const & context, T* child)
335  {
336  _drag_child = child;
337 
338  /* make up an icon for the drag */
340 
341  Gtk::Allocation a = child->action_widget().get_allocation ();
343 
344  _drag_icon->signal_expose_event().connect (sigc::mem_fun (*this, &DnDVBox::icon_expose));
346 
347  /* make the icon transparent if possible */
348  Glib::RefPtr<Gdk::Screen const> s = _drag_icon->get_screen ();
349  Glib::RefPtr<Gdk::Colormap const> c = s->get_rgba_colormap ();
350  if (c) {
352  }
353 
354  int w, h;
355  _drag_icon->get_size (w, h);
356  _drag_icon->drag_set_as_icon (context, w / 2, h / 2);
357 
358  _drag_source = this;
359  }
360 
361  /* Draw the drag icon */
363  {
364  /* Just grab the child's widget and use that */
365 
366  int w, h;
367  _drag_icon->get_size (w, h);
368 
369  cairo_t* cr = gdk_cairo_create (_drag_icon->get_window()->gobj ());
370 
371  Glib::RefPtr<Gdk::Pixmap> p = _drag_child->action_widget().get_snapshot();
372  gdk_cairo_set_source_pixmap (cr, p->gobj(), 0, 0);
373  cairo_rectangle (cr, 0, 0, w, h);
374  cairo_fill (cr);
375  cairo_destroy (cr);
376 
377  return false;
378  }
379 
380  void drag_data_get (Glib::RefPtr<Gdk::DragContext> const &context, Gtk::SelectionData & selection_data, guint, guint, T* child)
381  {
382  if (!child->drag_data_get(context, selection_data)) {
383  selection_data.set (selection_data.get_target(), 8, (const guchar *) &child, sizeof (&child));
384  }
385  }
386 
388  Glib::RefPtr<Gdk::DragContext> const & context, int /*x*/, int y, Gtk::SelectionData const & selection_data, guint /*info*/, guint time
389  )
390  {
391  /* work out where it was dropped */
392  std::pair<T*, double> const drop = get_child_at_position (y);
393 
394  if (selection_data.get_target () != _targets.front ().get_target ()) {
395  DropFromExternal (selection_data, drop.first, context);
396  context->drag_finish (false, false, time);
397  return;
398  }
399 
400  if (_drag_source == this) {
401 
402  /* dropped from ourselves onto ourselves */
403 
404  T* child = *((T * const *) selection_data.get_data());
405 
406  if (drop.first == 0) {
407  _internal_vbox.reorder_child (child->widget(), -1);
408  } else {
409 
410  /* where in the list this child should be dropped */
411  int target = drop.second + 0.5;
412 
413  /* find out whether the child was `picked up' from before the drop position */
414  int n = 0;
415  typename std::list<T*>::const_iterator i = _children.begin ();
416  while (i != _children.end() && *i != child && n < target) {
417  ++i;
418  ++n;
419  }
420 
421  /* if so, adjust the drop position to account for this */
422  if (n < target) {
423  --target;
424  }
425 
426  _internal_vbox.reorder_child (child->widget(), target);
427  }
428 
429  } else {
430 
431  /* drag started in another DnDVBox; raise a signal to say what happened */
432  DropFromAnotherBox (_drag_source, drop.first, context);
433  }
434 
435  context->drag_finish (false, false, time);
436  }
437 
438  void drag_end (Glib::RefPtr<Gdk::DragContext> const &, T *)
439  {
440  delete _drag_icon;
441  _drag_icon = 0;
442  _drag_source = 0;
443 
444  _drag_child = 0;
446 
447  Reordered (); /* EMIT SIGNAL */
448  }
449 
455  {
456  if (_placeholder == 0) {
457  _placeholder = manage (new Gtk::Label (""));
458  _internal_vbox.pack_start (*_placeholder, false, false);
459  _placeholder->show ();
460  }
461 
462  /* round up the index, unless we're off the end of the children */
463  int const n = c < 0 ? -1 : int (c + 0.5);
465  return n;
466  }
467 
468  bool drag_motion (Glib::RefPtr<Gdk::DragContext> const & ctx, int /*x*/, int y, guint tme)
469  {
470  if (_children.empty ()) {
471  return false;
472  }
473 
474  T* before;
475  T* at = NULL;
476  T* after;
477 
478  /* decide where we currently are */
479  double const c = get_children_around_position (y, &before, &at, &after);
480 
481  /* whether we're in the top or bottom half of the child that we're over */
482  bool top_half = (c - int (c)) < .5;
483  bool bottom_half = !top_half;
484 
485  if (_drag_source != this) {
486  if (DragRefuse (_drag_source, at)) {
487  ctx->drag_refuse (tme);
488  return true;
489  }
490  }
491 
492  if (_drag_source != this /* re-order */
493  && _drag_source && at
495  && _drag_source->selection ().size () == 1
496  && at != _drag_source->_drag_child // can't happen or can it?
497  && at->can_copy_state (_drag_source->_drag_child))
498  {
499  top_half = (c - int (c)) < 0.33;
500  bottom_half = (c - int (c)) > 0.8; // increase area >> 0.66; plugin below will move, or there's space
501  }
502 
503  /* Note that when checking on whether to remove a placeholder, we never do
504  so if _drag_child is 0 as this means that the child being dragged is
505  coming from a different DnDVBox, so it will never be the same as any
506  of our children.
507  */
508 
509  if (top_half && _drag_child && (before == _drag_child || at == _drag_child)) {
510  /* dropping here would have no effect, so remove the visual cue */
512  return false;
513  }
514 
515  if (bottom_half && _drag_child && (at == _drag_child || after == _drag_child)) {
516  /* dropping here would have no effect, so remove the visual cue */
518  return false;
519  }
520 
521  if (top_half || bottom_half) {
523  if (_drag_source == this /* re-order */) {
524  ctx->drag_status (Gdk::ACTION_MOVE, tme);
525  } else {
526  ctx->drag_status (ctx->get_suggested_action (), tme);
527  }
528  } else {
529  ctx->drag_status (Gdk::ACTION_LINK, tme);
531  }
532  return true;
533  }
534 
535  void drag_leave (Glib::RefPtr<Gdk::DragContext> const &, guint)
536  {
538  }
539 
540  bool button_press (GdkEventButton* ev, T* child)
541  {
542  if (_expecting_unwanted_button_event == true && child == 0) {
544  return true;
545  }
546 
547  if (child) {
549  }
550 
551  if (ev->button == 1 || ev->button == 3) {
552 
553  if (!selected (child)) {
554 
555  if ((ev->state & Gdk::SHIFT_MASK) && !_selection.empty()) {
556 
557  /* Shift-click; select all between the clicked child and any existing selections */
558 
559  bool selecting = false;
560  bool done = false;
561  for (typename std::list<T*>::const_iterator i = _children.begin(); i != _children.end(); ++i) {
562 
563  bool const was_selected = selected (*i);
564 
565  if (selecting && !was_selected) {
566  add_to_selection (*i);
567  }
568 
569  if (!selecting && !done) {
570  if (selected (*i)) {
571  selecting = true;
572  } else if (*i == child) {
573  selecting = true;
574  add_to_selection (child);
575  }
576  } else if (selecting) {
577  if (was_selected || *i == child) {
578  selecting = false;
579  done = true;
580  }
581  }
582  }
583 
584  } else {
585 
586  if ((ev->state & Keyboard::PrimaryModifier) == 0) {
587  clear_selection ();
588  }
589 
590  if (child) {
591  add_to_selection (child);
592  }
593 
594  }
595 
596  SelectionChanged (); /* EMIT SIGNAL */
597 
598  } else {
599  /* XXX THIS NEEDS GENERALIZING FOR OS X */
600  if (ev->button == 1 && (ev->state & Gdk::CONTROL_MASK)) {
601  if (child && selected (child)) {
602  remove_from_selection (child);
603  SelectionChanged (); /* EMIT SIGNAL */
604  }
605  }
606  }
607  }
608 
609  return ButtonPress (ev, child); /* EMIT SIGNAL */
610  }
611 
612  bool button_release (GdkEventButton* ev, T* child)
613  {
614  if (_expecting_unwanted_button_event == true && child == 0) {
616  return true;
617  }
618 
619  if (child) {
621  }
622 
623  return ButtonRelease (ev, child); /* EMIT SIGNAL */
624  }
625 
627  void setup_child_state (T* c)
628  {
629  assert (c);
630  c->set_visual_state (Selected, (selected (c) || (_active == c)));
631  }
632 
634  {
635  std::list<T*> old_selection = _selection;
636  _selection.clear ();
637  for (typename std::list<T*>::iterator i = old_selection.begin(); i != old_selection.end(); ++i) {
638  setup_child_state (*i);
639  }
640  }
641 
642  void add_to_selection (T* child)
643  {
644  if (!child->is_selectable()) {
645  return;
646  }
647  _selection.push_back (child);
648  setup_child_state (child);
649  SelectionAdded (*child); /* EMIT SIGNAL */
650  }
651 
652  void remove_from_selection (T* child)
653  {
654  typename std::list<T*>::iterator x = find (_selection.begin(), _selection.end(), child);
655  if (x != _selection.end()) {
656  T* c = *x;
657  _selection.erase (x);
658  setup_child_state (c);
659  }
660  }
661 
662  T* child_from_widget (Gtk::Widget const * w) const
663  {
664  typename std::list<T*>::const_iterator i = _children.begin();
665  while (i != _children.end() && &(*i)->widget() != w) {
666  ++i;
667  }
668 
669  if (i == _children.end()) {
670  return 0;
671  }
672 
673  return *i;
674  }
675 
677  std::list<Gtk::TargetEntry> _targets;
679  std::list<T*> _children;
680  std::list<T*> _selection;
690 
692 
693 };
694 
695 template <class T>
697 
698 }
int get_width() const
int get_y() const
int get_height() const
void pack_start(Widget &child, bool expand, bool fill, guint padding=0)
void set_spacing(int spacing)
void reorder_child(Widget &child, int pos)
int get_spacing() const
void remove(Widget &widget)
Glib::ListHandle< Widget * > get_children()
(internal) Operate on contained items (see foreach())
virtual void add(Widget &widget)
const guchar * get_data() const
std::string get_target() const
void set(int format, const guint8 *data, int length)
Glib::SignalProxy6< void, const Glib::RefPtr< Gdk::DragContext > &, int, int, const SelectionData &, guint, guint > signal_drag_data_received()
void set_name(const Glib::ustring &name)
void add_events(Gdk::EventMask events)
Glib::RefPtr< Gdk::Window > get_window()
Glib::SignalProxy1< bool, GdkEventButton * > signal_button_release_event()
void set_size_request(int width=-1, int height=-1)
void drag_set_as_icon(const Glib::RefPtr< Gdk::DragContext > &context, int hot_x, int hot_y)
Glib::SignalProxy1< bool, GdkEventExpose * > signal_expose_event()
Event triggered by window requiring a refresh.
Glib::SignalProxy2< void, const Glib::RefPtr< Gdk::DragContext > &, guint > signal_drag_leave()
Glib::SignalProxy1< bool, GdkEventButton * > signal_button_press_event()
Allocation get_allocation() const
Glib::ustring get_name() const
Glib::SignalProxy4< bool, const Glib::RefPtr< Gdk::DragContext > &, int, int, guint > signal_drag_motion()
void set_colormap(const Glib::RefPtr< const Gdk::Colormap > &colormap)
void drag_dest_set(DestDefaults flags=DestDefaults(0), Gdk::DragAction actions=Gdk::DragAction(0))
Glib::RefPtr< Gdk::Screen > get_screen()
void get_size(int &width, int &height) const
virtual bool drag_data_get(Glib::RefPtr< Gdk::DragContext > const, Gtk::SelectionData &)
Definition: dndvbox.h:56
virtual Gtk::Widget & widget()=0
virtual Gtk::EventBox & action_widget()=0
virtual void set_visual_state(VisualState, bool onoff)=0
virtual bool can_copy_state(DnDVBoxChild *) const =0
virtual ~DnDVBoxChild()
Definition: dndvbox.h:39
virtual std::string drag_text() const =0
virtual bool is_selectable() const =0
sigc::signal< void, DnDVBox *, T *, Glib::RefPtr< Gdk::DragContext > const & > DropFromAnotherBox
Definition: dndvbox.h:255
std::list< Gtk::TargetEntry > _targets
Definition: dndvbox.h:677
sigc::signal< void > SelectionChanged
Definition: dndvbox.h:257
std::list< T * > children()
Definition: dndvbox.h:122
void add_child(T *child, std::list< Gtk::TargetEntry > targets=std::list< Gtk::TargetEntry >())
Definition: dndvbox.h:102
static DnDVBox * _drag_source
Definition: dndvbox.h:691
bool icon_expose(GdkEventExpose *)
Definition: dndvbox.h:362
sigc::signal< void, T & > SelectionAdded
Definition: dndvbox.h:258
void clear_selection()
Definition: dndvbox.h:633
sigc::signal< void > Reordered
Definition: dndvbox.h:244
double bottom_of_child_ignoring_placeholder(T *child) const
Definition: dndvbox.h:267
bool _expecting_unwanted_button_event
Definition: dndvbox.h:683
sigc::signal< bool, GdkEventButton *, T * > ButtonPress
Definition: dndvbox.h:247
void remove_placeholder()
Definition: dndvbox.h:226
std::list< T * > _selection
Definition: dndvbox.h:680
bool selected(T *child) const
Definition: dndvbox.h:172
virtual ~DnDVBox()
Definition: dndvbox.h:94
bool button_release(GdkEventButton *ev, T *child)
Definition: dndvbox.h:612
void add_to_selection(T *child)
Definition: dndvbox.h:642
sigc::signal< bool, GdkEventButton *, T * > ButtonRelease
Definition: dndvbox.h:250
std::pair< T *, double > get_child_at_position(int y) const
Definition: dndvbox.h:210
void setup_child_state(T *c)
Definition: dndvbox.h:627
int add_placeholder(double y)
Definition: dndvbox.h:238
std::list< T * > _children
Definition: dndvbox.h:679
double get_children_around_position(int y, T **before, T **at, T **after) const
Definition: dndvbox.h:289
void select_none()
Definition: dndvbox.h:200
bool button_press(GdkEventButton *ev, T *child)
Definition: dndvbox.h:540
void drag_begin(Glib::RefPtr< Gdk::DragContext > const &context, T *child)
Definition: dndvbox.h:334
void drag_data_received(Glib::RefPtr< Gdk::DragContext > const &context, int, int y, Gtk::SelectionData const &selection_data, guint, guint time)
Definition: dndvbox.h:387
T * child_from_widget(Gtk::Widget const *w) const
Definition: dndvbox.h:662
void drag_leave(Glib::RefPtr< Gdk::DragContext > const &, guint)
Definition: dndvbox.h:535
void set_active(T *c)
Definition: dndvbox.h:158
void drag_data_get(Glib::RefPtr< Gdk::DragContext > const &context, Gtk::SelectionData &selection_data, guint, guint, T *child)
Definition: dndvbox.h:380
int create_or_update_placeholder(double c)
Definition: dndvbox.h:454
void remove_from_selection(T *child)
Definition: dndvbox.h:652
Gtk::Window * _drag_icon
Definition: dndvbox.h:682
void drag_end(Glib::RefPtr< Gdk::DragContext > const &, T *)
Definition: dndvbox.h:438
std::list< T * > selection(bool sorted=false) const
Definition: dndvbox.h:139
bool drag_motion(Glib::RefPtr< Gdk::DragContext > const &ctx, int, int y, guint tme)
Definition: dndvbox.h:468
Gtk::VBox _internal_vbox
Definition: dndvbox.h:676
void set_spacing(int s)
Definition: dndvbox.h:222
DnDVBox(std::list< Gtk::TargetEntry > targets, Gdk::DragAction actions=Gdk::ACTION_COPY)
Definition: dndvbox.h:66
Gdk::DragAction _actions
Definition: dndvbox.h:678
sigc::signal< void, Gtk::SelectionData const &, T *, Glib::RefPtr< Gdk::DragContext > const & > DropFromExternal
Definition: dndvbox.h:256
Gtk::Label * _placeholder
Definition: dndvbox.h:687
sigc::signal< bool, DnDVBox *, T * > DragRefuse
Definition: dndvbox.h:260
void select_all()
Definition: dndvbox.h:190
G_BEGIN_DECLS cairo_t * gdk_cairo_create(GdkDrawable *drawable)
void gdk_cairo_set_source_pixmap(cairo_t *cr, GdkPixmap *pixmap, double pixmap_x, double pixmap_y)
DragAction
Definition: dragcontext.h:68
@ LEAVE_NOTIFY_MASK
@ BUTTON_RELEASE_MASK
@ KEY_PRESS_MASK
@ ENTER_NOTIFY_MASK
@ BUTTON_PRESS_MASK
@ KEY_RELEASE_MASK
@ ACTION_LINK
Definition: dragcontext.h:72
@ ACTION_MOVE
Definition: dragcontext.h:71
@ ACTION_COPY
Definition: dragcontext.h:70
T * manage(T *obj)
Definition: object.h:58