Ardour  9.0-pre0-582-g084a23a80d
tearoff.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2003 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _WIDGETS_TEAROFF_H_
21 #define _WIDGETS_TEAROFF_H_
22 
23 #include <gtkmm/arrow.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/eventbox.h>
26 #include <gtkmm/window.h>
27 
28 #include "widgets/visibility.h"
29 
30 class XMLNode;
31 
32 namespace ArdourWidgets {
33 
35 {
36 public:
37  TearOff (Gtk::Widget& contents, bool allow_resize = false);
38  virtual ~TearOff ();
39 
40  void set_visible (bool yn, bool force = false);
41  void set_can_be_torn_off (bool);
42  bool can_be_torn_off () const { return _can_be_torn_off; }
43  bool visible () const { return _visible; }
44 
45  sigc::signal<void> Detach;
46  sigc::signal<void> Attach;
47  sigc::signal<void> Visible;
48  sigc::signal<void> Hidden;
49 
50  Gtk::Window& tearoff_window() { return own_window; }
51  bool torn_off() const;
52  void tear_it_off ();
53  void put_it_back ();
54  void hide_visible ();
55 
56  void set_state (const XMLNode&);
57  void add_state (XMLNode&) const;
58 
59 private:
67  double drag_x;
68  double drag_y;
69  bool dragging;
70  bool _visible;
71  bool _torn;
77 
80 
85 
88 };
89 
90 } /* namespace */
91 
92 #endif
Gtk::Window own_window
Definition: tearoff.h:61
TearOff(Gtk::Widget &contents, bool allow_resize=false)
void set_state(const XMLNode &)
Gtk::EventBox close_event_box
Definition: tearoff.h:66
Gtk::HBox window_box
Definition: tearoff.h:64
Gtk::Arrow tearoff_arrow
Definition: tearoff.h:62
bool visible() const
Definition: tearoff.h:43
gint close_click(GdkEventButton *)
Gtk::EventBox tearoff_event_box
Definition: tearoff.h:65
Gtk::Arrow close_arrow
Definition: tearoff.h:63
bool own_window_configured(GdkEventConfigure *)
sigc::signal< void > Visible
Definition: tearoff.h:47
void set_visible(bool yn, bool force=false)
gint window_delete_event(GdkEventAny *)
void add_state(XMLNode &) const
gint window_button_press(GdkEventButton *)
sigc::signal< void > Detach
Definition: tearoff.h:45
bool can_be_torn_off() const
Definition: tearoff.h:42
Gtk::Widget & contents
Definition: tearoff.h:60
void set_can_be_torn_off(bool)
gint window_button_release(GdkEventButton *)
gint window_motion(GdkEventMotion *)
sigc::signal< void > Attach
Definition: tearoff.h:46
sigc::signal< void > Hidden
Definition: tearoff.h:48
gint tearoff_click(GdkEventButton *)
Gtk::Window & tearoff_window()
Definition: tearoff.h:50
Definition: xml++.h:114
PBD::PropertyDescriptor< bool > contents
#define LIBWIDGETS_API