Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:24

0001 // Created on: 1999-12-30
0002 // Created by: data exchange team
0003 // Copyright (c) 1999-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 // Defines common framework for declaration of main/WinMain functions 
0018 // for executables on UNIX and WNT that extends DRAW Test Harness.
0019 
0020 // In order to create executable in DRAW environment, in the executable
0021 // the following line should be added:
0022 // DRAW_MAIN
0023 
0024 #ifndef Draw_Main_HeaderFile
0025 #define Draw_Main_HeaderFile
0026 
0027 #include <Draw_Appli.hxx>
0028 #include <Standard_PCharacter.hxx>
0029 
0030 typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
0031 
0032 Standard_EXPORT Standard_Integer Draw_Main (Standard_Integer argc, Standard_PCharacter argv[], const FDraw_InitAppli Draw_InitAppli);
0033 
0034 // Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
0035 #ifdef _WIN32
0036 
0037 #include <windows.h>
0038 
0039 Standard_EXPORT Standard_Integer Draw_WinMain (HINSTANCE hInstance,
0040                                                HINSTANCE hPrevinstance, 
0041                                                LPSTR lpCmdLine,
0042                                                Standard_Integer nCmdShow,
0043                            const FDraw_InitAppli Draw_InitAppli);
0044 
0045 // WinMain() and main()
0046 #define DRAW_MAIN Standard_Integer PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR lpCmdLine, Standard_Integer nCmdShow) \
0047 { return Draw_WinMain (hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli); } \
0048 \
0049 int main (int argc, char* argv[]) \
0050 { return Draw_Main (argc, argv, Draw_InitAppli); }
0051 
0052 #else
0053 
0054 // main()
0055 #define DRAW_MAIN int main (Standard_Integer argc, char* argv[]) \
0056 { return Draw_Main (argc, argv, Draw_InitAppli); }
0057 
0058 #endif
0059 
0060 #endif