Re: Pluggable widgets II

On Wed, 20 Dec 2006, Dominic Lachowicz wrote:

- If theme authors were supposed to use this API, a lot of crazy (and
reasonable) ideas could be implemented. Of the top of my head (from reasonable
to crazy):

Wouldn't this run into the following problem?

Themes are unloadable modules. GTypes in themes must be registered on
a GTypeModule, because the types can be unloaded, re-registered, etc.
The GTypeFactory would "appoint" a type in a theme to replace, say,
the GtkFileChooser with the Win32 native file chooser. The user then
changes the theme. The next time an application calls
gtk_file_chooser_new(), it crashes because the appointed type no
longer exists.

no, if themes - or any modele for that matter - is to implement dynamic
widgets, they'd of course have to implement dynamic types properly.
dynamic types don't ever go away, it's just their implementation that
can be unloaded if all references are dropped to it. as long as a type
implementation is in use or if it's needed again, type implementations
stay in memory or get reloaded on demand.

I was also wondering if we might be able to use this "replace all the
g_object_new() calls with a factory" opportunity to make GTK+
unloadable, so that people could use it in DLLs. If, at initialization
time, one could "appoint" a GTypeModule that does all object
registration and instantiation, perhaps we could enable that use case
as well.

no, making gdk and gtk as a whole dynamically loadable would be a completely
different undertaking and is not even remotely being planned for. there're simply too many explicit and implicit dependencies in the code base
on gdk/gtk code never being unloaded to even consider this a feasible
undertaking for 2.12 at all.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]