Commit a5798a496e17ef0b54188404021cda08c4415fb6
1 parent
660c53c1
Exists in
master
and in
1 other branch
Adjustments in the action objects.
Showing
3 changed files
with
10 additions
and
8 deletions
Show diff stats
src/include/v3270/actions.h
@@ -136,8 +136,9 @@ | @@ -136,8 +136,9 @@ | ||
136 | } properties; | 136 | } properties; |
137 | 137 | ||
138 | struct { | 138 | struct { |
139 | - const GVariantType * type; ///> @brief State type. | ||
140 | - } state; | 139 | + const GVariantType * state; ///> @brief State type. |
140 | + const GVariantType * parameter; ///> @brief State type. | ||
141 | + } type; | ||
141 | 142 | ||
142 | void (*change_widget)(GAction *action, GtkWidget *from, GtkWidget *to); | 143 | void (*change_widget)(GAction *action, GtkWidget *from, GtkWidget *to); |
143 | 144 |
src/terminal/actions/action.c
@@ -84,7 +84,8 @@ | @@ -84,7 +84,8 @@ | ||
84 | klass->get_enabled = get_enabled; | 84 | klass->get_enabled = get_enabled; |
85 | klass->get_state = get_state; | 85 | klass->get_state = get_state; |
86 | 86 | ||
87 | - klass->state.type = NULL; | 87 | + klass->type.state = NULL; |
88 | + klass->type.parameter = NULL; | ||
88 | 89 | ||
89 | object_class->finalize = finalize; | 90 | object_class->finalize = finalize; |
90 | object_class->get_property = get_property; | 91 | object_class->get_property = get_property; |
@@ -280,7 +281,7 @@ | @@ -280,7 +281,7 @@ | ||
280 | 281 | ||
281 | g_idle_add((GSourceFunc) bg_notify_enabled, G_OBJECT(action)); | 282 | g_idle_add((GSourceFunc) bg_notify_enabled, G_OBJECT(action)); |
282 | 283 | ||
283 | - if(V3270_ACTION_GET_CLASS(action)->state.type) | 284 | + if(V3270_ACTION_GET_CLASS(action)->type.state) |
284 | g_idle_add((GSourceFunc) bg_notify_state, G_OBJECT(action)); | 285 | g_idle_add((GSourceFunc) bg_notify_state, G_OBJECT(action)); |
285 | 286 | ||
286 | } | 287 | } |
@@ -417,12 +418,12 @@ | @@ -417,12 +418,12 @@ | ||
417 | 418 | ||
418 | } | 419 | } |
419 | 420 | ||
420 | - const GVariantType * iface_get_parameter_type(GAction G_GNUC_UNUSED(*action)) { | ||
421 | - return NULL; | 421 | + const GVariantType * iface_get_parameter_type(GAction *object) { |
422 | + return V3270_ACTION_GET_CLASS(object)->type.parameter; | ||
422 | } | 423 | } |
423 | 424 | ||
424 | const GVariantType * iface_get_state_type(GAction *object) { | 425 | const GVariantType * iface_get_state_type(GAction *object) { |
425 | - return V3270_ACTION_GET_CLASS(object)->state.type; | 426 | + return V3270_ACTION_GET_CLASS(object)->type.state; |
426 | } | 427 | } |
427 | 428 | ||
428 | GVariant * iface_get_state_hint(GAction G_GNUC_UNUSED(*object)) { | 429 | GVariant * iface_get_state_hint(GAction G_GNUC_UNUSED(*object)) { |
src/terminal/actions/toggle.c
@@ -110,7 +110,7 @@ | @@ -110,7 +110,7 @@ | ||
110 | void Lib3270ToggleAction_class_init(Lib3270ToggleActionClass *klass) { | 110 | void Lib3270ToggleAction_class_init(Lib3270ToggleActionClass *klass) { |
111 | 111 | ||
112 | klass->parent_class.change_widget = change_widget; | 112 | klass->parent_class.change_widget = change_widget; |
113 | - klass->parent_class.state.type = G_VARIANT_TYPE_BOOLEAN; | 113 | + klass->parent_class.type.state = G_VARIANT_TYPE_BOOLEAN; |
114 | klass->parent_class.get_state = get_state; | 114 | klass->parent_class.get_state = get_state; |
115 | 115 | ||
116 | } | 116 | } |