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


C++ purple_signal_connect函数代码示例

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


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

示例1: plugin_load

/**************************************************************************************************
    Load plugin
**************************************************************************************************/
static gboolean
plugin_load(PurplePlugin *plugin)
{
    PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist();
	GList *convs = purple_get_conversations();

    if (purple_prefs_get_bool("/plugins/core/hidemenu/default_state")) {
        hmb_is_menu_visible = FALSE;
    } else {
        hmb_is_menu_visible = TRUE;
    }

    // set callback for 'blist created' signal
    purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, 
                          PURPLE_CALLBACK(hmb_blist_created_cb), NULL);
    // set callback for 'conversation displayed' signal
	purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin,
	                      PURPLE_CALLBACK(hmb_conversation_displayed_cb), NULL);

	// hide blist menubar
    hmb_toggle_menubar(gtkblist, NULL);

    // hide conversations menubar
	while (convs) {
		PurpleConversation *conv = (PurpleConversation *)convs->data;
		if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) {
			hmb_toggle_menubar(NULL, PIDGIN_CONVERSATION(conv));
		}
		convs = convs->next;
	}

	return TRUE;
}
开发者ID:dreadatour,项目名称:pidgin-hide-menu,代码行数:36,代码来源:hidemenu.c

示例2: plugin_load

static gboolean
plugin_load(PurplePlugin *plugin) {
	void *conv_list_handle;

	PURPLE_DBUS_RETURN_FALSE_IF_DISABLED(plugin);

    /* First, we have to register our four exported functions with the
       main purple dbus loop.  Without this statement, the purple dbus
       code wouldn't know about our functions. */
    PURPLE_DBUS_REGISTER_BINDINGS(plugin);
	
	/* Keep the plugin for reference (needed for notify's) */
	plugin_pointer = plugin;
	
	/* Add the button to all the current conversations */
	purple_conversation_foreach (init_conversation);
	
	/* Listen for any new conversations */
	conv_list_handle = purple_conversations_get_handle();
	
	purple_signal_connect(conv_list_handle, "conversation-created", 
					plugin, PURPLE_CALLBACK(init_conversation), NULL);
	
	/* Listen for conversations that are ending */
	purple_signal_connect(conv_list_handle, "deleting-conversation",
					plugin, PURPLE_CALLBACK(conv_destroyed), NULL);
					
	/* Listen for sending/receiving messages to replace tags */
	purple_signal_connect(conv_list_handle, "sending-im-msg",
					plugin, PURPLE_CALLBACK(intercept_sent), NULL);
	purple_signal_connect(conv_list_handle, "receiving-im-msg",
					plugin, PURPLE_CALLBACK(intercept_received), NULL);
	
	return TRUE;
}
开发者ID:gotomypc,项目名称:pidgin_whiteboard,代码行数:35,代码来源:musicmessaging.c

示例3: plugin_load

static gboolean
plugin_load(PurplePlugin *plugin, GError **error)
{
	purple_prefs_add_none("/plugins");
	purple_prefs_add_none("/plugins/gnt");

	purple_prefs_add_none("/plugins/gnt/gntgf");
	purple_prefs_add_none(PREFS_EVENT);

	purple_prefs_add_bool(PREFS_EVENT_SIGNONF, TRUE);
	purple_prefs_add_bool(PREFS_EVENT_IM_MSG, TRUE);
	purple_prefs_add_bool(PREFS_EVENT_CHAT_MSG, TRUE);
	purple_prefs_add_bool(PREFS_EVENT_CHAT_NICK, TRUE);

	purple_prefs_add_bool(PREFS_BEEP, TRUE);
#ifdef HAVE_X11
	purple_prefs_add_bool(PREFS_URGENT, FALSE);
#endif

	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", plugin,
			PURPLE_CALLBACK(buddy_signed_on), NULL);
	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", plugin,
			PURPLE_CALLBACK(buddy_signed_off), NULL);
	purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", plugin,
			PURPLE_CALLBACK(received_im_msg), NULL);
	purple_signal_connect(purple_conversations_get_handle(), "received-chat-msg", plugin,
			PURPLE_CALLBACK(received_chat_msg), NULL);

	memset(&gpsy, 0, sizeof(gpsy));
	memset(&gpsw, 0, sizeof(gpsw));

	return TRUE;
}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:33,代码来源:gntgf.c

示例4: plugin_load

