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

@ -74,11 +74,11 @@
#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/fastmeter.h"
#include "gtkmm2ext/popup.h" #include "gtkmm2ext/popup.h"
#include "gtkmm2ext/window_title.h" #include "gtkmm2ext/window_title.h"
#include "widgets/fastmeter.h"
#include "ardour/ardour.h" #include "ardour/ardour.h"
#include "ardour/audio_backend.h" #include "ardour/audio_backend.h"
#include "ardour/audio_track.h" #include "ardour/audio_track.h"
@ -867,7 +867,7 @@ ARDOUR_UI::~ARDOUR_UI ()
delete gui_object_state; gui_object_state = 0; delete gui_object_state; gui_object_state = 0;
delete main_window_visibility; delete main_window_visibility;
FastMeter::flush_pattern_cache (); FastMeter::flush_pattern_cache ();
PixFader::flush_pattern_cache (); ArdourFader::flush_pattern_cache ();
} }
#ifndef NDEBUG #ifndef NDEBUG

View file

@ -55,7 +55,6 @@
#include <gtkmm/adjustment.h> #include <gtkmm/adjustment.h>
#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/stateful_button.h" #include "gtkmm2ext/stateful_button.h"
#include "gtkmm2ext/bindable_button.h" #include "gtkmm2ext/bindable_button.h"
#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/bindings.h"

View file

@ -37,7 +37,6 @@
#include "gtkmm2ext/cairocell.h" #include "gtkmm2ext/cairocell.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/window_title.h" #include "gtkmm2ext/window_title.h"
#include "ardour/profile.h" #include "ardour/profile.h"

View file

@ -47,8 +47,8 @@ using PBD::Controllable;
AutomationBarController::AutomationBarController ( AutomationBarController::AutomationBarController (
boost::shared_ptr<AutomationControl> ac, boost::shared_ptr<AutomationControl> ac,
Adjustment* adj) Adjustment* adj)
: Gtkmm2ext::BarController(*adj, ac) : ArdourWidgets::BarController (*adj, ac)
, _controllable(ac) , _controllable (ac)
{ {
} }
@ -344,7 +344,6 @@ AutomationController::disable_vertical_scroll ()
AutomationBarController* bar = dynamic_cast<AutomationBarController*>(_widget); AutomationBarController* bar = dynamic_cast<AutomationBarController*>(_widget);
if (bar) { if (bar) {
bar->set_tweaks ( bar->set_tweaks (
Gtkmm2ext::PixFader::Tweaks(bar->tweaks() | ArdourWidgets::ArdourFader::Tweaks(bar->tweaks() | ArdourWidgets::ArdourFader::NoVerticalScroll));
Gtkmm2ext::PixFader::NoVerticalScroll));
} }
} }

View file

