[retro-gtk/wip/aplazas/expose-options] core: Add option accessors
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/expose-options] core: Add option accessors
- Date: Thu, 18 May 2017 14:35:20 +0000 (UTC)
commit e41fccb2ac8c7eb8be50621d9c646f390bbfb4a0
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 d7d95c9..cc1905b 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -214,7 +214,7 @@ public class Core : Object {
private extern void set_callbacks ();
internal Module module;
- internal Variables variables_interface;
+ internal Options variables_interface;
internal float aspect_ratio;
internal bool overscan;
@@ -385,6 +385,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 void init_input () {
if (input_interface == null)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]