libfeedback: libfeedback Reference Manual

## libfeedback libfeedback — Library initialization and helpers |

## Functions

gboolean | lfb_init ()
void | lfb_uninit ()
void | lfb_set_app_id ()
const char * | lfb_get_app_id ()
gboolean | lfb_is_initted ()
void | lfb_set_feedback_profile ()
const char * | lfb_get_feedback_profile ()
LfbGdbusFeedback * | lfb_get_proxy ()

## Description

To use the library call `lfb_init()` with the id of your application (usually the desktop file name without the .desktop extension). After initializing the library you can trigger feedback using LfbEvent objects. When your application finishes call `lfb_uninit()` to free any resources:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    #define LIBFEEDBACK_USE_UNSTABLE_API
    #include <libfeedback.h>

    int main(void)
    {
       g_autoptr (GError) *err = NULL;
       if (lfb_init ("com.example.appid", &err)) {
         g_error ("%s", err->message);
       }
       ...
       lfb_uninit ();
       return 0;
    }

## Functions

### lfb_init ()

    gboolean
    lfb_init (const gchar *app_id,
              GError **error);

Initialize libfeedback. This must be called before any other functions.

#### Parameters

app_id | The application id |
error | Error information |

#### Returns

`TRUE` if successful, or `FALSE` on error.

### lfb_uninit ()

    void
    lfb_uninit (void);

Uninitialize the library when no longer used. Usually called on program shutdown.

### lfb_set_app_id ()

    void
    lfb_set_app_id (const char *app_id);

Sets the application id.

#### Parameters

app_id | The application id |

### lfb_get_app_id ()

    const char *
    lfb_get_app_id (void);

#### Returns

the application id.

### lfb_is_initted ()

    gboolean
    lfb_is_initted (void);

Gets whether or not libfeedback is initialized.

#### Returns

`TRUE` if libfeedback is initialized, or `FALSE` otherwise.

### lfb_set_feedback_profile ()

    void
    lfb_set_feedback_profile (const char *profile);

Sets the active feedback profile to profile. It is up to the feedback daemon to ignore this request. The new profile might not become active immediately. You can listen to changes LfbGdbusFeedback's ::profile property to get notified when it takes effect.

#### Parameters

profile | The profile to set |

### lfb_get_feedback_profile ()

    const char *
    lfb_get_feedback_profile (void);

Gets the currently set feedback profile.

#### Returns

The current profile or `NULL` on error.

### lfb_get_proxy ()

    LfbGdbusFeedback *
    lfb_get_proxy (void);

This can be used to access the lower level API e.g. to listen to property changes. The object is not owned by the caller. Don't unref it after use.

#### Returns

The DBus proxy.

[transfer none]