#include <synfigapp/action_system.h>
#include "state_mirror.h"
+#include "../state_normal.h"
#include "../canvasview.h"
#include "../workarea.h"
#include "../app.h"
class studio::StateMirror_Context : public sigc::trackable
{
etl::handle<CanvasView> canvas_view_;
+ CanvasView::IsWorking is_working;
synfigapp::Settings& settings;
duck_dragger_->axis=get_axis();
}
+ Smach::event_result event_stop_handler(const Smach::event& x);
Smach::event_result event_refresh_tool_options(const Smach::event& x);
void refresh_tool_options();
Smach::state<StateMirror_Context>("mirror")
{
insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateMirror_Context::event_refresh_tool_options));
+ insert(event_def(EVENT_STOP,&StateMirror_Context::event_stop_handler));
}
StateMirror::~StateMirror()
StateMirror_Context::StateMirror_Context(CanvasView* canvas_view):
canvas_view_(canvas_view),
+ is_working(*canvas_view),
settings(synfigapp::Main::get_selected_input_device()->settings()),
duck_dragger_(new DuckDrag_Mirror()),
radiobutton_axis_x(radiobutton_group,_("Horizontal")),
return Smach::RESULT_ACCEPT;
}
+Smach::event_result
+StateMirror_Context::event_stop_handler(const Smach::event& /*x*/)
+{
+ throw &state_normal;
+ return Smach::RESULT_OK;
+}
StateMirror_Context::~StateMirror_Context()
{
#include <synfigapp/action_system.h>
#include "state_rotate.h"
+#include "state_normal.h"
#include "canvasview.h"
#include "workarea.h"
#include "app.h"
class studio::StateRotate_Context : public sigc::trackable
{
etl::handle<CanvasView> canvas_view_;
+ CanvasView::IsWorking is_working;
synfigapp::Settings& settings;
bool get_scale_flag()const { return checkbutton_scale.get_active(); }
void set_scale_flag(bool x) { return checkbutton_scale.set_active(x); refresh_scale_flag(); }
-
+ Smach::event_result event_stop_handler(const Smach::event& x);
Smach::event_result event_refresh_tool_options(const Smach::event& x);
void refresh_tool_options();
Smach::state<StateRotate_Context>("rotate")
{
insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateRotate_Context::event_refresh_tool_options));
+ insert(event_def(EVENT_STOP,&StateRotate_Context::event_stop_handler));
}
StateRotate::~StateRotate()
StateRotate_Context::StateRotate_Context(CanvasView* canvas_view):
canvas_view_(canvas_view),
+ is_working(*canvas_view),
settings(synfigapp::Main::get_selected_input_device()->settings()),
duck_dragger_(new DuckDrag_Rotate()),
checkbutton_scale(_("Allow Scale"))
return Smach::RESULT_ACCEPT;
}
+Smach::event_result
+StateRotate_Context::event_stop_handler(const Smach::event& /*x*/)
+{
+ throw &state_normal;
+ return Smach::RESULT_OK;
+}
+
StateRotate_Context::~StateRotate_Context()
{
save_settings();
#include <synfigapp/action_system.h>
#include "state_scale.h"
+#include "state_normal.h"
#include "canvasview.h"
#include "workarea.h"
#include "app.h"
class studio::StateScale_Context : public sigc::trackable
{
etl::handle<CanvasView> canvas_view_;
+ CanvasView::IsWorking is_working;
synfigapp::Settings& settings;
void refresh_aspect_lock_flag() { if(duck_dragger_)duck_dragger_->lock_aspect=get_aspect_lock_flag(); }
+ Smach::event_result event_stop_handler(const Smach::event& x);
Smach::event_result event_refresh_tool_options(const Smach::event& x);
void refresh_tool_options();
Smach::state<StateScale_Context>("scale")
{
insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateScale_Context::event_refresh_tool_options));
+ insert(event_def(EVENT_STOP,&StateScale_Context::event_stop_handler));
}
StateScale::~StateScale()
StateScale_Context::StateScale_Context(CanvasView* canvas_view):
canvas_view_(canvas_view),
+ is_working(*canvas_view),
settings(synfigapp::Main::get_selected_input_device()->settings()),
duck_dragger_(new DuckDrag_Scale()),
checkbutton_aspect_lock(_("Lock Aspect Ratio"))
return Smach::RESULT_ACCEPT;
}
+Smach::event_result
+StateScale_Context::event_stop_handler(const Smach::event& /*x*/)
+{
+ throw &state_normal;
+ return Smach::RESULT_OK;
+}
+
StateScale_Context::~StateScale_Context()
{
save_settings();
#include <synfigapp/action_system.h>
#include "state_smoothmove.h"
+#include "state_normal.h"
#include "canvasview.h"
#include "workarea.h"
#include "app.h"
class studio::StateSmoothMove_Context : public sigc::trackable
{
etl::handle<CanvasView> canvas_view_;
+ CanvasView::IsWorking is_working;
//Duckmatic::Push duckmatic_push;
Smach::state<StateSmoothMove_Context>("smooth_move")
{
insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateSmoothMove_Context::event_refresh_tool_options));
+ insert(event_def(EVENT_STOP,&StateSmoothMove_Context::event_stop_handler));
}
StateSmoothMove::~StateSmoothMove()
StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view):
canvas_view_(canvas_view),
+ is_working(*canvas_view),
// duckmatic_push(get_work_area()),
settings(synfigapp::Main::get_selected_input_device()->settings()),
duck_dragger_(new DuckDrag_SmoothMove()),
return Smach::RESULT_ACCEPT;
}
+Smach::event_result
+StateSmoothMove_Context::event_stop_handler(const Smach::event& /*x*/)
+{
+ throw &state_normal;
+ return Smach::RESULT_OK;
+}
+
StateSmoothMove_Context::~StateSmoothMove_Context()
{
save_settings();