本文整理汇总了C++中etl::handle::is_active方法的典型用法代码示例。如果您正苦于以下问题:C++ handle::is_active方法的具体用法?C++ handle::is_active怎么用?C++ handle::is_active使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类etl::handle
的用法示例。
在下文中一共展示了handle::is_active方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle<synfigapp::Action::Undoable> action, bool /*is_active*/, bool is_undo, bool is_redo)
{
assert(action);
row[model.action] = action;
row[model.name] = static_cast<Glib::ustring>(action->get_local_name());
row[model.is_active] = action->is_active();
row[model.is_undo] = is_undo;
row[model.is_redo] = is_redo;
synfigapp::Action::CanvasSpecific *specific_action;
specific_action=dynamic_cast<synfigapp::Action::CanvasSpecific*>(action.get());
if(specific_action)
{
row[model.canvas] = specific_action->get_canvas();
row[model.canvas_id] = specific_action->get_canvas()->get_id();
}
etl::handle<synfigapp::Action::Group> group;
group=etl::handle<synfigapp::Action::Group>::cast_dynamic(action);
if(group)
{
synfigapp::Action::ActionList::const_iterator iter;
for(iter=group->action_list().begin();iter!=group->action_list().end();++iter)
{
Gtk::TreeRow child_row = *(append(row.children()));
insert_action(child_row,*iter,true,is_undo,is_redo);
}
}
//row[model.icon] = Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-canvas"),Gtk::ICON_SIZE_SMALL_TOOLBAR);
}
示例2: canvas_specific
bool
Action::System::set_action_status(etl::handle<Action::Undoable> action, bool x)
{
Stack::iterator iter;
int failed=false;
if(action->is_active()==x)
return true;
handle<Action::Undoable> cur_pos=undo_action_stack_.front();
Action::CanvasSpecific* canvas_specific(dynamic_cast<Action::CanvasSpecific*>(action.get()));
handle<UIInterface> uim=new ConfidentUIInterface();
iter=find(undo_action_stack_.begin(),undo_action_stack_.end(),action);
if(iter!=undo_action_stack_.end())
{
while(undo_action_stack_.front()!=action)
{
if(!undo_(uim))
{
return false;
}
}
if(!undo_(uim))
{
return false;
}
action->set_active(x);
if(redo_(get_ui_interface()))
{
signal_action_status_changed_(action);
}
else
{
action->set_active(!x);
failed=true;
}
while(undo_action_stack_.front()!=cur_pos)
{
if(!redo_(uim))
{
redo_action_stack_.front()->set_active(false);
signal_action_status_changed_(redo_action_stack_.front());
}
}
if(!failed && canvas_specific && canvas_specific->is_dirty())
{
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
//canvas_interface->signal_dirty_preview()();
}
return true;
}
iter=find(redo_action_stack_.begin(),redo_action_stack_.end(),action);
if(iter!=redo_action_stack_.end())
{
action->set_active(x);
signal_action_status_changed_(action);
if(canvas_specific && canvas_specific->is_dirty())
{
Canvas::Handle canvas=canvas_specific->get_canvas();
handle<CanvasInterface> canvas_interface=static_cast<Instance*>(this)->find_canvas_interface(canvas);
assert(canvas_interface);
//canvas_interface->signal_dirty_preview()();
}
return true;
}
return false;
}