r802: Remove renderframfsclient and renderfarmfsserver .h and .C from Makefile.am...
[cinelerra_cv/mob.git] / cinelerra / cwindowgui.h
blobe28e6f943d649c83661fb4ab4b70076b47f3e3c6
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);
43 int close_event();
44 int keypress_event();
45 int translation_event();
46 void set_operation(int value);
47 void update_tool();
48 void drag_motion();
49 int drag_stop();
50 void draw_status();
51 // Zero out pointers to affected auto
52 void reset_affected();
53 void keyboard_zoomin();
54 void keyboard_zoomout();
56 MWindow *mwindow;
57 CWindow *cwindow;
58 CWindowEditing *edit_panel;
59 // APanel *automation_panel;
60 CPanel *composite_panel;
61 CWindowZoom *zoom_panel;
62 CWindowSlider *slider;
63 CWindowReset *reset;
64 CWindowTransport *transport;
65 CWindowCanvas *canvas;
66 CTimeBar *timebar;
67 BC_Pixmap *active;
68 BC_Pixmap *inactive;
69 // MainClock *clock;
72 CWindowMeters *meters;
75 CWindowTool *tool_panel;
77 // Cursor motion modification being done
78 int current_operation;
79 // The pointers are only used for dragging. Information for tool windows
80 // must be integers and recalculted for every keypress.
81 // Track being modified in canvas
82 Track *affected_track;
83 // Transformation keyframe being modified
84 FloatAuto *affected_x;
85 FloatAuto *affected_y;
86 FloatAuto *affected_z;
87 // Keyfrom not affecting transformation being affected
88 Auto *affected_keyframe;
89 // Mask point being modified
90 int affected_point;
91 // Scrollbar offsets during last button press relative to output
92 float x_offset, y_offset;
93 // Cursor location during the last button press relative to output
94 // and offset by scroll bars
95 float x_origin, y_origin;
96 // Crop handle being dragged
97 int crop_handle;
98 // If dragging crop translation
99 int crop_translate;
100 // Origin of crop handle during last button press
101 float crop_origin_x, crop_origin_y;
102 // Origin of all 4 crop points during last button press
103 float crop_origin_x1, crop_origin_y1;
104 float crop_origin_x2, crop_origin_y2;
106 // Origin for camera and projector operations during last button press
107 float center_x, center_y, center_z;
108 float control_in_x, control_in_y, control_out_x, control_out_y;
109 int current_tool;
110 // Must recalculate the origin when pressing shift.
111 // Switch toggle on and off to recalculate origin.
112 int translating_zoom;
116 class CWindowEditing : public EditPanel
118 public:
119 CWindowEditing(MWindow *mwindow, CWindow *cwindow);
121 void set_inpoint();
122 void set_outpoint();
124 MWindow *mwindow;
125 CWindow *cwindow;
129 class CWindowMeters : public MeterPanel
131 public:
132 CWindowMeters(MWindow *mwindow, CWindowGUI *gui, int x, int y, int h);
133 ~CWindowMeters();
135 int change_status_event();
137 MWindow *mwindow;
138 CWindowGUI *gui;
141 class CWindowZoom : public ZoomPanel
143 public:
144 CWindowZoom(MWindow *mwindow, CWindowGUI *gui, int x, int y);
145 ~CWindowZoom();
146 int handle_event();
147 MWindow *mwindow;
148 CWindowGUI *gui;
152 class CWindowSlider : public BC_PercentageSlider
154 public:
155 CWindowSlider(MWindow *mwindow, CWindow *cwindow, int x, int y, int pixels);
156 ~CWindowSlider();
158 int handle_event();
159 void set_position();
160 int increase_value();
161 int decrease_value();
163 MWindow *mwindow;
164 CWindow *cwindow;
167 class CWindowReset : public BC_Button
169 public:
170 CWindowReset(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
171 ~CWindowReset();
172 int handle_event();
173 CWindowGUI *cwindow;
174 MWindow *mwindow;
177 // class CWindowDestination : public BC_PopupTextBox
178 // {
179 // public:
180 // CWindowDestination(MWindow *mwindow, CWindowGUI *cwindow, int x, int y);
181 // ~CWindowDestination();
182 // int handle_event();
183 // CWindowGUI *cwindow;
184 // MWindow *mwindow;
185 // };
187 class CWindowTransport : public PlayTransport
189 public:
190 CWindowTransport(MWindow *mwindow,
191 CWindowGUI *gui,
192 int x,
193 int y);
194 EDL* get_edl();
195 void goto_start();
196 void goto_end();
198 CWindowGUI *gui;
202 class CWindowCanvas : public Canvas
204 public:
205 CWindowCanvas(MWindow *mwindow, CWindowGUI *gui);
207 void status_event();
208 void zoom_resize_window(float percentage);
209 void update_zoom(int x, int y, float zoom);
210 int get_xscroll();
211 int get_yscroll();
212 float get_zoom();
213 int do_eyedrop(int &rerender, int button_press);
214 int do_mask(int &redraw,
215 int &rerender,
216 int button_press,
217 int cursor_motion,
218 int draw);
219 void draw_refresh();
220 void draw_overlays();
221 void draw_safe_regions();
222 // Cursor may have to be drawn
223 int cursor_leave_event();
224 int cursor_enter_event();
225 int cursor_motion_event();
226 int button_press_event();
227 int button_release_event();
228 int test_crop(int button_press, int &redraw);
229 int test_bezier(int button_press,
230 int &redraw,
231 int &redraw_canvas,
232 int &rerender,
233 int do_camera);
234 int test_zoom(int &redraw);
235 void reset_camera();
236 void reset_projector();
237 void reset_keyframe(int do_camera);
238 void draw_crophandle(int x, int y);
240 // Draw the projector overlay in different colors.
241 void draw_bezier(int do_camera);
242 void draw_crop();
243 void calculate_origin();
244 void toggle_controls();
245 int get_cwindow_controls();
247 MWindow *mwindow;
248 CWindowGUI *gui;
251 #endif