2013-01-16 13:37:48 -05:00
|
|
|
/*
|
2015-10-04 14:51:05 -04:00
|
|
|
Copyright (C) 2012 Paul Davis
|
2013-01-16 13:37:48 -05:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2012-02-02 23:17:53 -05:00
|
|
|
#ifndef __gtk2_ardour_button_joiner_h__
|
|
|
|
#define __gtk2_ardour_button_joiner_h__
|
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/alignment.h>
|
|
|
|
#include <gtkmm/action.h>
|
|
|
|
|
|
|
|
#include "gtkmm2ext/activatable.h"
|
|
|
|
#include "gtkmm2ext/cairo_widget.h"
|
|
|
|
|
|
|
|
class ButtonJoiner : public CairoWidget, public Gtkmm2ext::Activatable {
|
|
|
|
public:
|
2012-04-08 20:03:35 -04:00
|
|
|
ButtonJoiner (const std::string&, Gtk::Widget&, Gtk::Widget&, bool central_link = false);
|
2012-02-03 13:31:10 -05:00
|
|
|
~ButtonJoiner ();
|
|
|
|
|
2015-10-05 10:17:49 -04:00
|
|
|
void set_related_action (Glib::RefPtr<Gtk::Action>);
|
2012-02-02 23:17:53 -05:00
|
|
|
void set_active_state (Gtkmm2ext::ActiveState);
|
|
|
|
|
|
|
|
protected:
|
2017-03-20 12:11:56 -04:00
|
|
|
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
2012-02-02 23:17:53 -05:00
|
|
|
bool on_button_release_event (GdkEventButton*);
|
|
|
|
void on_size_request (Gtk::Requisition*);
|
2012-02-03 13:31:10 -05:00
|
|
|
void on_size_allocate (Gtk::Allocation&);
|
2012-02-02 23:17:53 -05:00
|
|
|
|
|
|
|
void action_sensitivity_changed ();
|
|
|
|
void action_visibility_changed ();
|
|
|
|
void action_tooltip_changed ();
|
|
|
|
void action_toggled ();
|
|
|
|
|
|
|
|
private:
|
2012-02-03 13:49:43 -05:00
|
|
|
Gtk::Widget& left;
|
|
|
|
Gtk::Widget& right;
|
|
|
|
Gtk::HBox packer;
|
2012-02-02 23:17:53 -05:00
|
|
|
Gtk::Alignment align;
|
2012-02-03 13:49:43 -05:00
|
|
|
std::string name;
|
2012-02-03 13:31:10 -05:00
|
|
|
cairo_pattern_t* active_fill_pattern;
|
|
|
|
cairo_pattern_t* inactive_fill_pattern;
|
2012-04-08 20:03:35 -04:00
|
|
|
bool central_link;
|
2012-02-03 14:10:39 -05:00
|
|
|
double border_r;
|
|
|
|
double border_g;
|
|
|
|
double border_b;
|
2012-02-02 23:17:53 -05:00
|
|
|
void set_colors ();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __gtk2_ardour_button_joiner_h__ */
|