[retro-gtk] retro-core: Add 'iterated' signal
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] retro-core: Add 'iterated' signal
- Date: Thu, 30 Jan 2020 09:29:18 +0000 (UTC)
commit 86c2c85dfbcb673f9cea29539f2e9f86facd8864
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue Jan 21 03:28:38 2020 +0500
retro-core: Add 'iterated' signal
This will be used by RetroPaPlayer in the following commits.
retro-gtk/retro-core.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
---
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index 4fca029..6282295 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -47,6 +47,7 @@ static GParamSpec *properties [N_PROPS];
enum {
SIG_VIDEO_OUTPUT_SIGNAL,
SIG_AUDIO_OUTPUT_SIGNAL,
+ SIG_ITERATED_SIGNAL,
SIG_LOG_SIGNAL,
SIG_SHUTDOWN_SIGNAL,
SIG_MESSAGE_SIGNAL,
@@ -521,6 +522,13 @@ retro_core_class_init (RetroCoreClass *klass)
G_TYPE_ULONG,
G_TYPE_DOUBLE);
+ signals[SIG_ITERATED_SIGNAL] =
+ g_signal_new ("iterated", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ NULL,
+ G_TYPE_NONE,
+ 0);
+
/**
* RetroCore::log:
* @self: the #RetroCore
@@ -1661,6 +1669,8 @@ retro_core_run (RetroCore *self)
run ();
retro_core_pop_cb_data ();
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
@@ -1678,6 +1688,8 @@ retro_core_run (RetroCore *self)
g_critical ("Couldn't run ahead: serialization not supported.");
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
@@ -1696,6 +1708,8 @@ retro_core_run (RetroCore *self)
G_GSIZE_FORMAT", expected %"G_GSIZE_FORMAT" or less.",
new_size, size);
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
@@ -1712,6 +1726,8 @@ retro_core_run (RetroCore *self)
g_free (data);
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
@@ -1729,6 +1745,8 @@ retro_core_run (RetroCore *self)
g_free (data);
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
@@ -1737,15 +1755,21 @@ retro_core_run (RetroCore *self)
success = unserialize ((guint8 *) data, size);
retro_core_pop_cb_data ();
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
if (!success) {
g_critical ("Couldn't run ahead: deserialization unexpectedly failed.");
g_free (data);
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
+
return;
}
g_free (data);
+
+ g_signal_emit (self, signals[SIG_ITERATED_SIGNAL], 0);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]