From b1eba98b58892bf6edf3358356cc058b94604f35 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 4 Sep 2019 15:53:21 -0300 Subject: [PATCH] Adding method to get the complete toggle descriptions. --- src/core/toggles/table.c | 17 +++++++++++------ src/include/lib3270/toggle.h | 7 +++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/core/toggles/table.c b/src/core/toggles/table.c index 1610e39..8875a6d 100644 --- a/src/core/toggles/table.c +++ b/src/core/toggles/table.c @@ -171,8 +171,8 @@ const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] = { "insert", False, - NULL, // Default keycode - NULL, // Icon name + "Insert", // Default keycode + "insert-text", // Icon name N_( "Insert" ), N_( "Set insert mode" ), "" @@ -189,8 +189,8 @@ const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] = { "bold", False, - NULL, // Default keycode - NULL, // Icon name + NULL, // Default keycode + "format-text-bold", // Icon name N_( "Bold" ), N_( "Bold" ), "" @@ -207,8 +207,8 @@ const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] = { "underline", False, - NULL, // Default keycode - NULL, // Icon name + NULL, // Default keycode + "format-text-underline", // Icon name N_( "Underline" ), N_( "Show Underline" ), "" @@ -298,6 +298,11 @@ const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] = }; +LIB3270_EXPORT const LIB3270_TOGGLE_ENTRY * lib3270_get_toggle_list() +{ + return toggle_descriptor; +} + LIB3270_EXPORT const char * lib3270_get_toggle_summary(LIB3270_TOGGLE ix) { if(ix < LIB3270_TOGGLE_COUNT) diff --git a/src/include/lib3270/toggle.h b/src/include/lib3270/toggle.h index 6daf6a4..7314185 100644 --- a/src/include/lib3270/toggle.h +++ b/src/include/lib3270/toggle.h @@ -48,6 +48,13 @@ const char *description; ///< @brief Toggle description. } LIB3270_TOGGLE_ENTRY; + + /** + * @brief Get the toggle description table. + * + */ + LIB3270_EXPORT const LIB3270_TOGGLE_ENTRY * lib3270_get_toggle_list(); + /** * @brief get toggle state. * -- libgit2 0.21.2