当前位置: 首页>>代码示例>>C++>>正文


C++ etl::handle类代码示例

本文整理汇总了C++中etl::handle的典型用法代码示例。如果您正苦于以下问题:C++ handle类的具体用法?C++ handle怎么用?C++ handle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了handle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
Widget_CompSelect::new_instance(etl::handle<studio::Instance> instance)
{
	if(studio::App::shutdown_in_progress)
		return;

	assert(instance);

	etl::loose_handle<studio::Instance> loose_instance(instance);

	instance->synfigapp::Instance::signal_filename_changed().connect(sigc::mem_fun(*this,&Widget_CompSelect::refresh));
	instance->synfigapp::Instance::signal_filename_changed().connect(
		sigc::bind<etl::loose_handle<studio::Instance> >(
			sigc::mem_fun(*this,&Widget_CompSelect::set_selected_instance),
			loose_instance
		)
	);

	{
		std::string name=basename(instance->get_file_name());
		instances.push_back(loose_instance);
		append(name);
	}

}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:25,代码来源:widget_compselect.cpp

示例2:

void
Dock_History::set_selected_instance_(etl::handle<studio::Instance> instance)
{
	if(studio::App::shutdown_in_progress)
		return;

	if (on_undo_tree_changed_connection)
		on_undo_tree_changed_connection.disconnect();

	selected_instance=instance;
	if(instance)
	{
		on_undo_tree_changed_connection = selected_instance->history_tree_store()->signal_undo_tree_changed().connect(
			sigc::mem_fun(*this,&Dock_History::on_undo_tree_changed));

		action_tree->set_model(instance->history_tree_store());
		action_tree->show();
		update_undo_redo();
		action_group->set_sensitive(true);
	}
	else
	{
		action_tree->set_model(Glib::RefPtr< Gtk::TreeModel >());
		action_tree->hide();
		action_group->set_sensitive(false);
	}
}
开发者ID:blackwarthog,项目名称:synfig,代码行数:27,代码来源:dock_history.cpp

示例3:

void
Super::add_action_front(etl::handle<Undoable> action)
{
	action_list_.push_front(action);
	CanvasSpecific *specific_action=dynamic_cast<CanvasSpecific *>(action.get());
	if(specific_action && !get_canvas())
		set_canvas(specific_action->get_canvas());
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:8,代码来源:action.cpp

示例4: r

int
ValueNode::replace(etl::handle<ValueNode> x)
{
	if(x.get()==this)
		return 0;

	while(parent_set.size())
	{
		(*parent_set.begin())->add_child(x.get());
		(*parent_set.begin())->remove_child(this);
		//x->parent_set.insert(*parent_set.begin());
		//parent_set.erase(parent_set.begin());
	}
	int r(RHandle(this).replace(x));
	x->changed();
	return r;
}
开发者ID:sergiorm,项目名称:synfig_jcome,代码行数:17,代码来源:valuenode.cpp

示例5: AsyncTarget_Cairo

	AsyncTarget_Cairo(etl::handle<synfig::Target_Cairo> warm_target):
		warm_target(warm_target),
		surface(),
		callback(),
		alive_flag(),
		ready_next()
	{
		set_avoid_time_sync(warm_target->get_avoid_time_sync());
		set_canvas(warm_target->get_canvas());
		set_quality(warm_target->get_quality());
		set_alpha_mode(warm_target->get_alpha_mode());
		set_rend_desc(&warm_target->rend_desc());
		alive_flag=true;
#ifndef GLIB_DISPATCHER_BROKEN
		ready_connection=frame_ready_signal.connect(sigc::mem_fun(*this,&AsyncTarget_Cairo::frame_ready));
#endif
	}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:17,代码来源:asyncrenderer.cpp

示例6: action

bool
Action::System::redo_(etl::handle<UIInterface> uim)
{
	handle<Action::Undoable> action(redo_action_stack().front());
	most_recent_action_name_=action->get_name();

	try { if(action->is_active()) action->perform(); }
	catch(Action::Error err)
	{
		if(err.get_type()!=Action::Error::TYPE_UNABLE)
		{
			if(err.get_desc().empty())
				uim->error(action->get_local_name()+_(" (Redo): ")+strprintf("%d",err.get_type()));
			else
				uim->error(action->get_local_name()+_(" (Redo): ")+err.get_desc());
		}

		return false;
	}
	catch(std::runtime_error x)
	{
		uim->error(x.what());
		return false;
	}
	catch(...)
	{
		return false;
	}

	inc_action_count();

	if(undo_action_stack_.empty())	signal_undo_status()(true);

	undo_action_stack_.push_front(redo_action_stack_.front());
	redo_action_stack_.pop_front();

	if(redo_action_stack_.empty())	signal_redo_status()(false);

	if(!group_stack_.empty())
		group_stack_.front()->inc_depth();

	signal_redo_();

	return true;
}
开发者ID:ZurbaXI,项目名称:synfig,代码行数:45,代码来源:action_system.cpp

示例7:

//! \writeme
int
synfig::activepoint_collect(set<Activepoint, std::less<UniqueID> >& /*activepoint_set*/,const Time& time, const etl::handle<Node>& node)
{
	const TimePointSet& timepoint_set(node->get_times());

	// Check to see if there is anything in here at the given time
	if(timepoint_set.find(time)==timepoint_set.end())
		return 0;

	return 0;
}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:12,代码来源:timepointcollect.cpp

示例8: AsyncTarget_Cairo_Tile

	AsyncTarget_Cairo_Tile(etl::handle<synfig::Target_Cairo_Tile> warm_target):
	warm_target(warm_target)
	{
		set_avoid_time_sync(warm_target->get_avoid_time_sync());
		set_tile_w(warm_target->get_tile_w());
		set_tile_h(warm_target->get_tile_h());
		set_canvas(warm_target->get_canvas());
		set_quality(warm_target->get_quality());
		set_alpha_mode(warm_target->get_alpha_mode());
		set_threads(warm_target->get_threads());
		set_clipping(warm_target->get_clipping());
		set_rend_desc(&warm_target->rend_desc());
		alive_flag=true;
#ifndef GLIB_DISPATCHER_BROKEN
		ready_connection=tile_ready_signal.connect(sigc::mem_fun(*this,&AsyncTarget_Cairo_Tile::tile_ready));
#endif
	}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:17,代码来源:asyncrenderer.cpp

示例9: value_icon

Gtk::StockID
studio::valuenode_icon(etl::handle<synfig::ValueNode> value_node)
{
	if(handle<ValueNode_Const>::cast_dynamic(value_node))
	{
		return value_icon(value_node->get_type());
	}
	else
	{
		return Gtk::StockID("synfig-value_node");
	}
}
开发者ID:steveway,项目名称:synfig,代码行数:12,代码来源:iconcontroller.cpp

示例10: AsyncTarget_Scanline

	AsyncTarget_Scanline(etl::handle<synfig::Target_Scanline> warm_target):
		warm_target(warm_target)
	{
		set_avoid_time_sync(warm_target->get_avoid_time_sync());
		set_canvas(warm_target->get_canvas());
		set_quality(warm_target->get_quality());
		set_remove_alpha(warm_target->get_remove_alpha());
		set_threads(warm_target->get_threads());
		set_rend_desc(&warm_target->rend_desc());
		alive_flag=true;
#ifndef GLIB_DISPATCHER_BROKEN
		ready_connection=frame_ready_signal.connect(sigc::mem_fun(*this,&AsyncTarget_Scanline::frame_ready));
#endif
		surface.set_wh(warm_target->rend_desc().get_w(),warm_target->rend_desc().get_h());
	}
开发者ID:ZurbaXI,项目名称:synfig,代码行数:15,代码来源:asyncrenderer.cpp

示例11: clear

void
ValueBase::set(etl::handle<Canvas> x)
{
	clear();
	if(x
#ifndef TRY_FIX_FOR_BUG_27
	   && x->is_inline()
#endif
		)
		_set(etl::handle<Canvas>(x));
	else
		_set(etl::loose_handle<Canvas>(x));
	assert(get(x)==x);
}
开发者ID:aaronaskew,项目名称:synfig,代码行数:14,代码来源:value.cpp

示例12: children_

void
HistoryTreeStore::on_action_status_changed(etl::handle<synfigapp::Action::Undoable> action)
{
	Gtk::TreeModel::Children::iterator iter;
	Gtk::TreeModel::Children children_(children());

	for(iter=children_.begin(); iter != children_.end(); ++iter)
	{
		Gtk::TreeModel::Row row = *iter;
		if(action == (etl::handle<synfigapp::Action::Undoable>)row[model.action])
		{
			row[model.is_active]=action->is_active();
			return;
		}
	}
}
开发者ID:Permutatrix,项目名称:synfig,代码行数:16,代码来源:historytreestore.cpp

示例13: get_canvas_interface

	etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view->canvas_interface();}
