Guido Günther
1933a23172
tests: Don't leak profiles and test that
...
We finalize the theme first so the last reference is dropped when
finalizing the profiles.
2023-03-13 15:26:07 +01:00
Guido Günther
460985cfa0
tests: Don't leak json string
2023-03-13 15:26:04 +01:00
Guido Günther
03b0f4c2aa
fbd-event: Make sure we iterate the list safely
...
When all feedbacks are done the event signals "feedbacks-ended" which
lets the manager dispose the feedback. When all feedbacks end instantly
and synchronously (as is the case with the dummy feedback) this triggers
the disposal of the event within the loop leading to a crash.
Make sure the object doesn't go away be referencing it during the loop
iteration.
We didn't see this before as glib's slice allocator for lists papered
over this for us.
Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/69
2023-03-13 15:25:41 +01:00
Guido Günther
64076e5ad0
fbd-event: Simplify
...
Gbp-Dch: Ignore
2023-03-13 15:25:37 +01:00
Guido Günther
847c21d78e
build: Avoid meson deprecation warning
2023-03-13 15:25:31 +01:00
Guido Günther
f50db727a1
Document changes and release 0.1.0
2023-02-25 14:07:09 +01:00
Guido Günther
b76e7f775f
d/gbp.conf: Be less strict when matching the meson version field
2023-02-25 14:04:09 +01:00
Guido Günther
995d21b587
fbd-dev-led: Move multicolor handling to separate class
...
Everything related to multicolor moves into the new class and we add the
necessary getters and setters so derived classes can access the parent
classes attributes where needed.
2023-02-10 15:15:12 +00:00
Guido Günther
ca712e9a32
fbd-dev-led: Add class methods so derived classes can override functionality
2023-02-10 15:15:12 +00:00
Guido Günther
ac0516329c
fbd-dev-led: Use GInitable
...
Use default GObject patterns instead of stuffing things into the
fbd_dev_led_new () so derived classes can override it.
2023-02-10 15:15:12 +00:00
Guido Günther
f7ec08497e
fbd-dev-led: Turn into a GObject
...
This is just the minimal changes to switch to a derivable GObject
2023-02-10 15:15:12 +00:00
Guido Günther
f17ca72c1b
fbd-dev-led: Make structure opaque
...
This will allow us to turn it into a GObject
2023-02-10 15:15:12 +00:00
Guido Günther
5d8b2e5fe4
fbd-dev-led: Allow to lookup color
...
This allows us to make the led structure into an opaque in
the next commit
2023-02-10 15:15:12 +00:00
Guido Günther
8ad1c43ff1
fbd-dev-leds: Move pattern trigger into fbd-dev-led
2023-02-10 15:15:12 +00:00
Guido Günther
fd852c6f69
fbd-dev-leds: Move led creation into fbd-dev-led
...
This will allow us to separate the different led types
2023-02-10 15:15:12 +00:00
Guido Günther
5fc0372b45
Move LED device to separate file
...
We separate out the led as different LED types have different
ways to set patterns, etc
2023-02-10 15:15:12 +00:00
Guido Günther
253d178cfc
fbd-dev-leds: Use gi-docgen compatible format
...
We don't document the server classes via gi-docgen atm but
as we use it for the lib update classes we touch.
2023-02-10 15:15:12 +00:00
Guido Günther
1013974958
theme: Fix some indentation
2023-02-10 15:15:12 +00:00
Guido Günther
4ea946b059
debian: Drop obsolete conf file
...
As this is now handled via udev's kmod builtin we can drop this.
2023-02-09 13:56:08 +01:00
Guido Günther
45bc7bc417
Document changes and release 0.0.3
2023-02-02 13:49:09 +01:00
Guido Günther
4822be0f7c
Update to gmobile 0.0.1
...
Adjust to the one API change. We do it all in one commit to keep
bisectability. We use a slightly newer commit than 0.0.1 to include
build fixes for older glib (as required on PureOS Byzantium).
2023-02-02 13:04:48 +01:00
Guido Günther
769fda1c68
ci: Update submodule strategy
2023-02-02 13:04:48 +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
ae85ac15d5
doc: Fix link to spec in manpage
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
0d50276f94
feedback-theme: Add screen-shot event
...
Used to indicate that a screen shot is being taken.
2023-01-02 11:45:11 +01:00
Guido Günther
b09f37b065
event-naming-spec: Separate application and system events
...
Make it obvious which events are meant to be used by "normal" GUI
applications in contrast to system components like desktop shells or
components monitoring the battery, etc.
This was prompted by
https://github.com/flatpak/xdg-desktop-portal/issues/929
2023-01-02 11:39:27 +01:00
Guido Günther
b10e699efa
build: Add dbus sources to the lib dependency
...
Otherwise we might fail to generate it for the executables
2022-12-15 17:54:08 +01:00
Guido Günther
42e9f38cc5
Add NEWS file
2022-12-15 11:52:25 +01:00
Guido Günther
089769bbcb
d/gbp.conf: Bump meson version automatically
2022-12-15 11:29:03 +01:00
Guido Günther
0e98a51a5d
Document changes and release 0.0.2
2022-12-15 11:29:03 +01:00
Guido Günther
c26eaa88b7
d/rules: Don't build tests with nocheck
2022-12-15 10:11:05 +00:00
Guido Günther
f2d02050d1
d/rules: Fix nodoc build profile usage
...
We were checking for the wrong option
2022-12-15 10:11:05 +00:00
Guido Günther
49f697b232
doc: Add manual page for fbd-theme-validate
2022-12-13 13:47:18 +01:00
Guido Günther
584d4ddb6f
doc: Convert manpages to rst
...
This will make it more fun to add details and more manpages.
2022-12-13 13:47:18 +01:00
Guido Günther
2e7483c775
ci: Use bookworm image for package build too
...
No need to fight against old glib and friends in PureOS
2022-12-13 13:47:18 +01:00
Guido Günther
b64ce1290c
Add theme validator
...
Recursively loads a given theme file.
2022-12-12 16:13:38 +01:00
Guido Günther
ef5dd5abca
theme-expander: Also log initial theme file
2022-12-12 16:13:38 +01:00
Guido Günther
9e13793bbe
tests: Help old glib on PureOS along
2022-12-11 17:34:38 +01:00
Guido Günther
9824d1cfc6
README: Document custom themes
2022-12-11 17:34:38 +01:00
Guido Günther
83091be25d
feedback-manager: Handle theme gsetting
...
Update the theme when the gsetting changes
2022-12-11 17:34:38 +01:00
Guido Günther
f5757045aa
manager: Don't load theme in constructor
...
Loading the theme can trigger calls to
fbd_feedback_manager_get_default() which then results in an endless look
as the object isn't fully initialized in constructed. Instead do
the setup in main() which has the advantage that the manager's life
cycle becomes more obvious too.
2022-12-11 17:34:38 +01:00
Guido Günther
c3beac7d41
data: Allow to set feedback theme
2022-12-11 17:34:38 +01:00
Guido Günther
a75cdbbc59
theme-expander: Allow to set the theme to expand
2022-12-11 17:34:38 +01:00
Guido Günther
242519498a
Recursively load themes
...
Themes (other than the default theme) can specify a `parent-name` in the
json file. This theme will be used as a base for the theme. Events and
profiles of the children override those in the parents.
For this we move the lookup code into it's separate class and also add
tests.
Closes : #38
2022-12-11 17:34:38 +01:00
Guido Günther
34f8733b2b
build: Don't include main in lib
...
For that move the error quark to a separate file.
2022-12-08 10:05:47 +01:00
Guido Günther
ba91939c85
Add gmobile library
2022-12-08 10:05:47 +01:00
Guido Günther
4c75f42c7e
ci: Install git
...
Needed for the submodule
2022-12-08 10:05:47 +01:00
Guido Günther
ada82a0ed1
feedback-theme: Allow to get and set parent theme name
...
If set the parent theme's feedbackd and profiles should be merged into
this theme.
2022-12-08 10:05:47 +01:00
Guido Günther
e10b2cc150
feedback-theme: Allow to update theme
...
New profiles are added, existing profiles updated. This will
allow to merge themes.
2022-12-08 10:05:47 +01:00
Guido Günther
d7f97dca51
feedback-profile: Allow to update profiles
...
Allow to add feedbacks from a profile to another one
2022-12-08 10:05:47 +01:00
Guido Günther
29bbe38fb3
feedback-dummy: Add getter for duration
...
Useful in tests
2022-12-08 10:05:47 +01:00
Guido Günther
53677e29ef
feedback-profile: Document hash types
2022-12-08 10:05:47 +01:00
Guido Günther
82a8b91096
feedback-theme: Allow to set name
2022-12-08 10:05:47 +01:00
Guido Günther
1d21bfa0dc
feedback-theme: Use getter
...
Ensures we stay consistent with future changes
2022-12-08 10:05:47 +01:00
Guido Günther
e6f1c351e2
feedback-theme: Fix indentation
2022-12-08 10:05:47 +01:00
Guido Günther
c9404d871e
feedback-theme: No need for constructed
...
We can do all that in init
2022-12-08 10:05:47 +01:00
Guido Günther
96b6af3766
tests: Test feedback theme name
2022-12-08 10:05:47 +01:00
Guido Günther
3c124e8ecd
feedback-vibra: Fix indentation
2022-12-08 10:05:47 +01:00
Guido Günther
3e4f66993e
dir-locals: Simlify consistent JS indenting
2022-12-08 10:05:47 +01:00
Guido Günther
6acdb67b78
Include specifications in the documentation
...
Now that we can use markdown easily add them as they provide
help to the developer what events exist, etc.
2022-12-06 13:58:04 +01: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
Guido Günther
7b7422f98e
build: Bump required meson version
2022-12-06 11:49:13 +01:00
Guido Günther
94880dbc0d
d/rules: Support nodoc build profile
2022-12-06 11:49:13 +01:00
Guido Günther
dfe2cdc665
d/control: Drop Breaks/Replaces on packages long gone
2022-12-06 11:21:04 +01:00
Guido Günther
388cf959ce
d/changelog: Fix typos
...
Gbp-Dch: Ignore
2022-12-05 19:00:18 +00:00
Guido Günther
a6809dccbc
d/control: Add settings schema for the tests
2022-12-05 19:00:18 +00:00
Guido Günther
bbcb396df8
ci: Switch build to bookworm / byzantium
...
Use Debian bookworm for the tests and PureOS byzantium for the
package build
We use the arm64 builder as the amd64 one fails to find a shell in the
bookworm image.
2022-12-05 13:18:23 +00:00
Guido Günther
fbfcce4470
d/gbp.conf: Update branch
...
Missed that one when switching to 'main'
2022-12-03 14:27:57 +00:00
Guido Günther
254bf944eb
example: Wait a bit before ending
...
feedbackd terminates feedback when clients disconnect from DBus so
we need to wait a bit before quitting as otherwise no feedback will
be played.
Closes : #65
2022-12-03 12:42:41 +00:00
Guido Günther
b0dc0c64cc
run: Fix daemon name
...
Fixes: 99fc8c2 ("run: Make it easy to run under gdb and document usage")
2022-12-03 12:29:55 +00:00
Guido Günther
193c0f8e57
Document changes and release 0.0.1
2022-11-11 10:54:55 +01:00
Guido Günther
2e29f5baf1
fbd: Fix indentation
2022-11-11 09:50:19 +00:00
Guido Günther
db13fc031d
manager: Use FEEDBACKD_UDEV_ATTR
...
It was introduced in
a5b4f99 ("feedbackd: Support visual feedback via LEDs")
2022-11-11 09:50:19 +00:00
Guido Günther
437d8290bf
tests/integration: Check the state of the ended event
2022-10-12 10:19:03 +02:00
Guido Günther
e782032efd
tests: Drop unused variable
2022-10-12 10:19:03 +02: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
Guido Günther
2e081602f6
data: Drop outdated comment
...
We use the hints since some time, see lfb_event_set_feedback_profile().
2022-07-20 18:32:47 +00:00
Guido Günther
17c1c2aa24
Document changes and release 0.0.0+git20220209
2022-05-20 10:57:37 +02:00
Guido Günther
5a3e501344
udev: Use more generic comment
...
Make it more obvious that this isn't device specific
2022-03-18 11:08:28 +01:00
Guido Günther
9851d3727f
udev: Drop pre L5 pre 5.9 workaround
...
Not neeed in 2022.
2022-03-18 10:55:15 +01:00
Guido Günther
74b178a363
Document changes and release 0.0.0+git20220208
2022-02-08 11:30:40 +01:00
Guido Günther
16bf78b5a4
manager: Don't sync DBus profile property
...
This will happen in on_feedbackd_setting_changed() once the
profile was adjusted.
2022-02-04 19:03:00 +01:00
Guido Günther
5c8cbfca39
manager: Sync profile with setting on startup
...
On startup the GSetting is the relevant input for selecting the profle.
Closes : #52
2022-02-04 19:03:00 +01:00
Guido Günther
2be41ec0ef
manager: Set initial profile to unknown
...
This makes sure we sync the profile with the DBus property after
fetching it from GSettings.
2022-02-04 19:03:00 +01:00
Guido Günther
a7a123a0b7
tests: Remove unused variables
2022-02-04 19:03:00 +01:00
Guido Günther
ff055cdb35
libfeedback: Remove unused variables
2022-02-04 19:03:00 +01:00
Guido Günther
753fff3e7a
d/changelog: Bump changes line to a recent date too
...
It was still stuck at 2021-10-07. Fixup version too while at that.
2021-10-19 13:15:28 +02:00
Guido Günther
d11ea0c555
Document changes and release 0.0.0+git20211018
2021-10-18 17:17:12 +02:00
Guido Günther
3a6b573d9b
gitlab-ci: Switch to bullseye
...
Drop support for buster, this can be handled in downstream builds.
2021-10-18 17:16:12 +02:00
Guido Günther
c88c6cfff5
fbd-dev-sound: Delay sending ended signal
...
Remove the feedback and the associated callback data before invoking the
callback (which then triggers FbdFeebackBased:ended) since we otherwise
remove the data from the currently playing sound from the hash table
instead of removing the data from the sound that just finished playing.
Call flow for a repeating sound before:
on_sound_play_finished_callback()
data->callback()
fbd_feedback_get_ended()
on_fb_ended()
fbd_feedback_run()
g_hash_table_insert(..., feedback, data)
fbd_dev_sound_play()
gsound_context_play_full() [async]
g_hash_table_remove (..., data->feedback) <- removes wrong feedback
So (since the feedback is still the same but only the callback data
changes) we end up removing the data from the currently playing sound
from the hash table and any calls to fbd_dev_sound_stop() would fail
to find data and hence not cancel the playing sound.
Call flow for a repeating sound now:
on_sound_play_finished_callback()
g_hash_table_remove (..., data->feedback)
data->callback()
fbd_feedback_get_ended()
on_fb_ended()
fbd_feedback_run()
g_hash_table_insert(..., feedback, data)
fbd_dev_sound_play()
gsound_context_play_full() [async]
So we remove the data of the currently playing sound before adding
the feedback to the hash table again. No ownership is transfered to
the hash table so no cleanusp need to be changed.
Closes: https://source.puri.sm/Librem5/feedbackd/-/issues/46
2021-10-15 15:12:55 +02:00
Guido Günther
05bd9ae0cb
fbd-dev-sounce: Name data consistently
...
We name it `data` elsewhere. Don't call it `object` in one function.
2021-10-15 15:10:31 +02:00
Guido Günther
48c05be29d
fbd-dev-sound: Rename cancellable to cancel
...
The current name is just confusing
2021-10-15 15:10:31 +02:00
Guido Günther
83ba584a53
feedback-theme: Add camera related events
2021-09-06 12:49:41 +02:00
Guido Günther
587cbf3188
cli: Fix changing global profile
...
For that we must not set a default event.
2021-08-09 11:49:30 +02:00
Guido Günther
3503fe0293
docs: Fix --profile short option
...
It's '-P', not '-p'.
2021-08-09 11:46:30 +02:00
Guido Günther
4f5d3cc253
examples: Unbreak python example
...
The method is `trigger_feedback` not `trigger`.
2021-07-23 15:07:13 +02:00