Re: A default plugin module infrastructure

Owen Taylor <otaylor redhat com> writes: 
> [ Since I know you are going to object to it, the reason
>   why gtk_module_ref() can fail and return FALSE is so
>   that failure to load a module can be handled intelligently
>   when loading the module directly rather than through
>   the type system. See gtk_theme_engine_get(). ]

Since these don't actually manage the lifecycle of GtkModule, but
rather of the module GtkModule is a handle to, if you rename them then
they make sense - gtk_module_load(), gtk_module_unload() maybe.

Or something like GPlugin or GModuleHandle rather than GtkModule.

For gtk_module_ref(), if returning FALSE is a recoverable error, why
not use GError? (I'm not sure what action you'd take on failure,
presumably error_dialog ("Input method not found: %s", err->message),
where err->message is "file /usr/lib/gtk/inputmethods/ no such
file or directory" - returning FALSE allows only "silently don't use
the module" as an action, though that could be the right thing,
dunno, probably is for themes.)


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