@ -31,9 +31,9 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <gtkmm.h> #include <gtkmm.h>
#include "gtkmm2ext/barcontroller.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "evoral/Parameter.hpp" #include "evoral/Parameter.hpp"
#include "widgets/barcontroller.h"
namespace ARDOUR { namespace ARDOUR {
class Session; class Session;
@ -41,7 +41,7 @@ namespace ARDOUR {
class AutomationControl; class AutomationControl;
} }
class AutomationBarController : public Gtkmm2ext::BarController { class AutomationBarController : public ArdourWidgets::BarController {
public: public:
AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac, AutomationBarController(boost::shared_ptr<ARDOUR::AutomationControl> ac,
Gtk::Adjustment* adj); Gtk::Adjustment* adj);

View file

@ -18,7 +18,6 @@
*/ */
#include <utility> #include <utility>
#include <gtkmm2ext/barcontroller.h>
#include <gtkmm2ext/utils.h> #include <gtkmm2ext/utils.h>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>

View file

@ -35,7 +35,6 @@
#include <gtkmm/layout.h> #include <gtkmm/layout.h>
#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/dndtreeview.h" #include "gtkmm2ext/dndtreeview.h"
#include "gtkmm2ext/pane.h" #include "gtkmm2ext/pane.h"
#include "gtkmm2ext/selector.h" #include "gtkmm2ext/selector.h"

View file

@ -31,7 +31,6 @@
#include "gtkmm/style.h" #include "gtkmm/style.h"
#include "gdkmm/color.h" #include "gdkmm/color.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/fastmeter.h"
#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/gtk_ui.h"
#include "widgets/tooltips.h" #include "widgets/tooltips.h"
@ -122,7 +121,7 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
meter_metric_area.signal_button_press_event().connect (sigc::mem_fun (*this, &GainMeterBase::level_meter_button_press)); meter_metric_area.signal_button_press_event().connect (sigc::mem_fun (*this, &GainMeterBase::level_meter_button_press));
meter_metric_area.add_events (Gdk::BUTTON_PRESS_MASK); meter_metric_area.add_events (Gdk::BUTTON_PRESS_MASK);
gain_slider->set_tweaks (PixFader::Tweaks(PixFader::NoButtonForward | PixFader::NoVerticalScroll)); gain_slider->set_tweaks (ArdourFader::Tweaks(ArdourFader::NoButtonForward | ArdourFader::NoVerticalScroll));
gain_slider->StartGesture.connect (sigc::mem_fun (*this, &GainMeter::amp_start_touch)); gain_slider->StartGesture.connect (sigc::mem_fun (*this, &GainMeter::amp_start_touch));
gain_slider->StopGesture.connect (sigc::mem_fun (*this, &GainMeter::amp_stop_touch)); gain_slider->StopGesture.connect (sigc::mem_fun (*this, &GainMeter::amp_stop_touch));
gain_slider->set_name ("GainFader"); gain_slider->set_name ("GainFader");
@ -645,7 +644,7 @@ void
GainMeterBase::update_gain_sensitive () GainMeterBase::update_gain_sensitive ()
{ {
bool x = !(_control->alist()->automation_state() & Play); bool x = !(_control->alist()->automation_state() & Play);
static_cast<Gtkmm2ext::SliderController*>(gain_slider)->set_sensitive (x); static_cast<ArdourWidgets::SliderController*>(gain_slider)->set_sensitive (x);
} }
gint gint

View file

@ -39,10 +39,8 @@
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"
#include "widgets/focus_entry.h"
#include "gtkmm2ext/click_box.h" #include "widgets/slider_controller.h"
#include "gtkmm2ext/focus_entry.h"
#include "gtkmm2ext/slider_controller.h"
#include "enums.h" #include "enums.h"
#include "level_meter.h" #include "level_meter.h"
@ -57,9 +55,7 @@ namespace ARDOUR {
class Amp; class Amp;
class Automatable; class Automatable;
} }
namespace Gtkmm2ext {
class FastMeter;
}
namespace Gtk { namespace Gtk {
class Menu; class Menu;
} }
@ -97,7 +93,7 @@ public:
boost::shared_ptr<PBD::Controllable> get_controllable(); boost::shared_ptr<PBD::Controllable> get_controllable();
LevelMeterHBox& get_level_meter() const { return *level_meter; } LevelMeterHBox& get_level_meter() const { return *level_meter; }
Gtkmm2ext::SliderController& get_gain_slider() const { return *gain_slider; } ArdourWidgets::SliderController& get_gain_slider() const { return *gain_slider; }
/** Emitted in the GUI thread when a button is pressed over the level meter; /** Emitted in the GUI thread when a button is pressed over the level meter;
* return true if the event is handled. * return true if the event is handled.
@ -123,14 +119,14 @@ protected:
bool ignore_toggle; bool ignore_toggle;
bool next_release_selects; bool next_release_selects;
Gtkmm2ext::SliderController *gain_slider; ArdourWidgets::SliderController* gain_slider;
Gtk::Adjustment gain_adjustment; Gtk::Adjustment gain_adjustment;
Gtkmm2ext::FocusEntry gain_display; ArdourWidgets::FocusEntry gain_display;
Gtkmm2ext::FocusEntry peak_display; ArdourWidgets::FocusEntry peak_display;
Gtk::DrawingArea meter_metric_area; Gtk::DrawingArea meter_metric_area;
Gtk::DrawingArea meter_ticks1_area; Gtk::DrawingArea meter_ticks1_area;
Gtk::DrawingArea meter_ticks2_area; Gtk::DrawingArea meter_ticks2_area;
LevelMeterHBox *level_meter; LevelMeterHBox* level_meter;
sigc::connection gain_watching; sigc::connection gain_watching;

View file

@ -32,14 +32,13 @@
#include "pbd/xml++.h" #include "pbd/xml++.h"
#include "pbd/failed_constructor.h" #include "pbd/failed_constructor.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/fastmeter.h"
#include "gtkmm2ext/barcontroller.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/doi.h" #include "gtkmm2ext/doi.h"
#include "gtkmm2ext/slider_controller.h"
#include "widgets/ardour_knob.h" #include "widgets/ardour_knob.h"
#include "widgets/click_box.h"
#include "widgets/fastmeter.h"
#include "widgets/slider_controller.h"
#include "widgets/tooltips.h" #include "widgets/tooltips.h"
#include "ardour/plugin.h" #include "ardour/plugin.h"
@ -756,7 +755,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter& param,
Adjustment* adj = control_ui->controller->adjustment(); Adjustment* adj = control_ui->controller->adjustment();
if (desc.integer_step && !desc.toggled) { if (desc.integer_step && !desc.toggled) {
control_ui->clickbox = new ClickBox (adj, "PluginUIClickBox", true); control_ui->clickbox = new ArdourWidgets::ClickBox (adj, "PluginUIClickBox", true);
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2); Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2);
if (desc.unit == ParameterDescriptor::MIDI_NOTE) { if (desc.unit == ParameterDescriptor::MIDI_NOTE) {
control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::midinote_printer), control_ui)); control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::midinote_printer), control_ui));

View file

@ -27,7 +27,8 @@
#include <gtkmm/scrolledwindow.h> #include <gtkmm/scrolledwindow.h>
#include <gtkmm/treeview.h> #include <gtkmm/treeview.h>
#include <gtkmm/treestore.h> #include <gtkmm/treestore.h>
#include "gtkmm2ext/searchbar.h"
#include "widgets/searchbar.h"
#include "ardour_window.h" #include "ardour_window.h"
@ -109,7 +110,7 @@ private:
Gtk::HBox reset_box; Gtk::HBox reset_box;
Gtk::Button reset_button; Gtk::Button reset_button;
Gtk::Label reset_label; Gtk::Label reset_label;
Gtkmm2ext::SearchBar filter_entry; ArdourWidgets::SearchBar filter_entry;
std::string filter_string; std::string filter_string;
Gtk::Button print_button; Gtk::Button print_button;
Gtk::Label print_label; Gtk::Label print_label;

View file

@ -28,10 +28,9 @@
#include <gtkmm/button.h> #include <gtkmm/button.h>
#include <gtkmm/adjustment.h> #include <gtkmm/adjustment.h>
#include <gtkmm2ext/barcontroller.h>
#include "pbd/controllable.h" #include "pbd/controllable.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "widgets/barcontroller.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"
@ -41,7 +40,7 @@ namespace ARDOUR {
class LatencyGUI; class LatencyGUI;
class LatencyBarController : public Gtkmm2ext::BarController class LatencyBarController : public ArdourWidgets::BarController
{ {
public: public:
LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g) LatencyBarController (Gtk::Adjustment& adj, LatencyGUI* g)

View file

@ -37,7 +37,7 @@
using namespace ARDOUR; using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS; using namespace ARDOUR_UI_UTILS;
using namespace PBD; using namespace PBD;
using namespace Gtkmm2ext; using namespace ArdourWidgets;
using namespace Gtk; using namespace Gtk;
using namespace std; using namespace std;

View file

@ -34,10 +34,9 @@
#include "ardour/chan_count.h" #include "ardour/chan_count.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include <gtkmm2ext/click_box.h> #include "widgets/fastmeter.h"
#include <gtkmm2ext/focus_entry.h> #include "widgets/focus_entry.h"
#include <gtkmm2ext/slider_controller.h> #include "widgets/slider_controller.h"
#include <gtkmm2ext/fastmeter.h>
#include "enums.h" #include "enums.h"
@ -53,7 +52,7 @@ class LevelMeterBase : public ARDOUR::SessionHandlePtr, virtual public sigc::tra
{ {
public: public:
LevelMeterBase (ARDOUR::Session*, PBD::EventLoop::InvalidationRecord* ir, LevelMeterBase (ARDOUR::Session*, PBD::EventLoop::InvalidationRecord* ir,
Gtkmm2ext::FastMeter::Orientation o = Gtkmm2ext::FastMeter::Vertical); ArdourWidgets::FastMeter::Orientation o = ArdourWidgets::FastMeter::Vertical);
virtual ~LevelMeterBase (); virtual ~LevelMeterBase ();
virtual void set_meter (ARDOUR::PeakMeter* meter); virtual void set_meter (ARDOUR::PeakMeter* meter);
@ -82,16 +81,16 @@ protected:
private: private:
PBD::EventLoop::InvalidationRecord* parent_invalidator; PBD::EventLoop::InvalidationRecord* parent_invalidator;
ARDOUR::PeakMeter* _meter; ARDOUR::PeakMeter* _meter;
Gtkmm2ext::FastMeter::Orientation _meter_orientation; ArdourWidgets::FastMeter::Orientation _meter_orientation;
Width _width; Width _width;
struct MeterInfo { struct MeterInfo {
Gtkmm2ext::FastMeter *meter; ArdourWidgets::FastMeter* meter;
gint16 width; gint16 width;
int length; int length;
bool packed; bool packed;
float max_peak; float max_peak;
MeterInfo() { MeterInfo() {
meter = 0; meter = 0;

View file

@ -21,10 +21,10 @@
#include "ardour/dB.h" #include "ardour/dB.h"
#include "ardour/rc_configuration.h" #include "ardour/rc_configuration.h"
#include "gtkmm2ext/slider_controller.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "widgets/ardour_dropdown.h" #include "widgets/ardour_dropdown.h"
#include "widgets/slider_controller.h"
#include "ardour_dialog.h" #include "ardour_dialog.h"
#include "luadialog.h" #include "luadialog.h"
@ -178,7 +178,7 @@ public:
: LuaDialogWidget (key, title) : LuaDialogWidget (key, title)
, _db_adjustment (ARDOUR::gain_to_slider_position_with_max (1.0, ARDOUR::Config->get_max_gain ()), 0, 1, 0.01, 0.1) , _db_adjustment (ARDOUR::gain_to_slider_position_with_max (1.0, ARDOUR::Config->get_max_gain ()), 0, 1, 0.01, 0.1)
{ {
_db_slider = Gtk::manage (new Gtkmm2ext::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable> (), 220, 18)); _db_slider = Gtk::manage (new ArdourWidgets::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable> (), 220, 18));
_fader_centering_box.pack_start (*_db_slider, true, false); _fader_centering_box.pack_start (*_db_slider, true, false);
@ -239,7 +239,7 @@ protected:
} }
Gtk::Adjustment _db_adjustment; Gtk::Adjustment _db_adjustment;
Gtkmm2ext::HSliderController* _db_slider; ArdourWidgets::HSliderController* _db_slider;
Gtk::Entry _db_display; Gtk::Entry _db_display;
Gtk::HBox _box; Gtk::HBox _box;
Gtk::VBox _fader_centering_box; Gtk::VBox _fader_centering_box;

View file

@ -32,7 +32,6 @@
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/choice.h" #include "gtkmm2ext/choice.h"
#include "gtkmm2ext/doi.h" #include "gtkmm2ext/doi.h"
#include "gtkmm2ext/slider_controller.h"
#include "gtkmm2ext/bindable_button.h" #include "gtkmm2ext/bindable_button.h"
#include "widgets/tooltips.h" #include "widgets/tooltips.h"

View file

@ -34,8 +34,6 @@
#include <gtkmm/textview.h> #include <gtkmm/textview.h>
#include <gtkmm/adjustment.h> #include <gtkmm/adjustment.h>
#include "gtkmm2ext/auto_spin.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/bindable_button.h" #include "gtkmm2ext/bindable_button.h"
#include "gtkmm2ext/stateful_button.h" #include "gtkmm2ext/stateful_button.h"

View file

@ -485,7 +485,7 @@ FaderOption::FaderOption (string const & i, string const & n, sigc::slot<gain_t>
, _get (g) , _get (g)
, _set (s) , _set (s)
{ {
_db_slider = manage (new HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18)); _db_slider = manage (new ArdourWidgets::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
_label.set_text (n + ":"); _label.set_text (n + ":");
_label.set_alignment (0, 0.5); _label.set_alignment (0, 0.5);

View file

@ -26,7 +26,7 @@
#include <gtkmm/table.h> #include <gtkmm/table.h>
#include <gtkmm/window.h> #include <gtkmm/window.h>
#include "gtkmm2ext/slider_controller.h" #include "widgets/slider_controller.h"
#include "ardour_window.h" #include "ardour_window.h"
#include "audio_clock.h" #include "audio_clock.h"
@ -544,7 +544,7 @@ private:
bool on_key_press (GdkEventKey* ev); bool on_key_press (GdkEventKey* ev);
Gtk::Adjustment _db_adjustment; Gtk::Adjustment _db_adjustment;
Gtkmm2ext::HSliderController* _db_slider; ArdourWidgets::HSliderController* _db_slider;
Gtk::Entry _db_display; Gtk::Entry _db_display;
Gtk::Label _label; Gtk::Label _label;
Gtk::HBox _box; Gtk::HBox _box;

View file

@ -29,9 +29,6 @@
#include <gtkmm/togglebutton.h> #include <gtkmm/togglebutton.h>
#include <gtkmm/button.h> #include <gtkmm/button.h>
#include <gtkmm2ext/click_box.h>
#include <gtkmm2ext/slider_controller.h>
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "enums.h" #include "enums.h"
@ -49,10 +46,6 @@ namespace ARDOUR {
class AutomationControl; class AutomationControl;
} }
namespace Gtkmm2ext {
class FastMeter;
}
namespace Gtk { namespace Gtk {
class Menu; class Menu;
class Menuitem; class Menuitem;

View file

@ -29,12 +29,12 @@
#include <gtkmm/box.h> #include <gtkmm/box.h>
#include "gtkmm2ext/pixfader.h"
#include "gtkmm2ext/persistent_tooltip.h" #include "gtkmm2ext/persistent_tooltip.h"
#include "gtkmm2ext/slider_controller.h"
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"
#include "widgets/ardour_dropdown.h" #include "widgets/ardour_dropdown.h"
#include "widgets/ardour_fader.h"
#include "widgets/slider_controller.h"
#include "ardour_window.h" #include "ardour_window.h"
#include "io_selector.h" #include "io_selector.h"
@ -210,7 +210,7 @@ private:
boost::weak_ptr<ARDOUR::AutomationControl> _control; boost::weak_ptr<ARDOUR::AutomationControl> _control;
Gtk::Adjustment _adjustment; Gtk::Adjustment _adjustment;
Gtkmm2ext::HSliderController _slider; ArdourWidgets::HSliderController _slider;
Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip; Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip;
bool _ignore_ui_adjustment; bool _ignore_ui_adjustment;

View file

@ -32,15 +32,13 @@
#include "gtkmm/widget.h" #include "gtkmm/widget.h"
#include "gtkmm/box.h" #include "gtkmm/box.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/fastmeter.h"
#include "gtkmm2ext/barcontroller.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/doi.h" #include "gtkmm2ext/doi.h"
#include "gtkmm2ext/slider_controller.h"
#include "gtkmm2ext/application.h" #include "gtkmm2ext/application.h"
#include "widgets/tooltips.h" #include "widgets/tooltips.h"
#include "widgets/fastmeter.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/plugin.h" #include "ardour/plugin.h"

View file

@ -69,12 +69,9 @@ namespace PBD {
class Controllable; class Controllable;
} }
namespace Gtkmm2ext { namespace ArdourWidgets {
class HSliderController;
class BarController;
class ClickBox; class ClickBox;
class FastMeter; class FastMeter;
class PixmapButton;
} }
class LatencyGUI; class LatencyGUI;
@ -206,7 +203,7 @@ private:
bool is_scrollable; bool is_scrollable;
struct MeterInfo { struct MeterInfo {
Gtkmm2ext::FastMeter *meter; ArdourWidgets::FastMeter* meter;
bool packed; bool packed;
MeterInfo () { MeterInfo () {
@ -231,7 +228,7 @@ private:
ArdourWidgets::ArdourButton automate_button; ArdourWidgets::ArdourButton automate_button;
Gtk::Label label; Gtk::Label label;
ArdourWidgets::ArdourDropdown* combo; ArdourWidgets::ArdourDropdown* combo;
Gtkmm2ext::ClickBox* clickbox; ArdourWidgets::ClickBox* clickbox;
Gtk::FileChooserButton* file_button; Gtk::FileChooserButton* file_button;
ArdourWidgets::ArdourSpinner* spin_box; ArdourWidgets::ArdourSpinner* spin_box;

View file

@ -30,12 +30,9 @@
#include <gtkmm/menu.h> #include <gtkmm/menu.h>
#include <gtkmm/scrolledwindow.h> #include <gtkmm/scrolledwindow.h>
#include "gtkmm2ext/auto_spin.h"
#include "gtkmm2ext/bindings.h" #include "gtkmm2ext/bindings.h"
#include "gtkmm2ext/click_box.h"
#include "gtkmm2ext/dndtreeview.h" #include "gtkmm2ext/dndtreeview.h"
#include "gtkmm2ext/dndvbox.h" #include "gtkmm2ext/dndvbox.h"
#include "gtkmm2ext/pixfader.h"
#include "gtkmm2ext/persistent_tooltip.h" #include "gtkmm2ext/persistent_tooltip.h"
#include "pbd/stateful.h" #include "pbd/stateful.h"
@ -53,6 +50,8 @@
#include "pbd/fastlog.h" #include "pbd/fastlog.h"
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"
#include "widgets/ardour_fader.h"
#include "widgets/slider_controller.h"
#include "plugin_interest.h" #include "plugin_interest.h"
#include "io_selector.h" #include "io_selector.h"
@ -227,7 +226,7 @@ private:
boost::weak_ptr<ARDOUR::AutomationControl> _control; boost::weak_ptr<ARDOUR::AutomationControl> _control;
/* things for a slider */ /* things for a slider */
Gtk::Adjustment _adjustment; Gtk::Adjustment _adjustment;
Gtkmm2ext::HSliderController _slider; ArdourWidgets::HSliderController _slider;
Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip; Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip;
/* things for a button */ /* things for a button */
ArdourWidgets::ArdourButton _button; ArdourWidgets::ArdourButton _button;

View file

@ -34,7 +34,6 @@
#include <gtkmm/scale.h> #include <gtkmm/scale.h>
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"
#include "gtkmm2ext/slider_controller.h"
#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/paths_dialog.h" #include "gtkmm2ext/paths_dialog.h"
#include "gtkmm2ext/window_title.h" #include "gtkmm2ext/window_title.h"

View file

@ -33,7 +33,6 @@
#include <gtkmm/adjustment.h> #include <gtkmm/adjustment.h>
#include <gtkmm2ext/selector.h> #include <gtkmm2ext/selector.h>
#include <gtkmm2ext/slider_controller.h>
#include "widgets/ardour_button.h" #include "widgets/ardour_button.h"

View file

@ -24,7 +24,6 @@
#include "gtkmm2ext/choice.h" #include "gtkmm2ext/choice.h"
#include "gtkmm2ext/doi.h" #include "gtkmm2ext/doi.h"
#include "gtkmm2ext/bindable_button.h" #include "gtkmm2ext/bindable_button.h"
#include "gtkmm2ext/barcontroller.h"
#include "gtkmm2ext/gtk_ui.h" #include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/utils.h" #include "gtkmm2ext/utils.h"

View file

@ -149,7 +149,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
set_tooltip (name_label, _("Track/Bus name (double click to edit)")); set_tooltip (name_label, _("Track/Bus name (double click to edit)"));
{ {
std::auto_ptr<Gtk::Entry> an_entry (new Gtkmm2ext::FocusEntry); std::auto_ptr<Gtk::Entry> an_entry (new FocusEntry);
an_entry->set_name (X_("TrackNameEditor")); an_entry->set_name (X_("TrackNameEditor"));
Gtk::Requisition req; Gtk::Requisition req;
an_entry->size_request (req); an_entry->size_request (req);

View file

@ -33,19 +33,19 @@
#include <gtkmm/label.h> #include <gtkmm/label.h>
#include <gtkmm/sizegroup.h> #include <gtkmm/sizegroup.h>
#include <gtkmm2ext/focus_entry.h>
#include "pbd/stateful.h" #include "pbd/stateful.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "evoral/Parameter.hpp"
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour/presentation_info.h" #include "ardour/presentation_info.h"
#include "ardour/region.h" #include "ardour/region.h"
#include "evoral/Parameter.hpp"
#include "canvas/line.h" #include "canvas/line.h"
#include "widgets/focus_entry.h"
#include "prompter.h" #include "prompter.h"
#include "axis_view.h" #include "axis_view.h"
#include "enums.h" #include "enums.h"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -21,14 +21,13 @@
#include <iostream> #include <iostream>
#include <cstdio> /* for sprintf, sigh ... */ #include <cstdio> /* for sprintf, sigh ... */
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/click_box.h>
#include "pbd/controllable.h" #include "pbd/controllable.h"
#include "gtkmm2ext/utils.h"
#include "widgets/click_box.h"
using namespace std; using namespace std;
using namespace Gtk; using namespace Gtk;
using namespace Gtkmm2ext; using namespace ArdourWidgets;
using namespace sigc; using namespace sigc;
ClickBox::ClickBox (Gtk::Adjustment *adjp, const string &name, bool round_to_steps) 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 You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/ */
#include <iostream> #include <iostream>
@ -27,9 +25,9 @@
#include <glibmm.h> #include <glibmm.h>
#include <gdkmm.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_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; } #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 Gtk;
using namespace Glib; using namespace Glib;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
using namespace ArdourWidgets;
using namespace std; using namespace std;
int FastMeter::min_pattern_metric_size = 16; 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 () FocusEntry::FocusEntry ()
: next_release_selects (false) : next_release_selects (false)
@ -47,4 +47,3 @@ FocusEntry::on_button_release_event (GdkEventButton* ev)
return Entry::on_button_release_event (ev); return Entry::on_button_release_event (ev);
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,8 +17,8 @@
*/ */
#ifndef __gtkmm2ext_click_box_h__ #ifndef _WIDGETS_CLICK_BOX_H_
#define __gtkmm2ext_click_box_h__ #define _WIDGETS_CLICK_BOX_H_
#ifdef interface #ifdef interface
#undef interface #undef interface
@ -27,17 +27,18 @@
#include <string> #include <string>
#include <gtkmm.h> #include <gtkmm.h>
#include "gtkmm2ext/auto_spin.h"
#include "gtkmm2ext/binding_proxy.h" #include "gtkmm2ext/binding_proxy.h"
#include "gtkmm2ext/visibility.h"
#include "widgets/auto_spin.h"
#include "widgets/visibility.h"
namespace PBD { namespace PBD {
class Controllable; 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: public:
ClickBox (Gtk::Adjustment *adj, const std::string &name, bool round_to_steps = false); 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 */ } /* namespace */
#endif /* __gtkmm2ext_click_box_h__ */ #endif

View file

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

View file

@ -17,27 +17,27 @@
*/ */
#ifndef __gtkmm2ext_focus_entry_h__ #ifndef _WIDGETS_FOCUS_ENTRY_H_
#define __gtkmm2ext_focus_entry_h__ #define _WIDGETS_FOCUS_ENTRY_H_
#include <gtkmm/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 (); FocusEntry ();
protected: protected:
bool on_button_press_event (GdkEventButton*); bool on_button_press_event (GdkEventButton*);
bool on_button_release_event (GdkEventButton*); bool on_button_release_event (GdkEventButton*);
private: private:
bool next_release_selects; bool next_release_selects;
}; };
} } /* end namespace */
#endif /* __gtkmm2ext_focus_entry_h__ */ #endif

View file

@ -3,21 +3,23 @@
#include <gtkmm/entry.h> #include <gtkmm/entry.h>
#include <string> #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: public:
SearchBar( SearchBar (
const std::string& placeholder_text = "Search...", const std::string& placeholder_text = "Search...",
bool icon_click_resets = true); bool icon_click_resets = true);
// resets the searchbar to the initial state /** resets the searchbar to the initial state */
void reset (); 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; } sigc::signal<void, const std::string&> signal_search_string_updated () { return sig_search_string_updated; }
protected: protected:
bool focus_in_event (GdkEventFocus*); bool focus_in_event (GdkEventFocus*);
bool focus_out_event (GdkEventFocus*); bool focus_out_event (GdkEventFocus*);
@ -27,6 +29,7 @@ protected:
const std::string placeholder_text; const std::string placeholder_text;
sigc::signal<void, const std::string&> sig_search_string_updated; sigc::signal<void, const std::string&> sig_search_string_updated;
private: private:
void search_string_changed () const; void search_string_changed () const;
@ -34,4 +37,4 @@ private:
bool icon_click_resets; bool icon_click_resets;
}; };
} } /* end namespace */

View file

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

View file

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