1 /* === S Y N F I G ========================================================= */
2 /*! \file state_normal.cpp
3 ** \brief Template File
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007, 2008 Chris Moore
10 ** Copyright (c) 2009 Nikita Kitaev
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.
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.
23 /* ========================================================================= */
25 /* === H E A D E R S ======================================================= */
34 #include <gtkmm/dialog.h>
35 #include <gtkmm/entry.h>
37 #include <synfig/valuenode_animated.h>
38 #include <synfig/valuenode_blinecalcvertex.h>
39 #include <synfig/valuenode_composite.h>
40 #include <synfig/valuenode_const.h>
41 #include <synfig/valuenode_dynamiclist.h>
42 #include <synfigapp/action_system.h>
44 #include "state_normal.h"
45 #include "canvasview.h"
49 #include <synfigapp/action.h>
50 #include "event_mouse.h"
51 #include "event_layerclick.h"
53 #include "dialog_tooloptions.h"
54 #include <gtkmm/optionmenu.h>
56 #include <synfig/angle.h>
57 #include <synfigapp/main.h>
62 /* === U S I N G =========================================================== */
66 using namespace synfig;
67 using namespace studio;
69 /* === M A C R O S ========================================================= */
72 #define EPSILON 0.0000001
75 /* === G L O B A L S ======================================================= */
77 StateNormal studio::state_normal;
79 /* === C L A S S E S & S T R U C T S ======================================= */
81 class DuckDrag_Combo : public DuckDrag_Base
83 synfig::Vector last_move;
84 synfig::Vector drag_offset;
85 synfig::Vector center;
88 synfig::Angle original_angle;
89 synfig::Real original_mag;
91 std::vector<synfig::Vector> last_;
92 std::vector<synfig::Vector> positions;
99 etl::handle<CanvasView> canvas_view_;
104 void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
105 bool end_duck_drag(Duckmatic* duckmatic);
106 void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
108 etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
112 class studio::StateNormal_Context : public sigc::trackable
114 etl::handle<CanvasView> canvas_view_;
116 synfigapp::Settings& settings;
118 sigc::connection keypress_connect;
119 sigc::connection keyrelease_connect;
121 etl::handle<DuckDrag_Combo> duck_dragger_;
123 Gtk::Table options_table;
125 Gtk::CheckButton checkbutton_rotate;
126 Gtk::CheckButton checkbutton_scale;
127 Gtk::CheckButton checkbutton_constrain;
131 bool get_rotate_flag()const { return checkbutton_rotate.get_active(); }
132 void set_rotate_flag(bool x) { checkbutton_rotate.set_active(x); refresh_rotate_flag(); }
133 void refresh_rotate_flag() { if(duck_dragger_)duck_dragger_->rotate=get_rotate_flag(); }
135 bool get_scale_flag()const { return checkbutton_scale.get_active(); }
136 void set_scale_flag(bool x) { checkbutton_scale.set_active(x); refresh_scale_flag(); }
137 void refresh_scale_flag() { if(duck_dragger_)duck_dragger_->scale=get_scale_flag(); }
139 bool get_constrain_flag()const { return checkbutton_constrain.get_active(); }
140 void set_constrain_flag(bool x) { checkbutton_constrain.set_active(x); refresh_constrain_flag(); }
141 void refresh_constrain_flag() { if(duck_dragger_)duck_dragger_->constrain=get_constrain_flag(); }
143 StateNormal_Context(CanvasView* canvas_view);
145 ~StateNormal_Context();
147 const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
148 etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
149 synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
150 WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
152 void load_settings();
153 void save_settings();
155 bool key_pressed(GdkEventKey *event);
156 bool key_released(GdkEventKey *event);
158 Smach::event_result event_stop_handler(const Smach::event& x);
159 Smach::event_result event_refresh_handler(const Smach::event& x);
160 Smach::event_result event_refresh_ducks_handler(const Smach::event& x);
161 Smach::event_result event_undo_handler(const Smach::event& x);
162 Smach::event_result event_redo_handler(const Smach::event& x);
163 Smach::event_result event_mouse_button_down_handler(const Smach::event& x);
164 Smach::event_result event_multiple_ducks_clicked_handler(const Smach::event& x);
165 Smach::event_result event_refresh_tool_options(const Smach::event& x);
166 void refresh_tool_options();
167 Smach::event_result event_layer_click(const Smach::event& x);
170 }; // END of class StateNormal_Context
172 /* === M E T H O D S ======================================================= */
174 StateNormal::StateNormal():
175 Smach::state<StateNormal_Context>("normal")
177 insert(event_def(EVENT_STOP,&StateNormal_Context::event_stop_handler));
178 insert(event_def(EVENT_REFRESH,&StateNormal_Context::event_refresh_handler));
179 insert(event_def(EVENT_REFRESH_DUCKS,&StateNormal_Context::event_refresh_ducks_handler));
180 insert(event_def(EVENT_UNDO,&StateNormal_Context::event_undo_handler));
181 insert(event_def(EVENT_REDO,&StateNormal_Context::event_redo_handler));
182 insert(event_def(EVENT_WORKAREA_MOUSE_BUTTON_DOWN,&StateNormal_Context::event_mouse_button_down_handler));
183 insert(event_def(EVENT_WORKAREA_MULTIPLE_DUCKS_CLICKED,&StateNormal_Context::event_multiple_ducks_clicked_handler));
184 insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateNormal_Context::event_refresh_tool_options));
185 insert(event_def(EVENT_WORKAREA_LAYER_CLICKED,&StateNormal_Context::event_layer_click));
189 StateNormal::~StateNormal()
194 StateNormal_Context::load_settings()
198 if(settings.get_value("normal.rotate",value) && value=="1")
199 set_rotate_flag(true);
201 set_rotate_flag(false);
203 if(settings.get_value("normal.scale",value) && value=="1")
204 set_scale_flag(true);
206 set_scale_flag(false);
208 if(settings.get_value("normal.constrain",value) && value=="1")
209 set_constrain_flag(true);
211 set_constrain_flag(false);
216 StateNormal_Context::save_settings()
218 settings.set_value("normal.rotate",get_rotate_flag()?"1":"0");
219 settings.set_value("normal.scale",get_scale_flag()?"1":"0");
220 settings.set_value("normal.constrain",get_constrain_flag()?"1":"0");
223 StateNormal_Context::StateNormal_Context(CanvasView* canvas_view):
224 canvas_view_(canvas_view),
225 settings(synfigapp::Main::get_selected_input_device()->settings()),
226 duck_dragger_(new DuckDrag_Combo()),
227 checkbutton_rotate(_("Rotate (Ctrl)")),
228 checkbutton_scale(_("Scale (Alt)")),
229 checkbutton_constrain(_("Constrain (Shift)"))
231 duck_dragger_->canvas_view_=get_canvas_view();
233 // Set up the tool options dialog
234 options_table.attach(*manage(new Gtk::Label(_("Normal Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
235 options_table.attach(checkbutton_rotate, 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
236 options_table.attach(checkbutton_scale, 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
237 options_table.attach(checkbutton_constrain, 0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
239 checkbutton_rotate.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_rotate_flag));
240 checkbutton_scale.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_scale_flag));
241 checkbutton_constrain.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_constrain_flag));
244 options_table.show_all();
245 refresh_tool_options();
246 //App::dialog_tool_options->set_widget(options_table);
247 //App::dialog_tool_options->present();
249 get_work_area()->set_allow_layer_clicks(true);
250 get_work_area()->set_duck_dragger(duck_dragger_);
252 keypress_connect=get_work_area()->signal_key_press_event().connect(sigc::mem_fun(*this,&StateNormal_Context::key_pressed),false);
253 keyrelease_connect=get_work_area()->signal_key_release_event().connect(sigc::mem_fun(*this,&StateNormal_Context::key_released),false);
255 //these will segfault
256 // get_work_area()->set_cursor(Gdk::CROSSHAIR);
257 // get_work_area()->reset_cursor();
259 App::toolbox->refresh();
262 refresh_scale_flag();
266 StateNormal_Context::key_pressed(GdkEventKey *event)
268 switch(event->keyval)
272 set_rotate_flag(true);
276 set_scale_flag(true);
280 set_constrain_flag(true);
285 return false; //Pass on the event to other handlers, just in case
289 StateNormal_Context::key_released(GdkEventKey *event)
291 switch(event->keyval)
295 set_rotate_flag(false);
299 set_scale_flag(false);
303 set_constrain_flag(false);
308 return false; //Pass on the event to other handlers
312 StateNormal_Context::refresh_tool_options()
314 App::dialog_tool_options->clear();
315 App::dialog_tool_options->set_widget(options_table);
316 App::dialog_tool_options->set_local_name(_("Normal Tool"));
317 App::dialog_tool_options->set_name("normal");
322 StateNormal_Context::~StateNormal_Context()
326 get_work_area()->clear_duck_dragger();
327 get_work_area()->reset_cursor();
329 keypress_connect.disconnect();
330 keyrelease_connect.disconnect();
332 App::dialog_tool_options->clear();
334 App::toolbox->refresh();
337 DuckDrag_Combo::DuckDrag_Combo():
340 constrain(false) // Lock aspect for scale; smooth move for translate
345 DuckDrag_Combo::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
347 last_move=Vector(1,1);
349 const DuckList selected_ducks(duckmatic->get_selected_ducks());
350 DuckList::const_iterator iter;
354 drag_offset=duckmatic->find_duck(offset)->get_trans_point();
356 //snap=drag_offset-duckmatic->snap_point_to_grid(drag_offset);
357 //snap=offset-drag_offset_;
361 Point vmin(100000000,100000000);
362 Point vmax(-100000000,-100000000);
363 //std::set<etl::handle<Duck> >::iterator iter;
366 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
368 Point p((*iter)->get_trans_point());
369 vmin[0]=min(vmin[0],p[0]);
370 vmin[1]=min(vmin[1],p[1]);
371 vmax[0]=max(vmax[0],p[0]);
372 vmax[1]=max(vmax[1],p[1]);
373 positions.push_back(p);
375 center=(vmin+vmax)*0.5;
376 if((vmin-vmax).mag()<=EPSILON)
382 synfig::Vector vect(offset-center);
383 original_angle=Angle::tan(vect[1],vect[0]);
384 original_mag=vect.mag();
389 DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
391 if (!duckmatic) return;
396 //Override axis lock set in workarea when holding down the shift key
397 if (!move_only && (scale || rotate))
398 duckmatic->set_axis_lock(false);
401 if (move_only || (!scale && !rotate))
402 vect= duckmatic->snap_point_to_grid(vector)-drag_offset+snap;
404 vect= duckmatic->snap_point_to_grid(vector)-center+snap;
408 const DuckList selected_ducks(duckmatic->get_selected_ducks());
409 DuckList::const_iterator iter;
411 Time time(duckmatic->get_time());
414 if( move_only || (!scale && !rotate) )
416 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
418 if((*iter)->get_type()==Duck::TYPE_VERTEX || (*iter)->get_type()==Duck::TYPE_POSITION)
419 (*iter)->set_trans_point(positions[i]+vect, time);
421 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
423 if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)
424 (*iter)->set_trans_point(positions[i]+vect, time);
430 Angle::deg angle(Angle::tan(vect[1],vect[0]));
431 angle=original_angle-angle;
434 float degrees = angle.get()/15;
435 angle= Angle::deg (degrees>0?std::floor(degrees)*15:std::ceil(degrees)*15);
437 Real mag(vect.mag()/original_mag);
438 Real sine(Angle::sin(angle).get());
439 Real cosine(Angle::cos(angle).get());
441 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
443 if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)continue;
445 Vector x(positions[i]-center),p;
447 p[0]=cosine*x[0]+sine*x[1];
448 p[1]=-sine*x[0]+cosine*x[1];
451 (*iter)->set_trans_point(p, time);
453 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
455 if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
457 Vector x(positions[i]-center),p;
459 p[0]=cosine*x[0]+sine*x[1];
460 p[1]=-sine*x[0]+cosine*x[1];
463 (*iter)->set_trans_point(p, time);
469 if(abs(drag_offset[0]-center[0])>EPSILON)
470 vect[0]/=drag_offset[0]-center[0];
473 if(abs(drag_offset[1]-center[1])>EPSILON)
474 vect[1]/=drag_offset[1]-center[1];
480 //vect[0]=vect[1]=vect.mag()*0.707106781;
481 Real amount(vect.mag()/(drag_offset-center).mag());
482 vect[0]=vect[1]=amount;
485 if(vect[0]<EPSILON && vect[0]>-EPSILON)
487 if(vect[1]<EPSILON && vect[1]>-EPSILON)
490 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
492 if(((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
494 Vector p(positions[i]-center);
499 (*iter)->set_trans_point(p, time);
501 for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
503 if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
505 Vector p(positions[i]-center);
510 (*iter)->set_trans_point(p, time);
514 // then patch up the tangents for the vertices we've moved
515 duckmatic->update_ducks();
521 DuckDrag_Combo::end_duck_drag(Duckmatic* duckmatic)
523 if(bad_drag)return false;
525 //synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
527 if((last_move-Vector(1,1)).mag()>0.0001)
529 duckmatic->signal_edited_selected_ducks();
534 duckmatic->signal_user_click_selected_ducks(0);
540 StateNormal_Context::event_refresh_tool_options(const Smach::event& /*x*/)
542 refresh_tool_options();
543 return Smach::RESULT_ACCEPT;
547 StateNormal_Context::event_stop_handler(const Smach::event& /*x*/)
549 // synfig::info("STATE NORMAL: Received Stop Event");
550 canvas_view_->stop();
551 return Smach::RESULT_ACCEPT;
555 StateNormal_Context::event_refresh_handler(const Smach::event& /*x*/)
557 // synfig::info("STATE NORMAL: Received Refresh Event");
558 canvas_view_->rebuild_tables();
559 canvas_view_->work_area->queue_render_preview();
560 return Smach::RESULT_ACCEPT;
564 StateNormal_Context::event_refresh_ducks_handler(const Smach::event& /*x*/)
566 // synfig::info("STATE NORMAL: Received Refresh Ducks");
567 canvas_view_->queue_rebuild_ducks();
568 return Smach::RESULT_ACCEPT;
572 StateNormal_Context::event_undo_handler(const Smach::event& /*x*/)
574 // synfig::info("STATE NORMAL: Received Undo Event");
575 canvas_view_->get_instance()->undo();
576 return Smach::RESULT_ACCEPT;
580 StateNormal_Context::event_redo_handler(const Smach::event& /*x*/)
582 // synfig::info("STATE NORMAL: Received Redo Event");
583 canvas_view_->get_instance()->redo();
584 return Smach::RESULT_ACCEPT;
588 StateNormal_Context::event_mouse_button_down_handler(const Smach::event& x)
590 // synfig::info("STATE NORMAL: Received mouse button down Event");
592 const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
597 canvas_view_->popup_main_menu();
598 return Smach::RESULT_ACCEPT;
600 return Smach::RESULT_OK;
605 StateNormal_Context::event_layer_click(const Smach::event& x)
607 const EventLayerClick& event(*reinterpret_cast<const EventLayerClick*>(&x));
611 // synfig::info("STATE NORMAL: Received layer click Event, \"%s\"",event.layer->get_name().c_str());
615 // synfig::info("STATE NORMAL: Received layer click Event with an empty layer.");
621 if(!(event.modifier&Gdk::CONTROL_MASK))
622 canvas_view_->get_selection_manager()->clear_selected_layers();
625 std::list<Layer::Handle> layer_list(canvas_view_->get_selection_manager()->get_selected_layers());
626 std::set<Layer::Handle> layers(layer_list.begin(),layer_list.end());
627 if(layers.count(event.layer))
629 layers.erase(event.layer);
630 layer_list=std::list<Layer::Handle>(layers.begin(),layers.end());
631 canvas_view_->get_selection_manager()->clear_selected_layers();
632 canvas_view_->get_selection_manager()->set_selected_layers(layer_list);
636 canvas_view_->get_selection_manager()->set_selected_layer(event.layer);
639 return Smach::RESULT_ACCEPT;
641 canvas_view_->popup_layer_menu(event.layer);
642 return Smach::RESULT_ACCEPT;
644 return Smach::RESULT_OK;
650 StateNormal_Context::edit_several_waypoints(std::list<synfigapp::ValueDesc> value_desc_list)
653 "Edit Multiple Waypoints", // Title
655 true // use_separator
658 Widget_WaypointModel widget_waypoint_model;
659 widget_waypoint_model.show();
661 dialog.get_vbox()->pack_start(widget_waypoint_model);
664 dialog.add_button(Gtk::StockID("gtk-apply"),1);
665 dialog.add_button(Gtk::StockID("gtk-cancel"),0);
670 synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Set Waypoints"));
672 std::list<synfigapp::ValueDesc>::iterator iter;
673 for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
675 synfigapp::ValueDesc value_desc(*iter);
677 if(!value_desc.is_valid())
680 ValueNode_Animated::Handle value_node;
682 // If this value isn't a ValueNode_Animated, but
683 // it is somewhat constant, then go ahead and convert
684 // it to a ValueNode_Animated.
685 if(!value_desc.is_value_node() || ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
688 if(value_desc.is_value_node())
689 value=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node())->get_value();
691 value=value_desc.get_value();
693 value_node=ValueNode_Animated::create(value,get_canvas()->get_time());
695 synfigapp::Action::Handle action;
697 if(!value_desc.is_value_node())
699 action=synfigapp::Action::create("ValueDescConnect");
700 action->set_param("dest",value_desc);
701 action->set_param("src",ValueNode::Handle(value_node));
705 action=synfigapp::Action::create("ValueNodeReplace");
706 action->set_param("dest",value_desc.get_value_node());
707 action->set_param("src",ValueNode::Handle(value_node));
710 action->set_param("canvas",get_canvas());
711 action->set_param("canvas_interface",get_canvas_interface());
714 if(!get_canvas_interface()->get_instance()->perform_action(action))
716 get_canvas_view()->get_ui_interface()->error(_("Unable to convert to animated waypoint"));
723 if(value_desc.is_value_node())
724 value_node=ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node());
731 synfigapp::Action::Handle action(synfigapp::Action::create("WaypointSetSmart"));
735 get_canvas_view()->get_ui_interface()->error(_("Unable to find WaypointSetSmart action"));
741 action->set_param("canvas",get_canvas());
742 action->set_param("canvas_interface",get_canvas_interface());
743 action->set_param("value_node",ValueNode::Handle(value_node));
744 action->set_param("time",get_canvas()->get_time());
745 action->set_param("model",widget_waypoint_model.get_waypoint_model());
747 if(!get_canvas_interface()->get_instance()->perform_action(action))
749 get_canvas_view()->get_ui_interface()->error(_("Unable to set a specific waypoint"));
756 //get_canvas_view()->get_ui_interface()->error(_("Unable to animate a specific valuedesc"));
766 StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& /*x*/)
768 // synfig::info("STATE NORMAL: Received multiple duck click event");
770 //const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
772 std::list<synfigapp::ValueDesc> value_desc_list;
774 // Create a list of value_descs associated with selection
775 const DuckList selected_ducks(get_work_area()->get_selected_ducks());
776 DuckList::const_iterator iter;
777 for(iter=selected_ducks.begin();iter!=selected_ducks.end();++iter)
779 synfigapp::ValueDesc value_desc((*iter)->get_value_desc());
781 if(!value_desc.is_valid())
784 if(value_desc.get_value_type()==ValueBase::TYPE_BLINEPOINT && value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
786 value_desc_list.push_back(
787 synfigapp::ValueDesc(
788 ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
789 ,ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
790 ->get_link_index_from_name("point")
795 value_desc_list.push_back(value_desc);
798 Gtk::Menu *menu=manage(new Gtk::Menu());
799 menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
801 canvas_view_->get_instance()->make_param_menu(menu,canvas_view_->get_canvas(),value_desc_list);
804 synfigapp::Action::ParamList param_list;
805 param_list=get_canvas_interface()->generate_param_list(value_desc_list);
807 canvas_view_->add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
809 menu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Edit Waypoints"),
813 &studio::StateNormal_Context::edit_several_waypoints
819 menu->popup(3,gtk_get_current_event_time());
821 return Smach::RESULT_ACCEPT;