Esempio n. 1
0
/**
 * infd_server_pool_new:
 * @directory: A #InfdDirectory to which to add incoming connections.
 *
 * Creates a new #InfdServerPool.
 *
 * Return Value: A new #InfdServerPool.
 **/
InfdServerPool*
infd_server_pool_new(InfdDirectory* directory)
{
  GObject* object;

  g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL);

  object = g_object_new(
    INFD_TYPE_SERVER_POOL,
    "directory", directory,
    NULL
  );

  return INFD_SERVER_POOL(object);
}
Esempio n. 2
0
void Gobby::Browser::on_set_browser(GtkTreeIter* iter,
                                    InfBrowser* old_browser,
                                    InfBrowser* new_browser)
{
	if(new_browser)
	{
		if(INFC_IS_BROWSER(new_browser))
		{
			InfcBrowser* browser = INFC_BROWSER(new_browser);
			infc_browser_add_plugin(browser, Plugins::C_TEXT);
			infc_browser_add_plugin(browser, Plugins::C_CHAT);
		}
		else if(INFD_IS_DIRECTORY(new_browser))
		{
			InfdDirectory* directory =
				INFD_DIRECTORY(new_browser);
			infd_directory_add_plugin(directory, Plugins::D_TEXT);
		}
	}
}
/**
 * infinoted_plugin_manager_new:
 * @directory: The #InfdDirectory on which plugins should operate.
 * @log: The #InfinotedLog to write log messages to.
 * @creds: The #InfCertificateCredentials used to secure data transfer with
 * the clients, or %NULL.
 *
 * Creates a new #InfinotedPluginManager with the given directory, log
 * and credentials. These three objects will be available for plugins
 * to enhance the infinoted functionality. Plugins can be loaded
 * with infinoted_plugin_manager_load().
 *
 * Returns: A new #InfinotedPluginManager.
 */
InfinotedPluginManager*
infinoted_plugin_manager_new(InfdDirectory* directory,
                             InfinotedLog* log,
                             InfCertificateCredentials* creds)
{
  GObject* object;

  g_return_val_if_fail(INFD_IS_DIRECTORY(directory), NULL);
  g_return_val_if_fail(INFINOTED_IS_LOG(log), NULL);

  object = g_object_new(
    INFINOTED_TYPE_PLUGIN_MANAGER,
    "directory", directory,
    "log", log,
    "credentials", creds,
    NULL
  );

  return INFINOTED_PLUGIN_MANAGER(object);
}