• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sigc::connection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: mesh_toolbox_watch_ec

static void mesh_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
    static sigc::connection c_selection_changed;
    static sigc::connection c_selection_modified;
    static sigc::connection c_subselection_changed;
    static sigc::connection c_defs_release;
    static sigc::connection c_defs_modified;

    if (SP_IS_MESH_CONTEXT(ec)) {
        // connect to selection modified and changed signals
        Inkscape::Selection *selection = desktop->getSelection();
        SPDocument *document = desktop->getDocument();

        c_selection_changed = selection->connectChanged(sigc::bind(sigc::ptr_fun(&ms_tb_selection_changed), holder));
        c_selection_modified = selection->connectModified(sigc::bind(sigc::ptr_fun(&ms_tb_selection_modified), holder));
        c_subselection_changed = desktop->connectToolSubselectionChanged(sigc::bind(sigc::ptr_fun(&ms_drag_selection_changed), holder));

        c_defs_release = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&ms_defs_release), holder));
        c_defs_modified = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&ms_defs_modified), holder));
        ms_tb_selection_changed(selection, holder);
    } else {
        if (c_selection_changed)
            c_selection_changed.disconnect();
        if (c_selection_modified)
            c_selection_modified.disconnect();
        if (c_subselection_changed)
            c_subselection_changed.disconnect();
        if (c_defs_release)
            c_defs_release.disconnect();
        if (c_defs_modified)
            c_defs_modified.disconnect();
    }
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:33,代码来源:mesh-toolbar.cpp


示例2: if

void
Simple::animate_toggled()
{
  static sigc::connection timer;
  bool  active = m_animate.get_active();
  if (active && !timer.connected())
      timer = Glib::signal_timeout().connect(sigc::mem_fun(*this, &Simple::animate_step), ANIMATE_FRAME_DELAY);
  else if (!active && timer.connected())
      timer.disconnect();
}
开发者ID:scott--,项目名称:papyrus,代码行数:10,代码来源:simple.cpp


示例3: box3d_toolbox_check_ec

static void box3d_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
    static sigc::connection changed;
    if (SP_IS_BOX3D_CONTEXT(ec)) {
        changed = sp_desktop_selection(desktop)->connectChanged(sigc::bind(sigc::ptr_fun(box3d_toolbox_selection_changed), holder));
        box3d_toolbox_selection_changed(sp_desktop_selection(desktop), holder);
    } else {
        if (changed)
            changed.disconnect();
    }
}
开发者ID:asitti,项目名称:inkscape,代码行数:11,代码来源:box3d-toolbar.cpp


示例4: arc_toolbox_check_ec

static void arc_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
    static sigc::connection changed;

    if (SP_IS_ARC_CONTEXT(ec)) {
        changed = desktop->getSelection()->connectChanged(sigc::bind(sigc::ptr_fun(sp_arc_toolbox_selection_changed), holder));
        sp_arc_toolbox_selection_changed(desktop->getSelection(), holder);
    } else {
        if (changed)
            changed.disconnect();
    }
}
开发者ID:vinics,项目名称:inkscape,代码行数:12,代码来源:arc-toolbar.cpp


示例5: updateSrcRectCon

	void updateSrcRectCon()
	{
		/* Cut old connection */
		srcRectCon.disconnect();
		/* Create new one */
		srcRectCon = srcRect->valueChanged.connect
				(sigc::mem_fun(this, &SpritePrivate::onSrcRectChange));
	}
开发者ID:Daverball,项目名称:mkxp,代码行数:8,代码来源:sprite.cpp


示例6: rect_toolbox_watch_ec

static void rect_toolbox_watch_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
    static sigc::connection changed;

    // use of dynamic_cast<> seems wrong here -- we just need to check the current tool

    if (dynamic_cast<Inkscape::UI::Tools::RectTool *>(ec)) {
        Inkscape::Selection *sel = desktop->getSelection();

        changed = sel->connectChanged(sigc::bind(sigc::ptr_fun(sp_rect_toolbox_selection_changed), holder));

        // Synthesize an emission to trigger the update
        sp_rect_toolbox_selection_changed(sel, holder);
    } else {
        if (changed) {
            changed.disconnect();
            purge_repr_listener(NULL, holder);
        }
    }
}
开发者ID:myutwo,项目名称:inkscape,代码行数:20,代码来源:rect-toolbar.cpp


示例7: gradient_toolbox_check_ec

/**
 * Checks the current tool and connects gradient aux toolbox signals if it happens to be the gradient tool.
 * Called every time the current tool changes by signal emission.
 */
