本文整理汇总了C++中G_TYPE_MODULE函数的典型用法代码示例。如果您正苦于以下问题:C++ G_TYPE_MODULE函数的具体用法?C++ G_TYPE_MODULE怎么用?C++ G_TYPE_MODULE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_TYPE_MODULE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gegl_module_new
/**
* 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: gnome_scan_module_init
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: meta_plugin_manager_load
/*
* 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: peas_register_types
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: peas_register_types
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: peas_register_types
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: gnome_scan_module_init
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);
}
示例8: peas_register_types
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);
}
示例9: peas_register_types
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);
}
示例10: cedit_plugin_loader_iface_load
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;
}
示例11: peas_register_types
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);
}
示例12: peas_register_types
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);
}
示例13: peas_register_types
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);
}
示例14: peas_register_types
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);
}
示例15: peas_register_types
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);
}