13 Commits

Author SHA1 Message Date
Christian Kellner
f9827edfb6 daemon: emit client count change automatically
Every time a game is (un)-registered and we emit the corresponding
signal, also emit the properties change signal for ClientCount.
2019-07-04 16:04:35 +02:00
Christian Kellner
d2bab2962d daemon: export game objects on the bus
For each registered game, export an object on the bus under the
path "/com/feralinteractive/GameMode/Games/<pid>" with an dbus
interface of ""com.feralinteractive.GameMode.Game". The interface
currently provides to properties, ProcessId and Executable.
Additionally add the ListGames method and the GameRegistered,
GameUnregistered signals to the com.feralinteractive.GameMode
interface.
2019-07-04 16:04:35 +02:00
Christian Kellner
5949a988ea daemon: add game_mode_context_lookup_client method
Like game_mode_context_has_client, but will add a reference to
the client, if a match was found.
2019-07-02 17:47:05 +02:00
Christian Kellner
208f37b7d1 daemon: method to list all registered clients
Return an array of pid_t elements containing the process ids of
all registered clients. Memory ownership is transferred to the
client and must be freed.
2019-07-02 17:47:05 +02:00
Christian Kellner
455ea0c72e daemon: getters for properties of GameModeClient
Add getters for all two properties of GameModeCLient: the process
id and the executable path.
2019-07-02 17:46:52 +02:00
Christian Kellner
d99af40795 daemon: add game_mode_client_ref
Now that GameModeClient is reference counted, the counterpart to
game_mode_client_unref is also needed.
2019-07-02 17:46:31 +02:00
Christian Kellner
7e10cc3a0b daemon: make game_mode_client_unref public
So it can be used outside ouf gamemode-context.c.
2019-07-02 17:46:24 +02:00
Christian Kellner
1a863f32a1 daemon: add ref-counting to GameModeClient
This is so it can out-live its membership in the client list, e.g.
when it is passed outside of gamemode-context.c and the reaper
comes along and reaps a client in the background but we still are
using the struct outside.
2019-07-02 17:46:17 +02:00
Christian Kellner
2027e981e6 daemon: expose GameModeClient as opaque struct
First step to making GameModeClient useful outside of gamemode-
context.c.
2019-07-02 17:45:55 +02:00
Marc Di Luzio
e9ab20be60 Add comments to the two parts where clang-format is off 2019-06-01 11:18:08 +01:00
Marc Di Luzio
e537caf170 Ensure we're more specific about clang format options and include order 2019-06-01 10:57:27 +01:00
Marc Di Luzio
2e67906402 Remove unneeded includes 2019-06-01 10:57:27 +01:00
Marc Di Luzio
1b78d0dcf7 Restructure files and libraries
Rename a bunch of files to make the consistent
	Create two new subdirectories for common code, and utilities
2019-06-01 10:54:22 +01:00