[retro-gtk] Standardize the signal enum names
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] Standardize the signal enum names
- Date: Thu, 22 Oct 2020 15:17:13 +0000 (UTC)
commit ab8b4748573f5d8ae7b932e9b40c0291eac75843
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Oct 22 16:40:48 2020 +0200
Standardize the signal enum names
This standardizes the signal enum names to SIGNAL_* to improve the
readability and the consistency.
Fixes https://gitlab.gnome.org/GNOME/retro-gtk/-/issues/60.
retro-gtk/retro-controller.c | 6 +++---
retro-gtk/retro-core-view.c | 20 ++++++++++----------
retro-gtk/retro-core.c | 32 ++++++++++++++++----------------
retro-gtk/retro-option.c | 6 +++---
retro-runner/retro-core.c | 34 +++++++++++++++++-----------------
5 files changed, 49 insertions(+), 49 deletions(-)
---
diff --git a/retro-gtk/retro-controller.c b/retro-gtk/retro-controller.c
index b6826944..b9e02c90 100644
--- a/retro-gtk/retro-controller.c
+++ b/retro-gtk/retro-controller.c
@@ -12,7 +12,7 @@
G_DEFINE_INTERFACE (RetroController, retro_controller, G_TYPE_OBJECT);
enum {
- SIG_STATE_CHANGED_SIGNAL,
+ SIGNAL_STATE_CHANGED,
N_SIGNALS,
};
@@ -21,7 +21,7 @@ static guint signals[N_SIGNALS];
static void
retro_controller_default_init (RetroControllerInterface *iface)
{
- signals[SIG_STATE_CHANGED_SIGNAL] =
+ signals[SIGNAL_STATE_CHANGED] =
g_signal_new ("state-changed",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_FIRST,
@@ -179,5 +179,5 @@ retro_controller_emit_state_changed (RetroController *self)
{
g_return_if_fail (RETRO_IS_CONTROLLER (self));
- g_signal_emit (self, signals[SIG_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_STATE_CHANGED], 0);
}
diff --git a/retro-gtk/retro-core-view.c b/retro-gtk/retro-core-view.c
index b67cdbdf..0c4e4995 100644
--- a/retro-gtk/retro-core-view.c
+++ b/retro-gtk/retro-core-view.c
@@ -52,7 +52,7 @@ enum {
static GParamSpec *properties [N_PROPS];
enum {
- SIG_CONTROLLER_STATE_CHANGED_SIGNAL,
+ SIGNAL_CONTROLLER_STATE_CHANGED,
N_SIGNALS,
};
@@ -161,7 +161,7 @@ grab (RetroCoreView *self,
recenter_pointer (self);
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
g_object_unref (cursor);
}
@@ -181,7 +181,7 @@ ungrab (RetroCoreView *self)
g_clear_object (&self->grabbed_device);
g_clear_object (&self->grabbed_screen);
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
}
static gboolean get_key_state (RetroCoreView *self,
@@ -205,7 +205,7 @@ key_press_event_cb (GtkWidget *source,
set_input_pressed (self->keyval_state, event->keyval);
if (changed)
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -218,7 +218,7 @@ key_release_event_cb (GtkWidget *source,
set_input_released (self->key_state, event->hardware_keycode);
set_input_released (self->keyval_state, event->keyval);
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -246,7 +246,7 @@ button_press_event_cb (GtkWidget *source,
&self->pointer_y);
}
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -258,7 +258,7 @@ button_release_event_cb (GtkWidget *source,
{
set_input_released (self->mouse_button_state, event->button);
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -274,7 +274,7 @@ focus_out_event_cb (GtkWidget *source,
reset_input (self->key_state);
reset_input (self->mouse_button_state);
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -303,7 +303,7 @@ motion_notify_event_cb (GtkWidget *source,
}
- g_signal_emit (self, signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_CONTROLLER_STATE_CHANGED], 0);
return FALSE;
}
@@ -461,7 +461,7 @@ retro_core_view_class_init (RetroCoreViewClass *klass)
*
* Stability: Private
*/
- signals[SIG_CONTROLLER_STATE_CHANGED_SIGNAL] =
+ signals[SIGNAL_CONTROLLER_STATE_CHANGED] =
g_signal_new ("controller-state-changed",
RETRO_TYPE_CORE_VIEW,
G_SIGNAL_RUN_LAST,
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index e91a5a7a..0e5a1c8c 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -112,11 +112,11 @@ enum {
static GParamSpec *properties [N_PROPS];
enum {
- SIG_VIDEO_OUTPUT_SIGNAL,
- SIG_LOG_SIGNAL,
- SIG_SHUTDOWN_SIGNAL,
- SIG_MESSAGE_SIGNAL,
- SIG_CRASHED_SIGNAL,
+ SIGNAL_VIDEO_OUTPUT,
+ SIGNAL_LOG,
+ SIGNAL_SHUTDOWN,
+ SIGNAL_MESSAGE,
+ SIGNAL_CRASHED,
N_SIGNALS,
};
@@ -497,7 +497,7 @@ retro_core_class_init (RetroCoreClass *klass)
* @pixdata will be invalid after the signal emission, copy it in some way if
* you want to keep it.
*/
- signals[SIG_VIDEO_OUTPUT_SIGNAL] =
+ signals[SIGNAL_VIDEO_OUTPUT] =
g_signal_new ("video-output", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -516,7 +516,7 @@ retro_core_class_init (RetroCoreClass *klass)
*
* The ::log signal is emitted each time the core emits a message to log.
*/
- signals[SIG_LOG_SIGNAL] =
+ signals[SIGNAL_LOG] =
g_signal_new ("log", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -534,7 +534,7 @@ retro_core_class_init (RetroCoreClass *klass)
*
* The core must be released or re-started in order to function anew.
*/
- signals[SIG_SHUTDOWN_SIGNAL] =
+ signals[SIGNAL_SHUTDOWN] =
g_signal_new ("shutdown", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -550,7 +550,7 @@ retro_core_class_init (RetroCoreClass *klass)
* The ::message signal is emitted each time the core emits a message to
* display during a given amount of frames.
*/
- signals[SIG_MESSAGE_SIGNAL] =
+ signals[SIGNAL_MESSAGE] =
g_signal_new ("message", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -566,7 +566,7 @@ retro_core_class_init (RetroCoreClass *klass)
*
* The ::crash signal is emitted when the core crashes.
*/
- signals[SIG_CRASHED_SIGNAL] =
+ signals[SIGNAL_CRASHED] =
g_signal_new ("crashed", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -610,7 +610,7 @@ static void
crash (RetroCore *self,
GError *error)
{
- g_signal_emit (self, signals[SIG_CRASHED_SIGNAL], 0, error->message);
+ g_signal_emit (self, signals[SIGNAL_CRASHED], 0, error->message);
}
static void
@@ -633,9 +633,9 @@ exit_cb (RetroRunnerProcess *process,
RetroCore *self)
{
if (success)
- g_signal_emit (self, signals[SIG_SHUTDOWN_SIGNAL], 0);
+ g_signal_emit (self, signals[SIGNAL_SHUTDOWN], 0);
else
- g_signal_emit (self, signals[SIG_CRASHED_SIGNAL], 0, error);
+ g_signal_emit (self, signals[SIGNAL_CRASHED], 0, error);
}
static gboolean
@@ -932,7 +932,7 @@ video_output_cb (IpcRunner *runner,
retro_pixdata_init (&pixdata, pixels, pixel_format, rowstride,
width, height, aspect_ratio);
- g_signal_emit (self, signals[SIG_VIDEO_OUTPUT_SIGNAL], 0, &pixdata);
+ g_signal_emit (self, signals[SIGNAL_VIDEO_OUTPUT], 0, &pixdata);
retro_framebuffer_unlock (self->framebuffer);
}
@@ -1012,7 +1012,7 @@ message_cb (IpcRunner *runner,
guint frames,
RetroCore *self)
{
- g_signal_emit (self, signals[SIG_MESSAGE_SIGNAL], 0, message, frames);
+ g_signal_emit (self, signals[SIGNAL_MESSAGE], 0, message, frames);
}
static void
@@ -1022,7 +1022,7 @@ log_cb (IpcRunner *runner,
const gchar *message,
RetroCore *self)
{
- g_signal_emit (self, signals[SIG_LOG_SIGNAL], 0, domain, level, message);
+ g_signal_emit (self, signals[SIGNAL_LOG], 0, domain, level, message);
}
static GVariant *
diff --git a/retro-gtk/retro-option.c b/retro-gtk/retro-option.c
index 57c0037e..01b3c36f 100644
--- a/retro-gtk/retro-option.c
+++ b/retro-gtk/retro-option.c
@@ -21,7 +21,7 @@ struct _RetroOption
G_DEFINE_TYPE (RetroOption, retro_option, G_TYPE_OBJECT)
enum {
- SIG_VALUE_CHANGED,
+ SIGNAL_VALUE_CHANGED,
N_SIGNALS,
};
@@ -58,7 +58,7 @@ retro_option_class_init (RetroOptionClass *klass)
object_class->finalize = retro_option_finalize;
- signals[SIG_VALUE_CHANGED] =
+ signals[SIGNAL_VALUE_CHANGED] =
g_signal_new ("value-changed", RETRO_TYPE_OPTION, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
@@ -177,7 +177,7 @@ retro_option_set_value (RetroOption *self,
self->value = i;
- g_signal_emit (self, signals[SIG_VALUE_CHANGED], 0);
+ g_signal_emit (self, signals[SIGNAL_VALUE_CHANGED], 0);
}
RetroOption *
diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c
index 76e32ff8..79a8cf11 100644
--- a/retro-runner/retro-core.c
+++ b/retro-runner/retro-core.c
@@ -45,14 +45,14 @@ enum {
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,
- SIG_VARIABLES_SET_SIGNAL,
- SIG_SET_RUMBLE_STATE_SIGNAL,
+ SIGNAL_VIDEO_OUTPUT,
+ SIGNAL_AUDIO_OUTPUT,
+ SIGNAL_ITERATED,
+ SIGNAL_LOG,
+ SIGNAL_SHUTDOWN,
+ SIGNAL_MESSAGE,
+ SIGNAL_VARIABLES_SET,
+ SIGNAL_SET_RUMBLE_STATE,
N_SIGNALS,
};
@@ -431,7 +431,7 @@ retro_core_class_init (RetroCoreClass *klass)
* The ::video-output signal is emitted each time a new video frame is emitted
* by the core.
*/
- signals[SIG_VIDEO_OUTPUT_SIGNAL] =
+ signals[SIGNAL_VIDEO_OUTPUT] =
g_signal_new ("video-output", RETRO_TYPE_CORE, G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
@@ -448,7 +448,7 @@ retro_core_class_init (RetroCoreClass *klass)
* The ::audio-output signal is emitted each time a new audio frame is emitted
* by the core.
*/
- signals[SIG_AUDIO_OUTPUT_SIGNAL] =
+ signals[SIGNAL_AUDIO_OUTPUT] =
g_signal_new ("audio-output", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -468,7 +468,7 @@ retro_core_class_init (RetroCoreClass *klass)
* internally, ::iterated will be emitted only once, after the perceived
* iteration is completed.
*/
- signals[SIG_ITERATED_SIGNAL] =
+ signals[SIGNAL_ITERATED] =
g_signal_new ("iterated", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -484,7 +484,7 @@ retro_core_class_init (RetroCoreClass *klass)
*
* The ::log signal is emitted each time the core emits a message to log.
*/
- signals[SIG_LOG_SIGNAL] =
+ signals[SIGNAL_LOG] =
g_signal_new ("log", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -502,7 +502,7 @@ retro_core_class_init (RetroCoreClass *klass)
*
* The core must be released or re-started in order to function anew.
*/
- signals[SIG_SHUTDOWN_SIGNAL] =
+ signals[SIGNAL_SHUTDOWN] =
g_signal_new ("shutdown", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -518,7 +518,7 @@ retro_core_class_init (RetroCoreClass *klass)
* The ::message signal is emitted each time the core emits a message to
* display during a given amount of frames.
*/
- signals[SIG_MESSAGE_SIGNAL] =
+ signals[SIGNAL_MESSAGE] =
g_signal_new ("message", RETRO_TYPE_CORE, G_SIGNAL_RUN_LAST,
0, NULL, NULL,
NULL,
@@ -538,7 +538,7 @@ retro_core_class_init (RetroCoreClass *klass)
* @variables will be invalid after the signal emission, copy it in some way
* if you want to keep it.
*/
- signals[SIG_VARIABLES_SET_SIGNAL] =
+ signals[SIGNAL_VARIABLES_SET] =
g_signal_new ("variables-set", RETRO_TYPE_CORE, G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
@@ -556,7 +556,7 @@ retro_core_class_init (RetroCoreClass *klass)
* The ::set-rumble-state signal is emitted when the core requests
* controller on the port @port to set rumble state.
*/
- signals[SIG_SET_RUMBLE_STATE_SIGNAL] =
+ signals[SIGNAL_SET_RUMBLE_STATE] =
g_signal_new ("set-rumble-state", RETRO_TYPE_CORE, G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
@@ -1515,7 +1515,7 @@ static inline void
emit_iterated (RetroCore **self)
{
if (*self)
- g_signal_emit (*self, signals[SIG_ITERATED_SIGNAL], 0);
+ g_signal_emit (*self, signals[SIGNAL_ITERATED], 0);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]