Exemplo n.º 1
0
static gboolean
plugin_unload(PurplePlugin *plugin)
{
	pidgin_conv_placement_remove_fnc("number");
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
	return TRUE;
}
Exemplo n.º 2
0
static gboolean
plugin_load(PurplePlugin *plugin)
{
	pidgin_conv_placement_add_fnc("number", _("By conversation count"),
							   &conv_placement_by_number);
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement");
	return TRUE;
}
Exemplo n.º 3
0
/**
 * The plugin's unload function
 *
 * @param[in] plugin     Unused
 * @return               Whether to continue unloading
**/
static gboolean plugin_unload(U PurplePlugin *plugin)
{
	/* Remove the conversation placement option. */
	pidgin_conv_placement_remove_fnc(PLUGIN_TOKEN);
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT
				      "/conversations/placement");

	/* XXX: There should be an interface to list available Buddy List
	 * windows. */
	pwm_split_conversation(pidgin_blist_get_default_gtk_blist());

	return TRUE;
}
Exemplo n.º 4
0
/**
 * The plugin's load function
 *
 * @param[in] plugin     Pointer to the plugin
 * @return               Whether to continue loading
**/
static gboolean plugin_load(PurplePlugin *plugin)
{
	PidginBuddyList *
	    gtkblist;	  /*< For determining if blist was initialized */
	void *conv_handle;     /*< The conversations handle                 */
	void *gtkblist_handle; /*< The Pidgin Buddy List handle             */
	void *gtkconv_handle;  /*< The Pidgin conversations handle          */

	/* XXX: There should be an interface to list available Buddy List
	 * windows. */
	gtkblist = pidgin_blist_get_default_gtk_blist();
	conv_handle = purple_conversations_get_handle();
	gtkblist_handle = pidgin_blist_get_handle();
	gtkconv_handle = pidgin_conversations_get_handle();

	/* Add the conversation placement option provided by this plugin. */
	pidgin_conv_placement_add_fnc(PLUGIN_TOKEN, _(PWM_STR_CP_BLIST),
				      &conv_placement_by_blist);
	purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT
				      "/conversations/placement");

	/* Rebuild the layout when the preference changes. */
	purple_prefs_connect_callback(plugin, PREF_SIDE, pref_convs_side_cb,
				      NULL);

	/* Toggle the instruction panel as conversations come and go. */
	purple_signal_connect(conv_handle, "conversation-created", plugin,
			      PURPLE_CALLBACK(conversation_created_cb), NULL);
	purple_signal_connect(conv_handle, "deleting-conversation", plugin,
			      PURPLE_CALLBACK(deleting_conversation_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-dragging", plugin,
			      PURPLE_CALLBACK(conversation_dragging_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-hiding", plugin,
			      PURPLE_CALLBACK(conversation_hiding_cb), NULL);
	purple_signal_connect(gtkconv_handle, "conversation-switched", plugin,
			      PURPLE_CALLBACK(conversation_switched_cb), NULL);

	/* Hijack Buddy Lists as they are created. */
	purple_signal_connect(gtkblist_handle, "gtkblist-created", plugin,
			      PURPLE_CALLBACK(gtkblist_created_cb), NULL);

	/* If a default Buddy List is already available, use it immediately. */
	if (gtkblist != NULL && gtkblist->window != NULL)
		pwm_merge_conversation(gtkblist);

	return TRUE;
}
Exemplo n.º 5
0
static void
finch_sound_init(void)
{
	void *gnt_sound_handle = finch_sound_get_handle();
	void *blist_handle = purple_blist_get_handle();
	void *conv_handle = purple_conversations_get_handle();
#ifdef USE_GSTREAMER
	GError *error = NULL;
#endif

	purple_signal_connect(purple_connections_get_handle(), "signed-on",
						gnt_sound_handle, PURPLE_CALLBACK(account_signon_cb),
						NULL);

	purple_prefs_add_none(FINCH_PREFS_ROOT "/sound");
	purple_prefs_add_string(FINCH_PREFS_ROOT "/sound/actprofile", DEFAULT_PROFILE);
	purple_prefs_add_none(FINCH_PREFS_ROOT "/sound/profiles");

	purple_prefs_connect_callback(gnt_sound_handle, FINCH_PREFS_ROOT "/sound/actprofile", initialize_profile, NULL);
	purple_prefs_trigger_callback(FINCH_PREFS_ROOT "/sound/actprofile");


#ifdef USE_GSTREAMER
	purple_debug_info("sound", "Initializing sound output drivers.\n");
#if (GST_VERSION_MAJOR > 0 || \
	(GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR > 10) || \
	 (GST_VERSION_MAJOR == 0 && GST_VERSION_MINOR == 10 && GST_VERSION_MICRO >= 10))
	gst_registry_fork_set_enabled(FALSE);
#endif
	if ((gst_init_failed = !gst_init_check(NULL, NULL, &error))) {
		purple_notify_error(NULL, _("GStreamer Failure"),
					_("GStreamer failed to initialize."),
					error ? error->message : "");
		if (error) {
			g_error_free(error);
			error = NULL;
		}
	}
#endif /* USE_GSTREAMER */

	purple_signal_connect(blist_handle, "buddy-signed-on",
						gnt_sound_handle, PURPLE_CALLBACK(buddy_state_cb),
						GINT_TO_POINTER(PURPLE_SOUND_BUDDY_ARRIVE));
	purple_signal_connect(blist_handle, "buddy-signed-off",
						gnt_sound_handle, PURPLE_CALLBACK(buddy_state_cb),
						GINT_TO_POINTER(PURPLE_SOUND_BUDDY_LEAVE));
	purple_signal_connect(conv_handle, "received-im-msg",
						gnt_sound_handle, PURPLE_CALLBACK(im_msg_received_cb),
						GINT_TO_POINTER(PURPLE_SOUND_RECEIVE));
	purple_signal_connect(conv_handle, "sent-im-msg",
						gnt_sound_handle, PURPLE_CALLBACK(im_msg_sent_cb),
						GINT_TO_POINTER(PURPLE_SOUND_SEND));
	purple_signal_connect(conv_handle, "chat-buddy-joined",
						gnt_sound_handle, PURPLE_CALLBACK(chat_buddy_join_cb),
						GINT_TO_POINTER(PURPLE_SOUND_CHAT_JOIN));
	purple_signal_connect(conv_handle, "chat-buddy-left",
						gnt_sound_handle, PURPLE_CALLBACK(chat_buddy_left_cb),
						GINT_TO_POINTER(PURPLE_SOUND_CHAT_LEAVE));
	purple_signal_connect(conv_handle, "sent-chat-msg",
						gnt_sound_handle, PURPLE_CALLBACK(chat_msg_sent_cb),
						GINT_TO_POINTER(PURPLE_SOUND_CHAT_YOU_SAY));
	purple_signal_connect(conv_handle, "received-chat-msg",
						gnt_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb),
						GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY));
	purple_signal_connect(conv_handle, "got-attention",
						gnt_sound_handle, PURPLE_CALLBACK(got_attention_cb),
						GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION));

	update_profiles();
}