diff --git a/src/core/properties/boolean.c b/src/core/properties/boolean.c index 95e7809..471b9e6 100644 --- a/src/core/properties/boolean.c +++ b/src/core/properties/boolean.c @@ -27,6 +27,11 @@ * */ + /** + * @brief Implements the boolean properties. + * + */ + #include #include #include @@ -66,6 +71,7 @@ { .name = "tso", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .description = N_( "Non zero if the host is TSO." ), // Property description. .get = lib3270_is_tso, // Get value. .set = lib3270_set_tso // Set value. @@ -73,6 +79,7 @@ { .name = "as400", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .description = N_( "Non zero if the host is AS400." ), // Property description. .get = lib3270_is_as400, // Get value. .set = lib3270_set_as400 // Set value. diff --git a/src/core/properties/string.c b/src/core/properties/string.c index 25987eb..1b20955 100644 --- a/src/core/properties/string.c +++ b/src/core/properties/string.c @@ -67,46 +67,50 @@ }, { - .name = "url", // Property name. - .icon = "network-server", // Property icon. - .description = N_( "URL of the current host" ), // Property description. - .get = lib3270_get_url, // Get value. - .set = lib3270_set_url // Set value. + .name = "url", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. + .icon = "network-server", // Property icon. + .description = N_( "URL of the current host" ), // Property description. + .get = lib3270_get_url, // Get value. + .set = lib3270_set_url // Set value. }, { - .name = "model", // Property name. - .description = N_( "Model name" ), // Property description. - .get = lib3270_get_model_name, // Get value. - .set = lib3270_set_model_name // Set value. + .name = "model", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. + .description = N_( "Model name" ), // Property description. + .get = lib3270_get_model_name, // Get value. + .set = lib3270_set_model_name // Set value. }, { - .name = "hosttype", // Property name. - .description = N_( "Host type name" ), // Property description. - .get = lib3270_get_host_type_name, // Get value. - .set = lib3270_set_host_type_by_name // Set value. + .name = "hosttype", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. + .description = N_( "Host type name" ), // Property description. + .get = lib3270_get_host_type_name, // Get value. + .set = lib3270_set_host_type_by_name // Set value. }, { - .name = "termtype", // Property name. - .description = N_( "Terminal type" ), // Property description. - .get = lib3270_get_termtype, // Get value. - .set = NULL // Set value. + .name = "termtype", // Property name. + .description = N_( "Terminal type" ), // Property description. + .get = lib3270_get_termtype, // Get value. + .set = NULL // Set value. }, { - .name = "termname", // Property name. - .description = N_( "Terminal name" ), // Property description. - .get = lib3270_get_termname, // Get value. - .set = NULL // Set value. + .name = "termname", // Property name. + .description = N_( "Terminal name" ), // Property description. + .get = lib3270_get_termname, // Get value. + .set = NULL // Set value. }, { - .name = "host_charset", // Property name. - .description = N_( "Host charset" ), // Property description. - .get = lib3270_get_host_charset, // Get value. - .set = lib3270_set_host_charset // Set value. + .name = "host_charset", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. + .description = N_( "Host charset" ), // Property description. + .get = lib3270_get_host_charset, // Get value. + .set = lib3270_set_host_charset // Set value. }, { @@ -132,6 +136,7 @@ { .name = "crlpath", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .description = N_( "URL for the certificate revocation list" ), // Property description. .get = lib3270_get_crl_url, // Get value. .set = lib3270_set_crl_url, // Set value. @@ -139,6 +144,7 @@ { .name = "crlprefer", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .description = N_( "Prefered protocol for CRL" ), // Property description. .get = lib3270_get_crl_prefered_protocol, // Get value. .set = lib3270_set_crl_prefered_protocol, // Set value. @@ -167,6 +173,7 @@ { .name = "oversize", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .description = N_( "Screen oversize if larger than the chosen model"), // Property description. .get = lib3270_get_oversize, // Get value. .set = lib3270_set_oversize // Set value. diff --git a/src/core/properties/unsigned.c b/src/core/properties/unsigned.c index c713ad2..e48dc77 100644 --- a/src/core/properties/unsigned.c +++ b/src/core/properties/unsigned.c @@ -60,14 +60,16 @@ static const LIB3270_UINT_PROPERTY properties[] = { { - .name = "color_type", // Property name. - .description = N_( "The color type" ), // Property description. - .get = lib3270_get_color_type, // Get value. - .set = lib3270_set_color_type // Set value. + .name = "color_type", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. + .description = N_( "The color type" ), // Property description. + .get = lib3270_get_color_type, // Get value. + .set = lib3270_set_color_type // Set value. }, { .name = "model_number", // Property name. + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .icon = "video-display", // Property Icon. .label = N_("Terminal model"), // Property label. .description = N_( "The model number" ), // Property description. @@ -80,6 +82,7 @@ { .name = "cursor_address", // Property name. + .group = LIB3270_ACTION_GROUP_ONLINE, // Property group. .description = N_( "Cursor address" ), // Property description. .get = lib3270_get_cursor_address, // Get value. .set = lib3270_set_cursor_address // Set value. diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 3cca886..b69d6ef 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -359,12 +359,27 @@ #endif + /// @brief Action/property groups. + typedef enum _lib3270_action_group + { + LIB3270_ACTION_GROUP_NONE, ///< @brief Simple action, no signals os special treatment. + LIB3270_ACTION_GROUP_ONLINE, ///< @brief Action requires online state. + LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. + LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. + LIB3270_ACTION_GROUP_LOCK_STATE, ///< @brief Action depends on keyboard lock state. + LIB3270_ACTION_GROUP_FORMATTED, ///< @brief Action depends on a formatted screen. + + LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. + } LIB3270_ACTION_GROUP; + + /** * @brief Head for property descriptors. * */ #define LIB3270_PROPERTY_HEAD \ const char * name; \ + LIB3270_ACTION_GROUP group; \ const char * label; \ const char * icon; \ const char * summary; \ diff --git a/src/include/lib3270/actions.h b/src/include/lib3270/actions.h index 4285dce..c8d8e4e 100644 --- a/src/include/lib3270/actions.h +++ b/src/include/lib3270/actions.h @@ -33,18 +33,6 @@ extern "C" { #endif - typedef enum _lib3270_action_group - { - LIB3270_ACTION_GROUP_NONE, ///< @brief Simple action, no signals os special treatment. - LIB3270_ACTION_GROUP_ONLINE, ///< @brief Action requires online state. - LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. - LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. - LIB3270_ACTION_GROUP_LOCK_STATE, ///< @brief Action depends on keyboard lock state. - LIB3270_ACTION_GROUP_FORMATTED, ///< @brief Action depends on a formatted screen. - - LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. - } LIB3270_ACTION_GROUP; - typedef enum _lib3270_action_type { LIB3270_ACTION_TYPE_GENERIC, ///< @brief Generic action. @@ -61,7 +49,6 @@ { LIB3270_PROPERTY_HEAD - LIB3270_ACTION_GROUP group; ///< @brief Action group. LIB3270_ACTION_TYPE type; ///< @brief Action type. int (*activate)(H3270 *hSession); ///< @brief lib3270 associated method. -- libgit2 0.21.2