/*! \file canvasview.h
** \brief Template Header
**
-** $Id: canvasview.h,v 1.2 2005/01/13 18:37:30 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007, 2008 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
#include "dialog_waypoint.h"
#include "dialog_keyframe.h"
+#include "framedial.h"
#include "duckmatic.h"
#include <gtkmm/scale.h>
/* === C L A S S E S & S T R U C T S ======================================= */
+namespace synfig {
+ class TransformStack;
+}
+
namespace studio {
class CanvasViewUIInterface;
class Dialog_SoundSelect;
class Dialog_Preview;
-class synfig::TransformStack;
class Dock_Layers;
class Dock_Children;
class Dock_Keyframes;
typedef ChildrenTreeStore::Model ChildrenTreeModel;
//! Create an instance of this class whenever doing a longer task.
- /*! Make sure that you check the bool value of this class occasionaly
+ /*! Make sure that you check the bool value of this class occasionally
** to make sure the action has not been canceled. */
class IsWorking
{
typedef synfigapp::CanvasInterface::Mode Mode;
+ void set_grid_snap_toggle(bool flag) { grid_snap_toggle->set_active(flag); }
+ void set_grid_show_toggle(bool flag) { grid_show_toggle->set_active(flag); }
+
/*
-- ** -- P R I V A T E D A T A ---------------------------------------------
*/
synfig::Rect bbox;
- DEBUGPOINT_CLASS(1);
+ // DEBUGPOINT_CLASS(1);
//! State Machine
Smach smach_;
- DEBUGPOINT_CLASS(2);
+ // DEBUGPOINT_CLASS(2);
etl::loose_handle<Instance> instance_;
etl::handle<synfigapp::CanvasInterface> canvas_interface_;
- DEBUGPOINT_CLASS(3);
+ // DEBUGPOINT_CLASS(3);
//! Sound and information to play it
etl::handle<AudioContainer> audio;
studio::Widget_Sound *disp_audio; //should this be put into thing too?
- SigC::Connection playcon;
- SigC::Connection stopcon;
+ sigc::connection playcon;
+ sigc::connection stopcon;
std::auto_ptr<UniversalScrubber> universal_scrubber;
- //! Tooltip controler
+ //! Tooltip controller
Gtk::Tooltips tooltips;
- DEBUGPOINT_CLASS(4);
+ // DEBUGPOINT_CLASS(4);
//! TreeModel for the layers
LayerTreeModel layer_tree_model;
//Glib::RefPtr<KeyframeTreeStore> keyframe_tree_store_;
- DEBUGPOINT_CLASS(5);
+ // DEBUGPOINT_CLASS(5);
//std::map<synfig::String,Glib::RefPtr<Gtk::TreeModel> > tree_model_book_;
std::map<synfig::String,Glib::RefPtr<Glib::ObjectBase> > ref_obj_book_;
std::map<synfig::String,Gtk::Widget*> ext_widget_book_;
-
//! The time adjustment's scope is defined by the time_window adjustment
Gtk::Adjustment time_adjustment_;
//Gtk::Adjustment time_window_adjustment_;
studio::Adjust_Window time_window_adjustment_;
-
LayerTree *layer_tree;
ChildrenTree *children_tree;
Gtk::Button *stopbutton;
Gtk::Button *refreshbutton;
- Gtk::Button *treetogglebutton;
- Gtk::Notebook *notebook;
+ Gtk::Button *treetogglebutton; // not used
+ Gtk::Notebook *notebook; // not used
Gtk::Widget *timebar;
+ Gtk::Button *animatebutton;
+ Gtk::Button *keyframebutton;
+ FrameDial *framedial;
+
+ //! Shows current time and allows edition
Widget_Time *current_time_widget;
void on_current_time_widget_changed();
- std::auto_ptr<Widget_Timeslider> timeslider;
+ //! Time slider class. Same than the Time track panel
+ std::auto_ptr<Widget_Timeslider> timeslider;
std::list<sigc::connection> duck_changed_connections;
-
-
- Gtk::Button *animatebutton;
- Gtk::Button *keyframebutton;
-
/* DEBUGPOINT_CLASS(8);
Gtk::Menu duckmaskmenu;
Gtk::CheckMenuItem* duck_mask_width;
Gtk::CheckMenuItem* duck_mask_angle;
*/
+ //! Menu members
Gtk::Menu parammenu;
-
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_position;
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_vertex;
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_tangent;
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_radius;
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_width;
- Glib::RefPtr<Gtk::ToggleAction> duck_mask_angle;
+ Glib::RefPtr<Gtk::ToggleAction> grid_snap_toggle;
+ Glib::RefPtr<Gtk::ToggleAction> grid_show_toggle;
Gtk::RadioButtonGroup quality_group;
+ Gtk::RadioButtonGroup low_res_pixel_size_group;
Glib::RefPtr<Gtk::ActionGroup> action_group;
-
etl::handle<synfigapp::UIInterface> ui_interface_;
etl::handle<synfigapp::SelectionManager> selection_manager_;
bool cancel;
-
/*
-- ** -- D I A L O G S -------------------------------------------------------
*/
CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigapp::CanvasInterface> canvas_interface);
//! Constructor Helper
- Gtk::Widget* create_layer_tree();
+ // Gtk::Widget* create_layer_tree();
//! Constructor Helper
- Gtk::Widget* create_children_tree();
+ // Gtk::Widget* create_children_tree();
//! Constructor Helper
- Gtk::Widget* create_keyframe_tree();
+ // Gtk::Widget* create_keyframe_tree();
//! Constructor Helper
Gtk::Widget* create_status_bar();
Gtk::Widget *create_time_bar();
-
-
+ //! Pop up menu for the bezier (bline, draw) tool (?)
void popup_param_menu_bezier(float location, synfigapp::ValueDesc value_desc)
- { popup_param_menu(value_desc,location); }
-
- void popup_param_menu(synfigapp::ValueDesc value_desc, float location=0);
+ { popup_param_menu(value_desc,location,true); }
+ //! Pop up menu for the tools but not the bezier ones.
+ void popup_param_menu(synfigapp::ValueDesc value_desc, float location=0, bool bezier=false);
void workarea_layer_selected(synfig::Layer::Handle layer);
void selected_layer_color_set(synfig::Color color);
-
-
void register_layer_type(synfig::Layer::Book::value_type &lyr,std::map<synfig::String,Gtk::Menu*>*);
//! Rebuilds the "new layer" menu
void rebuild_ducks_layer_(synfig::TransformStack& transform_stack, synfig::Canvas::Handle canvas, std::set<synfig::Layer::Handle>& selected_list);
+ void decrease_low_res_pixel_size();
+ void increase_low_res_pixel_size();
+
/*
-- ** -- P U B L I C M E T H O D S -----------------------------------------
*/
//! Updates the title of the window
void update_title();
+ //! Closes this document
+ bool close_instance();
+
//! Closes this canvas view
- bool close();
+ bool close_view();
//! Stops the currently executing action
/*! \see get_cancel_status(), reset_cancel_status(), IsWorking */
void hide_timebar();
//t Enables or disables interaction with the timebar
- void timebar_set_sensitive(bool sensitive);
-
- void do_rotoscope_bline();
-
- void do_rotoscope();
-
- void do_rotoscope_poly();
-
- void do_eyedrop();
+ void set_sensitive_timebar(bool sensitive);
void time_zoom_in();
void time_zoom_out();
void image_import();
- void on_waypoint_clicked(synfigapp::ValueDesc,synfig::Waypoint, int button);
+ void on_waypoint_clicked_canvasview(synfigapp::ValueDesc,std::set<synfig::Waypoint,std::less<synfig::UniqueID> >, int button);
void preview_option() {on_preview_option();}
void present();
+ bool is_playing() { return is_playing_; }
+
/*
-- ** -- S I G N A L T E R M I N A L S -------------------------------------
*/
private:
+ void on_select_layers();
void on_unselect_layers();
void on_input_device_changed(GdkDevice*);
void on_audio_offset_notify();
bool on_duck_changed(const synfig::Point &value,const synfigapp::ValueDesc& value_desc);
+ bool on_duck_angle_changed(const synfig::Angle &rotation,const synfigapp::ValueDesc& value_desc);
void on_layer_toggle(synfig::Layer::Handle);
void on_edited_value(synfigapp::ValueDesc,synfig::ValueBase);
- //void on_waypoint_clicked(synfigapp::ValueDesc,synfig::ValueNode_Animated::WaypointList::iterator, int button);
-
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);
//void on_audio_play();
bool on_audio_scrub();
+ void on_play_stop_pressed();
+
protected:
+ bool close_instance_when_safe();
bool on_delete_event(GdkEventAny* event);
/*
public:
static etl::handle<studio::CanvasView> create(etl::loose_handle<Instance> instance,etl::handle<synfig::Canvas> canvas);
+ static std::list<int>& get_pixel_sizes();
+
}; // END of class CanvasView
}; // END of namespace studio