[gnome-games/wip/exalm/ds: 57/63] retro-runner: Add init and deinit signals



commit 22e98f0b16a09e84764976de5135b3716cd279da
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Jan 6 20:39:02 2019 +0500

    retro-runner: Add init and deinit signals
    
    Provide a way for plugins to perform actions when the game starts or ends.

 src/retro/retro-runner.vala | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index d218ce8b..48038082 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -1,6 +1,9 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 public class Games.RetroRunner : Object, Runner {
+       public signal void game_init ();
+       public signal void game_deinit ();
+
        public bool can_fullscreen {
                get { return true; }
        }
@@ -202,6 +205,8 @@ public class Games.RetroRunner : Object, Runner {
 
                settings.changed["video-filter"].disconnect (on_video_filter_changed);
 
+               game_deinit ();
+
                core = null;
                view.set_core (null);
                view = null;
@@ -244,6 +249,8 @@ public class Games.RetroRunner : Object, Runner {
                                }
                        });
 
+               game_init ();
+
                var platforms_dir = Application.get_platforms_dir ();
                var platform_id = platform.get_id ();
                core.system_directory = @"$platforms_dir/$platform_id/system";


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