27 |
#include <gtkmm/treeview.h> |
#include <gtkmm/treeview.h> |
28 |
#include <gtkmm/liststore.h> |
#include <gtkmm/liststore.h> |
29 |
#include <gtkmm/scrolledwindow.h> |
#include <gtkmm/scrolledwindow.h> |
30 |
|
#include <gtkmm/checkbutton.h> |
31 |
|
|
32 |
#include <gig.h> |
#include <gig.h> |
33 |
|
#include <set> |
34 |
|
|
35 |
|
class DimTypeCellRenderer : public Gtk::CellRendererText { |
36 |
|
public: |
37 |
|
Glib::PropertyProxy<gig::dimension_t> propertyDimType() { |
38 |
|
return m_propertyDimType.get_proxy(); |
39 |
|
} |
40 |
|
|
41 |
|
Glib::PropertyProxy<int> propertyUsageCount() { |
42 |
|
return m_propertyUsageCount.get_proxy(); |
43 |
|
} |
44 |
|
|
45 |
|
Glib::PropertyProxy<int> propertyTotalRegions() { |
46 |
|
return m_propertyTotalRegions.get_proxy(); |
47 |
|
} |
48 |
|
|
49 |
|
DimTypeCellRenderer(); |
50 |
|
protected: |
51 |
|
void typeChanged(); |
52 |
|
void statsChanged(); |
53 |
|
private: |
54 |
|
Glib::Property<gig::dimension_t> m_propertyDimType; |
55 |
|
Glib::Property<int> m_propertyUsageCount; |
56 |
|
Glib::Property<int> m_propertyTotalRegions; |
57 |
|
}; |
58 |
|
|
59 |
|
class IntSetCellRenderer : public Gtk::CellRendererText { |
60 |
|
public: |
61 |
|
Glib::PropertyProxy<std::set<int> > propertyValue() { |
62 |
|
return m_propertyValue.get_proxy(); |
63 |
|
} |
64 |
|
|
65 |
|
IntSetCellRenderer(); |
66 |
|
protected: |
67 |
|
void valueChanged(); |
68 |
|
private: |
69 |
|
Glib::Property<std::set<int> > m_propertyValue; |
70 |
|
}; |
71 |
|
|
72 |
class DimensionManager : public Gtk::Window { |
class DimensionManager : public Gtk::Window { |
73 |
public: |
public: |
85 |
Gtk::TreeView treeView; |
Gtk::TreeView treeView; |
86 |
Gtk::Button addButton; |
Gtk::Button addButton; |
87 |
Gtk::Button removeButton; |
Gtk::Button removeButton; |
88 |
|
Gtk::CheckButton allRegionsCheckBox; |
89 |
|
|
90 |
|
DimTypeCellRenderer m_cellRendererDimType; |
91 |
|
IntSetCellRenderer m_cellRendererIntSet; |
92 |
|
|
93 |
class ModelColumns : public Gtk::TreeModel::ColumnRecord { |
class ModelColumns : public Gtk::TreeModel::ColumnRecord { |
94 |
public: |
public: |
95 |
ModelColumns() { |
ModelColumns() { |
96 |
add(m_dim_type); |
add(m_type); |
97 |
add(m_bits); |
add(m_bits); |
98 |
add(m_zones); |
add(m_zones); |
99 |
add(m_description); |
add(m_description); |
100 |
add(m_definition); |
add(m_usageCount); |
101 |
|
add(m_totalRegions); |
102 |
} |
} |
103 |
|
|
104 |
Gtk::TreeModelColumn<Glib::ustring> m_dim_type; |
Gtk::TreeModelColumn<gig::dimension_t> m_type; |
105 |
Gtk::TreeModelColumn<int> m_bits; |
Gtk::TreeModelColumn<std::set<int> > m_bits; |
106 |
Gtk::TreeModelColumn<int> m_zones; |
Gtk::TreeModelColumn<std::set<int> > m_zones; |
107 |
Gtk::TreeModelColumn<Glib::ustring> m_description; |
Gtk::TreeModelColumn<Glib::ustring> m_description; |
108 |
Gtk::TreeModelColumn<gig::dimension_def_t*> m_definition; |
Gtk::TreeModelColumn<int> m_usageCount; |
109 |
|
Gtk::TreeModelColumn<int> m_totalRegions; |
110 |
} tableModel; |
} tableModel; |
111 |
|
|
112 |
class ComboModelColumns : public Gtk::TreeModel::ColumnRecord { |
class ComboModelColumns : public Gtk::TreeModel::ColumnRecord { |
122 |
|
|
123 |
Glib::RefPtr<Gtk::ListStore> refTableModel; |
Glib::RefPtr<Gtk::ListStore> refTableModel; |
124 |
|
|
125 |
|
void onAllRegionsCheckBoxToggled(); |
126 |
void refreshManager(); |
void refreshManager(); |
127 |
void addDimension(); |
void addDimension(); |
128 |
void removeDimension(); |
void removeDimension(); |
129 |
|
bool allRegions() const; |
130 |
}; |
}; |
131 |
|
|
132 |
#endif // GIGEDIT_DIMENSIONMANAGER_H |
#endif // GIGEDIT_DIMENSIONMANAGER_H |