Commit 708a319b authored by Dom Lachowicz's avatar Dom Lachowicz

Introduce PRIVATE API to get around bugs 357406 and 362217. IMHO,

	* rsvg-gobject.c: Introduce PRIVATE API to get around bugs 357406 and 362217.
	IMHO, gobject's type registration and quark/error system is fundamentally
	broken with respect to (un)loadable modules such as GTK+ theme engines. This
	is the best I can do for now without breaking librsvg's API. This may cause
	as many headaches as it fixes, though.
	* rsvg-private.h: Declare new _rsvg_register_types() function
	* gtk-engine/svg-main.c: Invoke new type registration function
	* librsvg.def: export this function
parent aa92e953
2006-11-02 Dom Lachowicz <domlachowicz@gmail.com>
* rsvg-gobject.c: Introduce PRIVATE API to get around bugs 357406 and 362217.
IMHO, gobject's type registration and quark/error system is fundamentally
broken with respect to (un)loadable modules such as GTK+ theme engines. This
is the best I can do for now without breaking librsvg's API. This may cause
as many headaches as it fixes, though.
* rsvg-private.h: Declare new _rsvg_register_types() function
* gtk-engine/svg-main.c: Invoke new type registration function
* librsvg.def: export this function
2006-11-02 Dom Lachowicz <domlachowicz@gmail.com>
* rsvg-base.c: Use g_quark_from_string() because librsvg might be used
......
......@@ -24,6 +24,7 @@
#include "svg.h"
#include "svg-style.h"
#include "svg-rc-style.h"
#include "rsvg-private.h"
#include <gmodule.h>
G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
......@@ -34,6 +35,7 @@ G_MODULE_EXPORT GtkRcStyle * theme_create_rc_style (void);
void
theme_init (GTypeModule *module)
{
_rsvg_register_types (module); /* HACK to get around bugs 357406 and 362217 */
rsvg_rc_style_register_type (module);
rsvg_style_register_type (module);
}
......
......@@ -31,4 +31,5 @@ rsvg_handle_render_cairo_sub
rsvg_handle_get_type
_rsvg_size_callback
_rsvg_acquire_xlink_href_resource
_rsvg_register_types
rsvg_pixbuf_from_data_with_size_data
......@@ -266,26 +266,39 @@ class_init (RsvgHandleClass *klass)
rsvg_SAX_handler_struct_init ();
}
static const GTypeInfo rsvg_type_info = {
sizeof (RsvgHandleClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (RsvgHandle),
0, /* n_preallocs */
(GInstanceInitFunc) instance_init,
};
static GType rsvg_type = 0;
/* HACK to get around bugs 357406 and 362217 */
GType
_rsvg_register_types(GTypeModule *module)
{
rsvg_type = g_type_module_register_type (module,
G_TYPE_OBJECT,
"RsvgHandle",
&rsvg_type_info,
(GTypeFlags)0);
return rsvg_type;
}
GType
rsvg_handle_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo info = {
sizeof (RsvgHandleClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (RsvgHandle),
0, /* n_preallocs */
(GInstanceInitFunc) instance_init,
};
type = g_type_register_static (G_TYPE_OBJECT, "RsvgHandle", &info, (GTypeFlags)0);
if (!rsvg_type) {
rsvg_type = g_type_register_static (G_TYPE_OBJECT, "RsvgHandle", &rsvg_type_info, (GTypeFlags)0);
}
return type;
return rsvg_type;
}
/**
......
......@@ -114,6 +114,8 @@ typedef struct _RsvgIRect RsvgIRect;
*/
#define RSVG_ONE_MINUS_EPSILON (1.0 - DBL_EPSILON)
GType _rsvg_register_types(GTypeModule *module);
struct RsvgSaxHandler {
void (*free) (RsvgSaxHandler *self);
void (*start_element) (RsvgSaxHandler *self, const char *name, RsvgPropertyBag *atts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment