示例#1
0
/**
 * gegl_module_new:
 * @filename:     The filename of a loadable module.
 * @load_inhibit: Pass %TRUE to exclude this module from auto-loading.
 * @verbose:      Pass %TRUE to enable debugging output.
 *
 * Creates a new #GeglModule instance.
 *
 * Return value: The new #GeglModule object.
 **/
GeglModule *
gegl_module_new (const gchar *filename,
                 gboolean     load_inhibit,
                 gboolean     verbose)
{
  GeglModule *module;

  g_return_val_if_fail (filename != NULL, NULL);

  module = g_object_new (GEGL_TYPE_MODULE, NULL);

  module->filename     = g_strdup (filename);
  module->load_inhibit = load_inhibit ? TRUE : FALSE;
  module->verbose      = verbose ? TRUE : FALSE;
  module->on_disk      = TRUE;

  if (! module->load_inhibit)
    {
      if (gegl_module_load (G_TYPE_MODULE (module)))
        gegl_module_unload (G_TYPE_MODULE (module));
    }
  else
    {
      if (verbose)
        g_print ("Skipping module '%s'\n",
                 gegl_filename_to_utf8 (filename));

      module->state = GEGL_MODULE_STATE_NOT_LOADED;
    }

  return module;
}
示例#2
0
G_MODULE_EXPORT void
gnome_scan_module_init (GnomeScanModule *module)
{
	SANE_Status status;
	SANE_Int version;
	/* TODO: version checking */
	status = sane_init(&version, NULL);
	bind_textdomain_codeset("sane-backends","UTF-8");

	g_message (G_STRLOC ": SANE version is %i.%i.%i for GSANE %s",
		   SANE_VERSION_MAJOR(version),
		   SANE_VERSION_MINOR(version),
		   SANE_VERSION_BUILD(version),
		   PACKAGE_VERSION);
	
	if (SANE_VERSION_MAJOR(version) != SANE_CURRENT_MAJOR) {
		g_warning (G_STRLOC ": SANE major version must be %i.",
			   SANE_CURRENT_MAJOR);
		return;
	}
	
	gsane_backend_register (G_TYPE_MODULE (module));
	gsane_scanner_register (G_TYPE_MODULE (module));

	/* GSane option handling */
	gsane_option_manager = gsane_option_manager_new();
	gsane_option_manager_add_rule_by_type(gsane_option_manager, SANE_TYPE_BOOL, GSANE_TYPE_OPTION_HANDLER_GENERIC);
	gsane_option_manager_add_rule_by_type(gsane_option_manager, SANE_TYPE_INT, GSANE_TYPE_OPTION_HANDLER_GENERIC);
	gsane_option_manager_add_rule_by_type(gsane_option_manager, SANE_TYPE_FIXED, GSANE_TYPE_OPTION_HANDLER_GENERIC);
	gsane_option_manager_add_rule_by_type(gsane_option_manager, SANE_TYPE_STRING, GSANE_TYPE_OPTION_HANDLER_GENERIC);
	gsane_option_manager_add_rules_by_name(gsane_option_manager, GSANE_TYPE_OPTION_SOURCE, "source", "doc-source", NULL);
	gsane_option_manager_add_rules_by_name(gsane_option_manager, GSANE_TYPE_OPTION_PRIMARY, "resolution", "mode", NULL);
	gsane_option_manager_add_rules_by_name(gsane_option_manager, GSANE_TYPE_OPTION_AREA, "tl-x", "tl-y", "br-x", "br-y", NULL);
}
示例#3
0
/*
 * Loads the given plugin.
 */
