Commit Graph
31 Commits
Author SHA1 Message Date
Guido Günther 847c21d78e build: Avoid meson deprecation warning 2023-03-13 15:25:31 +01:00
Guido Günther 88cc9a2d54 libfeedback: Fix link to specs
Since we now have them as part of the API docs we can avoid any
remote URLs
2023-01-06 15:04:29 +00:00
Guido Günther d7eed4fd52 lfb-event: Fix docstring
This allows gi-docgen to pick it up
2023-01-06 15:04:29 +00:00
Guido Günther a150c2cbc3 Switch library documentation to gi-docgen
Switch from gtk-doc to gi-docgen for the library documentation and
adjust the source files accordingly.

We don't bother about the daemon doc headers as they're not built into
any docs atm.

Closes: #56
2022-12-06 12:44:54 +01:00
Chris Vogel 64956ea4df docs: Update references to documentation from branch master to branch main. 2022-11-28 10:22:26 +01:00
Guido Günther 14f99d6e67 lfb-event: Untabify 2022-10-12 10:19:03 +02:00
Guido Günther dafb18678b Use g_error() when library is not initalized
This makes sure it still works when asserts are disabled.
2022-10-12 10:19:03 +02:00
Guido Günther 8df5d1606e lfb-event: Use consistent prefix
Make async data use the same prefix.
2022-10-12 10:18:59 +02:00
Guido Günther c659f0adb5 lfb-event: Fix typo
It's LfbEvent
2022-10-12 10:13:08 +02:00
Evangelos Ribeiro Tzaras 7391062b87 lfb-event: Notify state change before completing async task
lfb_event_trigger_feedback_async() internally uses a GTask to handle
invocation of the user provided callback when g_task_return_*() is
called.

Currently GTask is completed first and only afterwards is the state of
the event being updated which can lead to suprising behaviour in code
like this:

static void
on_event_triggered (LfbEvent     *event,
                    GAsyncResult *res,
                    CallsRinger  *self)
{
  g_autoptr (GError) err = NULL;
  gboolean ok;

  g_return_if_fail (LFB_IS_EVENT (event));

  ok = lfb_event_trigger_feedback_finish (event, res, &err);
  if (ok) {
    LfbEventState state = lfb_event_get_state (event);
    /* do something with state */
  }
}

In this case `state` would return a stale value that's about to get
changed. Instead it would be better to *first* change the state and only
afterwards complete the GTask.

This also makes the sync and async variants consistent in terms of when
they change the event state.

Closes: #59
2022-10-11 12:32:43 +02:00
Evangelos Ribeiro Tzaras ad7aa5d1b0 lfb-event: Fix SPDX identifier
The library is LGPL-2.1+, not GPL-3.0+
2022-09-24 12:08:19 +02:00
Guido Günther ff055cdb35 libfeedback: Remove unused variables 2022-02-04 19:03:00 +01:00
Evangelos Ribeiro Tzaras b2a8061cdc doc: Clarify that the timeout is in seconds 2021-10-29 18:00:02 +02:00
Evangelos Ribeiro Tzaras ce8118e920 lfb-event: Clarify docstring on lfb_event_set_feedback_profile 2021-10-29 17:52:56 +02:00
Guido Günther 8c8382a0d2 lfb-event: Don't leak error
Don't leak the error values in the success case
2021-02-05 16:56:24 +01:00
Luca Weiss ed0253fc44 Fix typos 2020-10-26 08:21:05 +00:00
Guido Günther 6e30957714 lfb-event: Connect done handler in async case too
Otherwise the event state is not updated properly
2020-07-13 10:16:20 +02:00
Guido Günther bb561b0dc5 lfb-event: Clarify return values of finished functions
They just inidicate that we talked to feedbackd succesfully.
2020-07-13 10:16:20 +02:00
Guido Günther 50aeb79ec9 LfbEvent: Add feedback-profile property
This allows to specify the feedback profile to use for
this particular event.
2020-07-10 09:20:04 +00:00
Guido Günther 9c667bbc6c LfbEvent: Link to event naming specification 2020-07-10 09:20:04 +00:00
Guido Günther 49dab605c2 libfeedback: Cancel all running feedbacks on uninit
We keep track of the active ids and end them on uninit. This
make sure feedbacks don't continue to run if the application quits
and forgets to end a feedback.
2020-06-02 16:36:24 +00:00
Guido Günther ceef33c6a0 libfeedback: Unset _initted early
This make sure a client does not end up in our shutdown phase and sees a
half initted library.
2020-06-02 16:36:24 +00:00
Guido Günther f51721b77a lfb-event: Fix comment 2020-06-02 16:36:24 +00:00
Guido Günther 89edad123d Add symbols file 2020-04-17 11:45:02 +02:00
Guido Günther 524ed476a2 Expand examples
Closes: #4
2020-02-25 18:37:23 +01:00
Guido Günther 96dd2abef2 lfb-event: Fix property names in doc strings
This makes them render correctly in the generated docs.
2020-02-25 18:35:16 +01:00
Guido Günther e3e9ba89fc lfb-event: Document constructor
Closes: #8
2020-02-25 18:35:16 +01:00
Guido Günther e4af4eb9f7 Fix typos 2020-02-25 13:11:09 +00:00
Guido Günther 38b0fa8df5 build: Don't add lfb-enums.c to list of generated sources
Otherwise when used as a subproject the master project will try
to rebuild with it's own set of flags. These lack
LIBFEEDBACK_COMPILATION which does not end well.
2020-02-25 12:46:40 +00:00
Guido Günther 41eda0ea49 libfeedback: Drop trailing semicolon
Trips up some compilers.

Thanks: Andrea Schaefer
2020-02-21 12:44:13 +01:00
Guido Günther 3663b7d149 Initial commit
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2020-02-14 17:40:34 +01:00