static gboolean
plugin_load(PurplePlugin *plugin, GError **error)
{
	PurpleNotifyUiOps *ops = purple_notify_get_ui_ops();

	purple_prefs_add_none(PREFS_BASE);
	purple_prefs_add_int(PREF_LENGTH, 30);
	purple_prefs_add_string(PREF_URL, "http://tinyurl.com/api-create.php?url=");

	g_object_set_data(G_OBJECT(plugin), "notify-uri", ops->notify_uri);
	ops->notify_uri = tinyurl_notify_uri;

	tinyurl_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
		g_free, g_free);

	purple_signal_connect(purple_conversations_get_handle(),
			"wrote-im-msg",
			plugin, PURPLE_CALLBACK(wrote_msg), NULL);
	purple_signal_connect(purple_conversations_get_handle(),
			"wrote-chat-msg",
			plugin, PURPLE_CALLBACK(wrote_msg), NULL);
	purple_signal_connect(purple_conversations_get_handle(),
			"writing-im-msg",
			plugin, PURPLE_CALLBACK(writing_msg), NULL);
	purple_signal_connect(purple_conversations_get_handle(),
			"writing-chat-msg",
			plugin, PURPLE_CALLBACK(writing_msg), NULL);
	purple_signal_connect(purple_conversations_get_handle(),
			"deleting-conversation",
			plugin, PURPLE_CALLBACK(free_conv_urls), NULL);

	return TRUE;
}
开发者ID:N8Fear,项目名称:purple-facebook,代码行数:33,代码来源:gnttinyurl.c

示例5: finch_pounces_init

void
finch_pounces_init(void)
{
	purple_pounces_register_handler(FINCH_UI, pounce_cb, new_pounce,
								  free_pounce);

	purple_prefs_add_none("/finch/pounces");
	purple_prefs_add_none("/finch/pounces/default_actions");
	purple_prefs_add_bool("/finch/pounces/default_actions/open-window",
						FALSE);
	purple_prefs_add_bool("/finch/pounces/default_actions/popup-notify",
						TRUE);
	purple_prefs_add_bool("/finch/pounces/default_actions/send-message",
						FALSE);
	purple_prefs_add_bool("/finch/pounces/default_actions/execute-command",
						FALSE);
	purple_prefs_add_bool("/finch/pounces/default_actions/play-beep",
						FALSE);
	purple_prefs_add_none("/finch/pounces/dialog");

	purple_signal_connect(purple_connections_get_handle(), "signed-on",
						finch_pounces_get_handle(),
						PURPLE_CALLBACK(signed_on_off_cb), NULL);
	purple_signal_connect(purple_connections_get_handle(), "signed-off",
						finch_pounces_get_handle(),
						PURPLE_CALLBACK(signed_on_off_cb), NULL);
}
开发者ID:CkNoSFeRaTU,项目名称:pidgin,代码行数:27,代码来源:gntpounce.c

示例6: plugin_load

static gboolean plugin_load(PurplePlugin *plugin)
{
	void *conv_handle;
	GHashTable *users;
	guint id;
	gpointer *data;

	users = g_hash_table_new_full((GHashFunc)joinpart_key_hash,
	                              (GEqualFunc)joinpart_key_equal,
	                              (GDestroyNotify)joinpart_key_destroy,
	                              g_free);

	conv_handle = purple_conversations_get_handle();
	purple_signal_connect(conv_handle, "chat-buddy-joining", plugin,
	                    PURPLE_CALLBACK(chat_buddy_joining_cb), users);
	purple_signal_connect(conv_handle, "chat-buddy-leaving", plugin,
	                    PURPLE_CALLBACK(chat_buddy_leaving_cb), users);
	purple_signal_connect(conv_handle, "received-chat-msg", plugin,
	                    PURPLE_CALLBACK(received_chat_msg_cb), users);

	/* Cleanup every 5 minutes */
	id = purple_timeout_add_seconds(60 * 5, (GSourceFunc)clean_users_hash, users);

	data = g_new(gpointer, 2);
	data[0] = users;
	data[1] = GUINT_TO_POINTER(id);
	plugin->extra = data;

	return TRUE;
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:30,代码来源:joinpart.c

示例7: indicator_load

static gboolean
indicator_load(PurplePlugin *plugin) {
  indicator_docklet_init(plugin, &ui_ops);

  AppIndicator *indicator =
    app_indicator_new_with_path("pidgin", PIDGIN_STOCK_TRAY_AVAILABLE,
                                APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
                                DATADIR G_DIR_SEPARATOR_S "pixmaps" G_DIR_SEPARATOR_S "pidgin" G_DIR_SEPARATOR_S "tray");

  sIndicator = indicator;

  app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE);
  indicator_update_icon(purple_savedstatus_get_type(purple_savedstatus_get_current()),
                        FALSE, FALSE);

  void *plugins_handle = purple_plugins_get_handle();
  purple_signal_connect(plugins_handle, "plugin-load", plugin->handle,
                        PURPLE_CALLBACK(indicator_build_menu), indicator);
  purple_signal_connect(plugins_handle, "plugin-unload", plugin->handle,
                        PURPLE_CALLBACK(indicator_build_menu), indicator);
  indicator_build_menu(NULL, indicator);

  plugin->extra = indicator;

  pidgin_blist_visibility_manager_add();

  return TRUE;
}
开发者ID:codemon66,项目名称:pidgin-indicator,代码行数:28,代码来源:pidgin-indicator.c

