21a7f1d5a8c5ec50e1217deefd0f44854b30dacc
[synfig.git] / synfig-studio / src / gui / canvasview.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file canvasview.h
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **      Copyright (c) 2007, 2008 Chris Moore
10 **      Copyright (c) 2009 Carlos López
11 **
12 **      This package is free software; you can redistribute it and/or
13 **      modify it under the terms of the GNU General Public License as
14 **      published by the Free Software Foundation; either version 2 of
15 **      the License, or (at your option) any later version.
16 **
17 **      This package is distributed in the hope that it will be useful,
18 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
19 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 **      General Public License for more details.
21 **      \endlegal
22 */
23 /* ========================================================================= */
24
25 /* === S T A R T =========================================================== */
26
27 #ifndef __SYNFIG_STUDIO_GTKMM_CANVASVIEW_H
28 #define __SYNFIG_STUDIO_GTKMM_CANVASVIEW_H
29
30 /* === H E A D E R S ======================================================= */
31
32 #include <gtkmm/window.h>
33 #include <gtkmm/image.h>
34 #include <gtkmm/tooltips.h>
35 #include <gtkmm/table.h>
36 #include <gtkmm/statusbar.h>
37 #include <gtkmm/progressbar.h>
38 #include <gtkmm/button.h>
39 #include <gtkmm/menu.h>
40 #include <gtkmm/treeview.h>
41 #include <gtkmm/treestore.h>
42 #include <gtkmm/scrolledwindow.h>
43 #include <gtkmm/notebook.h>
44 #include <gdkmm/device.h>
45 #include <gtkmm/spinbutton.h>
46
47 #include <synfigapp/canvasinterface.h>
48 #include <synfigapp/selectionmanager.h>
49
50 #include <synfig/canvas.h>
51 #include <synfig/string.h>
52 #include <synfig/time.h>
53
54 #include "instance.h"
55 #include "dialogs/canvasproperties.h"
56 #include "dialogs/canvasoptions.h"
57 #include "render.h"
58 #include "cellrenderer_timetrack.h"
59 #include "app.h"
60
61 #include "trees/layertreestore.h"
62 #include "trees/layertree.h"
63 #include "trees/childrentreestore.h"
64 #include "trees/childrentree.h"
65 #include "trees/keyframetreestore.h"
66 #include "trees/keyframetree.h"
67
68 #include "dialogs/dialog_waypoint.h"
69 #include "dialogs/dialog_keyframe.h"
70 #include "framedial.h"
71 #include "toggleducksdial.h"
72 #include "resolutiondial.h"
73 #include "widgets/widget_keyframe_list.h"
74
75 #include "duckmatic.h"
76 #include <gtkmm/scale.h>
77
78 #include <gtkmm/uimanager.h>
79
80 #include "smach.h"
81
82 #include <memory>
83 #include <set>
84 #include <map>
85 #include <gtkmm/toggleaction.h>
86 #include <gtkmm/radioaction.h>
87 #include <synfig/rect.h>
88
89 #include "adjust_window.h"
90
91 #include <synfig/transform.h>
92
93 /* === M A C R O S ========================================================= */
94
95 #ifndef DEBUGPOINT_CLASS
96 #if     _DEBUG
97 #define DEBUGPOINT_CLASS(x)             struct debugpointclass_ ## x { debugpointclass_ ## x () { DEBUGPOINT(); } ~debugpointclass_ ## x () { DEBUGPOINT(); } } badfthguae_ ## x ;
98 #else
99 #define DEBUGPOINT_CLASS(x)
100 #endif
101 #endif
102
103 /* === T Y P E D E F S ===================================================== */
104
105 /* === C L A S S E S & S T R U C T S ======================================= */
106
107 namespace synfig {
108         class TransformStack;
109 }
110
111 namespace studio {
112
113 class CanvasViewUIInterface;
114 class CanvasViewSelectionManager;
115
116 class CellRenderer_TimeTrack;
117 class CellRenderer_ValueBase;
118 class UniversalScrubber;
119 class WorkArea;
120
121 class Duckmatic;
122
123 class Preview;
124 struct PreviewInfo;
125 class AudioContainer;
126
127 class Widget_Sound;
128 class Widget_Timeslider;
129 class Widget_Time;
130
131 class Dialog_SoundSelect;
132 class Dialog_Preview;
133
134 class Dock_Layers;
135 class Dock_Children;
136 class Dock_Keyframes;
137
138 class CanvasView : public Gtk::Window, public etl::shared_object
139 {
140         friend class UniversalScrubber;
141         friend class Dock_Layers;
142         friend class Dock_Children;
143         friend class Dock_Keyframes;
144
145         friend class CanvasViewUIInterface;
146         friend class CanvasViewSelectionManager;
147
148         friend class Duckmatic;
149
150         /*
151  -- ** -- P U B L I C   T Y P E S ---------------------------------------------
152         */
153
154 public:
155
156         typedef etl::handle<CanvasView> Handle;
157
158         typedef etl::handle<const CanvasView> ConstHandle;
159
160         typedef etl::loose_handle<CanvasView> LooseHandle;
161
162         typedef LayerTreeStore::Model LayerTreeModel;
163
164         typedef ChildrenTreeStore::Model ChildrenTreeModel;
165
166         //! Create an instance of this class whenever doing a longer task.
167         /*! Make sure that you check the bool value of this class occasionally
168         **      to make sure the action has not been canceled. */
169         class IsWorking
170         {
171                 CanvasView &canvas_view_;
172
173         public:
174                 IsWorking(CanvasView &canvas_view_);
175                 ~IsWorking();
176                 operator bool()const;
177         };
178         friend class IsWorking;
179
180         typedef synfigapp::CanvasInterface::Mode Mode;
181
182         void set_grid_snap_toggle(bool flag) { grid_snap_toggle->set_active(flag); }
183         void set_grid_show_toggle(bool flag) { grid_show_toggle->set_active(flag); }
184
185         /*
186  -- ** -- P R I V A T E   D A T A ---------------------------------------------
187         */
188
189 public:
190         std::auto_ptr<WorkArea> work_area;
191
192         WorkArea* get_work_area() { return work_area.get(); }
193 private:
194
195         synfig::TransformStack curr_transform_stack;
196         bool curr_transform_stack_set;
197
198         synfig::Rect bbox;
199
200         // DEBUGPOINT_CLASS(1);
201
202         //! State Machine
203         Smach smach_;
204
205         // DEBUGPOINT_CLASS(2);
206
207         etl::loose_handle<Instance> instance_;
208         etl::handle<synfigapp::CanvasInterface> canvas_interface_;
209
210         // DEBUGPOINT_CLASS(3);
211
212         //! Sound and information to play it
213         etl::handle<AudioContainer>             audio;
214         studio::Widget_Sound                    *disp_audio; //should this be put into thing too?
215
216         sigc::connection                                playcon;
217         sigc::connection                                stopcon;
218
219         std::auto_ptr<UniversalScrubber> universal_scrubber;
220
221         //! Tooltip controller
222         Gtk::Tooltips tooltips;
223
224         // DEBUGPOINT_CLASS(4);
225
226         //! TreeModel for the layers
227         LayerTreeModel layer_tree_model;
228
229         //! TreeModel for the the children
230         ChildrenTreeModel children_tree_model;
231
232         //Glib::RefPtr<LayerTreeStore> layer_tree_store_;
233
234         //Glib::RefPtr<ChildrenTreeStore> children_tree_store_;
235
236         //Glib::RefPtr<KeyframeTreeStore> keyframe_tree_store_;
237
238         // DEBUGPOINT_CLASS(5);
239
240         //std::map<synfig::String,Glib::RefPtr<Gtk::TreeModel> > tree_model_book_;
241         std::map<synfig::String,Glib::RefPtr<Glib::ObjectBase> > ref_obj_book_;
242         std::map<synfig::String,Gtk::Widget*> ext_widget_book_;
243
244         //! The time adjustment's scope is defined by the time_window adjustment
245         Gtk::Adjustment time_adjustment_;
246
247         //! The time_window adjustment governs the position of the time window on the whole time line
248         //Gtk::Adjustment time_window_adjustment_;
249         studio::Adjust_Window time_window_adjustment_;
250
251         LayerTree *layer_tree;
252
253         ChildrenTree *children_tree;
254
255         KeyframeTree *keyframe_tree;
256
257         Gtk::Widget *keyframe_tab_child;
258
259         Gtk::ProgressBar *progressbar;
260         Gtk::Statusbar *statusbar;
261
262         Gtk::TreeRow children_canvas_row;
263         Gtk::TreeRow children_valuenode_row;
264
265         Gtk::Button *stopbutton;
266         Gtk::Button *refreshbutton;
267         Gtk::Button *treetogglebutton;  // not used
268         Gtk::Notebook *notebook; // not used
269         Gtk::Table *timebar;
270         Gtk::Table *displaybar;
271         Gtk::Button *animatebutton;
272         Gtk::Button *keyframebutton;
273         FrameDial *framedial;
274         ToggleDucksDial *toggleducksdial;
275         bool toggling_ducks_;
276         ResolutionDial *resolutiondial;
277         bool changing_resolution_;
278         Gtk::Adjustment quality_adjustment_;
279         Gtk::SpinButton *quality_spin;
280         Gtk::Adjustment future_onion_adjustment_;
281         Gtk::Adjustment past_onion_adjustment_;
282         Gtk::SpinButton *past_onion_spin;
283         Gtk::SpinButton *future_onion_spin;
284         bool updating_quality_;
285         Gtk::ToggleButton *show_grid;
286         Gtk::ToggleButton *snap_grid;
287         Gtk::ToggleButton *onion_skin;
288         Gtk::Button *render_options_button;
289         Gtk::Button *preview_options_button;
290         bool toggling_show_grid;
291         bool toggling_snap_grid;
292         bool toggling_onion_skin;
293         //! Shows current time and allows edition
294         Widget_Time *current_time_widget;
295         void on_current_time_widget_changed();
296
297         //! Time slider class. Same than the Time track panel
298         std::auto_ptr<Widget_Timeslider> timeslider;
299
300         //!Keyframe list slider
301         std::auto_ptr<Widget_Keyframe_List> widget_kf_list;
302
303         std::list<sigc::connection> duck_changed_connections;
304
305 /*      DEBUGPOINT_CLASS(8);
306
307         Gtk::Menu duckmaskmenu;
308         DEBUGPOINT_CLASS(77);
309         Gtk::Menu qualitymenu;
310         DEBUGPOINT_CLASS(6);
311
312         Gtk::Menu filemenu;
313         DEBUGPOINT_CLASS(777);
314         Gtk::Menu editmenu;
315         DEBUGPOINT_CLASS(71);
316         Gtk::Menu canvasmenu;
317         DEBUGPOINT_CLASS(73);
318 public:
319         Gtk::Menu layermenu;
320 private:
321         DEBUGPOINT_CLASS(74);
322         Gtk::Menu newlayermenu;
323         DEBUGPOINT_CLASS(76);
324         Gtk::Menu viewmenu;
325
326         DEBUGPOINT_CLASS(99);
327         Gtk::Menu keyframemenu;
328
329         Gtk::Menu parammenu;
330         DEBUGPOINT_CLASS(9);
331         Gtk::Menu trackmenu;
332         DEBUGPOINT_CLASS(7);
333
334         Gtk::CheckMenuItem* duck_mask_position;
335         Gtk::CheckMenuItem* duck_mask_vertex;
336         Gtk::CheckMenuItem* duck_mask_tangent;
337         Gtk::CheckMenuItem* duck_mask_radius;
338         Gtk::CheckMenuItem* duck_mask_width;
339         Gtk::CheckMenuItem* duck_mask_angle;
340 */
341         //! Menu members
342         Gtk::Menu parammenu;
343
344         Glib::RefPtr<Gtk::ToggleAction> grid_snap_toggle;
345         Glib::RefPtr<Gtk::ToggleAction> grid_show_toggle;
346
347         Gtk::RadioButtonGroup quality_group;
348         Gtk::RadioButtonGroup low_res_pixel_size_group;
349
350         Glib::RefPtr<Gtk::ActionGroup> action_group;
351
352         etl::handle<synfigapp::UIInterface> ui_interface_;
353         etl::handle<synfigapp::SelectionManager> selection_manager_;
354
355         bool is_playing_;
356
357         sigc::signal<void> signal_deleted_;
358
359         bool rebuild_ducks_queued;
360         sigc::connection queue_rebuild_ducks_connection;
361
362         /*
363  -- ** -- P U B L I C   D A T A -----------------------------------------------
364         */
365
366 public:
367         void queue_rebuild_ducks();
368         sigc::signal<void>& signal_deleted() { return signal_deleted_; }
369
370         Gtk::Menu mainmenu;
371
372         bool duck_refresh_flag;
373         bool duck_refresh_needed;
374
375         //! This is for the IsWorking class.
376         int working_depth;
377
378         bool cancel;
379
380         /*
381  -- ** -- D I A L O G S -------------------------------------------------------
382         */
383
384 public:
385
386         CanvasProperties canvas_properties;
387         CanvasOptions canvas_options;
388         RenderSettings render_settings;
389         Dialog_Waypoint waypoint_dialog;
390         Dialog_Keyframe keyframe_dialog;
391
392         std::auto_ptr<Dialog_Preview>                   preview_dialog;
393         //std::auto_ptr<Dialog_PreviewOptions>  previewoption_dialog;
394         std::auto_ptr<Dialog_SoundSelect>               sound_dialog;
395
396         /*
397  -- ** -- P R I V A T E   M E T H O D S ---------------------------------------
398         */
399
400 private:
401
402         // Constructor is private to force the use of the "create()" constructor
403         CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigapp::CanvasInterface> canvas_interface);
404
405         //! Constructor Helper
406         // Gtk::Widget* create_layer_tree();
407
408         //! Constructor Helper
409         // Gtk::Widget* create_children_tree();
410
411         //! Constructor Helper
412         // Gtk::Widget* create_keyframe_tree();
413
414         //! Constructor Helper
415         Gtk::Widget* create_status_bar();
416
417         //! Constructor Helper - Initializes all of the menus
418         void init_menus();
419
420         bool duck_change_param(const synfig::Point &value,synfig::Layer::Handle layer, synfig::String param_name);
421
422         void refresh_time_window();
423
424         void time_was_changed();
425
426         void refresh_rend_desc();
427
428         void toggle_duck_mask(Duckmatic::Type type);
429
430         Gtk::Widget *create_work_area();
431
432         Gtk::Widget *create_time_bar();
433
434         Gtk::Widget *create_display_bar();
435
436         //! Pop up menu for the bezier (bline, draw) tool (?)
437         void popup_param_menu_bezier(float location, synfigapp::ValueDesc value_desc)
438         { popup_param_menu(value_desc,location,true); }
439
440         //! Pop up menu for the tools but not the bezier ones.
441         void popup_param_menu(synfigapp::ValueDesc value_desc, float location=0, bool bezier=false);
442
443         void workarea_layer_selected(synfig::Layer::Handle layer);
444
445         void selected_layer_color_set(synfig::Color color);
446
447         void register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>*);
448
449         //! Rebuilds the "new layer" menu
450         void build_new_layer_menu(Gtk::Menu &menu);
451
452         void rebuild_ducks_layer_(synfig::TransformStack& transform_stack, synfig::Canvas::Handle canvas, std::set<synfig::Layer::Handle>& selected_list);
453
454         void decrease_low_res_pixel_size();
455         void increase_low_res_pixel_size();
456         void toggle_low_res_pixel_flag();
457         void set_quality(int x);
458         void set_onion_skins();
459         void toggle_show_grid();
460         void toggle_snap_grid();
461         void toggle_onion_skin();
462
463         /*
464  -- ** -- P U B L I C   M E T H O D S -----------------------------------------
465         */
466
467 public:
468         const synfig::TransformStack& get_curr_transform_stack()const { return curr_transform_stack; }
469
470         const synfig::Rect& get_bbox()const { return bbox; }
471
472         Glib::RefPtr<Glib::ObjectBase> get_ref_obj(const synfig::String& x);
473         Glib::RefPtr<const Glib::ObjectBase> get_ref_obj(const synfig::String& x)const;
474         void set_ref_obj(const synfig::String& x, Glib::RefPtr<Glib::ObjectBase> y);
475
476         Glib::RefPtr<Gtk::TreeModel> get_tree_model(const synfig::String& x);
477         Glib::RefPtr<const Gtk::TreeModel> get_tree_model(const synfig::String& x)const;
478         void set_tree_model(const synfig::String& x, Glib::RefPtr<Gtk::TreeModel> y);
479
480         Gtk::Widget* get_ext_widget(const synfig::String& x);
481         void set_ext_widget(const synfig::String& x, Gtk::Widget* y);
482
483         //std::map<synfig::String,Gtk::Widget*>& tree_view_book() { return tree_view_book_; }
484         //std::map<synfig::String,Gtk::Widget*>& ext_widget_book() { return tree_view_book_; }
485
486         void popup_main_menu();
487
488         Smach& get_smach() { return smach_; }
489
490         const Smach& get_smach()const { return smach_; }
491
492         Smach::event_result process_event_key(EventKey x);
493
494         void popup_layer_menu(synfig::Layer::Handle layer);
495
496         virtual ~CanvasView();
497
498         void set_mode(Mode x) { canvas_interface()->set_mode(x); }
499
500         Mode get_mode()const { return canvas_interface()->get_mode(); }
501
502         Gtk::Adjustment &time_adjustment() { return time_adjustment_; }
503
504         const Gtk::Adjustment &time_adjustment()const { return time_adjustment_; }
505
506         studio::Adjust_Window &time_window_adjustment() { return time_window_adjustment_; }
507
508         const studio::Adjust_Window &time_window_adjustment()const { return time_window_adjustment_; }
509
510         etl::handle<synfigapp::UIInterface> get_ui_interface() { return ui_interface_;}
511
512         etl::handle<synfigapp::SelectionManager> get_selection_manager() { return selection_manager_; }
513
514         Glib::RefPtr<Gtk::TreeModel> layer_tree_store() { return get_tree_model("layers"); }
515
516         Glib::RefPtr<const Gtk::TreeModel> layer_tree_store()const { return get_tree_model("layers"); }
517
518         Glib::RefPtr<Gtk::TreeModel> children_tree_store() { return get_tree_model("children"); }
519
520         Glib::RefPtr<const Gtk::TreeModel> children_tree_store()const { return get_tree_model("children"); }
521
522         Glib::RefPtr<Gtk::TreeModel> keyframe_tree_store() { return get_tree_model("keyframes"); }
523
524         Glib::RefPtr<const Gtk::TreeModel> keyframe_tree_store()const { return get_tree_model("keyframes"); }
525
526         void set_time(synfig::Time t) { canvas_interface_->set_time(t); }
527
528         synfig::Time get_time() { return canvas_interface_->get_time(); }
529
530         etl::handle<synfig::Canvas> get_canvas()const { return canvas_interface_->get_canvas(); }
531
532         etl::handle<Instance> get_instance()const { return instance_; }
533
534         etl::handle<synfigapp::CanvasInterface> canvas_interface() { return canvas_interface_; }
535
536         etl::handle<const synfigapp::CanvasInterface> canvas_interface()const { return canvas_interface_; }
537
538         void add_actions_to_menu(Gtk::Menu *menu,   const synfigapp::Action::ParamList &param_list, synfigapp::Action::Category category=synfigapp::Action::CATEGORY_ALL)const;
539
540         //! Updates the title of the window
541         void update_title();
542
543         //! Closes this document
544         bool close_instance();
545
546         //! Closes this canvas view
547         bool close_view();
548
549         //!     Stops the currently executing action
550         /*! \see get_cancel_status(), reset_cancel_status(), IsWorking */
551         void stop() { cancel=true; }
552
553         //! Returns the cancel status
554         /*! \see stop(), reset_cancel_status(), IsWorking */
555         bool get_cancel_status()const { return cancel; }
556
557         //! Resets the cancel status
558         /*! \see stop(), get_cancel_status(), IsWorking */
559         void reset_cancel_status() { cancel=false; }
560
561         void new_child_canvas();
562
563         //! Rebuilds layer_tree_store_ from the Canvas. Maintains selected items.
564         void rebuild_tables();
565
566         //! Builds layer_tree_store_ from the Canvas. Does not maintain selected items.
567         void build_tables();
568
569         //! Refreshes the data for the tables
570         void refresh_tables();
571
572         //void rebuild_layer_table();
573         //void build_layer_table();
574         //void refresh_layer_table();
575
576 //      void rebuild_canvas_table();
577 //      void build_canvas_table();
578 //      void refresh_canvas_table();
579
580 //      void rebuild_valuenode_table();
581 //      void build_valuenode_table();
582 //      void refresh_valuenode_table();
583
584         //! \writeme
585         void rebuild_ducks();
586
587         //bool add_to_ducks(synfigapp::ValueDesc value_desc, synfig::ParamDesc *param_desc=NULL);
588
589         //! Starts "playing" the animation in real-time
590         void play();
591
592         //! Shows the tables (Layer/Children)
593         void show_tables();
594
595         //! Hides the tables (Layer/Children)
596         void hide_tables();
597
598         //! Toggles the tables
599         void toggle_tables();
600
601         //! Gets the table status
602         bool tables_are_visible();
603
604         //! Shows the time bar
605         void show_timebar();
606
607         //! Hides the time bar
608         void hide_timebar();
609
610         //t Enables or disables interaction with the timebar
611         void set_sensitive_timebar(bool sensitive);
612
613         void time_zoom_in();
614         void time_zoom_out();
615
616         void add_layer(synfig::String x);
617
618         void show_keyframe_dialog();
619
620         void play_audio(float t);
621         void stop_audio();
622
623         void image_import();
624
625         void on_waypoint_clicked_canvasview(synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >, int button);
626
627         void preview_option() {on_preview_option();}
628
629         void present();
630
631         bool is_playing() { return is_playing_; }
632
633         void update_quality();
634
635
636
637         /*
638  -- ** -- S I G N A L   T E R M I N A L S -------------------------------------
639         */
640
641 private:
642
643         void on_select_layers();
644         void on_unselect_layers();
645
646         void on_input_device_changed(GdkDevice*);
647
648         virtual void on_hide();
649
650         virtual bool on_focus_in_event(GdkEventFocus*);
651         virtual bool on_focus_out_event(GdkEventFocus*);
652
653         //bool on_children_tree_event(GdkEvent *event);
654
655         bool on_keyframe_tree_event(GdkEvent *event);
656
657         //void on_children_edited_value(const Glib::ustring&path_string,synfig::ValueBase value);
658
659         void on_dirty_preview();
660
661         bool on_children_user_click(int, Gtk::TreeRow, ChildrenTree::ColumnID);
662
663         bool on_layer_user_click(int, Gtk::TreeRow, LayerTree::ColumnID);
664
665 //      void on_layer_toggle(const Glib::ustring& path_string, Gtk::TreeModelColumn<bool> column);
666
667         void on_mode_changed(synfigapp::CanvasInterface::Mode mode);
668
669 //      void on_layer_waypoint_clicked(const Glib::ustring &, synfig::ValueNode_Animated::WaypointList::iterator);
670
671         //void on_children_waypoint_clicked(const Glib::ustring &, synfig::ValueNode_Animated::WaypointList::iterator);
672
673         void on_waypoint_changed();
674
675         void on_waypoint_delete();
676
677         void on_refresh_pressed();
678
679         void on_id_changed();
680
681         void on_time_changed();
682
683         /*
684         void on_layer_raise_pressed();
685         void on_layer_lower_pressed();
686         void on_layer_duplicate_pressed();
687         void on_layer_delete_pressed();
688         */
689
690         void on_keyframe_add_pressed();
691
692         void on_keyframe_duplicate_pressed();
693
694         void on_keyframe_remove_pressed();
695
696         void on_animate_button_pressed();
697
698         void on_keyframe_button_pressed();
699
700         void on_preview_option();
701         void on_preview_create(const PreviewInfo &);
702
703         void on_audio_option();
704         void on_audio_file_change(const std::string &f);
705         void on_audio_offset_change(const synfig::Time &t);
706
707         void on_audio_file_notify();
708         void on_audio_offset_notify();
709
710         bool on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc);
711         bool on_duck_angle_changed(const synfig::Angle &rotation,const synfigapp::ValueDesc& value_desc);
712
713         void on_layer_toggle(synfig::Layer::Handle);
714
715         void on_edited_value(synfigapp::ValueDesc,synfig::ValueBase);
716
717         void on_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
718
719         //void on_audio_play();
720         bool on_audio_scrub();
721
722         void on_play_stop_pressed();
723
724 protected:
725         bool close_instance_when_safe();
726         bool on_delete_event(GdkEventAny* event);
727
728         /*
729  -- ** -- S T A T I C   P U B L I C   M E T H O D S ---------------------------
730         */
731
732 public:
733
734         static etl::handle<studio::CanvasView> create(etl::loose_handle<Instance> instance,etl::handle<synfig::Canvas> canvas);
735         static std::list<int>& get_pixel_sizes();
736
737 }; // END of class CanvasView
738
739 }; // END of namespace studio
740
741 /* === E N D =============================================================== */
742
743 #endif