[gnome-games/wip/exalm/rebrand: 54/124] platform: Add get_runner_type()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/rebrand: 54/124] platform: Add get_runner_type()
- Date: Sat, 19 Jun 2021 14:37:44 +0000 (UTC)
commit 93f831acb76637b44f3f7c1b555b508247249e73
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Mon Mar 29 22:22:19 2021 +0500
platform: Add get_runner_type()
plugins/game-cube/src/game-cube-platform.vala | 11 +++++++++++
plugins/game-cube/src/game-cube-plugin.vala | 2 +-
plugins/game-cube/src/meson.build | 1 +
plugins/nintendo-3ds/src/meson.build | 1 +
plugins/nintendo-3ds/src/nintendo-3ds-platform.vala | 11 +++++++++++
plugins/nintendo-3ds/src/nintendo-3ds-plugin.vala | 2 +-
plugins/nintendo-64/src/nintendo-64-platform.vala | 4 ++++
plugins/nintendo-ds/src/nintendo-ds-platform.vala | 4 ++++
src/core/platform.vala | 4 ++++
9 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/plugins/game-cube/src/game-cube-platform.vala b/plugins/game-cube/src/game-cube-platform.vala
new file mode 100644
index 00000000..5690e404
--- /dev/null
+++ b/plugins/game-cube/src/game-cube-platform.vala
@@ -0,0 +1,11 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.GameCubePlatform : Platform {
+ public GameCubePlatform (string id, string name, string[] mime_types, string prefix) {
+ base (id, name, mime_types, prefix);
+ }
+
+ public override Type get_runner_type () {
+ return typeof (GameCubeRunner);
+ }
+}
diff --git a/plugins/game-cube/src/game-cube-plugin.vala b/plugins/game-cube/src/game-cube-plugin.vala
index 3468edc3..9b700346 100644
--- a/plugins/game-cube/src/game-cube-plugin.vala
+++ b/plugins/game-cube/src/game-cube-plugin.vala
@@ -9,7 +9,7 @@ private class Games.GameCubePlugin : Object, Plugin {
private static Platform platform;
static construct {
- platform = new Platform (PLATFORM_ID, PLATFORM_NAME, { MIME_TYPE }, PLATFORM_UID_PREFIX);
+ platform = new GameCubePlatform (PLATFORM_ID, PLATFORM_NAME, { MIME_TYPE },
PLATFORM_UID_PREFIX);
}
public Platform[] get_platforms () {
diff --git a/plugins/game-cube/src/meson.build b/plugins/game-cube/src/meson.build
index 49ab86b0..12d82e6c 100644
--- a/plugins/game-cube/src/meson.build
+++ b/plugins/game-cube/src/meson.build
@@ -1,5 +1,6 @@
vala_sources = [
'game-cube-header.vala',
+ 'game-cube-platform.vala',
'game-cube-plugin.vala',
'game-cube-runner.vala',
]
diff --git a/plugins/nintendo-3ds/src/meson.build b/plugins/nintendo-3ds/src/meson.build
index 726955f0..ff9b586f 100644
--- a/plugins/nintendo-3ds/src/meson.build
+++ b/plugins/nintendo-3ds/src/meson.build
@@ -1,5 +1,6 @@
vala_sources = [
'nintendo-3ds-layout.vala',
+ 'nintendo-3ds-platform.vala',
'nintendo-3ds-plugin.vala',
'nintendo-3ds-runner.vala',
]
diff --git a/plugins/nintendo-3ds/src/nintendo-3ds-platform.vala
b/plugins/nintendo-3ds/src/nintendo-3ds-platform.vala
new file mode 100644
index 00000000..8b4436f2
--- /dev/null
+++ b/plugins/nintendo-3ds/src/nintendo-3ds-platform.vala
@@ -0,0 +1,11 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.Nintendo3DsPlatform : Platform {
+ public Nintendo3DsPlatform (string id, string name, string[] mime_types, string prefix) {
+ base (id, name, mime_types, prefix);
+ }
+
+ public override Type get_runner_type () {
+ return typeof (Nintendo3DsRunner);
+ }
+}
diff --git a/plugins/nintendo-3ds/src/nintendo-3ds-plugin.vala
b/plugins/nintendo-3ds/src/nintendo-3ds-plugin.vala
index 59a58b32..81480acb 100644
--- a/plugins/nintendo-3ds/src/nintendo-3ds-plugin.vala
+++ b/plugins/nintendo-3ds/src/nintendo-3ds-plugin.vala
@@ -11,7 +11,7 @@ private class Games.Nintendo3DsPlugin : Object, Plugin {
private static Platform platform;
static construct {
- platform = new Platform (PLATFORM_ID, PLATFORM_NAME, MIME_TYPES, PLATFORM_UID_PREFIX);
+ platform = new Nintendo3DsPlatform (PLATFORM_ID, PLATFORM_NAME, MIME_TYPES,
PLATFORM_UID_PREFIX);
}
public Platform[] get_platforms () {
diff --git a/plugins/nintendo-64/src/nintendo-64-platform.vala
b/plugins/nintendo-64/src/nintendo-64-platform.vala
index c6775f13..a88f80fd 100644
--- a/plugins/nintendo-64/src/nintendo-64-platform.vala
+++ b/plugins/nintendo-64/src/nintendo-64-platform.vala
@@ -8,4 +8,8 @@ public class Games.Nintendo64Platform : Platform {
public override Type get_snapshot_type () {
return typeof (Nintendo64Snapshot);
}
+
+ public override Type get_runner_type () {
+ return typeof (Nintendo64Runner);
+ }
}
diff --git a/plugins/nintendo-ds/src/nintendo-ds-platform.vala
b/plugins/nintendo-ds/src/nintendo-ds-platform.vala
index 5a926124..487bf986 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-platform.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-platform.vala
@@ -8,4 +8,8 @@ public class Games.NintendoDsPlatform : Platform {
public override Type get_snapshot_type () {
return typeof (NintendoDsSnapshot);
}
+
+ public override Type get_runner_type () {
+ return typeof (NintendoDsRunner);
+ }
}
diff --git a/src/core/platform.vala b/src/core/platform.vala
index 3d220395..94507436 100644
--- a/src/core/platform.vala
+++ b/src/core/platform.vala
@@ -33,6 +33,10 @@ public class Games.Platform : Object {
return typeof (Snapshot);
}
+ public virtual Type get_runner_type () {
+ return typeof (Runner);
+ }
+
public static uint hash (Platform platform) {
return str_hash (platform.get_id ());
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]