7fd59977 |
1 | // File: Draw_Appli.hxx |
2 | // Created: Tue Apr 7 10:47:21 1992 |
3 | // Author: Remi LEQUETTE |
4 | // <rle@sdsun1> |
5 | |
6 | // JR 21 Oct 1999 : Change for Draw_Init_Appli which is in main and is |
7 | // called from Draw ===> undefined symbol on UNIX |
8 | // ===> duplication of code on NT : |
9 | // One argument added to DrawAppli : Draw_Init_Appli ===> |
10 | // Draw_Appli of Draw/TKDraw may call Draw_Init_Appli |
11 | |
12 | #ifndef Draw_Appli_HeaderFile |
13 | #define Draw_Appli_HeaderFile |
14 | |
15 | |
16 | #include <Draw_Viewer.hxx> |
17 | #include <Draw.hxx> |
18 | |
19 | typedef void (*FDraw_InitAppli)(Draw_Interpretor&); |
20 | |
21 | #ifdef WNT |
22 | #include <windows.h> |
23 | //extern void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int); |
24 | Standard_EXPORT void Draw_Appli(HINSTANCE,HINSTANCE,LPSTR,int, |
25 | const FDraw_InitAppli Draw_InitAppli); |
26 | #else |
27 | extern void Draw_Appli(Standard_Integer argc, char** argv, |
28 | const FDraw_InitAppli Draw_InitAppli); |
29 | #endif |
30 | |
31 | |
32 | |
33 | #if defined(WNT) && !defined(HAVE_NO_DLL) |
34 | #ifndef __Draw_API |
35 | # ifdef __Draw_DLL |
36 | # define __Draw_API __declspec ( dllexport ) |
37 | # else |
38 | # define __Draw_API __declspec ( dllimport ) |
39 | # endif |
40 | #endif |
41 | #else |
42 | # define __Draw_API |
43 | #endif |
44 | |
45 | |
46 | #ifndef WNT |
47 | extern Draw_Viewer dout; |
48 | extern Standard_Boolean Draw_Batch; |
49 | #endif |
50 | |
51 | #define atof(X) Draw::Atof(X) |
52 | #define atoi(X) Draw::Atoi(X) |
53 | |
54 | class Draw_SaveAndRestore { |
55 | |
56 | public : |
57 | |
58 | // __Draw_API Draw_SaveAndRestore |
59 | Standard_EXPORT Draw_SaveAndRestore |
60 | (const char* name, |
61 | Standard_Boolean (*test)(const Handle(Draw_Drawable3D)&), |
62 | void (*save)(const Handle(Draw_Drawable3D)&, ostream&), |
63 | Handle(Draw_Drawable3D) (*restore) (istream&), |
64 | Standard_Boolean display = Standard_True); |
65 | |
66 | |
67 | const char* Name() const {return myName;} |
68 | Standard_Boolean Test(const Handle(Draw_Drawable3D)&d); |
69 | void Save(const Handle(Draw_Drawable3D)& d, ostream& os) const; |
70 | Handle(Draw_Drawable3D) Restore(istream&) const; |
71 | Standard_Boolean Disp() const {return myDisplay;} |
72 | Draw_SaveAndRestore* Next() {return myNext;} |
73 | |
74 | private : |
75 | |
76 | const char* myName; |
77 | Standard_Boolean (*myTest)(const Handle(Draw_Drawable3D)&); |
78 | void (*mySave)(const Handle(Draw_Drawable3D)&, ostream&); |
79 | Handle(Draw_Drawable3D) (*myRestore) (istream&); |
80 | Standard_Boolean myDisplay; |
81 | Draw_SaveAndRestore* myNext; |
82 | |
83 | }; |
84 | |
85 | #endif |
86 | |
87 | |
88 | |