From a5798a496e17ef0b54188404021cda08c4415fb6 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 27 Dec 2019 15:27:39 -0300 Subject: [PATCH] Adjustments in the action objects. --- src/include/v3270/actions.h | 5 +++-- src/terminal/actions/action.c | 11 ++++++----- src/terminal/actions/toggle.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/include/v3270/actions.h b/src/include/v3270/actions.h index 13b3685..89a4c40 100644 --- a/src/include/v3270/actions.h +++ b/src/include/v3270/actions.h @@ -136,8 +136,9 @@ } properties; struct { - const GVariantType * type; ///> @brief State type. - } state; + const GVariantType * state; ///> @brief State type. + const GVariantType * parameter; ///> @brief State type. + } type; void (*change_widget)(GAction *action, GtkWidget *from, GtkWidget *to); diff --git a/src/terminal/actions/action.c b/src/terminal/actions/action.c index 454eaa7..f9cf6d2 100644 --- a/src/terminal/actions/action.c +++ b/src/terminal/actions/action.c @@ -84,7 +84,8 @@ klass->get_enabled = get_enabled; klass->get_state = get_state; - klass->state.type = NULL; + klass->type.state = NULL; + klass->type.parameter = NULL; object_class->finalize = finalize; object_class->get_property = get_property; @@ -280,7 +281,7 @@ g_idle_add((GSourceFunc) bg_notify_enabled, G_OBJECT(action)); - if(V3270_ACTION_GET_CLASS(action)->state.type) + if(V3270_ACTION_GET_CLASS(action)->type.state) g_idle_add((GSourceFunc) bg_notify_state, G_OBJECT(action)); } @@ -417,12 +418,12 @@ } - const GVariantType * iface_get_parameter_type(GAction G_GNUC_UNUSED(*action)) { - return NULL; + const GVariantType * iface_get_parameter_type(GAction *object) { + return V3270_ACTION_GET_CLASS(object)->type.parameter; } const GVariantType * iface_get_state_type(GAction *object) { - return V3270_ACTION_GET_CLASS(object)->state.type; + return V3270_ACTION_GET_CLASS(object)->type.state; } GVariant * iface_get_state_hint(GAction G_GNUC_UNUSED(*object)) { diff --git a/src/terminal/actions/toggle.c b/src/terminal/actions/toggle.c index 484d61f..0dedb2e 100644 --- a/src/terminal/actions/toggle.c +++ b/src/terminal/actions/toggle.c @@ -110,7 +110,7 @@ void Lib3270ToggleAction_class_init(Lib3270ToggleActionClass *klass) { klass->parent_class.change_widget = change_widget; - klass->parent_class.state.type = G_VARIANT_TYPE_BOOLEAN; + klass->parent_class.type.state = G_VARIANT_TYPE_BOOLEAN; klass->parent_class.get_state = get_state; } -- libgit2 0.21.2