[gnome-games/wip/exalm/platform-preferences: 14/26] retro: Add RetroPlatform



commit b711b4950c68cb2e3846cc9e479ef26cfd557795
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Sep 25 23:03:19 2018 +0500

    retro: Add RetroPlatform
    
    Introduce a specific platform for libretro-based games.
    
    This is just like GenericPlatform, except it also references platform's
    MIME type.
    
    This will be used later to provide a preference page with core chooser and
    firmware installer.

 src/meson.build               |  1 +
 src/retro/retro-platform.vala | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
---
diff --git a/src/meson.build b/src/meson.build
index 827ea4e9..c04ac402 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -113,6 +113,7 @@ vala_sources = [
   'retro/retro-gamepad.vala',
   'retro/retro-input-manager.vala',
   'retro/retro-options.vala',
+  'retro/retro-platform.vala',
   'retro/retro-runner.vala',
   'retro/retro-simple-game-uri-adapter.vala',
   'retro/retro-simple-type.vala',
diff --git a/src/retro/retro-platform.vala b/src/retro/retro-platform.vala
new file mode 100644
index 00000000..6d9de845
--- /dev/null
+++ b/src/retro/retro-platform.vala
@@ -0,0 +1,29 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.RetroPlatform : Object, Platform {
+       private string name;
+       private string id;
+       private string[] mime_types;
+
+       public RetroPlatform (string id, string name, string[] mime_types) {
+               this.id = id;
+               this.name = name;
+               this.mime_types = mime_types;
+       }
+
+       public string get_id () {
+               return id;
+       }
+
+       public string get_name () {
+               return name;
+       }
+
+       public string[] get_mime_types () {
+               return mime_types;
+       }
+
+       public PreferencesPage get_preferences () {
+               return new PreferencesPageDummyPlatform ();
+       }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]