## bonobo-main bonobo-main — Bonobo initialization. |

## Synopsis

    gboolean            bonobo_is_initialized               (void);
    gboolean            bonobo_init                         (int *argc,
                                                             char **argv);
    gboolean            bonobo_init_full                    (int *argc,
                                                             char **argv,
                                                             CORBA_ORB opt_orb,
                                                             PortableServer_POA opt_poa,
                                                             PortableServer_POAManager opt_manager);
    void                bonobo_debug_init                   (void);
    void                bonobo_debug_print                  (const char *name,
                                                             char *fmt,
                                                             ...);
    int                 bonobo_debug_shutdown               (void);
    void                bonobo_main                         (void);
    void                bonobo_main_quit                    (void);
    guint               bonobo_main_level                   (void);
    gboolean            bonobo_activate                     (void);
    void                bonobo_setup_x_error_handler        (void);
    CORBA_ORB           bonobo_orb                          (void);
    PortableServer_POA  bonobo_poa                          (void);
    PortableServer_POAManager  bonobo_poa_manager           (void);
    PortableServer_POA  bonobo_poa_get_threaded             (ORBitThreadHint hint,
                                                             ...);

## Description

Initialization functions for Bonobo applications.

## Details

### bonobo_is_initialized ()

    gboolean            bonobo_is_initialized               (void);

This allows you to protect against double initialization in your code.

Returns : | whether the ORB is initialized

### bonobo_init ()

    gboolean            bonobo_init                         (int *argc,
                                                             char **argv);

Initializes the bonobo component model.

`argc` : | a pointer to the number of arguments or `NULL`
`argv` : | the array of arguments or `NULL`
Returns : | `TRUE` on success, or `FALSE` on failure.

### bonobo_init_full ()

    gboolean            bonobo_init_full                    (int *argc,
                                                             char **argv,
                                                             CORBA_ORB opt_orb,
                                                             PortableServer_POA opt_poa,
                                                             PortableServer_POAManager opt_manager);

Initializes the bonobo document model. It requires at least the value for `orb`. If `poa` is CORBA_OBJECT_NIL, then the RootPOA will be used, in this case `manager` should be CORBA_OBJECT_NIL.

`argc` : | a pointer to the number of arguments
`argv` : | the array of arguments
`opt_orb` : | the ORB in which we run
`opt_poa` : | optional, a POA
`opt_manager` : | optional, a POA Manager
Returns : | `TRUE` on success, or `FALSE` on failure.

### bonobo_debug_init ()

    void                bonobo_debug_init                   (void);

### bonobo_debug_print ()

    void                bonobo_debug_print                  (const char *name,
                                                             char *fmt,
                                                             ...);

`name` : |
`fmt` : |
`...` : |

### bonobo_debug_shutdown ()

    int                 bonobo_debug_shutdown               (void);

This shuts down the ORB and any other bonobo related resources.

Returns : | whether the shutdown was clean, a good value to return from 'main'.

### bonobo_main ()

    void                bonobo_main                         (void);

Activates the Bonobo POA Manager and enters the main event loop.

### bonobo_main_quit ()

    void                bonobo_main_quit                    (void);

Quits the main event loop.

### bonobo_main_level ()

    guint               bonobo_main_level                   (void);

Determines the number of times the bonobo main loop has been entered (minus the number of exits from the main loop).

Returns : | The number of main loops currently running (0 if no main loops are running).

### bonobo_activate ()

    gboolean            bonobo_activate                     (void);

Activates the Bonobo POA manager registered by bonobo_init. This should be called at the end of application initialization. You do not need to call this function if you use `bonobo_main()`.

Returns : | `TRUE` on success, or `FALSE` on failure.

### bonobo_setup_x_error_handler ()

    void                bonobo_setup_x_error_handler        (void);

### bonobo_orb ()

    CORBA_ORB           bonobo_orb                          (void);

Returns : | The ORB used for this Bonobo application. The ORB is created in `bonobo_init()`.

### bonobo_poa ()

    PortableServer_POA  bonobo_poa                          (void);

Returns : | The POA used for this Bonobo application. The POA is created when `bonobo_init()` is called.

### bonobo_poa_manager ()

    PortableServer_POAManager  bonobo_poa_manager           (void);

Returns : | The POA Manager used for this Bonobo application. The POA Manager is created when `bonobo_init()` is called, but it is not activated until `bonobo_main()` is called.

### bonobo_poa_get_threaded ()

    PortableServer_POA  bonobo_poa_get_threaded             (ORBitThreadHint hint,
                                                             ...);

Get a predefined POA for a given threading policy/hint. The returned POA can be passed as the "poa" constructor property of a BonoboOject.

`hint` : | the desired thread hint
`...` : |
Returns : | the requested POA.