2
* Copyright (C) 2006, 2007 Andreas Persson
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License as
6
* published by the Free Software Foundation; either version 2, or (at
7
* your option) any later version.
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with program; see the file COPYING. If not, write to the Free
16
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
#ifndef GIGEDIT_DIMREGIONCHOOSER_H
21
#define GIGEDIT_DIMREGIONCHOOSER_H
23
#include <gtkmm/drawingarea.h>
24
#include <gdkmm/colormap.h>
25
#include <gdkmm/window.h>
31
class DimRegionChooser : public Gtk::DrawingArea
35
virtual ~DimRegionChooser();
37
void set_region(gig::Region* region);
39
sigc::signal<void>& signal_dimregion_selected();
40
sigc::signal<void>& signal_region_changed();
42
gig::DimensionRegion* get_dimregion() const { return dimreg; }
43
void get_dimregions(const gig::Region* region, bool stereo,
44
std::set<gig::DimensionRegion*>& dimregs) const;
47
virtual void on_realize();
48
virtual bool on_expose_event(GdkEventExpose* e);
49
virtual void on_size_request(GtkRequisition* requisition);
50
virtual bool on_button_press_event(GdkEventButton* event);
51
virtual bool on_button_release_event(GdkEventButton* event);
52
virtual bool on_motion_notify_event(GdkEventMotion* event);
53
virtual bool on_focus(Gtk::DirectionType direction);
55
Glib::RefPtr<Gdk::GC> gc;
56
Gdk::Color blue, red, black, white, green;
58
gig::Instrument* instrument;
62
sigc::signal<void> dimregion_selected;
63
sigc::signal<void> region_changed;
65
gig::DimensionRegion* dimreg;
71
// information needed during a resize
86
bool cursor_is_resize;
87
bool is_in_resize_zone(double x, double y);