示例8: plugin_load

static gboolean plugin_load(PurplePlugin *plugin)
{
	PurpleBuddyList *buddy_list;
	void *conv_handle;

	if (cc_init_gtk_gl())
		return FALSE;

	cc_init(&cc_info);
	buddy_list = purple_get_blist();
	if (buddy_list) {
		purple_signal_connect(PIDGIN_BLIST
				    (buddy_list),
				    "drawing-menu", plugin,
				    PURPLE_CALLBACK(cc_buddy_menu), NULL);
		conv_handle = purple_conversations_get_handle();
		purple_signal_connect(conv_handle, "received-im-msg", plugin,
			PURPLE_CALLBACK(receive_im_cb), &cc_info);
		purple_signal_connect(conv_handle, "displaying-im-msg", plugin,
			PURPLE_CALLBACK(display_im_cb), &cc_info);
	} else {
		purple_signal_connect
		    (purple_connections_get_handle(), "signed-on",
		     plugin, PURPLE_CALLBACK(cc_signed_on), plugin);
	}

	Debug("CrazyChat plugin loaded.\n");

	return TRUE;
}
开发者ID:dylex,项目名称:pidgin,代码行数:30,代码来源:cc_pidgin_plugin.c

示例9: plugin_load

/*
 *  EXPORTED FUNCTIONS
 */
static gboolean plugin_load(PurplePlugin *plugin) {

	purple_signal_connect(purple_conversations_get_handle(),
		"conversation-created", plugin,
		PURPLE_CALLBACK(new_conversation_cb), NULL);

	/* Set callback to remove window from the list, if the window is destroyed */
	purple_signal_connect(purple_conversations_get_handle(),
		"deleting-conversation", plugin,
		PURPLE_CALLBACK(conversation_delete_cb), NULL);

	purple_signal_connect(pidgin_conversations_get_handle(),
		"conversation-dragging", plugin,
		PURPLE_CALLBACK(set_conv_window_trans), NULL);

	purple_signal_connect(purple_conversations_get_handle(),
		"conversation-updated", plugin,
		PURPLE_CALLBACK(conv_updated_cb), NULL);

	update_existing_convs();

	if (blist)
		blist_created_cb(NULL, NULL);
	else
		purple_signal_connect(pidgin_blist_get_handle(),
			"gtkblist-created", plugin,
			PURPLE_CALLBACK(blist_created_cb), NULL);


	return TRUE;
}
开发者ID:Draghtnod,项目名称:pidgin,代码行数:34,代码来源:win2ktrans.c

示例10: plugin_load

static gboolean
plugin_load (PurplePlugin * plugin)
{
    printf("Foobar");
    purple_debug_info("core-hoh-hubbub-pidgin", "Fork debug\n");
    
    /*
    purple_notify_message (plugin, PURPLE_NOTIFY_MSG_INFO, "Hello World!",
        "Welcome to the Hubbub-Pidgin plugin ! Make sure the OTR plugin is loaded after me.", NULL, NULL,
        NULL);
    */

    purple_signal_connect(
                purple_conversations_get_handle(),
                "receiving-im-msg",
                plugin,
                PURPLE_CALLBACK(receiving_im_msg_cb),
                NULL);

    purple_signal_connect(
                purple_conversations_get_handle(),
                "writing-im-msg",
                plugin,
                PURPLE_CALLBACK(writing_im_msg_cb),
                NULL);

    helloworld_plugin = plugin; /* assign this here so we have a valid handle later */

    //hubbub_engine_status = system("/home/okso/Documents/Thesis/Hubbub/venv3/bin/python3 -m hubbub fork");
    purple_debug_info("core-hoh-hubbub-pidgin",
                      "Fork finished launching Python.\n");

    return TRUE;
}
开发者ID:hoh,项目名称:Hubbub-Pidgin,代码行数:34,代码来源:hubbub-pidgin.c

