Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:17:26

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 int Draw_Main(int                   argc,
0033                               Standard_PCharacter   argv[],
0034                               const FDraw_InitAppli Draw_InitAppli);
0035 
0036 // Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
0037 #ifdef _WIN32
0038 
0039   #include <windows.h>
0040 
0041 Standard_EXPORT int Draw_WinMain(HINSTANCE             hInstance,
0042                                  HINSTANCE             hPrevinstance,
0043                                  LPSTR                 lpCmdLine,
0044                                  int                   nCmdShow,
0045                                  const FDraw_InitAppli Draw_InitAppli);
0046 
0047   // WinMain() and main()
0048   #define DRAW_MAIN                                                                                \
0049     int PASCAL WinMain(HINSTANCE hInstance,                                                        \
0050                        HINSTANCE hPrevinstance,                                                    \
0051                        LPSTR     lpCmdLine,                                                        \
0052                        int       nCmdShow)                                                         \
0053     {                                                                                              \
0054       return Draw_WinMain(hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli);          \
0055     }                                                                                              \
0056                                                                                                    \
0057     int main(int argc, char* argv[])                                                               \
0058     {                                                                                              \
0059       return Draw_Main(argc, argv, Draw_InitAppli);                                                \
0060     }
0061 
0062 #else
0063 
0064   // main()
0065   #define DRAW_MAIN                                                                                \
0066     int main(int argc, char* argv[])                                                               \
0067     {                                                                                              \
0068       return Draw_Main(argc, argv, Draw_InitAppli);                                                \
0069     }
0070 
0071 #endif
0072 
0073 #endif