summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dive.h6
-rw-r--r--linux.c5
-rw-r--r--macos.c5
-rw-r--r--windows.c15
4 files changed, 31 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index d88ee1d92..940e5388a 100644
--- a/dive.h
+++ b/dive.h
@@ -437,10 +437,16 @@ const char *monthname(int mon);
#define FIVE_STARS UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR UTF8_BLACKSTAR
extern const char *star_strings[];
+/* enum holding list of OS features */
+typedef enum {
+ UTF8_FONT_WITH_STARS
+} os_feature_t;
+
extern const char *default_filename;
extern const char *existing_filename;
extern const char *subsurface_default_filename(void);
extern const char *subsurface_gettext_domainpath(char *);
+extern gboolean subsurface_os_feature_available(os_feature_t);
extern void subsurface_command_line_init(gint *, gchar ***);
extern void subsurface_command_line_exit(gint *, gchar ***);
#define AIR_PERMILLE 209
diff --git a/linux.c b/linux.c
index c11bc2f0c..b32bde8c1 100644
--- a/linux.c
+++ b/linux.c
@@ -112,3 +112,8 @@ void subsurface_command_line_exit(gint *argc, gchar ***argv)
{
/* this is a no-op */
}
+
+gboolean subsurface_os_feature_available(os_feature_t f)
+{
+ return TRUE;
+}
diff --git a/macos.c b/macos.c
index fb760887f..6727c1053 100644
--- a/macos.c
+++ b/macos.c
@@ -172,3 +172,8 @@ void subsurface_command_line_exit(gint *argc, gchar ***argv)
{
/* this is a no-op */
}
+
+gboolean subsurface_os_feature_available(os_feature_t f)
+{
+ return TRUE;
+}
diff --git a/windows.c b/windows.c
index 1c8cd0a01..2127614bd 100644
--- a/windows.c
+++ b/windows.c
@@ -223,3 +223,18 @@ void subsurface_command_line_exit(gint *argc, gchar ***argv)
g_free((*argv)[i]);
g_free(*argv);
}
+
+/* check if we are running a newer OS version */
+gboolean subsurface_os_feature_available(os_feature_t f)
+{
+ switch (f) {
+ case UTF8_FONT_WITH_STARS:
+ if ((GetVersion() & 0xff) < 6)
+ return FALSE; /* version less than Vista */
+ else
+ return TRUE;
+ break;
+ default:
+ return TRUE;
+ }
+}