1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2015 Andreas Persson |
* Copyright (C) 2006-2017 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 |
27 |
|
|
28 |
#include "compat.h" |
#include "compat.h" |
29 |
|
|
30 |
#include <gig.h> |
#ifdef LIBGIG_HEADER_FILE |
31 |
|
# include LIBGIG_HEADER_FILE(gig.h) |
32 |
|
#else |
33 |
|
# include <gig.h> |
34 |
|
#endif |
35 |
|
|
36 |
#include <set> |
#include <set> |
37 |
#include <map> |
#include <map> |
38 |
|
|
39 |
|
#include "global.h" |
40 |
|
|
41 |
class DimRegionChooser : public Gtk::DrawingArea |
class DimRegionChooser : public Gtk::DrawingArea |
42 |
{ |
{ |
43 |
public: |
public: |
53 |
void get_dimregions(const gig::Region* region, bool stereo, |
void get_dimregions(const gig::Region* region, bool stereo, |
54 |
std::set<gig::DimensionRegion*>& dimregs) const; |
std::set<gig::DimensionRegion*>& dimregs) const; |
55 |
bool select_dimregion(gig::DimensionRegion* dimrgn); |
bool select_dimregion(gig::DimensionRegion* dimrgn); |
56 |
|
void select_next_dimzone(); |
57 |
|
void select_prev_dimzone(); |
58 |
|
void select_next_dimension(); |
59 |
|
void select_prev_dimension(); |
60 |
|
|
61 |
|
// those 3 are ATM only relevant when resizing custom dimension region zones |
62 |
|
void setModifyBothChannels(bool b); |
63 |
|
void setModifyAllDimensionRegions(bool b); |
64 |
|
void setModifyAllRegions(bool b); |
65 |
|
|
66 |
protected: |
protected: |
67 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 90) || GTKMM_MAJOR_VERSION < 2 |
79 |
void split_dimension_zone(); |
void split_dimension_zone(); |
80 |
void delete_dimension_zone(); |
void delete_dimension_zone(); |
81 |
void resetSelectedZones(); |
void resetSelectedZones(); |
82 |
|
void select_dimzone_by_dir(int dir); |
83 |
|
|
84 |
Gdk::RGBA red, black, white; |
Gdk::RGBA red, black, white; |
85 |
|
|
89 |
sigc::signal<void> dimregion_selected; |
sigc::signal<void> dimregion_selected; |
90 |
sigc::signal<void> region_changed; |
sigc::signal<void> region_changed; |
91 |
|
|
92 |
//std::set<gig::DimensionRegion*> dimregs; ///< Reflects which dimension regions are currently selected. |
// those 3 are ATM only relevant when resizing custom dimension region zones |
93 |
|
bool modifybothchannels; |
94 |
|
bool modifyalldimregs; |
95 |
|
bool modifyallregions; |
96 |
|
|
97 |
int focus_line; |
int focus_line; |
98 |
std::map<gig::dimension_t, std::set<int> > dimzones; ///< Reflects which zone(s) of the individual dimension are currently selected. |
std::map<gig::dimension_t, std::set<int> > dimzones; ///< Reflects which zone(s) of the individual dimension are currently selected. |
99 |
int label_width; |
int label_width; |
105 |
// i.e. keyboard arrow key navigation) |
// i.e. keyboard arrow key navigation) |
106 |
// NOTE: these may *not* necessarily currently be selected ! |
// NOTE: these may *not* necessarily currently be selected ! |
107 |
gig::dimension_t maindimtype; |
gig::dimension_t maindimtype; |
108 |
std::map<gig::dimension_t,int> maindimcase; |
DimensionCase maindimcase; |
109 |
int maindimregno; |
int maindimregno; |
110 |
|
|
111 |
// information needed during a resize |
// information needed during a resize |
120 |
int min; |
int min; |
121 |
int max; |
int max; |
122 |
int dimension; |
int dimension; |
123 |
int offset; |
gig::dimension_def_t dimensionDef; |
124 |
|
int zone; |
125 |
} resize; |
} resize; |
126 |
|
|
127 |
bool multiSelectKeyDown; |
bool multiSelectKeyDown; |
136 |
Glib::RefPtr<Gtk::UIManager> uiManager; |
Glib::RefPtr<Gtk::UIManager> uiManager; |
137 |
Gtk::Menu* popup_menu_inside_dimregion; |
Gtk::Menu* popup_menu_inside_dimregion; |
138 |
Gtk::Menu* popup_menu_outside_dimregion; |
Gtk::Menu* popup_menu_outside_dimregion; |
139 |
|
|
140 |
|
private: |
141 |
|
Glib::RefPtr<Gtk::Action> actionDeleteDimZone; |
142 |
|
Glib::RefPtr<Gtk::Action> actionSplitDimZone; |
143 |
}; |
}; |
144 |
|
|
145 |
#endif |
#endif |