r860: Merge 2.1:
[cinelerra_cv.git] / cinelerra / cwindowgui.h
blob63969ffb429261d3190e3d6ad342bd30db99bae3
1 #ifndef CWINDOWGUI_H
2 #define CWINDOWGUI_H
4 #include "auto.inc"
5 #include "canvas.h"
6 #include "cpanel.inc"
7 #include "ctimebar.inc"
8 #include "cwindow.inc"
9 #include "cwindowtool.inc"
10 #include "editpanel.h"
11 #include "floatauto.inc"
12 #include "floatautos.inc"
13 #include "guicast.h"
14 #include "mainclock.inc"
15 #include "maskauto.inc"
16 #include "meterpanel.h"
17 #include "mwindow.inc"
18 #include "playtransport.h"
19 #include "thread.h"
20 #include "track.inc"
21 #include "zoompanel.h"
23 class CWindowZoom;
24 class CWindowSlider;
25 class CWindowReset;
26 class CWindowDestination;
27 class CWindowMeters;
28 class CWindowTransport;
29 class CWindowCanvas;
30 class CWindowEditing;
33 #define AUTO_ZOOM "Auto"
35 class CWindowGUI : public BC_Window
37 public:
38 CWindowGUI(MWindow *mwindow, CWindow *cwindow);
39 ~CWindowGUI();
41 int create_objects();
42 int resize_event(int w, int h);
44 // Events for the fullscreen canvas fall through to here.
45 int button_press_event();
46 int cursor_leave_event();
47 int cursor_enter_event();
48 int button_release_event();
49 int cursor_motion_event();
52 void zoom_canvas(int do_auto, double value, int update_menu);
54 int close_event();
55 int keypress_event();
56 int translation_event();
57 void set_operation(int value);
58 void update_tool();
59 void drag_motion();
60 int drag_stop();
61 void draw_status();
62 // Zero out pointers to affected auto
63 void reset_affected();
64 void keyboard_zoomin();
65 void keyboard_zoomout();
67 MWindow *mwindow;
68 CWindow *cwindow;
69 CWindowEditing *edit_panel;
70 // APanel *automation_panel;
71 CPanel *composite_panel;
72 CWindowZoom *zoom_panel;
73 CWindowSlider *slider;
74 CWindowReset *reset;
75 CWindowTransport *transport;
76 CWindowCanvas *canvas;
77 CTimeBar *timebar;
78 BC_Pixmap *active;
79 BC_Pixmap *inactive;
80 // MainClock *clock;
83 CWindowMeters *meters;
86 CWindowTool *tool_panel;
88 // Cursor motion modification being done
89 int current_operation;
90 // The pointers are only used for dragging. Information for tool windows
91 // must be integers and recalculted for every keypress.
92 // Track being modified in canvas
93 Track *affected_track;
94 // Transformation keyframe being modified
95 FloatAuto *affected_x;
96 FloatAuto *affected_y;
97 FloatAuto *affected_z;
98 // Keyfrom not affecting transformation being affected
99 Auto *affected_keyframe;
100 // Mask point being modified
101 int affected_point;
102 // Scrollbar offsets during last button press relative to output
103 float x_offset, y_offset;
104 // Cursor location during the last button press relative to output
105 // and offset by scroll bars
106 float x_origin, y_origin;
107 // Crop handle being dragged
108 int crop_handle;
109 // If dragging crop translation
110 int crop_translate;
111 // Origin of crop handle during last button press
112 float crop_origin_x, crop_origin_y;
113 // Origin of all 4 crop points during last button press
114 float crop_origin_x1, crop_origin_y1;
115 float crop_origin_x2, crop_origin_y2;
117 // Origin for camera and projector operations during last button press
118 float center_x, center_y, center_z;
119 float control_in_x, control_in_y, control_out_x, control_out_y;
120 int current_tool;
121 // Must recalculate the origin when pressing shift.
122 // Switch toggle on and off to recalculate origin.
123 int translating_zoom;
127 class CWindowEditing : public EditPanel
129 public:
130 CWindowEditing(MWindow *mwindow, CWindow *cwindow);
132 void set_inpoint();
133 void set_outpoint();
135 MWindow *mwindow;
136 CWindow *cwindow;
140 class CWindowMeters : public MeterPanel
142 public:
143 CWindowMeters(MWindow *mwindow, CWindowGUI *gui, int x, int y, int h);
144 ~CWindowMeters();
146 int change_status_event();
148 MWindow *mwindow;
149 CWindowGUI *gui;
152 class CWindowZoom : public ZoomPanel
154 public:
155 CWindowZoom(MWindow *mwindow, CWindowGUI *gui, int x, int y);
156 ~CWindowZoom();
157 int handle_event();
158 MWindow *mwindow;
159 CWindowGUI *gui;
163 class CWindowSlider : public BC_PercentageSlider
165 public:
166 CWindowSlider(MWindow *mwindow, CWindow *cwindow, int x, int y, int pixels);
167 ~CWindowSlider();
169 int handle_event();
170 void set_position();
171 int increase_value();
172 int decrease_value();
174 MWindow *mwindow;
175 CWindow *cwindow;
178 class CWindowReset : public BC_Button
180 public:
181 CWindowReset(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
182 ~CWindowReset();
183 int handle_event();
184 CWindowGUI *cwindow;
185 MWindow *mwindow;
188 // class CWindowDestination : public BC_PopupTextBox
189 // {
190 // public:
191 // CWindowDestination(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
192 // ~CWindowDestination();
193 // int handle_event();
194 // CWindowGUI *cwindow;
195 // MWindow *mwindow;
196 // };
198 class CWindowTransport : public PlayTransport
200 public:
201 CWindowTransport(MWindow *mwindow,
202 CWindowGUI *gui,
203 int x,
204 int y);
205 EDL* get_edl();
206 void goto_start();
207 void goto_end();
209 CWindowGUI *gui;
213 class CWindowCanvas : public Canvas
215 public:
216 CWindowCanvas(MWindow *mwindow, CWindowGUI *gui);
218 void status_event();
219 void zoom_resize_window(float percentage);
220 void update_zoom(int x, int y, float zoom);
221 int get_xscroll();
222 int get_yscroll();
223 float get_zoom();
224 int do_eyedrop(int &rerender, int button_press);
225 int do_mask(int &redraw,
226 int &rerender,
227 int button_press,
228 int cursor_motion,
229 int draw);
230 void draw_refresh();
231 void draw_overlays();
232 void draw_safe_regions();
233 // Cursor may have to be drawn
234 int cursor_leave_event();
235 int cursor_enter_event();
236 int cursor_motion_event();
237 int button_press_event();
238 int button_release_event();
239 int get_fullscreen();
240 void set_fullscreen(int value);
241 int test_crop(int button_press, int &redraw);
242 int test_bezier(int button_press,
243 int &redraw,
244 int &redraw_canvas,
245 int &rerender,
246 int do_camera);
247 int test_zoom(int &redraw);
248 void reset_camera();
249 void reset_projector();
250 void reset_keyframe(int do_camera);
251 void draw_crophandle(int x, int y);
252 void zoom_auto();
254 // Draw the projector overlay in different colors.
255 void draw_bezier(int do_camera);
256 void draw_crop();
257 void calculate_origin();
258 void toggle_controls();
259 int get_cwindow_controls();
261 MWindow *mwindow;
262 CWindowGUI *gui;
265 #endif