[gnome-games] generic: Add GenericSyncGameUriAdapter
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] generic: Add GenericSyncGameUriAdapter
- Date: Tue, 16 Aug 2016 15:47:46 +0000 (UTC)
commit 61a3561594145fb93ccd623b8e9538f4ffb19f3b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Aug 16 14:57:42 2016 +0200
generic: Add GenericSyncGameUriAdapter
This will be used in a subsequent commit to allow asynchrous convertion
of a game file URI into a game object from a delegate.
https://bugzilla.gnome.org/show_bug.cgi?id=769832
src/Makefile.am | 1 +
src/generic/generic-sync-game-uri-adapter.vala | 15 +++++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index c1d4fc9..4ca5887 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,6 +69,7 @@ gnome_games_SOURCES = \
gamepad/standard-gamepad-button.vala \
\
generic/generic-game.vala \
+ generic/generic-sync-game-uri-adapter.vala \
generic/generic-title.vala \
generic/generic-uid.vala \
\
diff --git a/src/generic/generic-sync-game-uri-adapter.vala b/src/generic/generic-sync-game-uri-adapter.vala
new file mode 100644
index 0000000..77d71fb
--- /dev/null
+++ b/src/generic/generic-sync-game-uri-adapter.vala
@@ -0,0 +1,15 @@
+// This file is part of GNOME Games. License: GPLv3
+
+public class Games.GenericSyncGameUriAdapter : GameUriAdapter, Object {
+ public delegate Game GameForUri (string uri) throws Error;
+
+ private GameForUri callback;
+
+ public GenericSyncGameUriAdapter (owned GameForUri callback) {
+ this.callback = (owned) callback;
+ }
+
+ public async Game game_for_uri (string uri) throws Error {
+ return callback (uri);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]