void
meta_plugin_manager_load (const gchar       *plugin_name)
{
  const gchar *dpath = MUTTER_PLUGIN_DIR "/";
  gchar       *path;
  MetaModule  *module;

  if (g_path_is_absolute (plugin_name))
    path = g_strdup (plugin_name);
  else
    path = g_strconcat (dpath, plugin_name, ".so", NULL);

  module = g_object_new (META_TYPE_MODULE, "path", path, NULL);
  if (!module || !g_type_module_use (G_TYPE_MODULE (module)))
    {
      /* This is fatal under the assumption that a monitoring
       * process like gnome-session will take over and handle
       * our untimely exit.
       */
      g_printerr ("Unable to load plugin module [%s]: %s",
                  path, g_module_error());
      exit (1);
    }

  meta_plugin_manager_set_plugin_type (meta_module_get_plugin_type (module));

  g_type_module_unuse (G_TYPE_MODULE (module));
  g_free (path);
}
示例#4
0
void
peas_register_types (PeasObjectModule *module)
{
  _ide_xml_highlighter_register_type (G_TYPE_MODULE (module));
  _ide_xml_indenter_register_type (G_TYPE_MODULE (module));

  peas_object_module_register_extension_type (module, IDE_TYPE_HIGHLIGHTER, IDE_TYPE_XML_HIGHLIGHTER);
  peas_object_module_register_extension_type (module, IDE_TYPE_INDENTER, IDE_TYPE_XML_INDENTER);
}
示例#5
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_visualizer_plugin_register_type (G_TYPE_MODULE (module));
	_rb_visualizer_page_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_VISUALIZER_PLUGIN);
}
示例#6
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_grilo_plugin_register_type (G_TYPE_MODULE (module));
	_rb_grilo_source_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_GRILO_PLUGIN);
}
示例#7
0
void
ide_c_pack_register_types (PeasObjectModule *module)
{
  _ide_c_indenter_register_type (G_TYPE_MODULE (module));
  _ide_c_format_provider_register_type (G_TYPE_MODULE (module));

  peas_object_module_register_extension_type (module, IDE_TYPE_INDENTER, IDE_TYPE_C_INDENTER);
  peas_object_module_register_extension_type (module, IDE_TYPE_COMPLETION_PROVIDER, IDE_TYPE_C_FORMAT_PROVIDER);
}
示例#8
0
G_MODULE_EXPORT void
gnome_scan_module_init (GnomeScanModule *module)
{
	gsfile_backend_register (G_TYPE_MODULE (module));
	gsfile_scanner_register (G_TYPE_MODULE (module));
	gsfile_option_filenames_register(G_TYPE_MODULE(module));
	gsfile_filenames_widget_register(G_TYPE_MODULE(module));

	gnome_scan_option_manager_register_rule_by_type(gnome_scan_option_manager, GSFILE_TYPE_OPTION_FILENAMES, GSFILE_TYPE_FILENAMES_WIDGET);
}
示例#9
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	gedit_spell_plugin_register_type (G_TYPE_MODULE (module));
	gedit_spell_app_activatable_register (G_TYPE_MODULE (module));

	peas_object_module_register_extension_type (module,
						    GEDIT_TYPE_WINDOW_ACTIVATABLE,
						    GEDIT_TYPE_SPELL_PLUGIN);
}
示例#10
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_ipod_plugin_register_type (G_TYPE_MODULE (module));
	_rb_ipod_source_register_type (G_TYPE_MODULE (module));
	_rb_ipod_static_playlist_source_register_type (G_TYPE_MODULE (module));
	_rb_ipod_db_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_IPOD_PLUGIN);
}
示例#11
0
static CeditPlugin *
cedit_plugin_loader_iface_load (CeditPluginLoader *loader,
				CeditPluginInfo   *info,
				const gchar       *path)
{
	CeditPluginLoaderC *cloader = CEDIT_PLUGIN_LOADER_C (loader);
	CeditObjectModule *module;
	const gchar *module_name;
	CeditPlugin *result;

	module = (CeditObjectModule *)g_hash_table_lookup (cloader->priv->loaded_plugins, info);
	module_name = cedit_plugin_info_get_module_name (info);

	if (module == NULL)
	{
		/* For now we force all modules to be resident */
		module = cedit_object_module_new (module_name,
						  path,
						  "register_cedit_plugin",
						  TRUE);

		/* Infos are available for all the lifetime of the loader.
		 * If this changes, we should use weak refs or something */

		g_hash_table_insert (cloader->priv->loaded_plugins, info, module);
	}

	if (!g_type_module_use (G_TYPE_MODULE (module)))
	{
		g_warning ("Could not load plugin module: %s", cedit_plugin_info_get_name (info));

		return NULL;
	}

	/* TODO: for now we force data-dir-name = module-name... if needed we can
	 * add a datadir field to the plugin descriptor file.
	 */
	result = (CeditPlugin *)cedit_object_module_new_object (module,
								"install-dir", path,
								"data-dir-name", module_name,
								NULL);

	if (!result)
	{
		g_warning ("Could not create plugin object: %s", cedit_plugin_info_get_name (info));
		g_type_module_unuse (G_TYPE_MODULE (module));
		
		return NULL;
	}

	g_type_module_unuse (G_TYPE_MODULE (module));
	
	return result;
}
示例#12
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
  testing_callable_plugin_register (G_TYPE_MODULE (module));
  testing_properties_plugin_register (G_TYPE_MODULE (module));

  peas_object_module_register_extension_type (module,
                                              INTROSPECTION_TYPE_CALLABLE,
                                              TESTING_TYPE_CALLABLE_PLUGIN);
  peas_object_module_register_extension_type (module,
                                              INTROSPECTION_TYPE_PROPERTIES,
                                              TESTING_TYPE_PROPERTIES_PLUGIN);
}
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
  peasdemo_hello_world_plugin_register_type (G_TYPE_MODULE (module));
  peasdemo_hello_world_configurable_register (G_TYPE_MODULE (module));

  peas_object_module_register_extension_type (module,
                                              PEAS_TYPE_ACTIVATABLE,
                                              PEASDEMO_TYPE_HELLO_WORLD_PLUGIN);
  peas_object_module_register_extension_type (module,
                                              PEAS_GTK_TYPE_CONFIGURABLE,
                                              PEASDEMO_TYPE_HELLO_WORLD_CONFIGURABLE);
}
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_generic_player_plugin_register_type (G_TYPE_MODULE (module));
	_rb_generic_player_source_register_type (G_TYPE_MODULE (module));
	_rb_generic_player_playlist_source_register_type (G_TYPE_MODULE (module));
	_rb_nokia770_source_register_type (G_TYPE_MODULE (module));
	_rb_psp_source_register_type (G_TYPE_MODULE (module));

	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_GENERIC_PLAYER_PLUGIN);
}
示例#15
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_mtp_plugin_register_type (G_TYPE_MODULE (module));
	_rb_mtp_source_register_type (G_TYPE_MODULE (module));
	_rb_mtp_thread_register_type (G_TYPE_MODULE (module));

	rb_mtp_gst_init ();

	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_MTP_PLUGIN);
}
示例#16
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_mtp_plugin_register_type (G_TYPE_MODULE (module));
	_rb_mtp_source_register_type (G_TYPE_MODULE (module));
	_rb_mtp_thread_register_type (G_TYPE_MODULE (module));

	/* ensure the gstreamer elements get linked in */
	rb_mtp_src_get_type ();
	rb_mtp_sink_get_type ();

	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_MTP_PLUGIN);
}
//Main
G_MODULE_EXPORT void pup_vm_plugin_init(PupVMPlugin *plugin)
{
	g_debug("loaded");
	//Register our classes
	pup_cd_drive_register_type(G_TYPE_MODULE(plugin));
	pup_cd_register_type(G_TYPE_MODULE(plugin));

	PupVMMonitor *monitor = pup_vm_monitor_get();
	
	//Initialize the thread pool
	pup_cdrom_probe_thread_pool = g_thread_pool_new
		((GFunc) pup_cd_new_from_drive, monitor, 1, FALSE, NULL);
	pup_cd_drive_get_all(monitor);
	g_signal_connect(monitor, "udev", G_CALLBACK(pup_cdrom_udev_event), NULL);
}
示例#18
0
void
um_user_panel_register (GIOModule *module)
{
        um_user_panel_register_type (G_TYPE_MODULE (module));
        g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
                                        UM_TYPE_USER_PANEL, "user-accounts", 0);
}
void
g_io_module_load (GIOModule *module)
{
    /* see gvfsproxyvolumemonitor.c:g_vfs_proxy_volume_monitor_daemon_init() */
    if (g_getenv ("GVFS_REMOTE_VOLUME_MONITOR_IGNORE") != NULL)
        goto out;

    /* We make this module resident since we *may* hold on to an instance
     * of the union monitor in the static method get_mount_for_mount_path()
     * on GNativeVolumeMonitor. And it doesn't make much sense to unload
     * the module *anyway*.
     *
     * See the comment gproxyvolumemonitor.c:get_mount_for_mount_path().
     */
    g_type_module_use (G_TYPE_MODULE (module));

    bindtextdomain (GETTEXT_PACKAGE, GVFS_LOCALEDIR);
    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");

    g_proxy_drive_register (module);
    g_proxy_mount_register (module);
    g_proxy_shadow_mount_register (module);
    g_proxy_volume_register (module);
    g_proxy_volume_monitor_register (module);
out:
    ;
}
示例#20
0
void
cc_wacom_panel_register (GIOModule *module)
{
	cc_wacom_panel_register_type (G_TYPE_MODULE (module));
	g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
					CC_TYPE_WACOM_PANEL, "wacom", 0);
}
static void
pluma_object_module_set_property (GObject      *object,
				  guint         prop_id,
				  const GValue *value,
				  GParamSpec   *pspec)
{
	PlumaObjectModule *module = PLUMA_OBJECT_MODULE (object);

	switch (prop_id)
	{
		case PROP_MODULE_NAME:
			module->priv->module_name = g_value_dup_string (value);
			g_type_module_set_name (G_TYPE_MODULE (object),
						module->priv->module_name);
			break;
		case PROP_PATH:
			module->priv->path = g_value_dup_string (value);
			break;
		case PROP_TYPE_REGISTRATION:
			module->priv->type_registration = g_value_dup_string (value);
			break;
		case PROP_RESIDENT:
			module->priv->resident = g_value_get_boolean (value);
			break;
		default:
			g_return_if_reached ();
	}
}
示例#22
0
EvDocument *
ev_backends_manager_get_document (const gchar *mime_type)
{
	EvDocument    *document;
	EvBackendInfo *info;

	info = ev_backends_manager_get_backend_info (mime_type);
	if (!info)
		return NULL;

	if (!info->module) {
		gchar *path;
		
		path = g_module_build_path (backends_dir(), info->module_name);
		info->module = G_TYPE_MODULE (ev_module_new (path, info->resident));
		g_free (path);
	}
	
	if (!g_type_module_use (info->module)) {
		g_warning ("Cannot load backend '%s' since file '%s' cannot be read.",
			   info->module_name,
			   ev_module_get_path (EV_MODULE (info->module)));
		g_object_unref (G_OBJECT (info->module));
		info->module = NULL;

		return NULL;
	}

	document = EV_DOCUMENT (ev_module_new_object (EV_MODULE (info->module)));
	g_type_module_unuse (info->module);

	return document;
}
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	xviewer_postasa_plugin_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
						    XVIEWER_TYPE_WINDOW_ACTIVATABLE,
						    XVIEWER_TYPE_POSTASA_PLUGIN);
}
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	eom_statusbar_date_plugin_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
	                                            EOM_TYPE_WINDOW_ACTIVATABLE,
	                                            EOM_TYPE_STATUSBAR_DATE_PLUGIN);
}
void
cc_ua_panel_register (GIOModule *module)
{
  cc_ua_panel_register_type (G_TYPE_MODULE (module));
  g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
                                  CC_TYPE_UA_PANEL,
                                  "universal-access", 0);
}
void
cc_screen_panel_register (GIOModule *module)
{
  cc_screen_panel_register_type (G_TYPE_MODULE (module));
  g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
                                  CC_TYPE_SCREEN_PANEL,
                                  "screen", 0);
}
示例#27
0
G_MODULE_EXPORT void
peas_register_types(PeasObjectModule *module)
{
	xmr_search_plugin_register_type(G_TYPE_MODULE(module));
	peas_object_module_register_extension_type(module,
							PEAS_TYPE_ACTIVATABLE,
							XMR_TYPE_SEARCH_PLUGIN);
}
void
cc_mouse_panel_register (GIOModule *module)
{
    cc_mouse_panel_register_type (G_TYPE_MODULE (module));
    g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
                                    CC_TYPE_MOUSE_PANEL,
                                    "mouse", 0);
}
void
cc_background_panel_register (GIOModule *module)
{
  cc_background_panel_register_type (G_TYPE_MODULE (module));
  g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
                                  CC_TYPE_BACKGROUND_PANEL,
                                  "background", 0);
}
示例#30
0
G_MODULE_EXPORT void
peas_register_types (PeasObjectModule *module)
{
	rb_lirc_plugin_register_type (G_TYPE_MODULE (module));
	peas_object_module_register_extension_type (module,
						    PEAS_TYPE_ACTIVATABLE,
						    RB_TYPE_LIRC_PLUGIN);
}