@@ -570,6 +570,113 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentVideoDriver(void);
570
570
*/
571
571
extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme (void );
572
572
573
+ /**
574
+ * An enumeration of various boolean system preferences.
575
+ *
576
+ * Some systems provide a variety of accessibility options that allow users to
577
+ * adapt their environment to various conditions.
578
+ *
579
+ * \since This enum is available since SDL 3.4.0.
580
+ *
581
+ * \sa SDL_GetSystemPreference
582
+ */
583
+ typedef enum SDL_SystemPreference
584
+ {
585
+ SDL_SYSTEM_PREFERENCE_REDUCED_MOTION , /**< Disable smooth graphical transitions */
586
+ SDL_SYSTEM_PREFERENCE_REDUCED_TRANSPARENCY , /**< Reduce usage of semi-transparent objects */
587
+ SDL_SYSTEM_PREFERENCE_HIGH_CONTRAST , /**< Use extreme color differences between different elements of the interface */
588
+ SDL_SYSTEM_PREFERENCE_COLORBLIND , /**< Add shape-based distinction between color-coded elements, for example "0" and "1" on switches */
589
+ SDL_SYSTEM_PREFERENCE_PERSIST_SCROLLBARS , /**< Always show scrollbars, don't hide them after a few seconds of inactivity */
590
+ SDL_SYSTEM_PREFERENCE_SCREEN_READER , /**< A screen reader is currently active */
591
+ } SDL_SystemPreference ;
592
+
593
+ /**
594
+ * Get whether or not a certain system preference was enabled by the user.
595
+ *
596
+ * This setting will emit a `SDL_EVENT_SYSTEM_PREFERENCE_CHANGED` when the user
597
+ * updates the corresponding preference in their settings or accessibility app.
598
+ * Note that some platforms may provide certain settings, but not allow
599
+ * listening to changes; as such, there may be certain preferences that can be
600
+ * fetched but that won't produce events when they are changed.
601
+ *
602
+ * \param preference the preference to be fetched.
603
+ * \returns true if the user enabled the system preference; false if the user
604
+ * disabled that setting, or the setting doesn't exist, or an error
605
+ * occured.
606
+ *
607
+ * \threadsafety This function should only be called on the main thread.
608
+ *
609
+ * \since This function is available since SDL 3.4.0.
610
+ *
611
+ * \sa SDL_SystemPreference
612
+ * \sa SDL_PreferenceEvent
613
+ */
614
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetSystemPreference (SDL_SystemPreference preference );
615
+
616
+ /**
617
+ * Get the system's accent color, as chosen by the user.
618
+ *
619
+ * If the current system does not have an accent color, false is returned and
620
+ * the struct is unaffected.
621
+ *
622
+ * This setting will emit a `SDL_EVENT_SYSTEM_ACCENT_COLOR_CHANGED` when the
623
+ * user updates the corresponding preference in their settings or accessibility
624
+ * app. Note that some platforms may provide certain settings, but not allow
625
+ * listening to changes; as such, there may be certain preferences that can be
626
+ * fetched but that won't produce events when they are changed.
627
+ *
628
+ * \param color a pointer to a struct to be filled with the color info. The
629
+ * alpha channel is what the operating system returned and may or
630
+ * may not be opaque.
631
+ * \returns true on success or false on failure; call SDL_GetError() for more
632
+ * information.
633
+ *
634
+ * \threadsafety This function should only be called on the main thread.
635
+ *
636
+ * \since This function is available since SDL 3.4.0.
637
+ */
638
+ extern SDL_DECLSPEC bool SDLCALL SDL_GetSystemAccentColor (SDL_Color * color );
639
+
640
+ /**
641
+ * Get the scale factor for text, as set by the user for their system. For
642
+ * absolute scaling methods, this presumes a base size of 16 pixels.
643
+ *
644
+ * If the system does not have a setting to scale the font, 1 is returned.
645
+ *
646
+ * This setting will emit a `SDL_EVENT_SYSTEM_TEXT_SCALE_CHANGED` when the user
647
+ * updates the corresponding preference in their settings or accessibility app.
648
+ * Note that some platforms may provide certain settings, but not allow
649
+ * listening to changes; as such, there may be certain preferences that can be
650
+ * fetched but that won't produce events when they are changed.
651
+ *
652
+ * \returns the preferred scale for text; a scale of 1 means no scaling.
653
+ *
654
+ * \threadsafety This function should only be called on the main thread.
655
+ *
656
+ * \since This function is available since SDL 3.4.0.
657
+ */
658
+ extern SDL_DECLSPEC float SDLCALL SDL_GetSystemTextScale (void );
659
+
660
+ /**
661
+ * Get the scale factor for the cursor, as set by the user for their system. For
662
+ * absolute scaling methods, this presumes a base size of 32 pixels.
663
+ *
664
+ * If the system does not have a setting to scale the cursor, 1 is returned.
665
+ *
666
+ * This setting will emit a `SDL_EVENT_SYSTEM_CURSOR_SCALE_CHANGED` when the
667
+ * user updates the corresponding preference in their settings or accessibility
668
+ * app. Note that some platforms may provide certain settings, but not allow
669
+ * listening to changes; as such, there may be certain preferences that can be
670
+ * fetched but that won't produce events when they are changed.
671
+ *
672
+ * \returns the preferred scale for the cursor; a scale of 1 means no scaling.
673
+ *
674
+ * \threadsafety This function should only be called on the main thread.
675
+ *
676
+ * \since This function is available since SDL 3.4.0.
677
+ */
678
+ extern SDL_DECLSPEC float SDLCALL SDL_GetSystemCursorScale (void );
679
+
573
680
/**
574
681
* Get a list of currently connected displays.
575
682
*
0 commit comments