gtk+-3.0 >= $GTK_REQUIRED_VERSION
gmodule-2.0
])
+# Libraries needed to build interpreter plugins
+PKG_CHECK_MODULES([PLUGIN], [
+ glib-2.0 dnl Any version will do
+ libpeas-1.0
+])
# Libraries needed to build test programs
PKG_CHECK_MODULES([TEST], [
gtk+-3.0 >= $GTK_REQUIRED_VERSION
# Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
# variables are black boxes to Automake, so it has to know about it being a
# module in the makefile itself.
-PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "^glk"'
+PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "(^glk|peas_register_types)"'
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
### OUTPUT ####################################################################
# All plugins
-pkglib_LTLIBRARIES = libbocfel.la libfrotz.la libgit.la libglulxe.la \
+plugindir = $(pkglibdir)/plugins
+plugin_LTLIBRARIES = libbocfel.la libfrotz.la libgit.la libglulxe.la \
libnitfol.la
CLEANFILES =
bocfel/random.c bocfel/random.h bocfel/screen.c bocfel/screen.h \
bocfel/stack.c bocfel/stack.h bocfel/table.c bocfel/table.h \
bocfel/unicode.c bocfel/unicode.h bocfel/util.c bocfel/util.h \
- bocfel/zoom.c bocfel/zoom.h bocfel/zterp.c bocfel/zterp.h
+ bocfel/zoom.c bocfel/zoom.h bocfel/zterp.c bocfel/zterp.h \
+ chimara-bocfel-plugin.c chimara-bocfel-plugin.h
libbocfel_la_CPPFLAGS = -DZTERP_GLK -DZTERP_UNIX \
-I$(top_srcdir) -I$(top_srcdir)/libchimara
-libbocfel_la_CFLAGS = -std=c99 $(AM_CFLAGS)
-libbocfel_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
+libbocfel_la_CFLAGS = -std=c99 $(PLUGIN_CFLAGS) $(AM_CFLAGS)
+libbocfel_la_LDFLAGS = -module $(PLUGIN_LIBS) $(PLUGIN_LIBTOOL_FLAGS)
# Frotz
frotz/quetzal.c frotz/random.c frotz/redirect.c frotz/sound.c \
frotz/stream.c frotz/table.c frotz/text.c frotz/variable.c \
frotz/glkscreen.c frotz/glkmisc.c frotz/frotz.h frotz/glkfrotz.h \
- frotz/glkio.h
+ frotz/glkio.h chimara-frotz-plugin.c chimara-frotz-plugin.h
libfrotz_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libchimara
-libfrotz_la_CFLAGS = -Wno-pointer-sign $(AM_CFLAGS)
-libfrotz_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
+libfrotz_la_CFLAGS = -Wno-pointer-sign $(PLUGIN_CFLAGS) $(AM_CFLAGS)
+libfrotz_la_LDFLAGS = -module $(PLUGIN_LIBS) $(PLUGIN_LIBTOOL_FLAGS)
# Git
git/memory.h git/opcodes.h git/labels.inc git/compiler.c git/gestalt.c \
git/git.c git/git_unix.c git/glkop.c git/heap.c git/memory.c git/opcodes.c \
git/operands.c git/peephole.c git/savefile.c git/saveundo.c git/search.c \
- git/terp.c git/accel.c
+ git/terp.c git/accel.c chimara-git-plugin.c chimara-git-plugin.h
libgit_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libchimara
-libgit_la_CFLAGS = -DCHIMARA_EXTENSIONS -DUSE_INLINE $(AM_CFLAGS)
-libgit_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
+libgit_la_CFLAGS = -DCHIMARA_EXTENSIONS -DUSE_INLINE \
+ $(PLUGIN_CFLAGS) $(AM_CFLAGS)
+libgit_la_LDFLAGS = -module $(PLUGIN_LIBS) $(PLUGIN_LIBTOOL_FLAGS)
# Memory mapping (-DUSE_MMAP) doesn't seem to work... FIXME
CLEANFILES += git/test/*.tmp
glulxe/glulxe.h glulxe/heap.c glulxe/main.c glulxe/opcodes.h \
glulxe/operand.c glulxe/osdepend.c glulxe/profile.c glulxe/search.c \
glulxe/serial.c glulxe/string.c glulxe/unixstrt.c glulxe/vm.c \
- glulxe/float.c
+ glulxe/float.c chimara-glulxe-plugin.c chimara-glulxe-plugin.h
libglulxe_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libchimara -DOS_UNIX
libglulxe_la_CFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes \
- -Wno-unused $(AM_CFLAGS)
-libglulxe_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
+ -Wno-unused $(PLUGIN_CFLAGS) $(AM_CFLAGS)
+libglulxe_la_LDFLAGS = -module $(PLUGIN_LIBS) $(PLUGIN_LIBTOOL_FLAGS)
#noinst_PROGRAMS = glulxdump
#glulxdump_SOURCES = glulxe/glulxdump.c
nitfol/struct.c nitfol/struct.h nitfol/tokenise.c nitfol/tokenise.h \
nitfol/undo.c nitfol/undo.h nitfol/z_io.c nitfol/z_io.h nitfol/zscii.c \
nitfol/zscii.h \
- $(NITFOL_GRAPHICS) $(NITFOL_BLORB) $(NITFOL_SOUND)
+ $(NITFOL_GRAPHICS) $(NITFOL_BLORB) $(NITFOL_SOUND) \
+ chimara-nitfol-plugin.c chimara-nitfol-plugin.h
nodist_libnitfol_la_SOURCES = nitfol/copying.c nitfol/dbg_help.h \
nitfol/startunix.c
libnitfol_la_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libchimara \
-I$(srcdir)/nitfol -DSMART_TOKENISER -DUSE_INLINE
-libnitfol_la_LDFLAGS = -module $(PLUGIN_LIBTOOL_FLAGS)
+libnitfol_la_CFLAGS = $(PLUGIN_CFLAGS) $(AM_CFLAGS)
+libnitfol_la_LDFLAGS = -module $(PLUGIN_LIBS) $(PLUGIN_LIBTOOL_FLAGS)
info_TEXINFOS = nitfol/nitfol.texi
nitfol_TEXINFOS = nitfol/dbg_help.texi nitfol/options.texi
EXTRA_DIST = nitfol/nitfol.opt nitfol/crashme.inf nitfol/test.inf
+# Plugin files
+
+dist_plugin_DATA = bocfel.plugin frotz.plugin git.plugin glulxe.plugin \
+ nitfol.plugin
+
# Documentation
pkgdocdir = $(datadir)/doc/$(PACKAGE)
--- /dev/null
+[Plugin]
+Module=bocfel
+Name=Bocfel
+Description=Bocfel Z-machine interpreter
--- /dev/null
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "chimara-bocfel-plugin.h"
+
+G_DEFINE_DYNAMIC_TYPE(ChimaraBocfelPlugin, chimara_bocfel_plugin, PEAS_TYPE_EXTENSION_BASE);
+
+G_MODULE_EXPORT void
+peas_register_types(PeasObjectModule *module)
+{
+ chimara_bocfel_plugin_register_type(G_TYPE_MODULE(module));
+
+ //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_BOCFEL_PLUGIN);
+}
+
+static void
+chimara_bocfel_plugin_init(ChimaraBocfelPlugin *self)
+{
+}
+
+static void
+chimara_bocfel_plugin_class_init(ChimaraBocfelPluginClass *klass)
+{
+}
+
+static void
+chimara_bocfel_plugin_class_finalize(ChimaraBocfelPluginClass *klass)
+{
+}
\ No newline at end of file
--- /dev/null
+#ifndef CHIMARA_BOCFEL_PLUGIN_H
+#define CHIMARA_BOCFEL_PLUGIN_H
+
+#include <glib.h>
+#include <libpeas/peas.h>
+
+G_BEGIN_DECLS
+
+#define CHIMARA_TYPE_BOCFEL_PLUGIN (chimara_bocfel_plugin_get_type())
+#define CHIMARA_BOCFEL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CHIMARA_TYPE_BOCFEL_PLUGIN, ChimaraBocfelPlugin))
+#define CHIMARA_BOCFEL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CHIMARA_TYPE_BOCFEL_PLUGIN, ChimaraBocfelPlugin))
+#define CHIMARA_IS_BOCFEL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CHIMARA_TYPE_BOCFEL_PLUGIN))
+#define CHIMARA_IS_BOCFEL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CHIMARA_TYPE_BOCFEL_PLUGIN))
+#define CHIMARA_BOCFEL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CHIMARA_TYPE_BOCFEL_PLUGIN, ChimaraBocfelPluginClass))
+
+typedef struct _ChimaraBocfelPlugin ChimaraBocfelPlugin;
+typedef struct _ChimaraBocfelPluginClass ChimaraBocfelPluginClass;
+
+struct _ChimaraBocfelPlugin {
+ PeasExtensionBase parent_instance;
+};
+
+struct _ChimaraBocfelPluginClass {
+ PeasExtensionBaseClass parent_class;
+};
+
+GType chimara_bocfel_plugin_get_type(void) G_GNUC_CONST;
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* CHIMARA_BOCFEL_PLUGIN_H */
--- /dev/null
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "chimara-frotz-plugin.h"
+
+G_DEFINE_DYNAMIC_TYPE(ChimaraFrotzPlugin, chimara_frotz_plugin, PEAS_TYPE_EXTENSION_BASE);
+
+G_MODULE_EXPORT void
+peas_register_types(PeasObjectModule *module)
+{
+ chimara_frotz_plugin_register_type(G_TYPE_MODULE(module));
+
+ //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_BOCFEL_PLUGIN);
+}
+
+static void
+chimara_frotz_plugin_init(ChimaraFrotzPlugin *self)
+{
+}
+
+static void
+chimara_frotz_plugin_class_init(ChimaraFrotzPluginClass *klass)
+{
+}
+
+static void
+chimara_frotz_plugin_class_finalize(ChimaraFrotzPluginClass *klass)
+{
+}
\ No newline at end of file
--- /dev/null
+#ifndef CHIMARA_FROTZ_PLUGIN_H
+#define CHIMARA_FROTZ_PLUGIN_H
+
+#include <glib.h>
+#include <libpeas/peas.h>
+
+G_BEGIN_DECLS
+
+#define CHIMARA_TYPE_FROTZ_PLUGIN (chimara_frotz_plugin_get_type())
+#define CHIMARA_FROTZ_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CHIMARA_TYPE_FROTZ_PLUGIN, ChimaraFrotzPlugin))
+#define CHIMARA_FROTZ_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CHIMARA_TYPE_FROTZ_PLUGIN, ChimaraFrotzPlugin))
+#define CHIMARA_IS_FROTZ_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CHIMARA_TYPE_FROTZ_PLUGIN))
+#define CHIMARA_IS_FROTZ_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CHIMARA_TYPE_FROTZ_PLUGIN))
+#define CHIMARA_FROTZ_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CHIMARA_TYPE_FROTZ_PLUGIN, ChimaraFrotzPluginClass))
+
+typedef struct _ChimaraFrotzPlugin ChimaraFrotzPlugin;
+typedef struct _ChimaraFrotzPluginClass ChimaraFrotzPluginClass;
+
+struct _ChimaraFrotzPlugin {
+ PeasExtensionBase parent_instance;
+};
+
+struct _ChimaraFrotzPluginClass {
+ PeasExtensionBaseClass parent_class;
+};
+
+GType chimara_frotz_plugin_get_type(void) G_GNUC_CONST;
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* CHIMARA_FROTZ_PLUGIN_H */
--- /dev/null
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "chimara-git-plugin.h"
+
+G_DEFINE_DYNAMIC_TYPE(ChimaraGitPlugin, chimara_git_plugin, PEAS_TYPE_EXTENSION_BASE);
+
+G_MODULE_EXPORT void
+peas_register_types(PeasObjectModule *module)
+{
+ chimara_git_plugin_register_type(G_TYPE_MODULE(module));
+
+ //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_GIT_PLUGIN);
+}
+
+static void
+chimara_git_plugin_init(ChimaraGitPlugin *self)
+{
+}
+
+static void
+chimara_git_plugin_class_init(ChimaraGitPluginClass *klass)
+{
+}
+
+static void
+chimara_git_plugin_class_finalize(ChimaraGitPluginClass *klass)
+{
+}
\ No newline at end of file
--- /dev/null
+#ifndef CHIMARA_GIT_PLUGIN_H
+#define CHIMARA_GIT_PLUGIN_H
+
+#include <glib.h>
+#include <libpeas/peas.h>
+
+G_BEGIN_DECLS
+
+#define CHIMARA_TYPE_GIT_PLUGIN (chimara_git_plugin_get_type())
+#define CHIMARA_GIT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CHIMARA_TYPE_GIT_PLUGIN, ChimaraGitPlugin))
+#define CHIMARA_GIT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CHIMARA_TYPE_GIT_PLUGIN, ChimaraGitPlugin))
+#define CHIMARA_IS_GIT_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CHIMARA_TYPE_GIT_PLUGIN))
+#define CHIMARA_IS_GIT_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CHIMARA_TYPE_GIT_PLUGIN))
+#define CHIMARA_GIT_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CHIMARA_TYPE_GIT_PLUGIN, ChimaraGitPluginClass))
+
+typedef struct _ChimaraGitPlugin ChimaraGitPlugin;
+typedef struct _ChimaraGitPluginClass ChimaraGitPluginClass;
+
+struct _ChimaraGitPlugin {
+ PeasExtensionBase parent_instance;
+};
+
+struct _ChimaraGitPluginClass {
+ PeasExtensionBaseClass parent_class;
+};
+
+GType chimara_git_plugin_get_type(void) G_GNUC_CONST;
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* CHIMARA_GIT_PLUGIN_H */
--- /dev/null
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "chimara-glulxe-plugin.h"
+
+G_DEFINE_DYNAMIC_TYPE(ChimaraGlulxePlugin, chimara_glulxe_plugin, PEAS_TYPE_EXTENSION_BASE);
+
+G_MODULE_EXPORT void
+peas_register_types(PeasObjectModule *module)
+{
+ chimara_glulxe_plugin_register_type(G_TYPE_MODULE(module));
+
+ //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_GLULXE_PLUGIN);
+}
+
+static void
+chimara_glulxe_plugin_init(ChimaraGlulxePlugin *self)
+{
+}
+
+static void
+chimara_glulxe_plugin_class_init(ChimaraGlulxePluginClass *klass)
+{
+}
+
+static void
+chimara_glulxe_plugin_class_finalize(ChimaraGlulxePluginClass *klass)
+{
+}
\ No newline at end of file
--- /dev/null
+#ifndef CHIMARA_GLULXE_PLUGIN_H
+#define CHIMARA_GLULXE_PLUGIN_H
+
+#include <glib.h>
+#include <libpeas/peas.h>
+
+G_BEGIN_DECLS
+
+#define CHIMARA_TYPE_GLULXE_PLUGIN (chimara_glulxe_plugin_get_type())
+#define CHIMARA_GLULXE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CHIMARA_TYPE_GLULXE_PLUGIN, ChimaraGlulxePlugin))
+#define CHIMARA_GLULXE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CHIMARA_TYPE_GLULXE_PLUGIN, ChimaraGlulxePlugin))
+#define CHIMARA_IS_GLULXE_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CHIMARA_TYPE_GLULXE_PLUGIN))
+#define CHIMARA_IS_GLULXE_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CHIMARA_TYPE_GLULXE_PLUGIN))
+#define CHIMARA_GLULXE_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CHIMARA_TYPE_GLULXE_PLUGIN, ChimaraGlulxePluginClass))
+
+typedef struct _ChimaraGlulxePlugin ChimaraGlulxePlugin;
+typedef struct _ChimaraGlulxePluginClass ChimaraGlulxePluginClass;
+
+struct _ChimaraGlulxePlugin {
+ PeasExtensionBase parent_instance;
+};
+
+struct _ChimaraGlulxePluginClass {
+ PeasExtensionBaseClass parent_class;
+};
+
+GType chimara_glulxe_plugin_get_type(void) G_GNUC_CONST;
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* CHIMARA_GLULXE_PLUGIN_H */
--- /dev/null
+#include <glib-object.h>
+#include <libpeas/peas.h>
+#include "chimara-nitfol-plugin.h"
+
+G_DEFINE_DYNAMIC_TYPE(ChimaraNitfolPlugin, chimara_nitfol_plugin, PEAS_TYPE_EXTENSION_BASE);
+
+G_MODULE_EXPORT void
+peas_register_types(PeasObjectModule *module)
+{
+ chimara_nitfol_plugin_register_type(G_TYPE_MODULE(module));
+
+ //peas_object_module_register_extension_type(module, PEAS_GTK_TYPE_CONFIGURABLE, CHIMARA_TYPE_NITFOL_PLUGIN);
+}
+
+static void
+chimara_nitfol_plugin_init(ChimaraNitfolPlugin *self)
+{
+}
+
+static void
+chimara_nitfol_plugin_class_init(ChimaraNitfolPluginClass *klass)
+{
+}
+
+static void
+chimara_nitfol_plugin_class_finalize(ChimaraNitfolPluginClass *klass)
+{
+}
\ No newline at end of file
--- /dev/null
+#ifndef CHIMARA_NITFOL_PLUGIN_H
+#define CHIMARA_NITFOL_PLUGIN_H
+
+#include <glib.h>
+#include <libpeas/peas.h>
+
+G_BEGIN_DECLS
+
+#define CHIMARA_TYPE_NITFOL_PLUGIN (chimara_nitfol_plugin_get_type())
+#define CHIMARA_NITFOL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST((o), CHIMARA_TYPE_NITFOL_PLUGIN, ChimaraNitfolPlugin))
+#define CHIMARA_NITFOL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CHIMARA_TYPE_NITFOL_PLUGIN, ChimaraNitfolPlugin))
+#define CHIMARA_IS_NITFOL_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), CHIMARA_TYPE_NITFOL_PLUGIN))
+#define CHIMARA_IS_NITFOL_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), CHIMARA_TYPE_NITFOL_PLUGIN))
+#define CHIMARA_NITFOL_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), CHIMARA_TYPE_NITFOL_PLUGIN, ChimaraNitfolPluginClass))
+
+typedef struct _ChimaraNitfolPlugin ChimaraNitfolPlugin;
+typedef struct _ChimaraNitfolPluginClass ChimaraNitfolPluginClass;
+
+struct _ChimaraNitfolPlugin {
+ PeasExtensionBase parent_instance;
+};
+
+struct _ChimaraNitfolPluginClass {
+ PeasExtensionBaseClass parent_class;
+};
+
+GType chimara_nitfol_plugin_get_type(void) G_GNUC_CONST;
+G_MODULE_EXPORT void peas_register_types (PeasObjectModule *module);
+
+G_END_DECLS
+
+#endif /* CHIMARA_NITFOL_PLUGIN_H */
--- /dev/null
+[Plugin]
+Module=frotz
+Name=Frotz
+Description=GlkFrotz interpreter
--- /dev/null
+[Plugin]
+Module=git
+Name=Git
+Description=Git, a lightning-fast Glulx interpreter
--- /dev/null
+[Plugin]
+Module=glulxe
+Name=Glulxe
+Description=Glulxe - reference interpreter for Glulx
+Authors=Andrew Plotkin
--- /dev/null
+[Plugin]
+Module=nitfol
+Name=Nitfol
+Description=Nitfol Z-machine interpreter
--- /dev/null
+from gi.repository import Gtk, Peas, PeasGtk, Chimara
+c = Chimara.Glk()
+
+e = Peas.Engine.get_default()
+e.add_search_path('/Users/fliep/gtk/inst/lib/chimara', None)
+
+for i in e.get_plugin_list():
+ print i.get_name()
+
+w = Gtk.Window()
+w.add(PeasGtk.PluginManager(e))
+w.connect('destroy', Gtk.main_quit)
+w.show_all()
+
+Gtk.main()