jsweeper/src/matrix.h

54 lines
889 B
C++

#ifndef MATRIX_H
#define MATRIX_H
#include <gtkmm.h>
#include <list>
#include "rect.h"
#include "colour.h"
struct Base;
typedef std::list<Base *> BaseList;
enum PortType {
PT_ALL,
PT_AUDIO,
PT_MIDI
};
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;
Rect m_x_rect;
Rect m_y_rect;
bool m_x_is_midi;
bool m_y_is_midi;
PortType m_port_type;
BaseList across;
BaseList down;
public:
Matrix(PortType port_type);
virtual ~Matrix();
void Refresh();
protected:
void Box(Cairo::RefPtr<Cairo::Context> cr, Colour &c, Rect &rect, bool highlight);
virtual bool on_expose_event(GdkEventExpose *event);
virtual bool on_button_press_event(GdkEventButton *event);
virtual bool on_motion_notify_event(GdkEventMotion *event);
};
#endif // MATRIX_H