1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006, 2007 Andreas Persson |
* Copyright (C) 2006-2011 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
21 |
#define GIGEDIT_DIMREGIONCHOOSER_H |
#define GIGEDIT_DIMREGIONCHOOSER_H |
22 |
|
|
23 |
#include <gtkmm/drawingarea.h> |
#include <gtkmm/drawingarea.h> |
|
#include <gdkmm/colormap.h> |
|
24 |
#include <gdkmm/window.h> |
#include <gdkmm/window.h> |
25 |
|
|
26 |
|
#include "compat.h" |
27 |
|
|
28 |
#include <gig.h> |
#include <gig.h> |
29 |
|
|
30 |
|
#include <set> |
31 |
|
|
32 |
class DimRegionChooser : public Gtk::DrawingArea |
class DimRegionChooser : public Gtk::DrawingArea |
33 |
{ |
{ |
34 |
public: |
public: |
40 |
sigc::signal<void>& signal_dimregion_selected(); |
sigc::signal<void>& signal_dimregion_selected(); |
41 |
sigc::signal<void>& signal_region_changed(); |
sigc::signal<void>& signal_region_changed(); |
42 |
|
|
43 |
gig::DimensionRegion* get_dimregion() { return dimreg; } |
gig::DimensionRegion* get_dimregion() const { return dimreg; } |
44 |
|
void get_dimregions(const gig::Region* region, bool stereo, |
45 |
|
std::set<gig::DimensionRegion*>& dimregs) const; |
46 |
|
|
47 |
protected: |
protected: |
48 |
virtual void on_realize(); |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
49 |
virtual bool on_expose_event(GdkEventExpose* e); |
virtual bool on_expose_event(GdkEventExpose* e); |
50 |
virtual void on_size_request(GtkRequisition* requisition); |
#endif |
51 |
|
virtual bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr); |
52 |
virtual bool on_button_press_event(GdkEventButton* event); |
virtual bool on_button_press_event(GdkEventButton* event); |
53 |
virtual bool on_button_release_event(GdkEventButton* event); |
virtual bool on_button_release_event(GdkEventButton* event); |
54 |
virtual bool on_motion_notify_event(GdkEventMotion* event); |
virtual bool on_motion_notify_event(GdkEventMotion* event); |
55 |
virtual bool on_focus(Gtk::DirectionType direction); |
virtual bool on_focus(Gtk::DirectionType direction); |
56 |
|
|
57 |
Glib::RefPtr<Gdk::GC> gc; |
Gdk::RGBA red, black, white; |
|
Gdk::Color blue, red, black, white, green; |
|
58 |
|
|
59 |
gig::Instrument* instrument; |
gig::Instrument* instrument; |
60 |
gig::Region* region; |
gig::Region* region; |
88 |
bool is_in_resize_zone(double x, double y); |
bool is_in_resize_zone(double x, double y); |
89 |
|
|
90 |
int h; |
int h; |
|
int w; |
|
91 |
}; |
}; |
92 |
|
|
93 |
#endif |
#endif |