matecomponent-main

## matecomponent-main matecomponent-main — MateComponent initialization. |

## Synopsis

    gboolean            matecomponent_is_initialized               (void);
    gboolean            matecomponent_init                         (int *argc,
                                                             char **argv);
    gboolean            matecomponent_init_full                    (int *argc,
                                                             char **argv,
                                                             CORBA_ORB opt_orb,
                                                             PortableServer_POA opt_poa,
                                                             PortableServer_POAManager opt_manager);
    void                matecomponent_debug_init                   (void);
    void                matecomponent_debug_print                  (const char *name,
                                                             char *fmt,
                                                             ...);
    int                 matecomponent_debug_shutdown               (void);
    void                matecomponent_main                         (void);
    void                matecomponent_main_quit                    (void);
    guint               matecomponent_main_level                   (void);
    gboolean            matecomponent_activate                     (void);
    void                matecomponent_setup_x_error_handler        (void);
    CORBA_ORB           matecomponent_orb                          (void);
    PortableServer_POA  matecomponent_poa                          (void);
    PortableServer_POAManager  matecomponent_poa_manager           (void);
    PortableServer_POA  matecomponent_poa_get_threaded             (MateCORBAThreadHint hint,
                                                             ...);

## Description

Initialization functions for MateComponent applications.

## Details

### matecomponent_is_initialized ()

    gboolean            matecomponent_is_initialized               (void);

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

Returns : | whether the ORB is initialized

### matecomponent_init ()

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

Initializes the matecomponent 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.

### matecomponent_init_full ()

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

Initializes the matecomponent 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.

### matecomponent_debug_init ()

    void                matecomponent_debug_init                   (void);

### matecomponent_debug_print ()

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

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

### matecomponent_debug_shutdown ()

    int                 matecomponent_debug_shutdown               (void);

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

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

### matecomponent_main ()

    void                matecomponent_main                         (void);

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

### matecomponent_main_quit ()

    void                matecomponent_main_quit                    (void);

Quits the main event loop.

### matecomponent_main_level ()

    guint               matecomponent_main_level                   (void);

Determines the number of times the matecomponent 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).

### matecomponent_activate ()

    gboolean            matecomponent_activate                     (void);

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

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

### matecomponent_setup_x_error_handler ()

    void                matecomponent_setup_x_error_handler        (void);

### matecomponent_orb ()

    CORBA_ORB           matecomponent_orb                          (void);

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

### matecomponent_poa ()

    PortableServer_POA  matecomponent_poa                          (void);

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

### matecomponent_poa_manager ()

    PortableServer_POAManager  matecomponent_poa_manager           (void);

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

### matecomponent_poa_get_threaded ()

    PortableServer_POA  matecomponent_poa_get_threaded             (MateCORBAThreadHint hint,
                                                             ...);

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

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