static void gradient_toolbox_check_ec(SPDesktop* desktop, Inkscape::UI::Tools::ToolBase* ec, GObject* holder)
{
    static sigc::connection connChanged;
    static sigc::connection connModified;
    static sigc::connection connSubselectionChanged;
    static sigc::connection connDefsRelease;
    static sigc::connection connDefsModified;

    if (SP_IS_GRADIENT_CONTEXT(ec)) {
        Inkscape::Selection *selection = sp_desktop_selection(desktop);
        SPDocument *document = sp_desktop_document(desktop);

        // connect to selection modified and changed signals
        connChanged = selection->connectChanged(sigc::bind(sigc::ptr_fun(&gr_tb_selection_changed), holder));
        connModified = selection->connectModified(sigc::bind(sigc::ptr_fun(&gr_tb_selection_modified), holder));
        connSubselectionChanged = desktop->connectToolSubselectionChanged(sigc::bind(sigc::ptr_fun(&gr_drag_selection_changed), holder));

        // Is this necessary? Couldn't hurt.
        gr_tb_selection_changed(selection, holder);

        // connect to release and modified signals of the defs (i.e. when someone changes gradient)
        connDefsRelease = document->getDefs()->connectRelease(sigc::bind<1>(sigc::ptr_fun(&gr_defs_release), GTK_WIDGET(holder)));
        connDefsModified = document->getDefs()->connectModified(sigc::bind<2>(sigc::ptr_fun(&gr_defs_modified), GTK_WIDGET(holder)));
    } else {
        if (connChanged)
            connChanged.disconnect();
        if (connModified)
            connModified.disconnect();
        if (connSubselectionChanged)
            connSubselectionChanged.disconnect();
        if (connDefsRelease)
            connDefsRelease.disconnect();
        if (connDefsModified)
            connDefsModified.disconnect();
    }
}
开发者ID:tik0,项目名称:inkscapeGrid,代码行数:40,代码来源:gradient-toolbar.cpp


示例8: float