开发者ID:,项目名称:,代码行数:1,代码来源:

示例14: manage

Widget_Waypoint::Widget_Waypoint(etl::handle<synfig::Canvas> canvas):
	Gtk::Alignment(0, 0, 1, 1),
	waypoint(synfig::ValueBase(),0),
	adj_tension(Gtk::Adjustment::create(0.0,-20,20,0.1,1)),
	adj_continuity(Gtk::Adjustment::create(0.0,-20,20,0.1,1)),
	adj_bias(Gtk::Adjustment::create(0.0,-20,20,0.1,1)),
	adj_temporal_tension(Gtk::Adjustment::create(0.0,-20,20,0.1,1))
{
	value_widget=manage(new Widget_ValueBase());
	value_widget->set_canvas(canvas);
	value_widget->show();

	value_node_label=manage(new Gtk::Label(_("(Non-static value)")));


	time_widget=manage(new Widget_Time());
	time_widget->set_fps(canvas->rend_desc().get_frame_rate());

	before_options=manage(new class Widget_Enum());
	before_options->show();
	before_options->set_param_desc(
		ParamDesc("interpolation")
			.set_hint("enum")
			.add_enum_value(INTERPOLATION_CLAMPED,"clamped",_("Clamped"))
			.add_enum_value(INTERPOLATION_TCB,"auto",_("TCB"))
			.add_enum_value(INTERPOLATION_CONSTANT,"constant",_("Constant"))
			.add_enum_value(INTERPOLATION_HALT,"ease",_("Ease In/Out"))
			.add_enum_value(INTERPOLATION_LINEAR,"linear",_("Linear"))
	);
	before_options->set_icon(0, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_clamped"),Gtk::ICON_SIZE_MENU));
	before_options->set_icon(1, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_tcb"),Gtk::ICON_SIZE_MENU));
	before_options->set_icon(2, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_const"),Gtk::ICON_SIZE_MENU));
	before_options->set_icon(3, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_ease"),Gtk::ICON_SIZE_MENU));
	before_options->set_icon(4, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_linear"),Gtk::ICON_SIZE_MENU));

	after_options=manage(new class Widget_Enum());
	after_options->show();
	after_options->set_param_desc(
		ParamDesc("interpolation")
			.set_hint("enum")
			.add_enum_value(INTERPOLATION_CLAMPED,"clamped",_("Clamped"))
			.add_enum_value(INTERPOLATION_TCB,"auto",_("TCB"))
			.add_enum_value(INTERPOLATION_CONSTANT,"constant",_("Constant"))
			.add_enum_value(INTERPOLATION_HALT,"ease",_("Ease In/Out"))
			.add_enum_value(INTERPOLATION_LINEAR,"linear",_("Linear"))
	);
	after_options->set_icon(0, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_clamped"),Gtk::ICON_SIZE_MENU));
	after_options->set_icon(1, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_tcb"),Gtk::ICON_SIZE_MENU));
	after_options->set_icon(2, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_const"),Gtk::ICON_SIZE_MENU));
	after_options->set_icon(3, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_ease"),Gtk::ICON_SIZE_MENU));
	after_options->set_icon(4, Gtk::Button().render_icon_pixbuf(Gtk::StockID("synfig-interpolation_type_linear"),Gtk::ICON_SIZE_MENU));

	spin_tension=manage(new class Gtk::SpinButton(adj_tension,0.1,3));
	spin_tension->show();
	spin_continuity=manage(new class Gtk::SpinButton(adj_continuity,0.1,3));
	spin_continuity->show();
	spin_bias=manage(new class Gtk::SpinButton(adj_bias,0.1,3));
	spin_bias->show();
	spin_temporal_tension=manage(new class Gtk::SpinButton(adj_temporal_tension,0.1,3));
	spin_temporal_tension->show();

	set_padding(12, 12, 12, 12);

	Gtk::VBox *widgetBox = manage(new Gtk::VBox(false, 12));
	add(*widgetBox);

	Gtk::Frame *waypointFrame = manage(new Gtk::Frame(_("Waypoint")));
	waypointFrame->set_shadow_type(Gtk::SHADOW_NONE);
	((Gtk::Label *) waypointFrame->get_label_widget())->set_markup(_("<b>Waypoint</b>"));
	widgetBox->pack_start(*waypointFrame, false, false, 0);

	Gtk::Alignment *waypointPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
	waypointPadding->set_padding(6, 0, 24, 0);
	waypointFrame->add(*waypointPadding);

	Gtk::Table *waypointTable = manage(new Gtk::Table(2, 2, false));
	waypointTable->set_row_spacings(6);
	waypointTable->set_col_spacings(12);
	waypointPadding->add(*waypointTable);

	Gtk::Label *waypointValueLabel = manage(new Gtk::Label(_("_Value"), true));
	waypointValueLabel->set_alignment(0, 0.5);
	waypointValueLabel->set_mnemonic_widget(*value_widget);
	waypointTable->attach(*waypointValueLabel, 0, 1, 0, 1, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
	waypointTable->attach(*value_widget, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
	waypointTable->attach(*value_node_label, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);

	Gtk::Label *waypointTimeLabel = manage(new Gtk::Label(_("_Time"), true));
	waypointTimeLabel->set_alignment(0, 0.5);
	waypointTimeLabel->set_mnemonic_widget(*time_widget);
	waypointTable->attach(*waypointTimeLabel, 0, 1, 1, 2, Gtk::SHRINK | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
	waypointTable->attach(*time_widget, 1, 2, 1, 2, Gtk::EXPAND | Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);

	Gtk::Frame *interpolationFrame = manage(new Gtk::Frame(_("Interpolation")));
	interpolationFrame->set_shadow_type(Gtk::SHADOW_NONE);
	((Gtk::Label *) interpolationFrame->get_label_widget())->set_markup(_("<b>Interpolation</b>"));
	widgetBox->pack_start(*interpolationFrame, false, false, 0);

	Gtk::Alignment *interpolationPadding = manage(new Gtk::Alignment(0, 0, 1, 1));
	interpolationPadding->set_padding(6, 0, 24, 0);
//.........这里部分代码省略.........
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:101,代码来源:widget_waypoint.cpp

示例15: next_frame

	virtual int next_frame(Time& time)
	{
		Glib::Mutex::Lock lock(mutex);
		if(!alive_flag)
			return 0;
		return warm_target->next_frame(time);
		
	}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:8,代码来源:asyncrenderer.cpp


注:本文中的etl::handle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。