r632: Boost up the requirement for mjpegtools to 1.6.3
[cinelerra_cv/mob.git] / cinelerra / cwindowgui.h
blob29a31c3c3fae5fcc87ca9f01f4dfafac33403a09
1 #ifndef CWINDOWGUI_H
2 #define CWINDOWGUI_H
4 //#include "apanel.inc"
5 #include "auto.inc"
6 #include "bezierauto.inc"
7 #include "bezierautos.inc"
8 #include "canvas.h"
9 #include "cpanel.inc"
10 #include "ctimebar.inc"
11 #include "cwindow.inc"
12 #include "cwindowtool.inc"
13 #include "editpanel.h"
14 #include "floatautos.inc"
15 #include "guicast.h"
16 #include "mainclock.inc"
17 #include "maskauto.inc"
18 #include "meterpanel.h"
19 #include "mwindow.inc"
20 #include "playtransport.h"
21 #include "thread.h"
22 #include "track.inc"
23 #include "zoompanel.h"
25 class CWindowZoom;
26 class CWindowSlider;
27 class CWindowReset;
28 class CWindowDestination;
29 class CWindowMeters;
30 class CWindowTransport;
31 class CWindowCanvas;
32 class CWindowEditing;
35 #define AUTO_ZOOM "Auto"
37 class CWindowGUI : public BC_Window
39 public:
40 CWindowGUI(MWindow *mwindow, CWindow *cwindow);
41 ~CWindowGUI();
43 int create_objects();
44 int resize_event(int w, int h);
45 int close_event();
46 int keypress_event();
47 int translation_event();
48 void set_operation(int value);
49 void update_tool();
50 void drag_motion();
51 int drag_stop();
52 void draw_status();
54 MWindow *mwindow;
55 CWindow *cwindow;
56 CWindowEditing *edit_panel;
57 // APanel *automation_panel;
58 CPanel *composite_panel;
59 CWindowZoom *zoom_panel;
60 CWindowSlider *slider;
61 CWindowReset *reset;
62 CWindowTransport *transport;
63 CWindowCanvas *canvas;
64 CTimeBar *timebar;
65 BC_Pixmap *active;
66 BC_Pixmap *inactive;
67 // MainClock *clock;
70 CWindowMeters *meters;
73 CWindowTool *tool_panel;
75 // Cursor motion modification being done
76 int current_operation;
77 // The pointers are only used for dragging. Information for tool windows
78 // must be integers and recalculted for every keypress.
79 // Track being modified in canvas
80 Track *affected_track;
81 // Keyframe being modified
82 Auto *affected_auto;
83 // Mask point being modified
84 int affected_point;
85 // Scrollbar offsets during last button press relative to output
86 float x_offset, y_offset;
87 // Cursor location during the last button press relative to output
88 // and offset by scroll bars
89 float x_origin, y_origin;
90 // Crop handle being dragged
91 int crop_handle;
92 // Origin of crop handle during last button press
93 float crop_origin_x, crop_origin_y;
94 // Origin for camera and projector operations during last button press
95 float center_x, center_y, center_z;
96 float control_in_x, control_in_y, control_out_x, control_out_y;
97 int current_tool;
98 // Must recalculate the origin when pressing shift.
99 // Switch toggle on and off to recalculate origin.
100 int translating_zoom;
104 class CWindowEditing : public EditPanel
106 public:
107 CWindowEditing(MWindow *mwindow, CWindow *cwindow);
109 void set_inpoint();
110 void set_outpoint();
112 MWindow *mwindow;
113 CWindow *cwindow;
117 class CWindowMeters : public MeterPanel
119 public:
120 CWindowMeters(MWindow *mwindow, CWindowGUI *gui, int x, int y, int h);
121 ~CWindowMeters();
123 int change_status_event();
125 MWindow *mwindow;
126 CWindowGUI *gui;
129 class CWindowZoom : public ZoomPanel
131 public:
132 CWindowZoom(MWindow *mwindow, CWindowGUI *gui, int x, int y);
133 ~CWindowZoom();
134 int handle_event();
135 MWindow *mwindow;
136 CWindowGUI *gui;
140 class CWindowSlider : public BC_PercentageSlider
142 public:
143 CWindowSlider(MWindow *mwindow, CWindow *cwindow, int x, int y, int pixels);
144 ~CWindowSlider();
146 int handle_event();
147 void set_position();
148 int increase_value();
149 int decrease_value();
151 MWindow *mwindow;
152 CWindow *cwindow;
155 class CWindowReset : public BC_Button
157 public:
158 CWindowReset(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
159 ~CWindowReset();
160 int handle_event();
161 CWindowGUI *cwindow;
162 MWindow *mwindow;
165 // class CWindowDestination : public BC_PopupTextBox
166 // {
167 // public:
168 // CWindowDestination(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
169 // ~CWindowDestination();
170 // int handle_event();
171 // CWindowGUI *cwindow;
172 // MWindow *mwindow;
173 // };
175 class CWindowTransport : public PlayTransport
177 public:
178 CWindowTransport(MWindow *mwindow,
179 CWindowGUI *gui,
180 int x,
181 int y);
182 EDL* get_edl();
183 void goto_start();
184 void goto_end();
186 CWindowGUI *gui;
190 class CWindowCanvas : public Canvas
192 public:
193 CWindowCanvas(MWindow *mwindow, CWindowGUI *gui);
195 void status_event();
196 void zoom_resize_window(float percentage);
197 void update_zoom(int x, int y, float zoom);
198 int get_xscroll();
199 int get_yscroll();
200 float get_zoom();
201 int do_mask(int &redraw,
202 int &rerender,
203 int button_press,
204 int cursor_motion,
205 int draw);
206 void draw_refresh();
207 void draw_overlays();
208 void draw_safe_regions();
209 // Cursor may have to be drawn
210 int cursor_leave_event();
211 int cursor_enter_event();
212 int cursor_motion_event();
213 int button_press_event();
214 int button_release_event();
215 int test_crop(int button_press, int &redraw);
216 int test_bezier(int button_press,
217 int &redraw,
218 int &redraw_canvas,
219 int &rerender,
220 int do_camera);
221 int test_zoom(int &redraw);
222 void reset_camera();
223 void reset_projector();
224 void reset_keyframe(int do_camera);
225 void draw_crophandle(int x, int y);
226 int do_bezier_center(BezierAuto *current,
227 BezierAutos *camera_autos,
228 BezierAutos *projector_autos,
229 FloatAutos *czoom_autos,
230 FloatAutos *pzoom_autos,
231 int camera,
232 int draw);
233 void draw_bezier_joining(BezierAuto *first,
234 BezierAuto *last,
235 BezierAutos *camera_autos,
236 BezierAutos *projector_autos,
237 FloatAutos *czoom_autos,
238 FloatAutos *pzoom_autos,
239 int camera);
240 void draw_bezier(int do_camera);
241 void draw_crop();
242 void calculate_origin();
243 void toggle_controls();
244 int get_cwindow_controls();
246 MWindow *mwindow;
247 CWindowGUI *gui;
250 #endif