diff options
-rw-r--r-- | doc/reference/vte-sections.txt | 2 | ||||
-rw-r--r-- | src/vte/vteenums.h | 21 | ||||
-rw-r--r-- | src/vte/vteglobals.h | 4 | ||||
-rw-r--r-- | src/vtegtk.cc | 30 |
4 files changed, 56 insertions, 1 deletions
diff --git a/doc/reference/vte-sections.txt b/doc/reference/vte-sections.txt index c402b447..28c1c958 100644 --- a/doc/reference/vte-sections.txt +++ b/doc/reference/vte-sections.txt @@ -95,8 +95,10 @@ vte_terminal_event_check_regex_array vte_terminal_event_check_regex_simple <SUBSECTION> +VteFeatureFlags vte_get_user_shell vte_get_features +vte_get_feature_flags vte_get_encodings vte_get_encoding_supported diff --git a/src/vte/vteenums.h b/src/vte/vteenums.h index 84d07a0d..fac22520 100644 --- a/src/vte/vteenums.h +++ b/src/vte/vteenums.h @@ -167,7 +167,7 @@ typedef enum { * @VTE_FORMAT_TEXT: Export as plain text * @VTE_FORMAT_HTML: Export as HTML formatted text * - * An enumeratio type that can be used to specify the format the selection + * An enumeration type that can be used to specify the format the selection * should be copied to the clipboard in. * * Since: 0.50 @@ -177,6 +177,25 @@ typedef enum { VTE_FORMAT_HTML = 2 } VteFormat; +/** + * VteFeatureFlags: + * @VTE_FEATURE_FLAG_BIDI: whether VTE was built with bidirectional text support + * @VTE_FEATURE_FLAG_ICU: whether VTE was built with ICU support + * @VTE_FEATURE_FLAG_SYSTEMD: whether VTE was built with systemd support + * @VTE_FEATURE_FLAG_SIXEL: whether VTE was built with SIXEL support + * + * An enumeration type for features. + * + * Since: 0.62 + */ +typedef enum /*< skip >*/ { + VTE_FEATURE_FLAG_BIDI = 1ULL << 0, + VTE_FEATURE_FLAG_ICU = 1ULL << 1, + VTE_FEATURE_FLAG_SYSTEMD = 1ULL << 2, + VTE_FEATURE_FLAG_SIXEL = 1ULL << 3, + VTE_FEATURE_FLAGS_MASK = 0xFFFFFFFFFFFFFFFFULL, /* force enum to 64 bit */ +} VteFeatureFlags; + G_END_DECLS #endif /* __VTE_VTE_ENUMS_H__ */ diff --git a/src/vte/vteglobals.h b/src/vte/vteglobals.h index 34b44bfb..cf7957b5 100644 --- a/src/vte/vteglobals.h +++ b/src/vte/vteglobals.h @@ -22,6 +22,7 @@ #include <glib.h> #include "vtemacros.h" +#include "vteenums.h" G_BEGIN_DECLS @@ -31,6 +32,9 @@ char *vte_get_user_shell(void) _VTE_CXX_NOEXCEPT; _VTE_PUBLIC const char *vte_get_features (void) _VTE_CXX_NOEXCEPT; +_VTE_PUBLIC +VteFeatureFlags vte_get_feature_flags(void) _VTE_CXX_NOEXCEPT; + #define VTE_TEST_FLAGS_NONE (G_GUINT64_CONSTANT(0)) #define VTE_TEST_FLAGS_ALL (~G_GUINT64_CONSTANT(0)) diff --git a/src/vtegtk.cc b/src/vtegtk.cc index 2ce55a26..5fcae132 100644 --- a/src/vtegtk.cc +++ b/src/vtegtk.cc @@ -2084,6 +2084,36 @@ vte_get_features (void) noexcept } /** + * vte_get_feature_flags: + * + * Gets features VTE was compiled with. + * + * Returns: (transfer none): flags from #VteFeatureFlags + * + * Since: 0.62 + */ +VteFeatureFlags +vte_get_feature_flags(void) noexcept +{ + return VteFeatureFlags(0ULL | +#ifdef WITH_FRIBIDI + VTE_FEATURE_FLAG_BIDI | +#endif +#ifdef WITH_ICU + VTE_FEATURE_FLAG_ICU | +#endif +#ifdef WITH_SIXEL + VTE_FEATURE_FLAG_SIXEL | +#endif +#ifdef __linux__ +#ifdef WITH_SYSTEMD + VTE_FEATURE_FLAG_SYSTEMD | +#endif +#endif // __linux__ + 0ULL); +} + +/** * vte_get_major_version: * * Returns the major version of the VTE library at runtime. |