[retro-gtk/wip/aplazas/expose-options: 73/75] core: Add option accessors



commit 568d1c99b702c159642748f25a965a2303b3048b
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu May 18 16:33:22 2017 +0200

    core: Add option accessors
    
    Add the has_option(), get_option_values() and set_option() methods to
    Core, allowing some access the options of the core.

 retro-gtk/core.vala |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/retro-gtk/core.vala b/retro-gtk/core.vala
index e898f2f..1e4c989 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -138,7 +138,7 @@ public class Core : Object {
         */
        public signal bool message (string message, uint frames);
 
-       internal Variables variables_interface;
+       internal Options variables_interface;
 
        internal void *environment_internal;
 
@@ -226,6 +226,18 @@ public class Core : Object {
         */
        public extern void set_memory (MemoryType id, uint8[] data);
 
+       public bool has_option (string key) {
+               return variables_interface.contains (key);
+       }
+
+       public unowned string[] get_option_values (string key) {
+               return variables_interface.lookup_values (key);
+       }
+
+       public void set_option (owned string key, owned string value) {
+               variables_interface.set_option (key, value);
+       }
+
        private extern void init_input ();
        private extern void on_input_controller_connected (uint port, InputDevice device);
        private extern void on_input_controller_disconnected (uint port);


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