Re: init clarity needed



Darin Adler <darin bentspoon com> writes:

> On Monday, July 16, 2001, at 03:00  PM, Havoc Pennington wrote:
> 
> > Theoretically gnome_program_init() is the big uber-init-wrapper that
> > handles calling all the others, IIRC.
> 
> That's what I would thought at first. But gnome_program_init does not
> call gtk_init. And bonobo_ui_init seems to call both
> gnome_program_init and gtk_init. So it seems from that that non-bonobo
> programs need to call both gnome_program_init and gtk_init.

Ok, so let's make this clear:

 * bonobo_init: you call it if and only if you're using libbonobo.

 * bonobo_ui_init: you call it if and only if you're using libbonoboui.

 * gnome_program_init: that's what you use for libgnome, libgnomeui and
     everything else except stand-alone Bonobo.

Normally, you need to give gnome_program_init() one of the following properties:

 - GNOME_PARAM_MODULES: comma separated list of modules to load; this is the
     same than the GNOME_MODULES environment variable (setting the property
     adds to the list) and the --load-modules command line argument.

     Commonly used modules are:

        "libgnome" - initializes libgnome and its dependencies

        "libgnomecanvas" - initializes the canvas and its dependencies,
            but not libgnomeui; good for GTK+ applications which want to
            use the canvas.

        "libgnomeui" - initializes libgnomeui and its dependencies.

 - GNOME_PARAM_MODULE_INFO: takes a GnomeModuleInfo struct as argument;
     useful if you want to have a custom init function etc.,
     see test-libgnome.c for an example.

     There are also global symbols

        libgnome_module_info
        libgnomeui_module_info

     which you can use.

 - GNOME_PARAM_POPT_TABLE, GNOME_PARAM_POPT_FLAGS - you can use this to
     specify a custom popt table.

 - GNOME_PARAM_POPT_CONTEXT - read-only property to get the poptContext back.

 - GNOME_PARAM_HUMAN_READABLE_NAME - the human readable name of the program

> I am confused because I can't find an exemplar program. It seems that
> you can't call gnome_program_init without properties in the varargs
> part, because some properties are required. what exactly does using
> "config:" entail? Do I have to invent a unique URL inside the config:
> URL space for each program?

Required are:

- either GNOME_PARAM_MODULE_INFO or GNOME_PARAM_MODULES
  (if not specified, will only initialize libgnome and its dependencies).

Recommended are:

- GNOME_PARAM_HUMAN_READABLE_NAME

Optional are:

- GNOME_PARAM_POPT_TABLE, GNOME_PARAM_POPT_FLAGS
- GNOME_PARAM_GNOME_PATH

Readable and should-not-write are:

- GNOME_PARAM_APP_PREFIX and the other directory properties

Read-only are:

- GNOME_PARAM_APP_ID, GNOME_PARAM_APP_VERSION, GNOME_PARAM_POPT_CONTEXT

-- 
Martin Baulig
martin gnome org (private)
baulig suse de (work)




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