[gnome-games] atari-7800: Add the Atari 7800 plugin



commit 8e39a7e61e1c8db12c6013ffd62228211e2c8029
Author: Ricard Gascons <gascons1995 gmail com>
Date:   Fri Mar 25 10:56:59 2016 +0100

    atari-7800: Add the Atari 7800 plugin
    
    Provides support for Atari 7800 games.
    
    Fixes https://github.com/Kekun/gnome-games/issues/263

 configure.ac                                  |    1 +
 plugins/Makefile.am                           |    4 ++
 plugins/atari-7800/Makefile.am                |    3 +
 plugins/atari-7800/configure.ac               |   14 +++++++
 plugins/atari-7800/data/Makefile.am           |    6 +++
 plugins/atari-7800/data/atari-7800.plugin     |    6 +++
 plugins/atari-7800/src/Makefile.am            |   53 +++++++++++++++++++++++++
 plugins/atari-7800/src/atari-7800-plugin.vala |   30 ++++++++++++++
 8 files changed, 117 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a14cb6f..eda1dd4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,7 @@ LT_INIT
 # Plugins
 m4_include([plugins/amiga/configure.ac])
 m4_include([plugins/atari-2600/configure.ac])
+m4_include([plugins/atari-7800/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 f30c5ad..43525ac 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -8,6 +8,10 @@ if ENABLE_ATARI_2600_PLUGIN
 SUBDIRS += atari-2600
 endif
 
+if ENABLE_ATARI_7800_PLUGIN
+SUBDIRS += atari-7800
+endif
+
 if ENABLE_DESKTOP_PLUGIN
 SUBDIRS += desktop
 endif
diff --git a/plugins/atari-7800/Makefile.am b/plugins/atari-7800/Makefile.am
new file mode 100644
index 0000000..1555c85
--- /dev/null
+++ b/plugins/atari-7800/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = data src
+
+include $(top_srcdir)/git.mk
diff --git a/plugins/atari-7800/configure.ac b/plugins/atari-7800/configure.ac
new file mode 100644
index 0000000..fe7eceb
--- /dev/null
+++ b/plugins/atari-7800/configure.ac
@@ -0,0 +1,14 @@
+PKG_CHECK_MODULES(ATARI_7800_PLUGIN, [
+       gio-2.0
+       glib-2.0 >= $GLIB_MIN_VERSION
+       gtk+-3.0
+       tracker-sparql-1.0
+], [enable_atari_7800_plugin=yes], [enable_atari_7800_plugin=no])
+
+AM_CONDITIONAL(ENABLE_ATARI_7800_PLUGIN, test x$enable_atari_7800_plugin != xno)
+
+AC_CONFIG_FILES([
+       plugins/atari-7800/Makefile
+       plugins/atari-7800/data/Makefile
+       plugins/atari-7800/src/Makefile
+])
diff --git a/plugins/atari-7800/data/Makefile.am b/plugins/atari-7800/data/Makefile.am
new file mode 100644
index 0000000..f2b4a34
--- /dev/null
+++ b/plugins/atari-7800/data/Makefile.am
@@ -0,0 +1,6 @@
+EXTRA_DIST = $(plugin_DATA)
+
+plugindir = $(libdir)/gnome-games/plugins
+dist_plugin_DATA = atari-7800.plugin
+
+-include $(top_srcdir)/git.mk
diff --git a/plugins/atari-7800/data/atari-7800.plugin b/plugins/atari-7800/data/atari-7800.plugin
new file mode 100644
index 0000000..b3e1781
--- /dev/null
+++ b/plugins/atari-7800/data/atari-7800.plugin
@@ -0,0 +1,6 @@
+[Plugin]
+Module=libgames-atari-7800-plugin
+Name=Atari 7800 Plugin
+Description=Provides support for Atari 7800 games.
+Authors=Ricard Gascons <gascons1995 gmail com>
+Copyright=Copyright © 2016 Ricard Gascons
diff --git a/plugins/atari-7800/src/Makefile.am b/plugins/atari-7800/src/Makefile.am
new file mode 100644
index 0000000..559515c
--- /dev/null
+++ b/plugins/atari-7800/src/Makefile.am
@@ -0,0 +1,53 @@
+plugindir = $(libdir)/gnome-games/plugins
+plugin_LTLIBRARIES = libgames-atari-7800-plugin.la
+
+libgames_atari_7800_plugin_la_DEPENDENCIES = \
+       $(top_builddir)/src/gnome-games.vapi \
+       $(NULL)
+
+libgames_atari_7800_plugin_la_SOURCES = \
+       atari-7800-plugin.vala \
+       $(NULL)
+
+libgames_atari_7800_plugin_la_VALAFLAGS = \
+       --target-glib= GLIB_MIN_VERSION@ \
+       --pkg gnome-games \
+       --pkg gio-2.0 \
+       --pkg glib-2.0 \
+       --pkg gtk+-3.0 \
+       --pkg tracker-sparql-1.0 \
+       --vapidir $(top_builddir)/src \
+       $(NULL)
+
+libgames_atari_7800_plugin_la_CFLAGS = \
+       $(ATARI_7800_PLUGIN_CFLAGS) \
+       $(GNOME_GAMES_CFLAGS) \
+       -DG_LOG_DOMAIN=\"GamesDesktop\" \
+       -DLOCALEDIR=\"$(localedir)\" \
+       $(NULL)
+
+libgames_atari_7800_plugin_la_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/src \
+       $(NULL)
+
+libgames_atari_7800_plugin_la_LIBADD = \
+       $(ATARI_7800_PLUGIN_LIBS) \
+       $(GNOME_GAMES_LIBS) \
+       $(NULL)
+
+libgames_atari_7800_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-7800/src/atari-7800-plugin.vala b/plugins/atari-7800/src/atari-7800-plugin.vala
new file mode 100644
index 0000000..694ded1
--- /dev/null
+++ b/plugins/atari-7800/src/atari-7800-plugin.vala
@@ -0,0 +1,30 @@
+// This file is part of GNOME Games. License: GPLv3
+
+private class Games.Atari7800 : Object, Plugin {
+       private const string FINGERPRINT_PREFIX = "atari-7800";
+       private const string MIME_TYPE = "application/x-atari-7800-rom";
+       private const string MODULE_BASENAME = "libretro-atari-7800.so";
+
+       public GameSource get_game_source () throws Error {
+               var query = new MimeTypeTrackerQuery (MIME_TYPE, game_for_uri);
+               var connection = Tracker Sparql Connection  get ();
+               var source = new TrackerGameSource (connection);
+               source.add_query (query);
+
+               return source;
+       }
+
+       private static Game game_for_uri (string uri) throws Error {
+               var uid = new FingerprintUid (uri, FINGERPRINT_PREFIX);
+               var title = new FilenameTitle (uri);
+               var cover = new DummyCover ();
+               var runner =  new RetroRunner (MODULE_BASENAME, uri, uid);
+
+               return new GenericGame (title, cover, runner);
+       }
+}
+
+[ModuleInit]
+public Type register_games_plugin (TypeModule module) {
+       return typeof(Games.Atari7800);
+}


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