@@ -4259,6 +4259,106 @@ extern "C" {
42594259 */
42604260#define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE "SDL_WINDOWS_ERASE_BACKGROUND_MODE"
42614261
4262+ /** \brief Allows back-button-press events on Windows Phone to be marked as handled
4263+ *
4264+ * Windows Phone devices typically feature a Back button. When pressed,
4265+ * the OS will emit back-button-press events, which apps are expected to
4266+ * handle in an appropriate manner. If apps do not explicitly mark these
4267+ * events as 'Handled', then the OS will invoke its default behavior for
4268+ * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to
4269+ * terminate the app (and attempt to switch to the previous app, or to the
4270+ * device's home screen).
4271+ *
4272+ * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL
4273+ * to mark back-button-press events as Handled, if and when one is sent to
4274+ * the app.
4275+ *
4276+ * Internally, Windows Phone sends back button events as parameters to
4277+ * special back-button-press callback functions. Apps that need to respond
4278+ * to back-button-press events are expected to register one or more
4279+ * callback functions for such, shortly after being launched (during the
4280+ * app's initialization phase). After the back button is pressed, the OS
4281+ * will invoke these callbacks. If the app's callback(s) do not explicitly
4282+ * mark the event as handled by the time they return, or if the app never
4283+ * registers one of these callback, the OS will consider the event
4284+ * un-handled, and it will apply its default back button behavior (terminate
4285+ * the app).
4286+ *
4287+ * SDL registers its own back-button-press callback with the Windows Phone
4288+ * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN
4289+ * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which
4290+ * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON.
4291+ * If the hint's value is set to "1", the back button event's Handled
4292+ * property will get set to 'true'. If the hint's value is set to something
4293+ * else, or if it is unset, SDL will leave the event's Handled property
4294+ * alone. (By default, the OS sets this property to 'false', to note.)
4295+ *
4296+ * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a
4297+ * back button is pressed, or can set it in direct-response to a back button
4298+ * being pressed.
4299+ *
4300+ * In order to get notified when a back button is pressed, SDL apps should
4301+ * register a callback function with SDL_AddEventWatch(), and have it listen
4302+ * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK.
4303+ * (Alternatively, SDL_KEYUP events can be listened-for. Listening for
4304+ * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON
4305+ * set by such a callback, will be applied to the OS' current
4306+ * back-button-press event.
4307+ *
4308+ * More details on back button behavior in Windows Phone apps can be found
4309+ * at the following page, on Microsoft's developer site:
4310+ * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx
4311+ */
4312+ #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON"
4313+
4314+ /** \brief Label text for a WinRT app's privacy policy link
4315+ *
4316+ * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
4317+ * Microsoft mandates that this policy be available via the Windows Settings charm.
4318+ * SDL provides code to add a link there, with its label text being set via the
4319+ * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
4320+ *
4321+ * Please note that a privacy policy's contents are not set via this hint. A separate
4322+ * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
4323+ * policy.
4324+ *
4325+ * The contents of this hint should be encoded as a UTF8 string.
4326+ *
4327+ * The default value is "Privacy Policy". This hint should only be set during app
4328+ * initialization, preferably before any calls to SDL_Init().
4329+ *
4330+ * For additional information on linking to a privacy policy, see the documentation for
4331+ * SDL_HINT_WINRT_PRIVACY_POLICY_URL.
4332+ */
4333+ #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL"
4334+
4335+ /**
4336+ * \brief A URL to a WinRT app's privacy policy
4337+ *
4338+ * All network-enabled WinRT apps must make a privacy policy available to its
4339+ * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
4340+ * be available in the Windows Settings charm, as accessed from within the app.
4341+ * SDL provides code to add a URL-based link there, which can point to the app's
4342+ * privacy policy.
4343+ *
4344+ * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
4345+ * before calling any SDL_Init() functions. The contents of the hint should
4346+ * be a valid URL. For example, "http://www.example.com".
4347+ *
4348+ * The default value is "", which will prevent SDL from adding a privacy policy
4349+ * link to the Settings charm. This hint should only be set during app init.
4350+ *
4351+ * The label text of an app's "Privacy Policy" link may be customized via another
4352+ * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
4353+ *
4354+ * Please note that on Windows Phone, Microsoft does not provide standard UI
4355+ * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
4356+ * will not get used on that platform. Network-enabled phone apps should display
4357+ * their privacy policy through some other, in-app means.
4358+ */
4359+ #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL"
4360+
4361+
42624362/**
42634363 * A variable controlling whether back-button-press events on Windows Phone to
42644364 * be marked as handled.
0 commit comments