Skip to content
modkitv0.2

preferences.h

#include <modkit/preferences.h>2 functions · 1 structs · 2 enums · 3 typedefs · 1 macros

Versioned system appearance and accessibility preferences.

Functions

mk_get_system_preferencesfunction

mk_result mk_get_system_preferences(mk_system_preferences_t *preferences)

Read the current available system preferences.

ParameterTypeDescription
preferencesmk_system_preferences_t *Initialized destination structure.

Returns MK_SUCCESS or an error result.

mk_system_preferences_initfunction

void mk_system_preferences_init(mk_system_preferences_t *preferences)

Initialize a system-preferences structure.

ParameterTypeDescription
preferencesmk_system_preferences_t *Structure to initialize.

Structs

mk_system_preferencesstruct

Versioned snapshot of platform appearance and accessibility preferences.

FieldTypeDescription
struct_sizeuint32_tStructure size in bytes.
struct_versionuint32_tMK_SYSTEM_PREFERENCES_VERSION.
availableuint32_tORed mk_system_preference_availability bits.
thememk_system_themeRequested appearance theme.
high_contrastboolWhether increased contrast is requested.
reduced_motionboolWhether reduced motion is requested.
reduced_transparencyboolWhether reduced transparency is requested.
accent_colormk_colorPlatform accent color.
text_scalefloatPreferred text scale multiplier.

Enums

mk_system_preference_availabilityenum

Bits indicating which system-preference fields are available.

ValueDescription
MK_SYSTEM_PREFERENCE_THEMEtheme is available.
MK_SYSTEM_PREFERENCE_HIGH_CONTRASThigh_contrast is available.
MK_SYSTEM_PREFERENCE_REDUCED_MOTIONreduced_motion is available.
MK_SYSTEM_PREFERENCE_REDUCED_TRANSPARENCYreduced_transparency is available.
MK_SYSTEM_PREFERENCE_ACCENT_COLORaccent_color is available.
MK_SYSTEM_PREFERENCE_TEXT_SCALEtext_scale is available.

mk_system_themeenum

Operating-system appearance theme.

ValueDescription
MK_SYSTEM_THEME_UNKNOWNThe platform provided no theme signal.
MK_SYSTEM_THEME_LIGHTThe platform requests a light theme.
MK_SYSTEM_THEME_DARKThe platform requests a dark theme.

Typedefs

mk_system_preference_availability_ttypedef

typedef enum mk_system_preference_availability mk_system_preference_availability_t

Bits indicating which system-preference fields are available.

mk_system_preferences_ttypedef

typedef struct mk_system_preferences mk_system_preferences_t

Versioned snapshot of platform appearance and accessibility preferences.

mk_system_themetypedef

typedef enum mk_system_theme mk_system_theme

Operating-system appearance theme.

Macros

MK_SYSTEM_PREFERENCES_VERSIONdefine

MK_SYSTEM_PREFERENCES_VERSION

ABI version for mk_system_preferences_t.