示例11: connect_to_signals

static void connect_to_signals(void) {
    static int handle;
    purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle,
            PURPLE_CALLBACK(signed_on), NULL);
     purple_signal_connect(purple_connections_get_handle(), "signed-off", &handle,
            PURPLE_CALLBACK(signed_off), NULL);

}
开发者ID:mrgrey,项目名称:cleancode.bot.ifmo.schedule,代码行数:8,代码来源:main.cpp

示例12: plugin_load

static gboolean
plugin_load(PurplePlugin *plugin)
{
	PurplePlugin *prpl = NULL;
	PurpleAccountOption *option;
	void *gc_handle = NULL;
#if !PURPLE_VERSION_CHECK(2,4,0)
	gchar *notice_help = NULL;
#endif

	prpl = purple_find_prpl("prpl-irc");

	/* if we didn't find the prpl, bail */
	if (!prpl)
		return FALSE;

#if !PURPLE_VERSION_CHECK(2,4,0)
	/* specify our help string and register our command */
	notice_help = _("notice target message:  Send a notice to the specified target.");

	notice_cmd_id = purple_cmd_register("notice", "ws", PURPLE_CMD_P_PLUGIN,
			PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
			"prpl-irc", notice_cmd_cb, notice_help, NULL);
#endif

	/* we need this handle for the signed-on signal */
	gc_handle = purple_connections_get_handle();

	/* list signals in alphabetical order for consistency */
	purple_signal_connect(prpl, "irc-sending-text", plugin,
				G_CALLBACK(irc_sending_text), NULL);
	purple_signal_connect(prpl, "irc-receiving-text", plugin,
				G_CALLBACK(irc_receiving_text), NULL);
	purple_signal_connect(gc_handle, "signed-on", plugin,
				G_CALLBACK(signed_on_cb), NULL);

	irc_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);

	/* Alphabetize the option label strings */
	option = purple_account_option_string_new(_("Auto-Join Channels"), "autojoin", "");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);

	option = purple_account_option_string_new(_("CTCP Version reply"), "ctcp-message", "Purple IRC");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);

	option = purple_account_option_string_new(_("Default Quit Message"), "quit-message", "Leaving.");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);

	option = purple_account_option_string_new(_("Default Part Message"), "part-message", "Leaving.");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);

	option = purple_account_option_string_new(_("Set User Modes On Connect"), "setumodes", "i");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);

	option = purple_account_option_string_new(_("Unset User Modes On Connect"), "unsetumodes", "");
	irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
	return TRUE;
}
开发者ID:Javran,项目名称:purple-plugin-pack,代码行数:58,代码来源:irc-more.c

示例13: connect_to_signals_for_demonstration_purposes_only

static void
connect_to_signals_for_demonstration_purposes_only(void)
{
	static int handle;
	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-on", &handle,
				PURPLE_CALLBACK(buddy_presence), NULL);
	purple_signal_connect(purple_blist_get_handle(), "buddy-signed-off", &handle,
				PURPLE_CALLBACK(buddy_presence), NULL);
}
开发者ID:fabianp,项目名称:libpurple-examples,代码行数:9,代码来源:buddy_status.c

示例14: plugin_load

static gboolean
plugin_load(PurplePlugin *plugin)
{
	purple_signal_connect(purple_xfers_get_handle(), "file-recv-request", plugin,
						PURPLE_CALLBACK(file_recv_request_cb), plugin);
	purple_signal_connect(purple_blist_get_handle(), "blist-node-extended-menu", plugin,
						PURPLE_CALLBACK(context_menu), plugin);
	return TRUE;
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:9,代码来源:autoaccept.c

示例15: connect_to_signals

static void connect_to_signals(void) {
  static int handle;

  purple_signal_connect(purple_connections_get_handle(), "signed-on", &handle,
        PURPLE_CALLBACK(signed_on), NULL);

  purple_signal_connect(purple_conversations_get_handle(), "received-im-msg", &handle,
        PURPLE_CALLBACK(received_im_msg), NULL);
}
开发者ID:kristopolous,项目名称:taim,代码行数:9,代码来源:nullclient.c


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