[retro-gtk/c-port: 23/42] Port MemoryType to C



commit 959c077ce3873d82fc2a02777a2bfa11537c5b0d
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Sep 7 11:33:01 2017 +0200

    Port MemoryType to C

 retro-gtk/Makefile.am           |    2 +-
 retro-gtk/memory.vala           |   16 ----------------
 retro-gtk/retro-gtk.h           |    1 +
 retro-gtk/retro-memory-type.h   |   33 +++++++++++++++++++++++++++++++++
 retro-gtk/vapi/retro-gtk-c.vapi |    8 ++++++++
 5 files changed, 43 insertions(+), 17 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index ec00b6b..18fa6d6 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -41,6 +41,7 @@ retro_gtk_public_h_sources = \
        retro-input-device.h \
        retro-joypad-id.h \
        retro-lightgun-id.h \
+       retro-memory-type.h \
        retro-mouse-id.h \
        retro-pa-player.h \
        retro-pixel-format.h \
@@ -73,7 +74,6 @@ libretro_gtk_la_SOURCES = \
        \
        core.vala \
        core-error.vala \
-       memory.vala \
        retro.vala \
        retro-cairo-display.c \
        retro-core-descriptor.vala \
diff --git a/retro-gtk/retro-gtk.h b/retro-gtk/retro-gtk.h
index 18b464e..5766d0b 100644
--- a/retro-gtk/retro-gtk.h
+++ b/retro-gtk/retro-gtk.h
@@ -18,6 +18,7 @@
 #include "retro-input-device.h"
 #include "retro-joypad-id.h"
 #include "retro-lightgun-id.h"
+#include "retro-memory-type.h"
 #include "retro-mouse-id.h"
 #include "retro-pixel-format.h"
 #include "retro-pointer-id.h"
diff --git a/retro-gtk/retro-memory-type.h b/retro-gtk/retro-memory-type.h
new file mode 100644
index 0000000..eeeac57
--- /dev/null
+++ b/retro-gtk/retro-memory-type.h
@@ -0,0 +1,33 @@
+// This file is part of retro-gtk. License: GPL-3.0+.
+
+#ifndef RETRO_MEMORY_TYPE_H
+#define RETRO_MEMORY_TYPE_H
+
+#if !defined(__RETRO_GTK_INSIDE__) && !defined(RETRO_GTK_COMPILATION)
+# error "Only <retro-gtk.h> can be included directly."
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+/**
+ * RetroMemoryType:
+ * @RETRO_MEMORY_TYPE_SAVE_RAM: The save RAM.
+ * @RETRO_MEMORY_TYPE_RTC: The real time clock.
+ * @RETRO_MEMORY_TYPE_SYSTEM_RAM: The system RAM.
+ * @RETRO_MEMORY_TYPE_VIDEO_RAM: The video RAM.
+ *
+ * Represents the memory types for the Libretro core.
+ */
+typedef enum
+{
+  RETRO_MEMORY_TYPE_SAVE_RAM,
+  RETRO_MEMORY_TYPE_RTC,
+  RETRO_MEMORY_TYPE_SYSTEM_RAM,
+  RETRO_MEMORY_TYPE_VIDEO_RAM,
+} RetroMemoryType;
+
+G_END_DECLS
+
+#endif /* RETRO_MEMORY_TYPE_H */
diff --git a/retro-gtk/vapi/retro-gtk-c.vapi b/retro-gtk/vapi/retro-gtk-c.vapi
index 1d548e2..bf0ea78 100644
--- a/retro-gtk/vapi/retro-gtk-c.vapi
+++ b/retro-gtk/vapi/retro-gtk-c.vapi
@@ -12,6 +12,14 @@ public enum Retro.DeviceType {
        POINTER = 6,
 }
 
+[CCode (cheader_filename = "retro-memory-type.h")]
+public enum Retro.MemoryType {
+       SAVE_RAM,
+       RTC,
+       SYSTEM_RAM,
+       VIDEO_RAM,
+}
+
 [CCode (cheader_filename = "retro-pixel-format.h")]
 public enum Retro.PixelFormat {
        XRGB1555,


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