tags tweak, rework canvas lock/refresh, vgui/cgui segv if closed while playing
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / canvas.h
index 1a65426064bbecc2da026e18dedaf72f97538bd2..775df7d016c0bfd4455d933deb20aecbc92cce63 100644 (file)
@@ -44,11 +44,9 @@ public:
        void calculate_sizes(float aspect_ratio,
                int output_w, int output_h, float zoom,
                int &w, int &h);
-// Lock access to the canvas pointer.
-// Must be called before get_canvas or locking the canvas.
-       void lock_canvas(const char *location);
+// Lock canvas pointer and window
+       BC_WindowBase *lock_canvas(const char *loc);
        void unlock_canvas();
-       int is_locked();
 
        void create_objects(EDL *edl);
        void set_cursor(int cursor);
@@ -87,8 +85,8 @@ public:
        virtual void draw_overlays() {}
        virtual void toggle_controls() {}
        virtual int get_cwindow_controls() { return 0; }
-       virtual int get_fullscreen() { return 0; }
-       virtual void set_fullscreen(int value) {}
+       virtual int get_fullscreen();
+       virtual void set_fullscreen(int value);
 
        int cursor_leave_event_base(BC_WindowBase *caller);
        int cursor_enter_event_base(BC_WindowBase *caller);
@@ -134,7 +132,7 @@ public:
        void update_refresh(VideoDevice *device, VFrame *output_frame);
 // Redraws the refresh_frame
        virtual void draw_refresh(int flush = 1) {};
-       virtual void clear(int flush=1);
+       virtual void clear(int flash=1);
 
 // Get top left offset of canvas relative to output.
 // Normally negative.  Can be positive if output is smaller than canvas.
@@ -173,6 +171,9 @@ public:
        int get_buttonpress();
 // Gets whatever video surface is enabled
        BC_WindowBase* get_canvas();
+// draw_refresh, with/without locks
+       int refresh(int flush);
+       int redraw(int flush);
 
 // The owner of the canvas
        BC_WindowBase *subwindow;
@@ -200,6 +201,7 @@ public:
 // For cases where video is not enabled on the canvas but processing is
 // occurring for a single frame, this causes the status to update.
        int is_processing;
+       int is_fullscreen;
 // Cursor is inside video surface
        int cursor_inside;
        int view_x;
@@ -214,7 +216,8 @@ public:
 private:
        void get_scrollbars(EDL *edl,
                int &canvas_x, int &canvas_y, int &canvas_w, int &canvas_h);
-       Mutex *canvas_lock;
+// Lock access to the canvas pointer.
+       Condition *canvas_lock;
 };