Commit 9ec86260975e927f8f65a9b7228fb2ff9851b51a

Authored by Perry Werneck
1 parent 423b757c

Working on a standard header for properties.

src/core/properties/boolean.c
@@ -44,138 +44,129 @@ @@ -44,138 +44,129 @@
44 44
45 static const LIB3270_INT_PROPERTY properties[] = { 45 static const LIB3270_INT_PROPERTY properties[] = {
46 { 46 {
47 - "ready", // Property name.  
48 - N_( "Is terminal ready" ), // Property description.  
49 - lib3270_is_ready, // Get value.  
50 - NULL // Set value. 47 + .name = "ready", // Property name.
  48 + .description = N_( "Is terminal ready" ), // Property description.
  49 + .get = lib3270_is_ready, // Get value.
  50 + .set = NULL // Set value.
51 }, 51 },
52 52
53 { 53 {
54 - "connected", // Property name.  
55 - N_( "Is terminal connected" ), // Property description.  
56 - lib3270_is_connected, // Get value.  
57 - NULL // Set value. 54 + .name = "connected", // Property name.
  55 + .description = N_( "Is terminal connected" ), // Property description.
  56 + .get = lib3270_is_connected, // Get value.
  57 + .set = NULL // Set value.
58 }, 58 },
59 59
60 { 60 {
61 - "secure", // Property name.  
62 - N_( "Is connection secure" ), // Property description.  
63 - lib3270_is_secure, // Get value.  
64 - NULL // Set value. 61 + .name = "secure", // Property name.
  62 + .description = N_( "Is connection secure" ), // Property description.
  63 + .get = lib3270_is_secure, // Get value.
  64 + .set = NULL // Set value.
65 }, 65 },
66 66
67 { 67 {
68 - "tso", // Property name.  
69 - N_( "Non zero if the host is TSO." ), // Property description.  
70 - lib3270_is_tso, // Get value.  
71 - lib3270_set_tso // Set value. 68 + .name = "tso", // Property name.
  69 + .description = N_( "Non zero if the host is TSO." ), // Property description.
  70 + .get = lib3270_is_tso, // Get value.
  71 + .set = lib3270_set_tso // Set value.
72 }, 72 },
73 73
74 { 74 {
75 - "as400", // Property name.  
76 - N_( "Non zero if the host is AS400." ), // Property description.  
77 - lib3270_is_as400, // Get value.  
78 - lib3270_set_as400 // Set value. 75 + .name = "as400", // Property name.
  76 + .description = N_( "Non zero if the host is AS400." ), // Property description.
  77 + .get = lib3270_is_as400, // Get value.
  78 + .set = lib3270_set_as400 // Set value.
79 }, 79 },
80 80
81 { 81 {
82 - "pconnected", // Property name.  
83 - "", // Property description.  
84 - lib3270_pconnected, // Get value.  
85 - NULL // Set value. 82 + .name = "pconnected", // Property name.
  83 + .description = "", // Property description.
  84 + .get = lib3270_pconnected, // Get value.
  85 + .set = NULL // Set value.
86 }, 86 },
87 87
88 { 88 {
89 - "half_connected", // Property name.  
90 - "", // Property description.  
91 - lib3270_half_connected, // Get value.  
92 - NULL // Set value. 89 + .name = "half_connected", // Property name.
  90 + .description = "", // Property description.
  91 + .get = lib3270_half_connected, // Get value.
  92 + .set = NULL // Set value.
93 }, 93 },
94 94
95 { 95 {
96 - "neither", // Property name.  
97 - "", // Property description.  
98 - lib3270_in_neither, // Get value.  
99 - NULL // Set value. 96 + .name = "neither", // Property name.
  97 + .description = "", // Property description.
  98 + .get = lib3270_in_neither, // Get value.
  99 + .set = NULL // Set value.
100 }, 100 },
101 101
102 { 102 {
103 - "ansi", // Property name.  
104 - "", // Property description.  
105 - lib3270_in_ansi, // Get value.  
106 - NULL // Set value. 103 + .name = "ansi", // Property name.
  104 + .description = "", // Property description.
  105 + .get = lib3270_in_ansi, // Get value.
  106 + .set = NULL // Set value.
107 }, 107 },
108 108
109 { 109 {
110 - "tn3270", // Property name.  
111 - N_( "State is 3270, TN3270e or SSCP" ), // Property description.  
112 - lib3270_in_3270, // Get value.  
113 - NULL // Set value. 110 + .name = "tn3270", // Property name.
  111 + .description = N_( "State is 3270, TN3270e or SSCP" ), // Property description.
  112 + .get = lib3270_in_3270, // Get value.
  113 + .set = NULL // Set value.
114 }, 114 },
115 115
116 { 116 {
117 - "sscp", // Property name.  
118 - "", // Property description.  
119 - lib3270_in_sscp, // Get value.  
120 - NULL // Set value. 117 + .name = "sscp", // Property name.
  118 + .description = "", // Property description.
  119 + .get = lib3270_in_sscp, // Get value.
  120 + .set = NULL // Set value.
121 }, 121 },
122 122
123 { 123 {
124 - "tn3270e", // Property name.  
125 - "", // Property description.  
126 - lib3270_in_tn3270e, // Get value.  
127 - NULL // Set value. 124 + .name = "tn3270e", // Property name.
  125 + .description = "", // Property description.
  126 + .get = lib3270_in_tn3270e, // Get value.
  127 + .set = NULL // Set value.
128 }, 128 },
129 129
130 { 130 {
131 - "e", // Property name.  
132 - N_( "Is terminal in the INITIAL_E state?" ), // Property description.  
133 - lib3270_in_e, // Get value.  
134 - NULL // Set value. 131 + .name = "e", // Property name.
  132 + .description = N_( "Is terminal in the INITIAL_E state?" ), // Property description.
  133 + .get = lib3270_in_e, // Get value.
  134 + .set = NULL // Set value.
135 }, 135 },
136 136
137 { 137 {
138 - "has_selection", // Property name.  
139 - N_( "Has selected area" ), // Property description.  
140 - lib3270_has_selection, // Get value.  
141 - NULL // Set value. 138 + .name = "has_selection", // Property name.
  139 + .description = N_( "Has selected area" ), // Property description.
  140 + .get = lib3270_has_selection, // Get value.
  141 + .set = NULL // Set value.
142 }, 142 },
143 143
144 { 144 {
145 - "starting", // Property name.  
146 - N_( "Is starting (no first screen)?" ), // Property description.  
147 - lib3270_is_starting, // Get value.  
148 - NULL // Set value. 145 + .name = "starting", // Property name.
  146 + .description = N_( "Is starting (no first screen)?" ), // Property description.
  147 + .get = lib3270_is_starting, // Get value.
  148 + .set = NULL // Set value.
149 }, 149 },
150 150
151 { 151 {
152 - "formatted", // Property name.  
153 - N_( "Formatted screen" ), // Property description.  
154 - lib3270_is_formatted, // Get value.  
155 - NULL // Set value. 152 + .name = "formatted", // Property name.
  153 + .description = N_( "Formatted screen" ), // Property description.
  154 + .get = lib3270_is_formatted, // Get value.
  155 + .set = NULL // Set value.
156 }, 156 },
157 157
158 { 158 {
159 - "oerrlock", // Property name.  
160 - N_( "Lock keyboard on operator error" ), // Property description.  
161 - lib3270_get_lock_on_operator_error, // Get value.  
162 - lib3270_set_lock_on_operator_error // Set value. 159 + .name = "oerrlock", // Property name.
  160 + .description = N_( "Lock keyboard on operator error" ), // Property description.
  161 + .get = lib3270_get_lock_on_operator_error, // Get value.
  162 + .set = lib3270_set_lock_on_operator_error // Set value.
163 }, 163 },
164 164
165 - /*  
166 { 165 {
167 - "", // Property name.  
168 - "", // Property description.  
169 - NULL, // Get value.  
170 - NULL // Set value.  
171 - },  
172 - */  
173 -  
174 - {  
175 - NULL,  
176 - NULL,  
177 - NULL,  
178 - NULL 166 + .name = NULL,
  167 + .description = NULL,
  168 + .get = NULL,
  169 + .set = NULL
179 } 170 }
180 171
181 }; 172 };
src/core/properties/signed.c
@@ -55,54 +55,45 @@ @@ -55,54 +55,45 @@
55 static const LIB3270_INT_PROPERTY properties[] = { 55 static const LIB3270_INT_PROPERTY properties[] = {
56 56
57 { 57 {
58 - "model_number", // Property name.  
59 - N_( "The model number" ), // Property description.  
60 - lib3270_get_model_number, // Get value.  
61 - NULL // Set value. 58 + .name = "model_number", // Property name.
  59 + .description = N_( "The model number" ), // Property description.
  60 + .get = lib3270_get_model_number, // Get value.
  61 + .set = NULL // Set value.
62 }, 62 },
63 63
64 { 64 {
65 - "color_type", // Property name.  
66 - N_( "The color type" ), // Property description.  
67 - lib3270_get_color_type, // Get value.  
68 - lib3270_set_color_type // Set value. 65 + .name = "color_type", // Property name.
  66 + .description = N_( "The color type" ), // Property description.
  67 + .get = lib3270_get_color_type, // Get value.
  68 + .set = lib3270_set_color_type // Set value.
69 }, 69 },
70 70
71 { 71 {
72 - "cstate", // Property name.  
73 - N_( "Connection state" ), // Property description.  
74 - lib3270_get_connection_state_as_int, // Get value.  
75 - NULL // Set value. 72 + .name = "cstate", // Property name.
  73 + .description = N_( "Connection state" ), // Property description.
  74 + .get = lib3270_get_connection_state_as_int, // Get value.
  75 + .set = NULL // Set value.
76 }, 76 },
77 77
78 { 78 {
79 - "program_message", // Property name.  
80 - N_( "Latest program message" ), // Property description.  
81 - lib3270_get_program_message_as_int, // Get value.  
82 - NULL // Set value. 79 + .name = "program_message", // Property name.
  80 + .description = N_( "Latest program message" ), // Property description.
  81 + .get = lib3270_get_program_message_as_int, // Get value.
  82 + .set = NULL // Set value.
83 }, 83 },
84 84
85 { 85 {
86 - "ssl_state", // Property name.  
87 - N_( "ID of the session security state" ), // Property description.  
88 - lib3270_get_ssl_state_as_int, // Get value.  
89 - NULL // Set value. 86 + .name = "ssl_state", // Property name.
  87 + .description = N_( "ID of the session security state" ), // Property description.
  88 + .get = lib3270_get_ssl_state_as_int, // Get value.
  89 + .set = NULL // Set value.
90 }, 90 },
91 91
92 - /*  
93 { 92 {
94 - "", // Property name.  
95 - "", // Property description.  
96 - NULL, // Get value.  
97 - NULL // Set value.  
98 - },  
99 - */  
100 -  
101 - {  
102 - NULL,  
103 - NULL,  
104 - NULL,  
105 - NULL 93 + .name = NULL,
  94 + .description = NULL,
  95 + .get = NULL,
  96 + .set = NULL
106 } 97 }
107 }; 98 };
108 99
src/core/properties/string.c
@@ -59,124 +59,115 @@ @@ -59,124 +59,115 @@
59 static const LIB3270_STRING_PROPERTY properties[] = { 59 static const LIB3270_STRING_PROPERTY properties[] = {
60 60
61 { 61 {
62 - "luname", // Property name.  
63 - N_( "The name of the active LU" ), // Property description.  
64 - lib3270_get_luname, // Get value.  
65 - lib3270_set_luname // Set value. 62 + .name = "luname", // Property name.
  63 + .description = N_( "The name of the active LU" ), // Property description.
  64 + .get = lib3270_get_luname, // Get value.
  65 + .set = lib3270_set_luname // Set value.
66 }, 66 },
67 67
68 { 68 {
69 - "url", // Property name.  
70 - N_( "URL of the current host" ), // Property description.  
71 - lib3270_get_url, // Get value.  
72 - lib3270_set_url // Set value. 69 + .name = "url", // Property name.
  70 + .description = N_( "URL of the current host" ), // Property description.
  71 + .get = lib3270_get_url, // Get value.
  72 + .set = lib3270_set_url // Set value.
73 }, 73 },
74 74
75 { 75 {
76 - "model", // Property name.  
77 - N_( "Model name" ), // Property description.  
78 - lib3270_get_model, // Get value.  
79 - lib3270_set_model // Set value. 76 + .name = "model", // Property name.
  77 + .description = N_( "Model name" ), // Property description.
  78 + .get = lib3270_get_model, // Get value.
  79 + .set = lib3270_set_model // Set value.
80 }, 80 },
81 81
82 { 82 {
83 - "hosttype", // Property name.  
84 - N_( "Host type name" ), // Property description.  
85 - lib3270_get_host_type_name, // Get value.  
86 - lib3270_set_host_type_by_name // Set value. 83 + .name = "hosttype", // Property name.
  84 + .description = N_( "Host type name" ), // Property description.
  85 + .get = lib3270_get_host_type_name, // Get value.
  86 + .set = lib3270_set_host_type_by_name // Set value.
87 }, 87 },
88 88
89 { 89 {
90 - "termtype", // Property name.  
91 - N_( "Terminal type" ), // Property description.  
92 - lib3270_get_termtype, // Get value.  
93 - NULL // Set value. 90 + .name = "termtype", // Property name.
  91 + .description = N_( "Terminal type" ), // Property description.
  92 + .get = lib3270_get_termtype, // Get value.
  93 + .set = NULL // Set value.
94 }, 94 },
95 95
96 { 96 {
97 - "termname", // Property name.  
98 - N_( "Terminal name" ), // Property description.  
99 - lib3270_get_termname, // Get value.  
100 - NULL // Set value. 97 + .name = "termname", // Property name.
  98 + .description = N_( "Terminal name" ), // Property description.
  99 + .get = lib3270_get_termname, // Get value.
  100 + .set = NULL // Set value.
101 }, 101 },
102 102
103 { 103 {
104 - "host_charset", // Property name.  
105 - N_( "Host charset" ), // Property description.  
106 - lib3270_get_host_charset, // Get value.  
107 - lib3270_set_host_charset // Set value. 104 + .name = "host_charset", // Property name.
  105 + .description = N_( "Host charset" ), // Property description.
  106 + .get = lib3270_get_host_charset, // Get value.
  107 + .set = lib3270_set_host_charset // Set value.
108 }, 108 },
109 109
110 { 110 {
111 - "display_charset", // Property name.  
112 - N_( "Display charset" ), // Property description.  
113 - lib3270_get_display_charset, // Get value.  
114 - NULL // Set value. 111 + .name = "display_charset", // Property name.
  112 + .description = N_( "Display charset" ), // Property description.
  113 + .get = lib3270_get_display_charset, // Get value.
  114 + .set = NULL // Set value.
115 }, 115 },
116 116
117 { 117 {
118 - "version", // Property name.  
119 - N_( "lib3270 version" ), // Property description.  
120 - get_version, // Get value.  
121 - NULL // Set value. 118 + .name = "version", // Property name.
  119 + .description = N_( "lib3270 version" ), // Property description.
  120 + .get = get_version, // Get value.
  121 + .set = NULL // Set value.
122 }, 122 },
123 123
124 { 124 {
125 - "revision", // Property name.  
126 - N_( "lib3270 revision" ), // Property description.  
127 - get_revision, // Get value.  
128 - NULL // Set value. 125 + .name = "revision", // Property name.
  126 + .description = N_( "lib3270 revision" ), // Property description.
  127 + .get = get_revision, // Get value.
  128 + .set = NULL // Set value.
129 }, 129 },
130 130
131 { 131 {
132 - "crlpath", // Property name.  
133 - N_( "URL for the certificate revocation list" ), // Property description.  
134 - lib3270_get_crl_url, // Get value.  
135 - lib3270_set_crl_url, // Set value. 132 + .name = "crlpath", // Property name.
  133 + .description = N_( "URL for the certificate revocation list" ), // Property description.
  134 + .get = lib3270_get_crl_url, // Get value.
  135 + .set = lib3270_set_crl_url, // Set value.
136 }, 136 },
137 137
138 { 138 {
139 - "default_host", // Property name.  
140 - N_( "Default host URL" ), // Property description.  
141 - lib3270_get_default_host, // Get value.  
142 - NULL // Set value. 139 + .name = "default_host", // Property name.
  140 + .description = N_( "Default host URL" ), // Property description.
  141 + .get = lib3270_get_default_host, // Get value.
  142 + .set = NULL // Set value.
143 }, 143 },
144 144
145 { 145 {
146 - "sslmessage", // Property name.  
147 - N_( "The security state" ), // Property description.  
148 - lib3270_get_ssl_state_message, // Get value.  
149 - NULL // Set value. 146 + .name = "sslmessage", // Property name.
  147 + .description = N_( "The security state" ), // Property description.
  148 + .get = lib3270_get_ssl_state_message, // Get value.
  149 + .set = NULL // Set value.
150 }, 150 },
151 151
152 { 152 {
153 - "ssldescription", // Property name.  
154 - N_( "Description of the current security state" ), // Property description.  
155 - lib3270_get_ssl_state_description, // Get value.  
156 - NULL // Set value. 153 + .name = "ssldescription", // Property name.
  154 + .description = N_( "Description of the current security state" ), // Property description.
  155 + .get = lib3270_get_ssl_state_description, // Get value.
  156 + .set = NULL // Set value.
157 }, 157 },
158 158
159 { 159 {
160 - "oversize", // Property name.  
161 - N_( "Screen oversize if larger than the chosen model"), // Property description.  
162 - lib3270_get_oversize, // Get value.  
163 - lib3270_set_oversize // Set value. 160 + .name = "oversize", // Property name.
  161 + .description = N_( "Screen oversize if larger than the chosen model"), // Property description.
  162 + .get = lib3270_get_oversize, // Get value.
  163 + .set = lib3270_set_oversize // Set value.
164 }, 164 },
165 165
166 - /*  
167 { 166 {
168 - "", // Property name.  
169 - "", // Property description.  
170 - , // Get value.  
171 - NULL // Set value.  
172 - },  
173 - */  
174 -  
175 - {  
176 - NULL,  
177 - NULL,  
178 - NULL,  
179 - NULL 167 + .name = NULL,
  168 + .description = NULL,
  169 + .get = NULL,
  170 + .set = NULL
180 } 171 }
181 172
182 }; 173 };
src/core/properties/unsigned.c
@@ -45,75 +45,66 @@ @@ -45,75 +45,66 @@
45 static const LIB3270_UINT_PROPERTY properties[] = { 45 static const LIB3270_UINT_PROPERTY properties[] = {
46 46
47 { 47 {
48 - "cursor_address", // Property name.  
49 - N_( "Cursor address" ), // Property description.  
50 - lib3270_get_cursor_address, // Get value.  
51 - lib3270_set_cursor_address // Set value. 48 + .name = "cursor_address", // Property name.
  49 + .description = N_( "Cursor address" ), // Property description.
  50 + .get = lib3270_get_cursor_address, // Get value.
  51 + .set = lib3270_set_cursor_address // Set value.
52 }, 52 },
53 53
54 { 54 {
55 - "width", // Property name.  
56 - N_( "Current screen width in columns" ), // Property description.  
57 - lib3270_get_width, // Get value.  
58 - NULL // Set value. 55 + .name = "width", // Property name.
  56 + .description = N_( "Current screen width in columns" ), // Property description.
  57 + .get = lib3270_get_width, // Get value.
  58 + .set = NULL // Set value.
59 }, 59 },
60 60
61 { 61 {
62 - "height", // Property name.  
63 - N_( "Current screen height in rows" ), // Property description.  
64 - lib3270_get_height, // Get value.  
65 - NULL // Set value. 62 + .name = "height", // Property name.
  63 + .description = N_( "Current screen height in rows" ), // Property description.
  64 + .get = lib3270_get_height, // Get value.
  65 + .set = NULL // Set value.
66 }, 66 },
67 67
68 { 68 {
69 - "max_width", // Property name.  
70 - N_( "Maximum screen width in columns" ), // Property description.  
71 - lib3270_get_max_width, // Get value.  
72 - NULL // Set value. 69 + .name = "max_width", // Property name.
  70 + .description = N_( "Maximum screen width in columns" ), // Property description.
  71 + .get = lib3270_get_max_width, // Get value.
  72 + .set = NULL // Set value.
73 }, 73 },
74 74
75 { 75 {
76 - "max_height", // Property name.  
77 - N_( "Maximum screen height in rows" ), // Property description.  
78 - lib3270_get_max_height, // Get value.  
79 - NULL // Set value. 76 + .name = "max_height", // Property name.
  77 + .description = N_( "Maximum screen height in rows" ), // Property description.
  78 + .get = lib3270_get_max_height, // Get value.
  79 + .set = NULL // Set value.
80 }, 80 },
81 81
82 { 82 {
83 - "length", // Property name.  
84 - N_( "Screen buffer length in bytes" ), // Property description.  
85 - lib3270_get_length, // Get value.  
86 - NULL // Set value. 83 + .name = "length", // Property name.
  84 + .description = N_( "Screen buffer length in bytes" ), // Property description.
  85 + .get = lib3270_get_length, // Get value.
  86 + .set = NULL // Set value.
87 }, 87 },
88 88
89 { 89 {
90 - "unlock_delay", // Property name.  
91 - N_( "The delay between the host unlocking the keyboard and the actual unlock" ), // Property description.  
92 - lib3270_get_unlock_delay, // Get value.  
93 - lib3270_set_unlock_delay // Set value. 90 + .name = "unlock_delay", // Property name.
  91 + .description = N_( "The delay between the host unlocking the keyboard and the actual unlock" ), // Property description.
  92 + .get = lib3270_get_unlock_delay, // Get value.
  93 + .set = lib3270_set_unlock_delay // Set value.
94 }, 94 },
95 95
96 { 96 {
97 - "kybdlock", // Property name.  
98 - N_( "Keyboard lock status" ), // Property description.  
99 - lib3270_get_kybdlock_as_int, // Get value.  
100 - NULL // Set value. 97 + .name = "kybdlock", // Property name.
  98 + .description = N_( "Keyboard lock status" ), // Property description.
  99 + .get = lib3270_get_kybdlock_as_int, // Get value.
  100 + .set = NULL // Set value.
101 }, 101 },
102 102
103 - /*  
104 { 103 {
105 - "", // Property name.  
106 - "", // Property description.  
107 - NULL, // Get value.  
108 - NULL // Set value.  
109 - },  
110 - */  
111 -  
112 - {  
113 - NULL,  
114 - NULL,  
115 - NULL,  
116 - NULL 104 + .name = NULL,
  105 + .description = NULL,
  106 + .get = NULL,
  107 + .set = NULL
117 } 108 }
118 }; 109 };
119 110
src/core/toggles/table.c
@@ -43,285 +43,287 @@ @@ -43,285 +43,287 @@
43 const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] = 43 const LIB3270_TOGGLE_ENTRY toggle_descriptor[LIB3270_TOGGLE_COUNT+1] =
44 { 44 {
45 { 45 {
46 - LIB3270_TOGGLE_MONOCASE,  
47 - "monocase",  
48 - False,  
49 - NULL, // Default keycode  
50 - NULL, // Icon name  
51 - N_( "Monocase" ),  
52 - N_( "Uppercase only" ),  
53 - N_( "If set, the terminal operates in uppercase-only mode" ) 46 + .id = LIB3270_TOGGLE_MONOCASE,
  47 + .name = "monocase",
  48 + .def = False,
  49 + .key = NULL, // Default keycode
  50 + .icon = NULL, // Icon name
  51 + .label = N_( "Monocase" ),
  52 + .summary = N_( "Uppercase only" ),
  53 + .description = N_( "If set, the terminal operates in uppercase-only mode" )
54 }, 54 },
  55 +
55 { 56 {
56 - LIB3270_TOGGLE_CURSOR_BLINK,  
57 - "cursorblink",  
58 - True,  
59 - NULL, // Default keycode  
60 - NULL, // Icon name  
61 - N_( "Blinking Cursor" ),  
62 - N_( "Blinking Cursor" ),  
63 - N_( "If set, the cursor blinks" ) 57 + .id = LIB3270_TOGGLE_CURSOR_BLINK,
  58 + .name = "cursorblink",
  59 + .def = True,
  60 + .key = NULL, // Default keycode
  61 + .icon = NULL, // Icon name
  62 + .label = N_( "Blinking Cursor" ),
  63 + .summary = N_( "Blinking Cursor" ),
  64 + .description = N_( "If set, the cursor blinks" )
64 }, 65 },
65 { 66 {
66 - LIB3270_TOGGLE_SHOW_TIMING,  
67 - "showtiming",  
68 - True,  
69 - NULL, // Default keycode  
70 - NULL, // Icon name  
71 - N_( "Show timer when processing" ),  
72 - N_( "Show timer when processing" ),  
73 - N_( "If set, the time taken by the host to process an AID is displayed on the status line" ) 67 + .id = LIB3270_TOGGLE_SHOW_TIMING,
  68 + .name = "showtiming",
  69 + .def = True,
  70 + .key = NULL, // Default keycode
  71 + .icon = NULL, // Icon name
  72 + .label = N_( "Show timer when processing" ),
  73 + .summary = N_( "Show timer when processing" ),
  74 + .description = N_( "If set, the time taken by the host to process an AID is displayed on the status line" )
74 }, 75 },
75 { 76 {
76 - LIB3270_TOGGLE_CURSOR_POS,  
77 - "cursorpos",  
78 - True,  
79 - NULL, // Default keycode  
80 - NULL, // Icon name  
81 - N_( "Track Cursor" ),  
82 - N_( "Track Cursor" ),  
83 - N_( "Display the cursor location in the OIA (the status line)" ) 77 + .id = LIB3270_TOGGLE_CURSOR_POS,
  78 + .name = "cursorpos",
  79 + .def = True,
  80 + .key = NULL, // Default keycode
  81 + .icon = NULL, // Icon name
  82 + .label = N_( "Track Cursor" ),
  83 + .summary = N_( "Track Cursor" ),
  84 + .description = N_( "Display the cursor location in the OIA (the status line)" )
84 }, 85 },
85 { 86 {
86 - LIB3270_TOGGLE_DS_TRACE,  
87 - "dstrace",  
88 - False,  
89 - NULL, // Default keycode  
90 - NULL, // Icon name  
91 - N_( "Data Stream" ),  
92 - N_( "Trace Data Stream" ),  
93 - "" 87 + .id = LIB3270_TOGGLE_DS_TRACE,
  88 + .name = "dstrace",
  89 + .def = False,
  90 + .key = NULL, // Default keycode
  91 + .icon = NULL, // Icon name
  92 + .label = N_( "Data Stream" ),
  93 + .summary = N_( "Trace Data Stream" ),
  94 + .description = ""
94 }, 95 },
95 { 96 {
96 - LIB3270_TOGGLE_LINE_WRAP,  
97 - "linewrap",  
98 - False,  
99 - NULL, // Default keycode  
100 - NULL, // Icon name  
101 - N_("Wrap around"),  
102 - N_("Wrap around"),  
103 - N_("If set, the NVT terminal emulator automatically assumes a NEWLINE character when it reaches the end of a line.") 97 + .id = LIB3270_TOGGLE_LINE_WRAP,
  98 + .name = "linewrap",
  99 + .def = False,
  100 + .key = NULL, // Default keycode
  101 + .icon = NULL, // Icon name
  102 + .label = N_("Wrap around"),
  103 + .summary = N_("Wrap around"),
  104 + .description = N_("If set, the NVT terminal emulator automatically assumes a NEWLINE character when it reaches the end of a line.")
104 }, 105 },
105 { 106 {
106 - LIB3270_TOGGLE_BLANK_FILL,  
107 - "blankfill",  
108 - False,  
109 - NULL, // Default keycode  
110 - NULL, // Icon name  
111 - N_( "Blank Fill" ),  
112 - N_( "Blank Fill" ),  
113 - N_( "Automatically convert trailing blanks in a field to NULLs in order to insert a character, and will automatically convert leading NULLs to blanks so that input data is not squeezed to the left" ) 107 + .id = LIB3270_TOGGLE_BLANK_FILL,
  108 + .name = "blankfill",
  109 + .def = False,
  110 + .key = NULL, // Default keycode
  111 + .icon = NULL, // Icon name
  112 + .label = N_( "Blank Fill" ),
  113 + .summary = N_( "Blank Fill" ),
  114 + .description = N_( "Automatically convert trailing blanks in a field to NULLs in order to insert a character, and will automatically convert leading NULLs to blanks so that input data is not squeezed to the left" )
114 }, 115 },
115 { 116 {
116 - LIB3270_TOGGLE_SCREEN_TRACE,  
117 - "screentrace",  
118 - False,  
119 - NULL, // Default keycode  
120 - NULL, // Icon name  
121 - N_( "Screens" ),  
122 - N_( "Trace screen contents" ),  
123 - "" 117 + .id = LIB3270_TOGGLE_SCREEN_TRACE,
  118 + .name = "screentrace",
  119 + .def = False,
  120 + .key = NULL, // Default keycode
  121 + .icon = NULL, // Icon name
  122 + .label = N_( "Screens" ),
  123 + .summary = N_( "Trace screen contents" ),
  124 + .description = ""
124 }, 125 },
125 { 126 {
126 - LIB3270_TOGGLE_EVENT_TRACE,  
127 - "eventtrace",  
128 - False,  
129 - NULL, // Default keycode  
130 - NULL, // Icon name  
131 - N_( "Events" ),  
132 - N_( "Trace interface and application events" ),  
133 - "" 127 + .id = LIB3270_TOGGLE_EVENT_TRACE,
  128 + .name = "eventtrace",
  129 + .def = False,
  130 + .key = NULL, // Default keycode
  131 + .icon = NULL, // Icon name
  132 + .label = N_( "Events" ),
  133 + .summary = N_( "Trace interface and application events" ),
  134 + .description = ""
134 }, 135 },
135 { 136 {
136 - LIB3270_TOGGLE_MARGINED_PASTE,  
137 - "marginedpaste",  
138 - False,  
139 - NULL, // Default keycode  
140 - NULL, // Icon name  
141 - N_( "Paste with left margin" ),  
142 - N_( "Paste with left margin" ),  
143 - N_( "If set, puts restrictions on how pasted text is placed on the screen. The position of the cursor at the time the paste operation is begun is used as a left margin. No pasted text will fill any area of the screen to the left of that position. This option is useful for pasting into certain IBM editors that use the left side of the screen for control information" ) 137 + .id = LIB3270_TOGGLE_MARGINED_PASTE,
  138 + .name = "marginedpaste",
  139 + .def = False,
  140 + .key = NULL, // Default keycode
  141 + .icon = NULL, // Icon name
  142 + .label = N_( "Paste with left margin" ),
  143 + .summary = N_( "Paste with left margin" ),
  144 + .description = N_( "If set, puts restrictions on how pasted text is placed on the screen. The position of the cursor at the time the paste operation is begun is used as a left margin. No pasted text will fill any area of the screen to the left of that position. This option is useful for pasting into certain IBM editors that use the left side of the screen for control information" )
144 }, 145 },
145 { 146 {
146 - LIB3270_TOGGLE_RECTANGLE_SELECT,  
147 - "rectselect",  
148 - False,  
149 - NULL, // Default keycode  
150 - NULL, // Icon name  
151 - N_( "Select by rectangles" ),  
152 - N_( "Select by rectangles" ),  
153 - N_( "If set, the terminal will always select rectangular areas of the screen. Otherwise, it selects continuous regions of the screen" ) 147 + .id = LIB3270_TOGGLE_RECTANGLE_SELECT,
  148 + .name = "rectselect",
  149 + .def = False,
  150 + .key = NULL, // Default keycode
  151 + .icon = NULL, // Icon name
  152 + .label = N_( "Select by rectangles" ),
  153 + .summary = N_( "Select by rectangles" ),
  154 + .description = N_( "If set, the terminal will always select rectangular areas of the screen. Otherwise, it selects continuous regions of the screen" )
154 }, 155 },
155 { 156 {
156 - LIB3270_TOGGLE_CROSSHAIR,  
157 - "crosshair",  
158 - False,  
159 - "<alt>x", // Default keycode  
160 - NULL, // Icon name  
161 - N_( "Cross hair cursor" ),  
162 - N_( "Cross hair cursor" ),  
163 - N_( "If set, the terminal will display a crosshair over the cursor: lines extending the full width and height of the screen, centered over the cursor position. This makes locating the cursor on the screen much easier" ) 157 + .id = LIB3270_TOGGLE_CROSSHAIR,
  158 + .name = "crosshair",
  159 + .def = False,
  160 + .key = "<alt>x", // Default keycode
  161 + .icon = NULL, // Icon name
  162 + .label = N_( "Cross hair cursor" ),
  163 + .summary = N_( "Cross hair cursor" ),
  164 + .description = N_( "If set, the terminal will display a crosshair over the cursor: lines extending the full width and height of the screen, centered over the cursor position. This makes locating the cursor on the screen much easier" )
164 }, 165 },
165 { 166 {
166 - LIB3270_TOGGLE_FULL_SCREEN,  
167 - "fullscreen",  
168 - False,  
169 - "<alt>Home", // Default keycode  
170 - NULL, // Icon name  
171 - N_( "Full Screen" ),  
172 - N_( "Full Screen" ),  
173 - N_( "If set, asks to place the toplevel window in the fullscreen state" ) 167 + .id = LIB3270_TOGGLE_FULL_SCREEN,
  168 + .name = "fullscreen",
  169 + .def = False,
  170 + .key = "<alt>Home", // Default keycode
  171 + .icon = NULL, // Icon name
  172 + .label = N_( "Full Screen" ),
  173 + .summary = N_( "Full Screen" ),
  174 + .description = N_( "If set, asks to place the toplevel window in the fullscreen state" )
174 }, 175 },
175 { 176 {
176 - LIB3270_TOGGLE_RECONNECT,  
177 - "reconnect",  
178 - False,  
179 - NULL, // Default keycode  
180 - NULL, // Icon name  
181 - N_( "Auto-Reconnect" ),  
182 - N_( "Auto-Reconnect" ),  
183 - N_( "Automatically reconnect to the host if it ever disconnects" ) 177 + .id = LIB3270_TOGGLE_RECONNECT,
  178 + .name = "reconnect",
  179 + .def = False,
  180 + .key = NULL, // Default keycode
  181 + .icon = NULL, // Icon name
  182 + .label = N_( "Auto-Reconnect" ),
  183 + .summary = N_( "Auto-Reconnect" ),
  184 + .description = N_( "Automatically reconnect to the host if it ever disconnects" )
184 }, 185 },
185 { 186 {
186 - LIB3270_TOGGLE_INSERT,  
187 - "insert",  
188 - False,  
189 - "Insert", // Default keycode  
190 - "insert-text", // Icon name  
191 - N_( "Insert" ),  
192 - N_( "Set insert mode" ),  
193 - "" 187 + .id = LIB3270_TOGGLE_INSERT,
  188 + .name = "insert",
  189 + .def = False,
  190 + .key = "Insert", // Default keycode
  191 + .icon = "insert-text", // Icon name
  192 + .label = N_( "Insert" ),
  193 + .summary = N_( "Set insert mode" ),
  194 + .description = ""
194 }, 195 },
195 { 196 {
196 - LIB3270_TOGGLE_SMART_PASTE,  
197 - "smartpaste",  
198 - False,  
199 - NULL, // Default keycode  
200 - NULL, // Icon name  
201 - N_( "Smart paste" ),  
202 - N_( "Smart paste" ),  
203 - "" 197 + .id = LIB3270_TOGGLE_SMART_PASTE,
  198 + .name = "smartpaste",
  199 + .def = False,
  200 + .key = NULL, // Default keycode
  201 + .icon = NULL, // Icon name
  202 + .label = N_( "Smart paste" ),
  203 + .summary = N_( "Smart paste" ),
  204 + .description = ""
204 }, 205 },
205 { 206 {
206 - LIB3270_TOGGLE_BOLD,  
207 - "bold",  
208 - False,  
209 - NULL, // Default keycode  
210 - "format-text-bold", // Icon name  
211 - N_( "Bold" ),  
212 - N_( "Bold" ),  
213 - "" 207 + .id = LIB3270_TOGGLE_BOLD,
  208 + .name = "bold",
  209 + .def = False,
  210 + .key = NULL, // Default keycode
  211 + .icon = "format-text-bold", // Icon name
  212 + .label = N_( "Bold" ),
  213 + .summary = N_( "Bold" ),
  214 + .description = ""
214 }, 215 },
215 { 216 {
216 - LIB3270_TOGGLE_KEEP_SELECTED,  
217 - "keepselected",  
218 - False,  
219 - NULL, // Default keycode  
220 - NULL, // Icon name  
221 - N_( "Keep selected" ),  
222 - N_( "Keep selected" ),  
223 - "" 217 + .id = LIB3270_TOGGLE_KEEP_SELECTED,
  218 + .name = "keepselected",
  219 + .def = False,
  220 + .key = NULL, // Default keycode
  221 + .icon = NULL, // Icon name
  222 + .label = N_( "Keep selected" ),
  223 + .summary = N_( "Keep selected" ),
  224 + .description = ""
224 }, 225 },
225 { 226 {
226 - LIB3270_TOGGLE_UNDERLINE,  
227 - "underline",  
228 - True,  
229 - NULL, // Default keycode  
230 - "format-text-underline", // Icon name  
231 - N_( "Underline" ),  
232 - N_( "Show Underline" ),  
233 - "" 227 + .id = LIB3270_TOGGLE_UNDERLINE,
  228 + .name = "underline",
  229 + .def = True,
  230 + .key = NULL, // Default keycode
  231 + .icon = "format-text-underline", // Icon name
  232 + .label = N_( "Underline" ),
  233 + .summary = N_( "Show Underline" ),
  234 + .description = ""
234 }, 235 },
235 { 236 {
236 - LIB3270_TOGGLE_CONNECT_ON_STARTUP,  
237 - "autoconnect",  
238 - False,  
239 - NULL, // Default keycode  
240 - NULL, // Icon name  
241 - N_( "Auto connect" ),  
242 - N_( "Connect on startup" ),  
243 - "" 237 + .id = LIB3270_TOGGLE_CONNECT_ON_STARTUP,
  238 + .name = "autoconnect",
  239 + .def = False,
  240 + .key = NULL, // Default keycode
  241 + .icon = NULL, // Icon name
  242 + .label = N_( "Auto connect" ),
  243 + .summary = N_( "Connect on startup" ),
  244 + .description = ""
244 }, 245 },
245 { 246 {
246 - LIB3270_TOGGLE_KP_ALTERNATIVE,  
247 - "kpalternative",  
248 - False,  
249 - NULL, // Default keycode  
250 - NULL, // Icon name  
251 - N_( "Use +/- for field navigation" ),  
252 - N_( "Use +/- for field navigation" ),  
253 - N_( "Use the keys +/- from keypad to select editable fields" ) 247 + .id = LIB3270_TOGGLE_KP_ALTERNATIVE,
  248 + .name = "kpalternative",
  249 + .def = False,
  250 + .key = NULL, // Default keycode
  251 + .icon = NULL, // Icon name
  252 + .label = N_( "Use +/- for field navigation" ),
  253 + .summary = N_( "Use +/- for field navigation" ),
  254 + .description = N_( "Use the keys +/- from keypad to select editable fields" )
254 }, 255 },
255 { 256 {
256 - LIB3270_TOGGLE_BEEP,  
257 - "beep",  
258 - True,  
259 - NULL, // Default keycode  
260 - NULL, // Icon name  
261 - N_( "Sound" ),  
262 - N_( "Alert sound" ),  
263 - N_( "Beep on errors" ) 257 + .id = LIB3270_TOGGLE_BEEP,
  258 + .name = "beep",
  259 + .def = True,
  260 + .key = NULL, // Default keycode
  261 + .icon = NULL, // Icon name
  262 + .label = N_( "Sound" ),
  263 + .summary = N_( "Alert sound" ),
  264 + .description = N_( "Beep on errors" )
264 }, 265 },
265 { 266 {
266 - LIB3270_TOGGLE_VIEW_FIELD,  
267 - "fieldattr",  
268 - False,  
269 - NULL, // Default keycode  
270 - NULL, // Icon name  
271 - N_( "Show Field" ),  
272 - N_( "Show Field attributes" ),  
273 - "" 267 + .id = LIB3270_TOGGLE_VIEW_FIELD,
  268 + .name = "fieldattr",
  269 + .def = False,
  270 + .key = NULL, // Default keycode
  271 + .icon = NULL, // Icon name
  272 + .label = N_( "Show Field" ),
  273 + .summary = N_( "Show Field attributes" ),
  274 + .description = ""
274 }, 275 },
275 { 276 {
276 - LIB3270_TOGGLE_ALTSCREEN,  
277 - "altscreen",  
278 - True,  
279 - NULL, // Default keycode  
280 - NULL, // Icon name  
281 - N_( "Alternate screen" ),  
282 - N_( "Resize on alternate screen" ),  
283 - N_( "Auto resize on altscreen" ) 277 + .id = LIB3270_TOGGLE_ALTSCREEN,
  278 + .name = "altscreen",
  279 + .def = True,
  280 + .key = NULL, // Default keycode
  281 + .icon = NULL, // Icon name
  282 + .label = N_( "Alternate screen" ),
  283 + .summary = N_( "Resize on alternate screen" ),
  284 + .description = N_( "Auto resize on altscreen" )
284 }, 285 },
285 { 286 {
286 - LIB3270_TOGGLE_KEEP_ALIVE,  
287 - "keepalive",  
288 - True,  
289 - NULL, // Default keycode  
290 - NULL, // Icon name  
291 - N_( "Network keep alive" ),  
292 - N_( "Network keep alive" ),  
293 - N_( "Enable network keep-alive with SO_KEEPALIVE" ) 287 + .id = LIB3270_TOGGLE_KEEP_ALIVE,
  288 + .name = "keepalive",
  289 + .def = True,
  290 + .key = NULL, // Default keycode
  291 + .icon = NULL, // Icon name
  292 + .label = N_( "Network keep alive" ),
  293 + .summary = N_( "Network keep alive" ),
  294 + .description = N_( "Enable network keep-alive with SO_KEEPALIVE" )
294 }, 295 },
295 { 296 {
296 - LIB3270_TOGGLE_NETWORK_TRACE,  
297 - "nettrace",  
298 - False,  
299 - NULL, // Default keycode  
300 - NULL, // Icon name  
301 - N_( "Network data" ),  
302 - N_( "Trace network data flow" ),  
303 - N_( "Enable network in/out trace" ) 297 + .id = LIB3270_TOGGLE_NETWORK_TRACE,
  298 + .name = "nettrace",
  299 + .def = False,
  300 + .key = NULL, // Default keycode
  301 + .icon = NULL, // Icon name
  302 + .label = N_( "Network data" ),
  303 + .summary = N_( "Trace network data flow" ),
  304 + .description = N_( "Enable network in/out trace" )
304 }, 305 },
305 { 306 {
306 - LIB3270_TOGGLE_SSL_TRACE,  
307 - "ssltrace",  
308 - False,  
309 - NULL, // Default keycode  
310 - NULL, // Icon name  
311 - N_( "SSL negotiation" ),  
312 - N_( "Trace SSL negotiation" ),  
313 - N_( "Enable security negotiation trace" ) 307 + .id = LIB3270_TOGGLE_SSL_TRACE,
  308 + .name = "ssltrace",
  309 + .def = False,
  310 + .key = NULL, // Default keycode
  311 + .icon = NULL, // Icon name
  312 + .label = N_( "SSL negotiation" ),
  313 + .summary = N_( "Trace SSL negotiation" ),
  314 + .description = N_( "Enable security negotiation trace" )
314 }, 315 },
315 316
316 { 317 {
317 - LIB3270_TOGGLE_COUNT,  
318 - NULL,  
319 - 0,  
320 - NULL,  
321 - NULL,  
322 - NULL,  
323 - NULL,  
324 - NULL 318 + .id = LIB3270_TOGGLE_COUNT,
  319 + .name = NULL,
  320 + .def = False,
  321 + .key = NULL, // Default keycode
  322 + .icon = NULL, // Icon name
  323 + .label = NULL,
  324 + .summary = NULL,
  325 + .description = NULL
  326 +
325 } 327 }
326 328
327 }; 329 };
src/include/lib3270.h
@@ -135,43 +135,6 @@ @@ -135,43 +135,6 @@
135 135
136 } LIB3270_ATTR; 136 } LIB3270_ATTR;
137 137
138 - /**  
139 - * @brief Toogles.  
140 - */  
141 - typedef enum _lib3270_toggle  
142 - {  
143 - LIB3270_TOGGLE_MONOCASE,  
144 - LIB3270_TOGGLE_CURSOR_BLINK,  
145 - LIB3270_TOGGLE_SHOW_TIMING,  
146 - LIB3270_TOGGLE_CURSOR_POS,  
147 - LIB3270_TOGGLE_DS_TRACE,  
148 - LIB3270_TOGGLE_LINE_WRAP,  
149 - LIB3270_TOGGLE_BLANK_FILL,  
150 - LIB3270_TOGGLE_SCREEN_TRACE,  
151 - LIB3270_TOGGLE_EVENT_TRACE,  
152 - LIB3270_TOGGLE_MARGINED_PASTE,  
153 - LIB3270_TOGGLE_RECTANGLE_SELECT,  
154 - LIB3270_TOGGLE_CROSSHAIR,  
155 - LIB3270_TOGGLE_FULL_SCREEN,  
156 - LIB3270_TOGGLE_RECONNECT,  
157 - LIB3270_TOGGLE_INSERT,  
158 - LIB3270_TOGGLE_SMART_PASTE,  
159 - LIB3270_TOGGLE_BOLD,  
160 - LIB3270_TOGGLE_KEEP_SELECTED,  
161 - LIB3270_TOGGLE_UNDERLINE, /**< @brief Show underline ? */  
162 - LIB3270_TOGGLE_CONNECT_ON_STARTUP,  
163 - LIB3270_TOGGLE_KP_ALTERNATIVE, /**< @brief Keypad +/- move to next/previous field */  
164 - LIB3270_TOGGLE_BEEP, /**< @brief Beep on errors */  
165 - LIB3270_TOGGLE_VIEW_FIELD, /**< @brief View Field attribute */  
166 - LIB3270_TOGGLE_ALTSCREEN, /**< @brief auto resize on altscreen */  
167 - LIB3270_TOGGLE_KEEP_ALIVE, /**< @brief Enable network keep-alive with SO_KEEPALIVE */  
168 - LIB3270_TOGGLE_NETWORK_TRACE, /**< @brief Enable network in/out trace */  
169 - LIB3270_TOGGLE_SSL_TRACE, /**< @brief Enable security traces */  
170 -  
171 - LIB3270_TOGGLE_COUNT  
172 -  
173 - } LIB3270_TOGGLE;  
174 -  
175 typedef enum _lib3270_direction 138 typedef enum _lib3270_direction
176 { 139 {
177 LIB3270_DIR_UP, 140 LIB3270_DIR_UP,
@@ -186,23 +149,6 @@ @@ -186,23 +149,6 @@
186 } LIB3270_DIRECTION; 149 } LIB3270_DIRECTION;
187 150
188 /** 151 /**
189 - * @brief Toggle types.  
190 - *  
191 - */  
192 - typedef enum _LIB3270_TOGGLE_TYPE  
193 - {  
194 - LIB3270_TOGGLE_TYPE_INITIAL,  
195 - LIB3270_TOGGLE_TYPE_INTERACTIVE,  
196 - LIB3270_TOGGLE_TYPE_ACTION,  
197 - LIB3270_TOGGLE_TYPE_FINAL,  
198 - LIB3270_TOGGLE_TYPE_UPDATE,  
199 -  
200 - LIB3270_TOGGLE_TYPE_USER  
201 -  
202 - } LIB3270_TOGGLE_TYPE;  
203 -  
204 -  
205 - /**  
206 * @brief OIA Status indicators. 152 * @brief OIA Status indicators.
207 * 153 *
208 */ 154 */
@@ -396,6 +342,19 @@ @@ -396,6 +342,19 @@
396 #endif 342 #endif
397 343
398 /** 344 /**
  345 + * @brief Head for property descriptors.
  346 + *
  347 + */
  348 + #define LIB3270_PROPERTY_HEAD \
  349 + const char * name; \
  350 + const char * summary; \
  351 + const char * description;
  352 +
  353 + typedef struct _lib3270_property {
  354 + LIB3270_PROPERTY_HEAD
  355 + } LIB3270_PROPERTY;
  356 +
  357 + /**
399 * @brief State change IDs. 358 * @brief State change IDs.
400 * 359 *
401 */ 360 */
src/include/lib3270/properties.h
@@ -38,14 +38,16 @@ @@ -38,14 +38,16 @@
38 38
39 #define LIB3270_PROPERTIES_H_INCLUDED 39 #define LIB3270_PROPERTIES_H_INCLUDED
40 40
  41 + #include <lib3270.h>
  42 +
