/** * Basic (i.e. minimal) initialization of libdia. * * It does not load any plug-ins but instead brings libdia to a state that plug-in loading can take place. * @param flags a set of DIA_INTERACTIVE, DIA_MESSAGE_STDERR */ void libdia_init (guint flags) { static gboolean initialized = FALSE; if (initialized) return; if (flags & DIA_MESSAGE_STDERR) set_message_func(stderr_message_internal); LIBXML_TEST_VERSION; #ifdef G_OS_WIN32 xmlSetGenericErrorFunc(NULL, myXmlErrorReporting); #endif if (flags & DIA_VERBOSE) { dia_log_message_enable (TRUE); dia_log_message ("initializing libdia"); } stdprops_init(); if (flags & DIA_INTERACTIVE) { char *diagtkrc; gtk_widget_set_default_colormap(gdk_rgb_get_cmap()); diagtkrc = dia_config_filename("diagtkrc"); dia_log_message ("Config from %s", diagtkrc); gtk_rc_parse(diagtkrc); g_free(diagtkrc); color_init(); } initialized = TRUE; object_registry_init(); /* The group_type is registered in app, but it needs to be exported anyway */ object_register_type(&stdpath_type); }
/** * Basic (i.e. minimal) initialization of libdia. * * It does not load any plug-ins but instead brings libdia to a state that plug-in loading can take place. * @param flags a set of DIA_INTERACTIVE, DIA_MESSAGE_STDERR */ void libdia_init (guint flags) { static gboolean initialized = FALSE; if (initialized) return; if (flags & DIA_MESSAGE_STDERR) set_message_func(stderr_message_internal); LIBXML_TEST_VERSION; #ifdef G_OS_WIN32 xmlSetGenericErrorFunc(NULL, myXmlErrorReporting); #endif if (flags & DIA_VERBOSE) { dia_log_message_enable (TRUE); dia_log_message ("initializing libdia"); } stdprops_init(); if (flags & DIA_INTERACTIVE) { char *diagtkrc; dia_image_init(); diagtkrc = dia_config_filename("diagtkrc"); dia_log_message ("Config from %s", diagtkrc); gtk_rc_parse(diagtkrc); g_free(diagtkrc); color_init(); } initialized = TRUE; object_registry_init(); }