2009-11-26 07:47:47 +00:00
|
|
|
#ifndef MATRIX_H
|
|
|
|
#define MATRIX_H
|
|
|
|
|
|
|
|
#include <gtkmm.h>
|
|
|
|
#include <list>
|
|
|
|
#include "rect.h"
|
2009-11-26 10:38:37 +00:00
|
|
|
#include "colour.h"
|
2009-11-26 07:47:47 +00:00
|
|
|
|
2009-11-27 17:19:30 +00:00
|
|
|
struct Base;
|
2009-11-26 07:47:47 +00:00
|
|
|
typedef std::list<Base *> BaseList;
|
|
|
|
|
2009-11-26 17:19:03 +00:00
|
|
|
enum PortType {
|
|
|
|
PT_ALL,
|
|
|
|
PT_AUDIO,
|
|
|
|
PT_MIDI
|
|
|
|
};
|
|
|
|
|
2009-11-26 07:47:47 +00:00
|
|
|
class Matrix : public Gtk::DrawingArea
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
int m_client_width;
|
|
|
|
int m_client_height;
|
|
|
|
int m_port_width;
|
|
|
|
int m_port_height;
|
|
|
|
int m_separation;
|
|
|
|
int m_width;
|
|
|
|
int m_height;
|
|
|
|
|
2009-11-30 23:46:37 +00:00
|
|
|
Rect m_x_rect;
|
|
|
|
Rect m_y_rect;
|
|
|
|
|
|
|
|
bool m_x_is_midi;
|
|
|
|
bool m_y_is_midi;
|
|
|
|
|
2009-11-26 17:19:03 +00:00
|
|
|
PortType m_port_type;
|
|
|
|
|
2009-11-26 07:47:47 +00:00
|
|
|
BaseList across;
|
|
|
|
BaseList down;
|
|
|
|
|
|
|
|
public:
|
2009-11-26 17:19:03 +00:00
|
|
|
Matrix(PortType port_type);
|
2009-11-26 07:47:47 +00:00
|
|
|
virtual ~Matrix();
|
|
|
|
|
|
|
|
void Refresh();
|
|
|
|
|
|
|
|
protected:
|
2009-11-30 23:46:37 +00:00
|
|
|
void Box(Cairo::RefPtr<Cairo::Context> cr, Colour &c, Rect &rect, bool highlight);
|
2009-11-26 07:47:47 +00:00
|
|
|
virtual bool on_expose_event(GdkEventExpose *event);
|
|
|
|
virtual bool on_button_press_event(GdkEventButton *event);
|
2009-11-30 23:46:37 +00:00
|
|
|
virtual bool on_motion_notify_event(GdkEventMotion *event);
|
2009-11-26 07:47:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MATRIX_H
|