41 #ifdef __cplusplus 43 #ifdef __cplusplus
42 extern "C" { 44 extern "C" {
43 #endif 45 #endif
44 46
45 typedef struct _lib3270_int_property 47 typedef struct _lib3270_int_property
46 { 48 {
47 - const char * name; ///< @brief Property name.  
48 - const char * description; ///< @brief Property description. 49 + LIB3270_PROPERTY_HEAD
  50 +
49 int (*get)(const H3270 *hSession); ///< @brief Get value. 51 int (*get)(const H3270 *hSession); ///< @brief Get value.
50 int (*set)(H3270 *hSession, int value); ///< @brief Set value. 52 int (*set)(H3270 *hSession, int value); ///< @brief Set value.
51 53
@@ -53,8 +55,8 @@ @@ -53,8 +55,8 @@
53 55
54 typedef struct _lib3270_uint_property 56 typedef struct _lib3270_uint_property
55 { 57 {
56 - const char * name; ///< @brief Property name.  
57 - const char * description; ///< @brief Property description. 58 + LIB3270_PROPERTY_HEAD
  59 +
58 unsigned int (*get)(const H3270 *hSession); ///< @brief Get value. 60 unsigned int (*get)(const H3270 *hSession); ///< @brief Get value.
59 int (*set)(H3270 *hSession, unsigned int value); ///< @brief Set value. 61 int (*set)(H3270 *hSession, unsigned int value); ///< @brief Set value.
60 62
@@ -62,8 +64,8 @@ @@ -62,8 +64,8 @@
62 64
63 typedef struct _lib3270_string_property 65 typedef struct _lib3270_string_property
64 { 66 {
65 - const char * name; ///< @brief Property name.  
66 - const char * description; ///< @brief Property description. 67 + LIB3270_PROPERTY_HEAD
  68 +
67 const char * (*get)(const H3270 *hSession); ///< @brief Get value. 69 const char * (*get)(const H3270 *hSession); ///< @brief Get value.
68 int (*set)(H3270 *hSession, const char * value); ///< @brief Set value. 70 int (*set)(H3270 *hSession, const char * value); ///< @brief Set value.
69 71
src/include/lib3270/session.h
@@ -44,6 +44,7 @@ @@ -44,6 +44,7 @@
44 #endif // HAVE_LIBSSL 44 #endif // HAVE_LIBSSL
45 45
46 #include <lib3270/popup.h> 46 #include <lib3270/popup.h>
  47 + #include <lib3270/toggle.h>
47 48
48 struct lib3270_session_callbacks 49 struct lib3270_session_callbacks
49 { 50 {
src/include/lib3270/toggle.h
@@ -37,16 +37,70 @@ @@ -37,16 +37,70 @@
37 extern "C" { 37 extern "C" {
38 #endif 38 #endif
39 39
  40 + /**
  41 + * @brief Toogles.
  42 + */
  43 + typedef enum _lib3270_toggle
  44 + {
  45 + LIB3270_TOGGLE_MONOCASE,
  46 + LIB3270_TOGGLE_CURSOR_BLINK,
  47 + LIB3270_TOGGLE_SHOW_TIMING,
  48 + LIB3270_TOGGLE_CURSOR_POS,
  49 + LIB3270_TOGGLE_DS_TRACE,
  50 + LIB3270_TOGGLE_LINE_WRAP,
  51 + LIB3270_TOGGLE_BLANK_FILL,
  52 + LIB3270_TOGGLE_SCREEN_TRACE,
  53 + LIB3270_TOGGLE_EVENT_TRACE,
  54 + LIB3270_TOGGLE_MARGINED_PASTE,
  55 + LIB3270_TOGGLE_RECTANGLE_SELECT,
  56 + LIB3270_TOGGLE_CROSSHAIR,
  57 + LIB3270_TOGGLE_FULL_SCREEN,
  58 + LIB3270_TOGGLE_RECONNECT,
  59 + LIB3270_TOGGLE_INSERT,
  60 + LIB3270_TOGGLE_SMART_PASTE,
  61 + LIB3270_TOGGLE_BOLD,
  62 + LIB3270_TOGGLE_KEEP_SELECTED,
  63 + LIB3270_TOGGLE_UNDERLINE, /**< @brief Show underline ? */
  64 + LIB3270_TOGGLE_CONNECT_ON_STARTUP,
  65 + LIB3270_TOGGLE_KP_ALTERNATIVE, /**< @brief Keypad +/- move to next/previous field */
  66 + LIB3270_TOGGLE_BEEP, /**< @brief Beep on errors */
  67 + LIB3270_TOGGLE_VIEW_FIELD, /**< @brief View Field attribute */
  68 + LIB3270_TOGGLE_ALTSCREEN, /**< @brief auto resize on altscreen */
  69 + LIB3270_TOGGLE_KEEP_ALIVE, /**< @brief Enable network keep-alive with SO_KEEPALIVE */
  70 + LIB3270_TOGGLE_NETWORK_TRACE, /**< @brief Enable network in/out trace */
  71 + LIB3270_TOGGLE_SSL_TRACE, /**< @brief Enable security traces */
  72 +
  73 + LIB3270_TOGGLE_COUNT
  74 +
  75 + } LIB3270_TOGGLE;
  76 +
  77 + /**
  78 + * @brief Toggle types.
  79 + *
  80 + */
  81 + typedef enum _LIB3270_TOGGLE_TYPE
  82 + {
  83 + LIB3270_TOGGLE_TYPE_INITIAL,
  84 + LIB3270_TOGGLE_TYPE_INTERACTIVE,
  85 + LIB3270_TOGGLE_TYPE_ACTION,
  86 + LIB3270_TOGGLE_TYPE_FINAL,
  87 + LIB3270_TOGGLE_TYPE_UPDATE,
  88 +
  89 + LIB3270_TOGGLE_TYPE_USER
  90 +
  91 + } LIB3270_TOGGLE_TYPE;
  92 +
  93 +
40 typedef struct _lib3270_toggle_entry 94 typedef struct _lib3270_toggle_entry
41 { 95 {
  96 + LIB3270_PROPERTY_HEAD
  97 +
42 LIB3270_TOGGLE id; ///< @brief Toggle ID. 98 LIB3270_TOGGLE id; ///< @brief Toggle ID.
43 - const char * name; ///< @brief Toggle name.  
44 const char def; ///< @brief Default value. 99 const char def; ///< @brief Default value.
45 const char * key; ///< @brief Default key (or NULL if no default). 100 const char * key; ///< @brief Default key (or NULL if no default).
46 const char * icon; ///< @brief Icon name (from https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html) 101 const char * icon; ///< @brief Icon name (from https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html)
47 const char * label; ///< @brief Button label (or NULL). 102 const char * label; ///< @brief Button label (or NULL).
48 - const char * summary; ///< @brief Short description (or NULL).  
49 - const char * description; ///< @brief Toggle description. 103 +
50 } LIB3270_TOGGLE_ENTRY; 104 } LIB3270_TOGGLE_ENTRY;
51 105
52 /** 106 /**