src/video/android/SDL_androidmessagebox.h
author Sam Lantinga <slouken@libsdl.org>
Sat, 13 Sep 2014 02:15:18 -0700
changeset 9135 6cd8e6b54f4d
child 9619 b94b6d0bff0f
permissions -rw-r--r--
Fixed bug 2415 - Message Boxes aren't implemented on Android

Philipp Wiesemann

I attached a patch for an incomplete implementation of the messagebox parts.

It was not tested on lots of devices yet and features a very fragile workaround to block the calling SDL thread while the dialog is handled on Android's UI thread. Although it works for testmessage.c I assume there are lot of situations were it may fail (standby, device rotation and other changes). Also not all flags and colors are implemented.

On the other hand most uses of the messagebox are to show an error on start and fragility (or working at all) may not matter there.
slouken@9135
     1
/*
slouken@9135
     2
  Simple DirectMedia Layer
slouken@9135
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
slouken@9135
     4
slouken@9135
     5
  This software is provided 'as-is', without any express or implied
slouken@9135
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@9135
     7
  arising from the use of this software.
slouken@9135
     8
slouken@9135
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@9135
    10
  including commercial applications, and to alter it and redistribute it
slouken@9135
    11
  freely, subject to the following restrictions:
slouken@9135
    12
slouken@9135
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@9135
    14
     claim that you wrote the original software. If you use this software
slouken@9135
    15
     in a product, an acknowledgment in the product documentation would be
slouken@9135
    16
     appreciated but is not required.
slouken@9135
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@9135
    18
     misrepresented as being the original software.
slouken@9135
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@9135
    20
*/
slouken@9135
    21
#include "../../SDL_internal.h"
slouken@9135
    22
slouken@9135
    23
#if SDL_VIDEO_DRIVER_ANDROID
slouken@9135
    24
slouken@9135
    25
extern int Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
slouken@9135
    26
slouken@9135
    27
#endif /* SDL_VIDEO_DRIVER_ANDROID */
slouken@9135
    28
slouken@9135
    29
/* vi: set ts=4 sw=4 expandtab: */