71 lines
1.3 KiB
C
71 lines
1.3 KiB
C
|
#ifndef GUI_H
|
||
|
#define GUI_H
|
||
|
|
||
|
#include <gtkmm.h>
|
||
|
#include <list>
|
||
|
#include "rect.h"
|
||
|
|
||
|
#define BACK_COLOUR 0.1020, 0.1059, 0.1059
|
||
|
#define MIDI_COLOUR 0.3098, 0.1882, 0.1882
|
||
|
#define AUDIO_COLOUR 0.1608, 0.2510, 0.3373
|
||
|
#define GROUP_COLOUR 0.1608, 0.3373, 0.1647
|
||
|
|
||
|
#define GRID_CLIENT 0.00, 0.00, 0.00
|
||
|
#define GRID_GROUP 0.10, 0.10, 0.10
|
||
|
#define GRID_PORT 0.20, 0.20, 0.20
|
||
|
|
||
|
typedef std::list<Base *> BaseList;
|
||
|
|
||
|
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_padding;
|
||
|
int m_width;
|
||
|
int m_height;
|
||
|
|
||
|
int m_font_size;
|
||
|
std::string m_typeface;
|
||
|
|
||
|
BaseList across;
|
||
|
BaseList down;
|
||
|
|
||
|
public:
|
||
|
Matrix();
|
||
|
virtual ~Matrix();
|
||
|
|
||
|
void Refresh();
|
||
|
|
||
|
Gtk::Window *parent;
|
||
|
|
||
|
protected:
|
||
|
void Box(Cairo::RefPtr<Cairo::Context> cr, float r, float g, float b, Rect &rect);
|
||
|
virtual bool on_expose_event(GdkEventExpose *event);
|
||
|
virtual bool on_button_press_event(GdkEventButton *event);
|
||
|
};
|
||
|
|
||
|
class Gui : public Gtk::Window
|
||
|
{
|
||
|
private:
|
||
|
Glib::RefPtr<Gtk::ActionGroup> m_actiongroup;
|
||
|
Glib::RefPtr<Gtk::UIManager> m_uimanager;
|
||
|
Gtk::ScrolledWindow m_scrolledwindow;
|
||
|
Gtk::VBox m_box;
|
||
|
Matrix m_matrix;
|
||
|
|
||
|
public:
|
||
|
Gui();
|
||
|
virtual ~Gui();
|
||
|
|
||
|
void Refresh();
|
||
|
|
||
|
protected:
|
||
|
bool on_idle();
|
||
|
};
|
||
|
|
||
|
#endif // GUI_H
|