Commit e53ba7243acb512e974ae125a24a137b9add871c
1 parent
0bf059d7
Exists in
master
and in
2 other branches
Adding 'editable' property.
Showing
3 changed files
with
13 additions
and
0 deletions
Show diff stats
src/core/properties/boolean.c
@@ -55,6 +55,10 @@ LIB3270_EXPORT int lib3270_ssl_get_crl_download(const H3270 *hSession) { | @@ -55,6 +55,10 @@ LIB3270_EXPORT int lib3270_ssl_get_crl_download(const H3270 *hSession) { | ||
55 | return hSession->ssl.download_crl; | 55 | return hSession->ssl.download_crl; |
56 | } | 56 | } |
57 | 57 | ||
58 | +LIB3270_EXPORT int lib3270_is_editable(const H3270 *hSession) { | ||
59 | + return (hSession->pointer & 0x03) == LIB3270_POINTER_UNLOCKED; | ||
60 | +} | ||
61 | + | ||
58 | const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { | 62 | const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { |
59 | 63 | ||
60 | static const LIB3270_INT_PROPERTY properties[] = { | 64 | static const LIB3270_INT_PROPERTY properties[] = { |
@@ -194,6 +198,13 @@ const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { | @@ -194,6 +198,13 @@ const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { | ||
194 | }, | 198 | }, |
195 | 199 | ||
196 | { | 200 | { |
201 | + .name = "editable", // Property name. | ||
202 | + .description = N_( "Non zero if the terminal is editable" ), // Property description. | ||
203 | + .get = lib3270_is_editable, // Get value. | ||
204 | + .set = NULL // Set value. | ||
205 | + }, | ||
206 | + | ||
207 | + { | ||
197 | .name = "crl_download", // Property name. | 208 | .name = "crl_download", // Property name. |
198 | .description = N_( "Non zero if the download of CRL is enabled" ), // Property description. | 209 | .description = N_( "Non zero if the download of CRL is enabled" ), // Property description. |
199 | .get = lib3270_ssl_get_crl_download, // Get value. | 210 | .get = lib3270_ssl_get_crl_download, // Get value. |
src/core/screen.c
@@ -672,6 +672,7 @@ static void status_3270_mode(H3270 *hSession, int GNUC_UNUSED(ignored), void GNU | @@ -672,6 +672,7 @@ static void status_3270_mode(H3270 *hSession, int GNUC_UNUSED(ignored), void GNU | ||
672 | } | 672 | } |
673 | 673 | ||
674 | void mcursor_set(H3270 *hSession,LIB3270_POINTER m) { | 674 | void mcursor_set(H3270 *hSession,LIB3270_POINTER m) { |
675 | + | ||
675 | if(hSession->pointer != ((unsigned short) m)) { | 676 | if(hSession->pointer != ((unsigned short) m)) { |
676 | 677 | ||
677 | // Pointer changed | 678 | // Pointer changed |
src/include/lib3270.h
@@ -994,6 +994,7 @@ LIB3270_EXPORT int lib3270_in_e(const H3270 *h); | @@ -994,6 +994,7 @@ LIB3270_EXPORT int lib3270_in_e(const H3270 *h); | ||
994 | 994 | ||
995 | LIB3270_EXPORT int lib3270_is_ready(const H3270 *h); | 995 | LIB3270_EXPORT int lib3270_is_ready(const H3270 *h); |
996 | LIB3270_EXPORT int lib3270_is_secure(const H3270 *h); | 996 | LIB3270_EXPORT int lib3270_is_secure(const H3270 *h); |
997 | +LIB3270_EXPORT int lib3270_is_editable(const H3270 *h); | ||
997 | 998 | ||
998 | LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_lock_status(const H3270 *h); | 999 | LIB3270_EXPORT LIB3270_MESSAGE lib3270_get_lock_status(const H3270 *h); |
999 | 1000 |