8 // Output for all X11 video
11 class CanvasFullScreen
;
15 class CanvasFullScreenPopup
;
16 class CanvasToggleControls
;
18 // The EDL arguments can be set to 0 if the canvas_w and canvas_h are used
22 Canvas(MWindow
*mwindow
,
23 BC_WindowBase
*subwindow
,
33 int use_vwindow
= 0); // Use menu different options for different windows
37 // Get dimensions given a zoom
38 void calculate_sizes(float aspect_ratio
,
44 // Lock access to the canvas pointer.
45 // Must be called before get_canvas or locking the canvas.
46 void lock_canvas(char *location
);
50 int create_objects(EDL
*edl
);
51 void set_cursor(int cursor
);
52 // Start video playback
56 // Start single frame processing. Causes the status indicator to update
60 void start_fullscreen();
61 void stop_fullscreen();
63 // Don't call from inside the canvas
68 // Processing or video playback changed.
69 virtual void status_event() {};
72 virtual void reset_camera() {};
73 virtual void reset_projector() {};
74 virtual void zoom_resize_window(float percentage
) {};
75 virtual void zoom_auto() {};
76 virtual int cursor_leave_event() { return 0; };
77 virtual int cursor_enter_event() { return 0; };
78 virtual int button_release_event() { return 0; };
79 virtual int button_press_event();
80 virtual int cursor_motion_event() { return 0; };
81 virtual void draw_overlays() { };
82 virtual void toggle_controls() { } ;
83 virtual int get_cwindow_controls() { return 0; };
84 virtual int get_fullscreen() { return 0; }
85 virtual void set_fullscreen(int value
) { };
87 int cursor_leave_event_base(BC_WindowBase
*caller
);
88 int cursor_enter_event_base(BC_WindowBase
*caller
);
89 int button_press_event_base(BC_WindowBase
*caller
);
90 int keypress_event(BC_WindowBase
*caller
);
94 // Provide canvas dimensions since a BC_Bitmap containing obsolete dimensions
95 // is often the output being transferred to.
96 // This gets the input coordinates on the device output_frame
97 // and the corresponding output coordinates on the canvas.
98 // Must be floating point to support OpenGL.
99 void get_transfers(EDL
*edl
,
108 // passing -1 causes automatic size detection
111 void reposition_window(EDL
*edl
, int x
, int y
, int w
, int h
);
112 virtual void reset_translation() {};
113 virtual void close_source() {};
114 // Updates the stores
115 virtual void update_zoom(int x
, int y
, float zoom
) {};
116 void check_boundaries(EDL
*edl
, int &x
, int &y
, float &zoom
);
117 void update_scrollbars();
118 // Get scrollbar positions relative to output.
119 // No correction is done if output is smaller than canvas
120 virtual int get_xscroll() { return 0; };
121 virtual int get_yscroll() { return 0; };
122 virtual float get_zoom() { return 0; };
124 virtual void draw_refresh() {};
126 // Get top left offset of canvas relative to output.
127 // Normally negative. Can be positive if output is smaller than canvas.
128 float get_x_offset(EDL
*edl
,
133 float get_y_offset(EDL
*edl
,
138 void get_zooms(EDL
*edl
,
146 // Convert coord from output to canvas position, including
147 // x and y scroll offsets
148 void output_to_canvas(EDL
*edl
, int single_channel
, float &x
, float &y
);
149 // Convert coord from canvas to output position
150 void canvas_to_output(EDL
*edl
, int single_channel
, float &x
, float &y
);
152 // Get dimensions of frame being sent to canvas
153 virtual int get_output_w(EDL
*edl
);
154 virtual int get_output_h(EDL
*edl
);
155 // Get if scrollbars exist
156 int scrollbars_exist();
157 // Get cursor locations relative to canvas and not offset by scrollbars
160 int get_buttonpress();
161 // Gets whatever video surface is enabled
162 BC_WindowBase
* get_canvas();
164 // The owner of the canvas
165 BC_WindowBase
*subwindow
;
166 // Video surface if a subwindow
167 CanvasOutput
*canvas_subwindow
;
168 // Video surface if fullscreen
169 CanvasFullScreen
*canvas_fullscreen
;
170 CanvasXScroll
*xscroll
;
171 CanvasYScroll
*yscroll
;
172 CanvasPopup
*canvas_menu
;
173 CanvasFullScreenPopup
*fullscreen_menu
;
179 // Used in record monitor
180 int output_w
, output_h
;
181 // Last frame played is stored here in driver format for
183 VFrame
*refresh_frame
;
184 // Results from last get_scrollbars
189 // For cases where video is not enabled on the canvas but processing is
190 // occurring for a single frame, this causes the status to update.
192 // Cursor is inside video surface
204 void get_scrollbars(EDL
*edl
,
213 class CanvasOutput
: public BC_SubWindow
216 CanvasOutput(Canvas
*canvas
,
223 int cursor_leave_event();
224 int cursor_enter_event();
225 int button_press_event();
226 int button_release_event();
227 int cursor_motion_event();
228 int keypress_event();
236 class CanvasFullScreen
: public BC_FullScreen
239 CanvasFullScreen(Canvas
*canvas
,
250 class CanvasXScroll
: public BC_ScrollBar
253 CanvasXScroll(EDL
*edl
,
268 class CanvasYScroll
: public BC_ScrollBar
271 CanvasYScroll(EDL
*edl
,
287 class CanvasFullScreenPopup
: public BC_PopupMenu
290 CanvasFullScreenPopup(Canvas
*canvas
);
292 void create_objects();
297 class CanvasSubWindowItem
: public BC_MenuItem
300 CanvasSubWindowItem(Canvas
*canvas
);
305 class CanvasPopup
: public BC_PopupMenu
308 CanvasPopup(Canvas
*canvas
);
311 void create_objects();
314 CanvasToggleControls
*toggle_controls
;
317 class CanvasPopupSize
: public BC_MenuItem
320 CanvasPopupSize(Canvas
*canvas
, char *text
, float percentage
);
327 class CanvasPopupAuto
: public BC_MenuItem
330 CanvasPopupAuto(Canvas
*canvas
);
335 class CanvasPopupResetCamera
: public BC_MenuItem
338 CanvasPopupResetCamera(Canvas
*canvas
);
343 class CanvasPopupResetProjector
: public BC_MenuItem
346 CanvasPopupResetProjector(Canvas
*canvas
);
351 class CanvasToggleControls
: public BC_MenuItem
354 CanvasToggleControls(Canvas
*canvas
);
356 static char* calculate_text(int cwindow_controls
);
360 class CanvasFullScreenItem
: public BC_MenuItem
363 CanvasFullScreenItem(Canvas
*canvas
);
368 class CanvasPopupResetTranslation
: public BC_MenuItem
371 CanvasPopupResetTranslation(Canvas
*canvas
);
377 class CanvasPopupRemoveSource
: public BC_MenuItem
380 CanvasPopupRemoveSource(Canvas
*canvas
);
393 // c-file-style: "linux"