namespace Gui {

bool Screen::initted = false;
int Screen::width;
int Screen::height;
int Screen::realWidth;
int Screen::realHeight;
float Screen::invRealWidth;
float Screen::invRealHeight;
float Screen::fontScale[2];
std::list<Widget*> Screen::kbshortcut_widgets;
Gui::Fixed *Screen::baseContainer;
Gui::Widget *Screen::focusedWidget;
GLdouble Screen::modelMatrix[16];
GLdouble Screen::projMatrix[16];
GLint Screen::viewport[4];

FontCache Screen::s_fontCache;
std::stack< RefCountedPtr<Text::TextureFont> > Screen::s_fontStack;
RefCountedPtr<Text::TextureFont>Screen::s_defaultFont;

Graphics::Renderer *Screen::s_renderer;

void Screen::Init(Graphics::Renderer *renderer, int real_width, int real_height, int ui_width, int ui_height)
{
    s_renderer = renderer;

	Screen::width = ui_width;
	Screen::height = ui_height;
	Screen::realWidth = real_width;
	Screen::realHeight = real_height;
	Screen::invRealWidth = 1.0f/real_width;
	Screen::invRealHeight = 1.0f/real_height;
	Screen::initted = true;
	// Why? because although our font textures get bigger with screen
	// resolution, our Gui Ortho projection is still 800x600 so vertex
	// coords must be scaled.
	Screen::fontScale[0] = ui_width / float(real_width);
	Screen::fontScale[1] = ui_height / float(real_height);
    s_defaultFont = s_fontCache.GetTextureFont("GuiFont");
    PushFont(s_defaultFont);
	Screen::baseContainer = new Gui::Fixed();
	Screen::baseContainer->SetSize(float(Screen::width), float(Screen::height));
	Screen::baseContainer->Show();
}

void Screen::Uninit()
{
	Screen::baseContainer->RemoveAllChildren();		// children deleted elsewhere?
	delete Screen::baseContainer;
}

static sigc::connection _focusedWidgetOnDelete;

void Screen::OnDeleteFocusedWidget()
{
	_focusedWidgetOnDelete.disconnect();
	focusedWidget = 0;
	SDL_EnableKeyRepeat(0, 0); // disable key repeat
}

void Screen::SetFocused(Widget *w, bool enableKeyRepeat)
{
	ClearFocus();
	if (enableKeyRepeat)
		SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
	_focusedWidgetOnDelete = w->onDelete.connect(sigc::ptr_fun(&Screen::OnDeleteFocusedWidget));
	focusedWidget = w;
}

void Screen::ClearFocus()
{
	if (!focusedWidget) return;
	_focusedWidgetOnDelete.disconnect();
	focusedWidget = 0;
	SDL_EnableKeyRepeat(0, 0); // disable key repeat
}

void Screen::ShowBadError(const char *msg)
{
	baseContainer->HideChildren();

	Gui::Fixed *f = new Gui::Fixed(6*GetWidth()/8.0f, 6*GetHeight()/8.0f);
	Gui::Screen::AddBaseWidget(f, GetWidth()/8, GetHeight()/8);
	f->SetTransparency(false);
	f->SetBgColor(0.4f,0,0,1.0f);
	f->Add(new Gui::Label(msg), 10, 10);

	Gui::Button *okButton = new Gui::LabelButton(new Gui::Label("Ok"));
	okButton->SetShortcut(SDLK_RETURN, KMOD_NONE);
	f->Add(okButton, 10.0f, 6*GetHeight()/8.0f - 32);
	f->ShowAll();
	f->Show();

	do {
		Gui::MainLoopIteration();
		SDL_Delay(10);
	} while (!okButton->IsPressed());

	Gui::Screen::RemoveBaseWidget(f);
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


示例9:

	~AsyncTarget_Scanline()
	{
		ready_connection.disconnect();
	}
开发者ID:ChillyCider,项目名称:synfig-reloaded,代码行数:4,代码来源:asyncrenderer.cpp


示例10: TextureFontFace

namespace Gui {

TextureFontFace *Screen::font;
bool Screen::initted = false;
int Screen::width;
int Screen::height;
int Screen::realWidth;
int Screen::realHeight;
float Screen::invRealWidth;
float Screen::invRealHeight;
float Screen::fontScale[2];
std::list<Widget*> Screen::kbshortcut_widgets;
Gui::Fixed *Screen::baseContainer;
Gui::Widget *Screen::focusedWidget;
GLdouble Screen::modelMatrix[16];
GLdouble Screen::projMatrix[16];
GLint Screen::viewport[4];


void Screen::Init(int real_width, int real_height, int ui_width, int ui_height)
{
	Screen::width = ui_width;
	Screen::height = ui_height;
	Screen::realWidth = real_width;
	Screen::realHeight = real_height;
	Screen::invRealWidth = 1.0f/real_width;
	Screen::invRealHeight = 1.0f/real_height;
	Screen::initted = true;
	// Why? because although our font textures get bigger with screen
	// resolution, our Gui Ortho projection is still 800x600 so vertex
	// coords must be scaled.
	Screen::fontScale[0] = ui_width / (float)real_width;
	Screen::fontScale[1] = ui_height / (float)real_height;
	Screen::font = new TextureFontFace(PIONEER_DATA_DIR "/fonts/guifont.ttf", (int)(12/fontScale[0]), (int)(12/fontScale[1]));
	Screen::baseContainer = new Gui::Fixed();
	Screen::baseContainer->SetSize((float)Screen::width, (float)Screen::height);
	Screen::baseContainer->Show();
}

static sigc::connection _focusedWidgetOnDelete;

void Screen::OnDeleteFocusedWidget()
{
	_focusedWidgetOnDelete.disconnect();
	focusedWidget = 0;
}

void Screen::SetFocused(Widget *w)
{
	if (focusedWidget) {
		_focusedWidgetOnDelete.disconnect();
	}
	_focusedWidgetOnDelete = w->onDelete.connect(sigc::ptr_fun(&Screen::OnDeleteFocusedWidget));
	focusedWidget = w;
}

void Screen::ShowBadError(const char *msg)
{
	fprintf(stderr, "%s", msg);
	baseContainer->HideChildren();
	
	Gui::Fixed *f = new Gui::Fixed(6*GetWidth()/8, 6*GetHeight()/8);
	Gui::Screen::AddBaseWidget(f, GetWidth()/8, GetHeight()/8);
	f->SetTransparency(false);
	f->SetBgColor(0.4,0,0,1.0);
	f->Add(new Gui::Label(msg), 10, 10);

	Gui::Button *okButton = new Gui::LabelButton(new Gui::Label("Ok"));
	okButton->SetShortcut(SDLK_RETURN, KMOD_NONE);
	f->Add(okButton, 10, 6*GetHeight()/8 - 32);
	f->ShowAll();
	f->Show();

	do {
		Gui::MainLoopIteration();
		SDL_Delay(10);
	} while (!okButton->IsPressed());

	Gui::Screen::RemoveBaseWidget(f);
	delete f;
	baseContainer->ShowAll();
}

bool Screen::Project(const vector3d &in, vector3d &out)
{
	GLint o = gluProject(in.x, in.y, in.z, modelMatrix, projMatrix, viewport, &out.x, &out.y, &out.z);
	out.x = out.x * width * invRealWidth;
	out.y = GetHeight() - out.y * height * invRealHeight;
	if (out.x*out.x > 1e8) return false;
	if (out.y*out.y > 1e8) return false;			// these get converted to ints later, must be sane
	return (o == GL_TRUE) ? true : false;
}

void Screen::EnterOrtho()
{
	glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix);
	glGetDoublev (GL_PROJECTION_MATRIX, projMatrix);
	glGetIntegerv (GL_VIEWPORT, viewport);

	glDisable(GL_DEPTH_TEST);
//.........这里部分代码省略.........
开发者ID:Snaar,项目名称:pioneer,代码行数:101,代码来源:GuiScreen.cpp


示例11: Q_FOREACH

 Q_FOREACH(sigc::connection connection, connections) {
     connection.disconnect();
 }
开发者ID:hamaxx,项目名称:unity-2d-for-xmonad,代码行数:3,代码来源:indicatorswidget.cpp


示例12: stopSimulationRequested

 void stopSimulationRequested()
 {
     if (runner.isRunning())
         runner.interrupt();
     if (!progressTimer.empty())
         progressTimer.disconnect();
     updateProgressBar();
 }
开发者ID:,项目名称:,代码行数:8,代码来源:


示例13:

	~WindowVXPrivate()
	{
		shState->texPool().release(base.tex);

		cursorRectCon.disconnect();
		toneCon.disconnect();
		prepareCon.disconnect();
	}
开发者ID:Alex223124,项目名称:mkxp,代码行数:8,代码来源:windowvx.cpp


示例14: ClearFocus

void Screen::ClearFocus()
{
	if (!focusedWidget) return;
	_focusedWidgetOnDelete.disconnect();
	focusedWidget = 0;
	SDL_EnableKeyRepeat(0, 0); // disable key repeat
}
开发者ID:,项目名称:,代码行数:7,代码来源:


示例15: close

 virtual bool close()
 {
     monitorOutput.close();
     m_timer.disconnect();
     fprintf(stdout,"done...\n");
     yarp::os::exit(1);        
     return true;
 }
开发者ID:Tobias-Fischer,项目名称:ikart,代码行数:8,代码来源:main.cpp


示例16: SetFocused

void Screen::SetFocused(Widget *w)
{
	if (focusedWidget) {
		_focusedWidgetOnDelete.disconnect();
	}
	_focusedWidgetOnDelete = w->onDelete.connect(sigc::ptr_fun(&Screen::OnDeleteFocusedWidget));
	focusedWidget = w;
}
开发者ID:Snaar,项目名称:pioneer,代码行数:8,代码来源:GuiScreen.cpp


示例17: on_thread_back_clicked

void on_thread_back_clicked() {
	///To be run when the back button is clicked while viewing a thread
	
	boardView();
	Gtk::TreeView *threadlist = 0;
	pWebKitView = WEBKIT_WEB_VIEW (webkit_web_view_new ());
	Gtk::ScrolledWindow *imgview = 0;
	builder->get_widget("scrolledwindow3", imgview);
	imgview->set_visible(true);
	imgview->show();
	
	gtk_container_add (GTK_CONTAINER (imgview->gobj()), GTK_WIDGET (pWebKitView));
	webkit_web_view_load_uri(pWebKitView, "about:blank");
	webkit_web_view_set_zoom_level(pWebKitView, true);
	gtk_widget_set_can_focus(GTK_WIDGET(pWebKitView), true);
	gtk_widget_show(GTK_WIDGET(pWebKitView));
	builder->get_widget("treeview2", threadlist);
	Glib::RefPtr<Gtk::TreeSelection> thread_selection = threadlist->get_selection();
	thread_selection->signal_changed().connect(sigc::bind<Glib::RefPtr<Gtk::TreeSelection>, WebKitWebView*>(sigc::ptr_fun(&on_selection_changed), thread_selection, pWebKitView));
	
	POST_CLICK_CONNECT.disconnect();
	POST_REFRESH_CONNECT.disconnect();
}
开发者ID:Klendathu,项目名称:minichan,代码行数:23,代码来源:main.cpp


示例18:

	~ViewportPrivate()
	{
		rectCon.disconnect();
	}
开发者ID:Alex223124,项目名称:mkxp,代码行数:4,代码来源:viewport.cpp


示例19: refreshCursorRectCon

	void refreshCursorRectCon()
	{
		cursorRectCon.disconnect();
		cursorRectCon = cursorRect->valueChanged.connect
		        (sigc::mem_fun(this, &WindowVXPrivate::invalidateCursorVert));
	}
开发者ID:Alex223124,项目名称:mkxp,代码行数:6,代码来源:windowvx.cpp


示例20: OnDeleteFocusedWidget

void Screen::OnDeleteFocusedWidget()
{
	_focusedWidgetOnDelete.disconnect();
	focusedWidget = 0;
	SDL_EnableKeyRepeat(0, 0); // disable key repeat
}
开发者ID:,项目名称:,代码行数:6,代码来源:



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sigc::signal类代码示例发布时间:2022-05-31
下一篇:
C++ sid::String类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap