[gnome-games] runner: Add preview_current_state()



commit 993a000ecab493a78c58e86aa9419819b9e257ad
Author: Yetizone <andreii lisita gmail com>
Date:   Thu Aug 8 13:01:07 2019 +0300

    runner: Add preview_current_state()

 src/command/command-runner.vala | 3 +++
 src/core/runner.vala            | 1 +
 src/dummy/dummy-runner.vala     | 3 +++
 src/retro/retro-runner.vala     | 4 ++++
 4 files changed, 11 insertions(+)
---
diff --git a/src/command/command-runner.vala b/src/command/command-runner.vala
index cbd7a84c..3fb10edf 100644
--- a/src/command/command-runner.vala
+++ b/src/command/command-runner.vala
@@ -56,6 +56,9 @@ public class Games.CommandRunner : Object, Runner {
        public void capture_current_state_pixbuf () {
        }
 
+       public void preview_current_state () {
+       }
+
        public void start () throws Error {
                string? working_directory = null;
                string[]? envp = null;
diff --git a/src/core/runner.vala b/src/core/runner.vala
index 4504ab2a..b704d3a4 100644
--- a/src/core/runner.vala
+++ b/src/core/runner.vala
@@ -20,6 +20,7 @@ public interface Games.Runner : Object {
        public abstract void stop ();
 
        public abstract void capture_current_state_pixbuf ();
+       public abstract void preview_current_state ();
 
        public abstract bool try_create_savestate (bool is_automatic);
        public abstract void load_savestate (Savestate savestate) throws Error;
diff --git a/src/dummy/dummy-runner.vala b/src/dummy/dummy-runner.vala
index bcc106f1..6565820e 100644
--- a/src/dummy/dummy-runner.vala
+++ b/src/dummy/dummy-runner.vala
@@ -43,6 +43,9 @@ private class Games.DummyRunner : Object, Runner {
        public void capture_current_state_pixbuf () {
        }
 
+       public void preview_current_state () {
+       }
+
        public void start () throws Error {
        }
 
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 72b6e3d7..6801a884 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -154,6 +154,10 @@ public class Games.RetroRunner : Object, Runner {
                current_state_pixbuf = view.get_pixbuf ();
        }
 
+       public void preview_current_state () {
+               view.set_pixbuf (current_state_pixbuf);
+       }
+
        public virtual Gtk.Widget? get_extra_widget () {
                return null;
        }


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