support for glade and new new session dialog
[ardour.git] / gtk2_ardour / editing.h
1 #ifndef __gtk_ardour_editing_h__
2 #define __gtk_ardour_editing_h__
3
4 #include <string>
5 #include <map>
6
7 // This involves some cpp magic. --taybin
8
9 #define SNAPTYPE(a) /*empty*/
10 #define SNAPMODE(a) /*empty*/
11 #define REGIONLISTSORTTYPE(a) /*empty*/
12 #define MOUSEMODE(a) /*empty*/
13 #define ZOOMFOCUS(a) /*empty*/
14 #define DISPLAYCONTROL(a) /*empty*/
15 #define COLORID(a) /*empty*/
16
17 namespace Editing {
18
19 // SNAPTYPE
20 #undef SNAPTYPE
21 #define SNAPTYPE(a) a,
22 enum SnapType {
23         #include "editing_syms.h"
24 };
25
26 #undef SNAPTYPE
27 #define SNAPTYPE(s) #s,
28 static const char *snaptypestrs[] = {
29         #include "editing_syms.h"
30 };
31 inline const char* enum2str(SnapType m) {return snaptypestrs[m];}
32 SnapType str2snaptype(std::string);
33
34 #undef SNAPTYPE
35 #define SNAPTYPE(a) /*empty*/
36
37 // SNAPMODE
38 #undef SNAPMODE
39 #define SNAPMODE(a) a,
40 enum SnapMode {
41         #include "editing_syms.h"
42 };
43
44 #undef SNAPMODE
45 #define SNAPMODE(s) #s,
46 static const char *snapmodestrs[] = {
47         #include "editing_syms.h"
48 };
49 inline const char* enum2str(SnapMode m) {return snapmodestrs[m];}
50 SnapMode str2snapmode(std::string);
51
52 #undef SNAPMODE
53 #define SNAPMODE(a) /*empty*/
54
55 // REGIONLISTSORTTYPE
56 #undef REGIONLISTSORTTYPE
57 #define REGIONLISTSORTTYPE(a) a,
58 enum RegionListSortType {
59         #include "editing_syms.h"
60 };
61
62 #undef REGIONLISTSORTTYPE
63 #define REGIONLISTSORTTYPE(s) #s,
64 static const char *regionlistsorttypestrs[] = {
65         #include "editing_syms.h"
66 };
67 inline const char* enum2str(RegionListSortType m) {return regionlistsorttypestrs[m];}
68 RegionListSortType str2regionlistsorttype(std::string);
69
70 #undef REGIONLISTSORTTYPE
71 #define REGIONLISTSORTTYPE(a) /*empty*/
72
73 // MOUSEMODE
74 #undef MOUSEMODE
75 #define MOUSEMODE(a) a,
76 enum MouseMode {
77         #include "editing_syms.h"
78 };
79
80 #undef MOUSEMODE
81 #define MOUSEMODE(s) #s,
82 static const char *mousemodestrs[] = {
83         #include "editing_syms.h"
84 };
85 inline const char* enum2str(MouseMode m) {return mousemodestrs[m];}
86 MouseMode str2mousemode(std::string);
87
88 #undef MOUSEMODE
89 #define MOUSEMODE(a) /*empty*/
90
91 // ZOOMFOCUS
92 #undef ZOOMFOCUS
93 #define ZOOMFOCUS(a) a,
94 enum ZoomFocus {
95         #include "editing_syms.h"
96 };
97
98 #undef ZOOMFOCUS
99 #define ZOOMFOCUS(s) #s,
100 static const char *zoomfocusstrs[] = {
101         #include "editing_syms.h"
102 };
103 inline const char* enum2str(ZoomFocus m) {return zoomfocusstrs[m];}
104 ZoomFocus str2zoomfocus(std::string);
105
106 #undef ZOOMFOCUS
107 #define ZOOMFOCUS(a) /*empty*/
108
109 // DISPLAYCONTROL
110 #undef DISPLAYCONTROL
111 #define DISPLAYCONTROL(a) a,
112 enum DisplayControl {
113         #include "editing_syms.h"
114 };
115
116 #undef DISPLAYCONTROL
117 #define DISPLAYCONTROL(s) #s,
118 static const char *displaycontrolstrs[] = {
119         #include "editing_syms.h"
120 };
121 inline const char* enum2str(DisplayControl m) {return displaycontrolstrs[m];}
122 DisplayControl str2displaycontrol (std::string);
123
124 #undef DISPLAYCONTROL
125 #define DISPLAYCONTROL(a) /*empty*/
126
127 #undef COLORID
128 #define COLORID(a) a,
129 enum ColorID {
130          #include "editing_syms.h"
131 };
132
133 #undef COLORID
134 #define COLORID(s) #s,
135 static const char *color_id_strs[] = {
136         #include "editing_syms.h"
137 };
138 inline const char* enum2str(ColorID m) {return color_id_strs[m];}
139 ColorID str2color_id (std::string);
140
141 #undef COLORID
142 #define COLORID(a) /*empty*/
143
144 /////////////////////
145 // These don't need their state saved. yet...
146 enum CutCopyOp {
147         Cut,
148         Copy,
149         Clear
150 };
151
152 enum XFadeType {
153         Pre,
154         Post,
155         At
156 };
157
158 struct Color {
159     char r;
160     char g;
161     char b;
162     char a;
163 };
164
165 typedef std::map<Editing::ColorID,int> ColorMap;
166 extern ColorMap color_map;
167
168 } // namespace Editing
169
170 #endif // __gtk_ardour_editing_h__