misc/winutils/include/SDL_main.h
author unc0rr
Fri, 30 Mar 2012 23:58:08 +0400
changeset 6838 b1a0e7a52c04
parent 6560 ca07e6be08d0
child 7809 7d4fb2f35f4f
permissions -rw-r--r--
More clean namespace, some fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6560
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     1
/*
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     2
    SDL - Simple DirectMedia Layer
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     3
    Copyright (C) 1997-2009 Sam Lantinga
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     4
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     5
    This library is free software; you can redistribute it and/or
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     6
    modify it under the terms of the GNU Lesser General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     7
    License as published by the Free Software Foundation; either
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     8
    version 2.1 of the License, or (at your option) any later version.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
     9
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    10
    This library is distributed in the hope that it will be useful,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    13
    Lesser General Public License for more details.
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    14
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    15
    You should have received a copy of the GNU Lesser General Public
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    16
    License along with this library; if not, write to the Free Software
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    18
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    19
    Sam Lantinga
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    20
    slouken@libsdl.org
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    21
*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    22
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    23
#ifndef _SDL_main_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    24
#define _SDL_main_h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    25
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    26
#include "SDL_stdinc.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    27
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    28
/** @file SDL_main.h
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    29
 *  Redefine main() on Win32 and MacOS so that it is called by winmain.c
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    30
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    31
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    32
#if defined(__WIN32__) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    33
    (defined(__MWERKS__) && !defined(__BEOS__)) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    34
    defined(__MACOS__) || defined(__MACOSX__) || \
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    35
    defined(__SYMBIAN32__) || defined(QWS)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    36
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    37
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    38
#define C_LINKAGE	"C"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    39
#else
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    40
#define C_LINKAGE
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    41
#endif /* __cplusplus */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    42
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    43
/** The application's main() function must be called with C linkage,
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    44
 *  and should be declared like this:
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    45
 *      @code
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    46
 *      #ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    47
 *      extern "C"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    48
 *      #endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    49
 *	int main(int argc, char *argv[])
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    50
 *	{
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    51
 *	}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    52
 *      @endcode
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    53
 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    54
#define main	SDL_main
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    55
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    56
/** The prototype for the application's main() function */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    57
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    58
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    59
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    60
/** @name From the SDL library code -- needed for registering the app on Win32 */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    61
/*@{*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    62
#ifdef __WIN32__
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    63
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    64
#include "begin_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    65
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    66
extern "C" {
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    67
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    68
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    69
/** This should be called from your WinMain() function, if any */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    70
extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    71
/** This can also be called, but is no longer necessary */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    72
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    73
/** This can also be called, but is no longer necessary (SDL_Quit calls it) */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    74
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    75
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    76
}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    77
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    78
#include "close_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    79
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    80
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    81
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    82
/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    83
/*@{*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    84
#if defined(__MACOS__)
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    85
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    86
#include "begin_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    87
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    88
extern "C" {
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    89
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    90
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    91
/** Forward declaration so we don't need to include QuickDraw.h */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    92
struct QDGlobals;
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    93
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    94
/** This should be called from your main() function, if any */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    95
extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd);
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    96
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    97
#ifdef __cplusplus
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    98
}
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
    99
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   100
#include "close_code.h"
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   101
#endif
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   102
/*@}*/
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   103
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   104
#endif /* Need to redefine main()? */
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   105
ca07e6be08d0 GCI task: cmd.exe
bovi
parents:
diff changeset
   106
#endif /* _SDL_main_h */