Commit 790b2f4e31b1d78a653fd512e822ef8430b35c31
1 parent
27318e57
Exists in
master
and in
4 other branches
Refactoring toggle actions.
Showing
5 changed files
with
31 additions
and
10 deletions
Show diff stats
pw3270.cbp
... | ... | @@ -74,9 +74,6 @@ |
74 | 74 | <Unit filename="src/objects/actions/dialog.c"> |
75 | 75 | <Option compilerVar="CC" /> |
76 | 76 | </Unit> |
77 | - <Unit filename="src/objects/actions/lib3270/action.c"> | |
78 | - <Option compilerVar="CC" /> | |
79 | - </Unit> | |
80 | 77 | <Unit filename="src/objects/actions/lib3270/pakey.c"> |
81 | 78 | <Option compilerVar="CC" /> |
82 | 79 | </Unit> |
... | ... | @@ -96,9 +93,6 @@ |
96 | 93 | <Unit filename="src/objects/actions/simple.c"> |
97 | 94 | <Option compilerVar="CC" /> |
98 | 95 | </Unit> |
99 | - <Unit filename="src/objects/actions/v3270/action.c"> | |
100 | - <Option compilerVar="CC" /> | |
101 | - </Unit> | |
102 | 96 | <Unit filename="src/objects/actions/v3270/conditional.c"> |
103 | 97 | <Option compilerVar="CC" /> |
104 | 98 | </Unit> | ... | ... |
src/objects/actions/lib3270/toggle.c
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | |
126 | 126 | } |
127 | 127 | |
128 | - GAction * pw3270_toggle_action_new_from_lib3270(const LIB3270_TOGGLE * definition) { | |
128 | + GAction * g_action_new_from_toggle(const LIB3270_TOGGLE * definition) { | |
129 | 129 | |
130 | 130 | Lib3270ToggleAction * action = (Lib3270ToggleAction *) g_object_new(PW3270_TYPE_LIB3270_TOGGLE_ACTION, NULL); |
131 | 131 | ... | ... |
src/objects/actions/private.h
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | /* not really I18N-related, but also a string marker macro */ |
52 | 52 | #define I_(string) g_intern_static_string (string) |
53 | 53 | |
54 | - G_GNUC_INTERNAL GAction * pw3270_toggle_action_new_from_lib3270(const LIB3270_TOGGLE * definition); | |
54 | + G_GNUC_INTERNAL GAction * g_action_new_from_toggle(const LIB3270_TOGGLE * definition); | |
55 | 55 | G_GNUC_INTERNAL GAction * pw3270_action_new_pfkey(void); |
56 | 56 | G_GNUC_INTERNAL GAction * pw3270_action_new_pakey(void); |
57 | 57 | ... | ... |
src/objects/actions/window.c
... | ... | @@ -60,12 +60,13 @@ |
60 | 60 | const LIB3270_TOGGLE * toggles = lib3270_get_toggles(); |
61 | 61 | for(ix = 0; toggles[ix].name; ix++) { |
62 | 62 | |
63 | - GAction *action = pw3270_toggle_action_new_from_lib3270(&toggles[ix]); | |
63 | + GAction *action = g_action_new_from_toggle(&toggles[ix]); | |
64 | 64 | g_action_map_add_action(map,action); |
65 | 65 | |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | + /* | |
69 | 70 | // Map V3270 actions |
70 | 71 | { |
71 | 72 | const V3270_ACTION * actions = v3270_get_actions(); |
... | ... | @@ -76,6 +77,7 @@ |
76 | 77 | } |
77 | 78 | |
78 | 79 | } |
80 | + */ | |
79 | 81 | |
80 | 82 | // Map special actions |
81 | 83 | { | ... | ... |
src/objects/window/window.c
... | ... | @@ -167,7 +167,6 @@ |
167 | 167 | |
168 | 168 | } |
169 | 169 | |
170 | - | |
171 | 170 | // |
172 | 171 | // Setup toolbar |
173 | 172 | // |
... | ... | @@ -186,6 +185,32 @@ |
186 | 185 | |
187 | 186 | } |
188 | 187 | |
188 | +/* | |
189 | +#ifdef DEBUG | |
190 | + | |
191 | + { | |
192 | + GAction *actions[] = { | |
193 | + g_action_map_lookup_action(G_ACTION_MAP(widget),"crosshair"), | |
194 | + g_action_map_lookup_action(G_ACTION_MAP(widget),"toolbar") | |
195 | + }; | |
196 | + | |
197 | + size_t ix; | |
198 | + | |
199 | + for(ix = 0; ix < G_N_ELEMENTS(actions);ix++) { | |
200 | + | |
201 | + debug("\n\nAction %u = %p",(unsigned int) ix, actions[ix]); | |
202 | + | |
203 | + debug("Action: %s",g_action_get_name(actions[ix])); | |
204 | + debug("\tState-type:\t\t%s",g_action_get_state_type(actions[ix])); | |
205 | + debug("\tParameter-type:\t%s",g_action_get_parameter_type(actions[ix])); | |
206 | + | |
207 | + } | |
208 | + | |
209 | + } | |
210 | + | |
211 | +#endif // DEBUG | |
212 | +*/ | |
213 | + | |
189 | 214 | } |
190 | 215 | |
191 | 216 | GtkWidget * pw3270_application_window_new(GtkApplication * application) { | ... | ... |