[gnome-games] Add the atari-lynx plugin
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] Add the atari-lynx plugin
- Date: Thu, 25 May 2017 05:39:11 +0000 (UTC)
commit cb10991e80c7eebec7fc1fa80acb4d232673fd14
Author: Adrien Plazas <kekun plazas laposte net>
Date: Mon May 15 19:38:56 2017 +0200
Add the atari-lynx plugin
This allows to list Atari Lynx games.
https://bugzilla.gnome.org/show_bug.cgi?id=783067
configure.ac | 1 +
plugins/Makefile.am | 4 ++
plugins/atari-lynx/Makefile.am | 3 ++
plugins/atari-lynx/configure.ac | 14 +++++++
plugins/atari-lynx/data/Makefile.am | 6 +++
plugins/atari-lynx/data/atari-lynx.plugin | 6 +++
plugins/atari-lynx/src/Makefile.am | 49 +++++++++++++++++++++++++
plugins/atari-lynx/src/atari-lynx-plugin.vala | 38 +++++++++++++++++++
8 files changed, 121 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f2b59c8..fe04201 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,7 @@ LT_INIT
m4_include([plugins/amiga/configure.ac])
m4_include([plugins/atari-2600/configure.ac])
m4_include([plugins/atari-7800/configure.ac])
+m4_include([plugins/atari-lynx/configure.ac])
m4_include([plugins/desktop/configure.ac])
m4_include([plugins/doom/configure.ac])
m4_include([plugins/dreamcast/configure.ac])
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index cd409c4..11650a0 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -12,6 +12,10 @@ if ENABLE_ATARI_7800_PLUGIN
SUBDIRS += atari-7800
endif
+if ENABLE_ATARI_LYNX_PLUGIN
+SUBDIRS += atari-lynx
+endif
+
if ENABLE_DESKTOP_PLUGIN
SUBDIRS += desktop
endif
diff --git a/plugins/atari-lynx/Makefile.am b/plugins/atari-lynx/Makefile.am
new file mode 100644
index 0000000..1555c85
--- /dev/null
+++ b/plugins/atari-lynx/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = data src
+
+include $(top_srcdir)/git.mk
diff --git a/plugins/atari-lynx/configure.ac b/plugins/atari-lynx/configure.ac
new file mode 100644
index 0000000..a7ba2e2
--- /dev/null
+++ b/plugins/atari-lynx/configure.ac
@@ -0,0 +1,14 @@
+PKG_CHECK_MODULES(ATARI_LYNX_PLUGIN, [
+ gio-2.0
+ glib-2.0 >= $GLIB_MIN_VERSION
+ gtk+-3.0
+ retro-gtk-0.10
+], [enable_atari_lynx_plugin=yes], [enable_atari_lynx_plugin=no])
+
+AM_CONDITIONAL(ENABLE_ATARI_LYNX_PLUGIN, test x$enable_atari_lynx_plugin != xno)
+
+AC_CONFIG_FILES([
+ plugins/atari-lynx/Makefile
+ plugins/atari-lynx/data/Makefile
+ plugins/atari-lynx/src/Makefile
+])
diff --git a/plugins/atari-lynx/data/Makefile.am b/plugins/atari-lynx/data/Makefile.am
new file mode 100644
index 0000000..a2bd68a
--- /dev/null
+++ b/plugins/atari-lynx/data/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = $(plugin_DATA)
+
+plugindir = $(libdir)/gnome-games/plugins
+dist_plugin_DATA = atari-lynx.plugin
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/atari-lynx/data/atari-lynx.plugin b/plugins/atari-lynx/data/atari-lynx.plugin
new file mode 100644
index 0000000..4a96046
--- /dev/null
+++ b/plugins/atari-lynx/data/atari-lynx.plugin
@@ -0,0 +1,6 @@
+[Plugin]
+Module=libgames-atari-lynx-plugin
+Name=Atari Lynx Plugin
+Description=Provides support for Atari Lynx games.
+Authors=Adrien Plazas <kekun plazas laposte net>
+Copyright=Copyright © 2017 Adrien Plazas
diff --git a/plugins/atari-lynx/src/Makefile.am b/plugins/atari-lynx/src/Makefile.am
new file mode 100644
index 0000000..8d332a6
--- /dev/null
+++ b/plugins/atari-lynx/src/Makefile.am
@@ -0,0 +1,49 @@
+plugindir = $(libdir)/gnome-games/plugins
+plugin_LTLIBRARIES = libgames-atari-lynx-plugin.la
+
+libgames_atari_lynx_plugin_la_DEPENDENCIES = \
+ $(top_builddir)/src/gnome-games.vapi \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_SOURCES = \
+ atari-lynx-plugin.vala \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_VALAFLAGS = \
+ --target-glib=@GLIB_MIN_VERSION@ \
+ --pkg gnome-games \
+ --vapidir $(top_builddir)/src \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_CFLAGS = \
+ $(ATARI_LYNX_PLUGIN_CFLAGS) \
+ $(GNOME_GAMES_CFLAGS) \
+ -DG_LOG_DOMAIN=\"GamesDesktop\" \
+ -DLOCALEDIR=\"$(localedir)\" \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_LIBADD = \
+ $(ATARI_LYNX_PLUGIN_LIBS) \
+ $(GNOME_GAMES_LIBS) \
+ $(NULL)
+
+libgames_atari_lynx_plugin_la_LDFLAGS = \
+ -no-undefined \
+ -module \
+ -avoid-version \
+ $(NULL)
+
+EXTRA_DIST = \
+ $(plugin_DATA) \
+ $(NULL)
+
+MAINTAINERCLEANFILES = \
+ $(BUILT_SOURCES) \
+ $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/atari-lynx/src/atari-lynx-plugin.vala b/plugins/atari-lynx/src/atari-lynx-plugin.vala
new file mode 100644
index 0000000..1de3864
--- /dev/null
+++ b/plugins/atari-lynx/src/atari-lynx-plugin.vala
@@ -0,0 +1,38 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+private class Games.AtariLynx : Object, Plugin {
+ private const string FINGERPRINT_PREFIX = "atari-lynx";
+ private const string MIME_TYPE = "application/x-atari-lynx-rom";
+ private const string PLATFORM = "AtariLynx";
+
+ public string[] get_mime_types () {
+ return { MIME_TYPE };
+ }
+
+ public UriGameFactory[] get_uri_game_factories () {
+ var game_uri_adapter = new GenericGameUriAdapter (game_for_uri);
+ var factory = new GenericUriGameFactory (game_uri_adapter);
+ factory.add_mime_type (MIME_TYPE);
+
+ return { factory };
+ }
+
+ private static Game game_for_uri (Uri uri) throws Error {
+ var uid = new FingerprintUid (uri, FINGERPRINT_PREFIX);
+ var title = new FilenameTitle (uri);
+ var icon = new DummyIcon ();
+ var media = new GriloMedia (title, MIME_TYPE);
+ var cover = new CompositeCover ({
+ new LocalCover (uri),
+ new GriloCover (media, uid)});
+ var core_source = new RetroCoreSource (PLATFORM, { MIME_TYPE });
+ var runner = new RetroRunner (core_source, uri, uid, title);
+
+ return new GenericGame (title, icon, cover, runner);
+ }
+}
+
+[ModuleInit]
+public Type register_games_plugin (TypeModule module) {
+ return typeof(Games.AtariLynx);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]