On Fri, 2003-03-28 at 03:31, James Su wrote:
Oh, I see. But the interface of this function is different with the
static one, could you please give me some hint on how to use it?
The GTypeInfo parameter is replaced by a GTypePlugin pointer. Could you
please tell me how can I convert a GTypeInfo into GTypePlugin?
The idea of GTypePlugin is that you provide information to GObject
as to how to load your type when necessary.
However, you don't need to provide your own GTypePlugin or
use g_type_register_dynamic() directly... what the GTypeModule
parameter passed to your init() is is basically an
implementation of GTypePlugin that is already set up to for you
use.
Just use g_type_module_register_type() rather than
g_type_register_static(). There are multiple examples of this
in the provided input modules, or for more examples, you can
look at the theme engines in the gtk-engines/ modules. (They
generally register two types .. one GtkStyle type and one
GtkRcStyle type.)