Move Gtkmm2ext widgets into libwidget

This commit is contained in:
Robin Gareus 2017-07-16 22:13:46 +02:00
parent b6e4dfe37b
commit f6e182b937
48 changed files with 218 additions and 252 deletions

View file

@ -17,6 +17,7 @@
*/
#include <gtkmm/window.h>
#include <gtkmm/box.h>
#include "gtkmm2ext/visibility.h"

View file

@ -26,8 +26,6 @@ gtkmm2ext_sources = [
'actions.cc',
'application.cc',
'ardour_icon.cc',
'auto_spin.cc',
'barcontroller.cc',
'binding_proxy.cc',
'bindable_button.cc',
'bindings.cc',
@ -39,13 +37,11 @@ gtkmm2ext_sources = [
'cell_renderer_pixbuf_multi.cc',
'cell_renderer_pixbuf_toggle.cc',
'choice.cc',
'click_box.cc',
'cursors.cc',
'debug.cc',
'dndtreeview.cc',
'emscale.cc',
'eventboxext.cc',
'focus_entry.cc',
'grouped_buttons.cc',
'gtk_ui.cc',
'gtkapplication.c',
@ -55,14 +51,11 @@ gtkmm2ext_sources = [
'pane.cc',
'paths_dialog.cc',
'persistent_tooltip.cc',
'pixfader.cc',
'pixscroller.cc',
'popup.cc',
'prompter.cc',
'scroomer.cc',
'searchbar.cc',
'selector.cc',
'slider_controller.cc',
'stateful_button.cc',
'tabbable.cc',
'tearoff.cc',
@ -95,8 +88,6 @@ def build(bld):
sources = list(gtkmm2ext_sources)
if bld.is_tracks_build():
sources += [ 'waves_fastmeter.cc', 'fader.cc' ]
else:
sources += [ 'fastmeter.cc' ]
if bld.is_defined ('INTERNAL_SHARED_LIBS'):
obj = bld.shlib(features = 'c cxx cshlib cxxshlib', source=sources)

View file

@ -26,21 +26,23 @@
#include "gtkmm2ext/cairo_widget.h"
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/pixfader.h"
#include "gtkmm2ext/utils.h"
using namespace Gtkmm2ext;
#include "widgets/ardour_fader.h"
using namespace Gtk;
using namespace std;
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
#define CORNER_RADIUS 2.5
#define CORNER_SIZE 2
#define CORNER_OFFSET 1
#define FADER_RESERVE 6
std::list<PixFader::FaderImage*> PixFader::_patterns;
std::list<ArdourFader::FaderImage*> ArdourFader::_patterns;
PixFader::PixFader (Gtk::Adjustment& adj, int orientation, int fader_length, int fader_girth)
ArdourFader::ArdourFader (Gtk::Adjustment& adj, int orientation, int fader_length, int fader_girth)
: _layout (0)
, _tweaks (Tweaks(0))
, _adjustment (adj)
@ -69,9 +71,9 @@ PixFader::PixFader (Gtk::Adjustment& adj, int orientation, int fader_length, int
| Gdk::LEAVE_NOTIFY_MASK
);
_adjustment.signal_value_changed().connect (mem_fun (*this, &PixFader::adjustment_changed));
_adjustment.signal_changed().connect (mem_fun (*this, &PixFader::adjustment_changed));
signal_grab_broken_event ().connect (mem_fun (*this, &PixFader::on_grab_broken_event));
_adjustment.signal_value_changed().connect (mem_fun (*this, &ArdourFader::adjustment_changed));
_adjustment.signal_changed().connect (mem_fun (*this, &ArdourFader::adjustment_changed));
signal_grab_broken_event ().connect (mem_fun (*this, &ArdourFader::on_grab_broken_event));
if (_orien == VERT) {
CairoWidget::set_size_request(_girth, _span);
} else {
@ -79,14 +81,14 @@ PixFader::PixFader (Gtk::Adjustment& adj, int orientation, int fader_length, int
}
}
PixFader::~PixFader ()
ArdourFader::~ArdourFader ()
{
if (_parent_style_change) _parent_style_change.disconnect();
if (_layout) _layout.clear (); // drop reference to existing layout
}
void
PixFader::flush_pattern_cache () {
ArdourFader::flush_pattern_cache () {
for (list<FaderImage*>::iterator f = _patterns.begin(); f != _patterns.end(); ++f) {
cairo_pattern_destroy ((*f)->pattern);
}
@ -95,7 +97,7 @@ PixFader::flush_pattern_cache () {
cairo_pattern_t*
PixFader::find_pattern (double afr, double afg, double afb,
ArdourFader::find_pattern (double afr, double afg, double afb,
double abr, double abg, double abb,
int w, int h)
{
@ -108,7 +110,7 @@ PixFader::find_pattern (double afr, double afg, double afb,
}
void
PixFader::create_patterns ()
ArdourFader::create_patterns ()
{
Gdk::Color c = get_style()->get_fg (get_state());
float fr, fg, fb;
@ -205,7 +207,7 @@ PixFader::create_patterns ()
}
void
PixFader::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t* area)
ArdourFader::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t* area)
{
cairo_t* cr = ctx->cobj();
@ -344,7 +346,7 @@ PixFader::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t* a
}
void
PixFader::on_size_request (GtkRequisition* req)
ArdourFader::on_size_request (GtkRequisition* req)
{
if (_orien == VERT) {
req->width = (_min_girth ? _min_girth : -1);
@ -356,7 +358,7 @@ PixFader::on_size_request (GtkRequisition* req)
}
void
PixFader::on_size_allocate (Gtk::Allocation& alloc)
ArdourFader::on_size_allocate (Gtk::Allocation& alloc)
{
int old_girth = _girth;
int old_span = _span;
@ -380,7 +382,7 @@ PixFader::on_size_allocate (Gtk::Allocation& alloc)
}
bool
PixFader::on_grab_broken_event (GdkEventGrabBroken* ev)
ArdourFader::on_grab_broken_event (GdkEventGrabBroken* ev)
{
if (_dragging) {
remove_modal_grab();
@ -392,7 +394,7 @@ PixFader::on_grab_broken_event (GdkEventGrabBroken* ev)
}
bool
PixFader::on_button_press_event (GdkEventButton* ev)
ArdourFader::on_button_press_event (GdkEventButton* ev)
{
if (ev->type != GDK_BUTTON_PRESS) {
if (_dragging) {
@ -426,7 +428,7 @@ PixFader::on_button_press_event (GdkEventButton* ev)
}
bool
PixFader::on_button_release_event (GdkEventButton* ev)
ArdourFader::on_button_release_event (GdkEventButton* ev)
{
double ev_pos = (_orien == VERT) ? ev->y : ev->x;
@ -486,7 +488,7 @@ PixFader::on_button_release_event (GdkEventButton* ev)
}
bool
PixFader::on_scroll_event (GdkEventScroll* ev)
ArdourFader::on_scroll_event (GdkEventScroll* ev)
{
double scale;
bool ret = false;
@ -539,7 +541,7 @@ PixFader::on_scroll_event (GdkEventScroll* ev)
}
bool
PixFader::on_motion_notify_event (GdkEventMotion* ev)
ArdourFader::on_motion_notify_event (GdkEventMotion* ev)
{
if (_dragging) {
double scale = 1.0;
@ -582,14 +584,14 @@ PixFader::on_motion_notify_event (GdkEventMotion* ev)
}
void
PixFader::adjustment_changed ()
ArdourFader::adjustment_changed ()
{
queue_draw ();
}
/** @return pixel offset of the current value from the right or bottom of the fader */
int
PixFader::display_span ()
ArdourFader::display_span ()
{
float fract = (_adjustment.get_value () - _adjustment.get_lower()) / ((_adjustment.get_upper() - _adjustment.get_lower()));
int ds;
@ -607,7 +609,7 @@ PixFader::display_span ()
}
void
PixFader::update_unity_position ()
ArdourFader::update_unity_position ()
{
if (_orien == VERT) {
const double span = _span - FADER_RESERVE - CORNER_OFFSET;
@ -621,7 +623,7 @@ PixFader::update_unity_position ()
}
bool
PixFader::on_enter_notify_event (GdkEventCrossing*)
ArdourFader::on_enter_notify_event (GdkEventCrossing*)
{
_hovering = true;
if (!(_tweaks & NoVerticalScroll)) {
@ -632,7 +634,7 @@ PixFader::on_enter_notify_event (GdkEventCrossing*)
}
bool
PixFader::on_leave_notify_event (GdkEventCrossing*)
ArdourFader::on_leave_notify_event (GdkEventCrossing*)
{
if (!_dragging) {
_hovering = false;
@ -645,7 +647,7 @@ PixFader::on_leave_notify_event (GdkEventCrossing*)
}
void
PixFader::set_adjustment_from_event (GdkEventButton* ev)
ArdourFader::set_adjustment_from_event (GdkEventButton* ev)
{
const double off = FADER_RESERVE + ((_orien == VERT) ? CORNER_OFFSET : 0);
const double span = _span - off;
@ -658,14 +660,14 @@ PixFader::set_adjustment_from_event (GdkEventButton* ev)
}
void
PixFader::set_default_value (float d)
ArdourFader::set_default_value (float d)
{
_default_value = d;
update_unity_position ();
}
void
PixFader::set_tweaks (Tweaks t)
ArdourFader::set_tweaks (Tweaks t)
{
bool need_redraw = false;
if ((_tweaks & NoShowUnityLine) ^ (t & NoShowUnityLine)) {
@ -678,7 +680,7 @@ PixFader::set_tweaks (Tweaks t)
}
void
PixFader::set_text (const std::string& str, bool centered, bool expose)
ArdourFader::set_text (const std::string& str, bool centered, bool expose)
{
if (_layout && _text == str) {
return;
@ -698,7 +700,7 @@ PixFader::set_text (const std::string& str, bool centered, bool expose)
}
void
PixFader::on_state_changed (Gtk::StateType old_state)
ArdourFader::on_state_changed (Gtk::StateType old_state)
{
Widget::on_state_changed (old_state);
create_patterns ();
@ -706,7 +708,7 @@ PixFader::on_state_changed (Gtk::StateType old_state)
}
void
PixFader::on_style_changed (const Glib::RefPtr<Gtk::Style>&)
ArdourFader::on_style_changed (const Glib::RefPtr<Gtk::Style>&)
{
if (_layout) {
std::string txt = _layout->get_text();
@ -721,7 +723,7 @@ PixFader::on_style_changed (const Glib::RefPtr<Gtk::Style>&)
}
Gdk::Color
PixFader::get_parent_bg ()
ArdourFader::get_parent_bg ()
{
Widget* parent = get_parent ();
@ -736,7 +738,7 @@ PixFader::get_parent_bg ()
if (_current_parent != parent) {
if (_parent_style_change) _parent_style_change.disconnect();
_current_parent = parent;
_parent_style_change = parent->signal_style_changed().connect (mem_fun (*this, &PixFader::on_style_changed));
_parent_style_change = parent->signal_style_changed().connect (mem_fun (*this, &ArdourFader::on_style_changed));
}
return parent->get_style ()->get_bg (parent->get_state());
}

View file

@ -19,10 +19,11 @@
*/
#include <cmath>
#include "gtkmm2ext/auto_spin.h"
#include "gtkmm2ext/keyboard.h"
#include "widgets/auto_spin.h"
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
using namespace std;
#define upper adjustment.get_upper()

View file

@ -27,14 +27,16 @@
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/barcontroller.h"
#include "gtkmm2ext/cairo_widget.h"
#include "widgets/barcontroller.h"
#include "pbd/i18n.h"
using namespace std;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
BarController::BarController (Gtk::Adjustment& adj,
boost::shared_ptr<PBD::Controllable> mc)
@ -46,7 +48,7 @@ BarController::BarController (Gtk::Adjustment& adj,
add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
set (.5, .5, 1.0, 1.0);
set_border_width (0);
_slider.set_tweaks (PixFader::NoShowUnityLine);
_slider.set_tweaks (ArdourFader::NoShowUnityLine);
_slider.StartGesture.connect (sigc::mem_fun(*this, &BarController::passtrhu_gesture_start));
_slider.StopGesture.connect (sigc::mem_fun(*this, &BarController::passtrhu_gesture_stop));

View file

@ -21,14 +21,13 @@
#include <iostream>
#include <cstdio> /* for sprintf, sigh ... */
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/click_box.h>
#include "pbd/controllable.h"
#include "gtkmm2ext/utils.h"
#include "widgets/click_box.h"
using namespace std;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
using namespace sigc;
ClickBox::ClickBox (Gtk::Adjustment *adjp, const string &name, bool round_to_steps)

View file

@ -14,8 +14,6 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#include <iostream>
@ -27,9 +25,9 @@
#include <glibmm.h>
#include <gdkmm.h>
#include <gdkmm/rectangle.h>
#include <gtkmm2ext/fastmeter.h>
#include <gtkmm2ext/utils.h>
#include "gtkmm2ext/utils.h"
#include "widgets/fastmeter.h"
#define UINT_TO_RGB(u,r,g,b) { (*(r)) = ((u)>>16)&0xff; (*(g)) = ((u)>>8)&0xff; (*(b)) = (u)&0xff; }
#define UINT_TO_RGBA(u,r,g,b,a) { UINT_TO_RGB(((u)>>8),r,g,b); (*(a)) = (u)&0xff; }
@ -37,6 +35,7 @@
using namespace Gtk;
using namespace Glib;
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
using namespace std;
int FastMeter::min_pattern_metric_size = 16;

View file

@ -17,9 +17,9 @@
*/
#include <gtkmm2ext/focus_entry.h>
#include "widgets/focus_entry.h"
using namespace Gtkmm2ext;
using namespace ArdourWidgets;
FocusEntry::FocusEntry ()
: next_release_selects (false)
@ -47,4 +47,3 @@ FocusEntry::on_button_release_event (GdkEventButton* ev)
return Entry::on_button_release_event (ev);
}

View file

@ -1,8 +1,9 @@
#include "gtkmm2ext/searchbar.h"
#include "gtkmm2ext/keyboard.h"
#include <iostream>
namespace Gtkmm2ext {
#include "gtkmm2ext/keyboard.h"
#include "widgets/searchbar.h"
using namespace ArdourWidgets;
SearchBar::SearchBar (const std::string& label, bool icon_resets)
: placeholder_text (label)
@ -89,5 +90,3 @@ SearchBar::reset ()
set_text (placeholder_text);
search_string_changed ();
}
}

View file

@ -19,18 +19,19 @@
#include <string>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/pixfader.h>
#include <gtkmm2ext/slider_controller.h>
#include "gtkmm2ext/gtk_ui.h"
#include "pbd/controllable.h"
#include "widgets/ardour_fader.h"
#include "widgets/slider_controller.h"
#include "pbd/i18n.h"
using namespace Gtkmm2ext;
using namespace PBD;
using namespace ArdourWidgets;
SliderController::SliderController (Gtk::Adjustment *adj, boost::shared_ptr<PBD::Controllable> mc, int orientation, int fader_length, int fader_girth)
: PixFader (*adj, orientation, fader_length, fader_girth)
: ArdourFader (*adj, orientation, fader_length, fader_girth)
, _ctrl (mc)
, _ctrl_adj (adj)
, _spin_adj (0, 0, 1.0, .1, .01)
@ -62,7 +63,7 @@ SliderController::on_button_press_event (GdkEventButton *ev)
return true;
}
return PixFader::on_button_press_event (ev);
return ArdourFader::on_button_press_event (ev);
}
bool
@ -72,7 +73,7 @@ SliderController::on_enter_notify_event (GdkEventCrossing* ev)
if (c) {
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> (c));
}
return PixFader::on_enter_notify_event (ev);
return ArdourFader::on_enter_notify_event (ev);
}
bool
@ -81,7 +82,7 @@ SliderController::on_leave_notify_event (GdkEventCrossing* ev)
if (_binding_proxy.get_controllable()) {
PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> ());
}
return PixFader::on_leave_notify_event (ev);
return ArdourFader::on_leave_notify_event (ev);
}
void

View file

@ -17,25 +17,25 @@
*/
#ifndef __gtkmm2ext_pixfader_h__
#define __gtkmm2ext_pixfader_h__
#ifndef _WIDGETS_ARDOUR_FADER_H_
#define _WIDGETS_ARDOUR_FADER_H_
#include <cmath>
#include <stdint.h>
#include "gtkmm2ext/cairo_widget.h"
#include <gtkmm/adjustment.h>
#include <gdkmm.h>
#include <gtkmm/adjustment.h>
#include "gtkmm2ext/visibility.h"
#include "gtkmm2ext/cairo_widget.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API PixFader : public CairoWidget
class LIBWIDGETS_API ArdourFader : public CairoWidget
{
public:
PixFader (Gtk::Adjustment& adjustment, int orientation, int span, int girth);
virtual ~PixFader ();
public:
ArdourFader (Gtk::Adjustment& adjustment, int orientation, int span, int girth);
virtual ~ArdourFader ();
static void flush_pattern_cache();
sigc::signal<void> StartGesture;
@ -54,7 +54,7 @@ class LIBGTKMM2EXT_API PixFader : public CairoWidget
Tweaks tweaks() const { return _tweaks; }
void set_tweaks (Tweaks);
protected:
protected:
void on_size_request (GtkRequisition*);
void on_size_allocate (Gtk::Allocation& alloc);
@ -75,8 +75,7 @@ class LIBGTKMM2EXT_API PixFader : public CairoWidget
HORIZ,
};
private:
private:
Glib::RefPtr<Pango::Layout> _layout;
std::string _text;
Tweaks _tweaks;
@ -154,7 +153,6 @@ class LIBGTKMM2EXT_API PixFader : public CairoWidget
};
} /* namespace */
#endif /* __gtkmm2ext_pixfader_h__ */

View file

@ -17,8 +17,8 @@
*/
#ifndef __gtkmm2ext_auto_spin_h__
#define __gtkmm2ext_auto_spin_h__
#ifndef _WIDGETS_AUTO_SPIN_H_
#define _WIDGETS_AUTO_SPIN_H_
#ifdef interface
#undef interface
@ -26,14 +26,13 @@
#include <gtkmm.h>
#include "gtkmm2ext/visibility.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
class LIBGTKMM2EXT_API AutoSpin
namespace ArdourWidgets {
class LIBWIDGETS_API AutoSpin
{
public:
public:
AutoSpin (Gtk::Adjustment &adj, gfloat cr = 0, bool round_to_steps_yn = false);
Gtk::Adjustment &get_adjustment() { return adjustment; }
@ -41,15 +40,14 @@ class LIBGTKMM2EXT_API AutoSpin
void use_left_as_decrement (bool yn) { left_is_decrement = yn; }
void set_wrap (bool yn) { wrap = yn; }
void set_climb_rate (gfloat cr) { climb_rate = cr; }
void set_bounds (gfloat initial, gfloat low, gfloat high,
bool with_reset = true);
void set_bounds (gfloat initial, gfloat low, gfloat high, bool with_reset = true);
gint button_press (GdkEventButton *);
gint stop_spinning (GdkEventButton *ignored_but_here_for_clicked);
void start_spinning (bool decrementing, bool use_page);
gint scroll_event (GdkEventScroll *);
private:
private:
Gtk::Adjustment &adjustment;
gfloat climb_rate;
gfloat timer_increment;
@ -75,4 +73,4 @@ class LIBGTKMM2EXT_API AutoSpin
} /* namespace */
#endif /* __gtkmm2ext_auto_spin_h__ */
#endif

View file

@ -16,29 +16,29 @@
*/
#ifndef __gtkmm2ext_bar_controller_h__
#define __gtkmm2ext_bar_controller_h__
#ifndef _WIDGETS_BAR_CONTROLLER_H_
#define _WIDGETS_BAR_CONTROLLER_H_
#include <gtkmm/alignment.h>
#include <cairo.h>
#include "gtkmm2ext/visibility.h"
#include "gtkmm2ext/binding_proxy.h"
#include "gtkmm2ext/slider_controller.h"
#include "widgets/slider_controller.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API BarController : public Gtk::Alignment
class LIBWIDGETS_API BarController : public Gtk::Alignment
{
public:
public:
BarController (Gtk::Adjustment& adj, boost::shared_ptr<PBD::Controllable>);
virtual ~BarController ();
void set_sensitive (bool yn);
PixFader::Tweaks tweaks() const { return _slider.tweaks (); }
void set_tweaks (PixFader::Tweaks t) { _slider.set_tweaks (t);}
ArdourFader::Tweaks tweaks() const { return _slider.tweaks (); }
void set_tweaks (ArdourFader::Tweaks t) { _slider.set_tweaks (t);}
sigc::signal<void> StartGesture;
sigc::signal<void> StopGesture;
@ -51,7 +51,7 @@ class LIBGTKMM2EXT_API BarController : public Gtk::Alignment
*/
sigc::signal<void, bool> SpinnerActive;
protected:
protected:
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
void on_style_changed (const Glib::RefPtr<Gtk::Style>&);
@ -60,7 +60,7 @@ class LIBGTKMM2EXT_API BarController : public Gtk::Alignment
return "";
}
private:
private:
HSliderController _slider;
bool entry_focus_out (GdkEventFocus*);
void entry_activated ();

View file

@ -17,8 +17,8 @@
*/
#ifndef __gtkmm2ext_click_box_h__
#define __gtkmm2ext_click_box_h__
#ifndef _WIDGETS_CLICK_BOX_H_
#define _WIDGETS_CLICK_BOX_H_
#ifdef interface
#undef interface
@ -27,17 +27,18 @@
#include <string>
#include <gtkmm.h>
#include "gtkmm2ext/auto_spin.h"
#include "gtkmm2ext/binding_proxy.h"
#include "gtkmm2ext/visibility.h"
#include "widgets/auto_spin.h"
#include "widgets/visibility.h"
namespace PBD {
class Controllable;
}
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API ClickBox : public Gtk::DrawingArea, public AutoSpin
class LIBWIDGETS_API ClickBox : public Gtk::DrawingArea, public AutoSpin
{
public:
ClickBox (Gtk::Adjustment *adj, const std::string &name, bool round_to_steps = false);
@ -77,4 +78,4 @@ class LIBGTKMM2EXT_API ClickBox : public Gtk::DrawingArea, public AutoSpin
} /* namespace */
#endif /* __gtkmm2ext_click_box_h__ */
#endif

View file

@ -17,8 +17,8 @@
*/
#ifndef __gtkmm2ext_fastmeter_h__
#define __gtkmm2ext_fastmeter_h__
#ifndef _WIDGETS_FAST_METER_H_
#define _WIDGETS_FAST_METER_H_
#include <map>
#include <boost/tuple/tuple.hpp>
@ -26,12 +26,12 @@
#include <cairomm/pattern.h>
#include "gtkmm2ext/cairo_widget.h"
#include "gtkmm2ext/visibility.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API FastMeter : public CairoWidget {
public:
class LIBWIDGETS_API FastMeter : public CairoWidget {
public:
enum Orientation {
Horizontal,
Vertical
@ -70,8 +70,8 @@ class LIBGTKMM2EXT_API FastMeter : public CairoWidget {
protected:
void on_size_request (GtkRequisition*);
void on_size_allocate (Gtk::Allocation&);
private:
private:
Cairo::RefPtr<Cairo::Pattern> fgpattern;
Cairo::RefPtr<Cairo::Pattern> bgpattern;
gint pixheight;
@ -174,4 +174,4 @@ private:
} /* namespace */
#endif /* __gtkmm2ext_fastmeter_h__ */
#endif

View file

@ -17,27 +17,27 @@
*/
#ifndef __gtkmm2ext_focus_entry_h__
#define __gtkmm2ext_focus_entry_h__
#ifndef _WIDGETS_FOCUS_ENTRY_H_
#define _WIDGETS_FOCUS_ENTRY_H_
#include <gtkmm/entry.h>
#include "gtkmm2ext/visibility.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API FocusEntry : public Gtk::Entry
class LIBWIDGETS_API FocusEntry : public Gtk::Entry
{
public:
public:
FocusEntry ();
protected:
protected:
bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*);
private:
private:
bool next_release_selects;
};
}
} /* end namespace */
#endif /* __gtkmm2ext_focus_entry_h__ */
#endif

View file

@ -3,21 +3,23 @@
#include <gtkmm/entry.h>
#include <string>
#include "gtkmm2ext/visibility.h"
#include "widgets/visibility.h"
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API SearchBar : public Gtk::Entry
class LIBWIDGETS_API SearchBar : public Gtk::Entry
{
public:
SearchBar(
SearchBar (
const std::string& placeholder_text = "Search...",
bool icon_click_resets = true);
// resets the searchbar to the initial state
/** resets the searchbar to the initial state */
void reset ();
// emitted when the filter has been updated
/* emitted when the filter has been updated */
sigc::signal<void, const std::string&> signal_search_string_updated () { return sig_search_string_updated; }
protected:
bool focus_in_event (GdkEventFocus*);
bool focus_out_event (GdkEventFocus*);
@ -27,6 +29,7 @@ protected:
const std::string placeholder_text;
sigc::signal<void, const std::string&> sig_search_string_updated;
private:
void search_string_changed () const;
@ -34,4 +37,4 @@ private:
bool icon_click_resets;
};
}
} /* end namespace */

View file

@ -16,35 +16,31 @@
*/
#ifndef __gtkmm2ext_slider_controller_h__
#define __gtkmm2ext_slider_controller_h__
#ifndef _WIDGETS_SLIDER_CONTROLLER_H_
#define _WIDGETS_SLIDER_CONTROLLER_H_
#ifdef interface
#undef interface
#endif
#include <gtkmm.h>
#include <gtkmm2ext/popup.h>
#include <gtkmm2ext/pixfader.h>
#include <gtkmm2ext/binding_proxy.h>
#include <boost/shared_ptr.hpp>
#include "gtkmm2ext/visibility.h"
#include "gtkmm2ext/popup.h"
#include "gtkmm2ext/binding_proxy.h"
namespace Gtkmm2ext {
class Pix;
}
#include "widgets/ardour_fader.h"
#include "widgets/visibility.h"
namespace PBD {
class Controllable;
}
namespace Gtkmm2ext {
namespace ArdourWidgets {
class LIBGTKMM2EXT_API SliderController : public Gtkmm2ext::PixFader
class LIBWIDGETS_API SliderController : public ArdourWidgets::ArdourFader
{
public:
public:
SliderController (Gtk::Adjustment* adj, boost::shared_ptr<PBD::Controllable> mc, int orientation, int, int);
virtual ~SliderController () {}
@ -52,7 +48,7 @@ class LIBGTKMM2EXT_API SliderController : public Gtkmm2ext::PixFader
Gtk::SpinButton& get_spin_button () { assert(_ctrl); return _spin; }
void set_controllable (boost::shared_ptr<PBD::Controllable> c) { _binding_proxy.set_controllable (c); }
protected:
protected:
bool on_button_press_event (GdkEventButton *ev);
bool on_enter_notify_event (GdkEventCrossing* ev);
bool on_leave_notify_event (GdkEventCrossing* ev);
@ -68,19 +64,18 @@ class LIBGTKMM2EXT_API SliderController : public Gtkmm2ext::PixFader
bool _spin_ignore;
};
class LIBGTKMM2EXT_API VSliderController : public SliderController
class LIBWIDGETS_API VSliderController : public SliderController
{
public:
public:
VSliderController (Gtk::Adjustment *adj, boost::shared_ptr<PBD::Controllable> mc, int, int);
};
class LIBGTKMM2EXT_API HSliderController : public SliderController
class LIBWIDGETS_API HSliderController : public SliderController
{
public:
public:
HSliderController (Gtk::Adjustment *adj, boost::shared_ptr<PBD::Controllable> mc, int, int);
};
}; /* namespace */
#endif // __gtkmm2ext_slider_controller_h__
#endif

View file

@ -29,9 +29,17 @@ widgets_sources = [
'ardour_button.cc',
'ardour_display.cc',
'ardour_dropdown.cc',
'ardour_fader.cc',
'ardour_knob.cc',
'ardour_spacer.cc',
'ardour_spinner.cc',
'auto_spin.cc',
'barcontroller.cc',
'click_box.cc',
'fastmeter.cc',
'focus_entry.cc',
'searchbar.cc',
'slider_controller.cc',
'tooltips.cc',
'ui_config.cc',
]