1 | //-----------------------------------------------------------------------------
|
---|
2 | // -------------------
|
---|
3 | // File ....: Client.h
|
---|
4 | // -------------------
|
---|
5 | // Author...: Gus J Grubba
|
---|
6 | // Date ....: November 1995
|
---|
7 | // O.S. ....: Windows NT 3.51
|
---|
8 | //
|
---|
9 | // History .: Nov, 18 1995 - Created
|
---|
10 | //
|
---|
11 | // 3D Studio Max Network Rendering
|
---|
12 | //
|
---|
13 | // Client
|
---|
14 | //
|
---|
15 | //-----------------------------------------------------------------------------
|
---|
16 |
|
---|
17 | #ifndef _CLIENTINCLUDE_
|
---|
18 | #define _CLIENTINCLUDE_
|
---|
19 |
|
---|
20 | #ifndef NETCEXPORT
|
---|
21 | #define NETCEXPORT __declspec( dllimport )
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | //-----------------------------------------------------------------------------
|
---|
25 | //-- Interface Class ---------------------------------------------------------
|
---|
26 | //-----------------------------------------------------------------------------
|
---|
27 |
|
---|
28 | class ClientInterface {
|
---|
29 |
|
---|
30 | public:
|
---|
31 |
|
---|
32 | virtual HINSTANCE HostInst () = 0;
|
---|
33 | virtual HWND HostWnd () = 0;
|
---|
34 | virtual TCHAR *GetDir (int i) = 0;
|
---|
35 | virtual TCHAR *GetAppDir () = 0;
|
---|
36 | virtual TSTR GetMaxFileName () = 0;
|
---|
37 | virtual void SaveMaxFile (TCHAR *name) = 0;
|
---|
38 | virtual int ArchiveToFile (const TCHAR *fname) = 0;
|
---|
39 |
|
---|
40 | };
|
---|
41 |
|
---|
42 | //-----------------------------------------------------------------------------
|
---|
43 | //-- Base Class Definition ---------------------------------------------------
|
---|
44 | //-----------------------------------------------------------------------------
|
---|
45 | // #> Client
|
---|
46 | //
|
---|
47 |
|
---|
48 | class Client {
|
---|
49 |
|
---|
50 | private:
|
---|
51 |
|
---|
52 | TCPcomm *tcp;
|
---|
53 | ConnectionInfo ci;
|
---|
54 |
|
---|
55 | #define DEFNUMMANAGERS 4
|
---|
56 |
|
---|
57 | char manager[DEFNUMMANAGERS][MAX_PATH];
|
---|
58 | WORD mgrport;
|
---|
59 |
|
---|
60 | Tab<ServerList> Servers;
|
---|
61 | ServerReg sReg;
|
---|
62 | ClientInterface *iface;
|
---|
63 | Interface *max;
|
---|
64 | int curServer;
|
---|
65 |
|
---|
66 | int numSel;
|
---|
67 | int *selBuf;
|
---|
68 |
|
---|
69 | int start,end,step;
|
---|
70 |
|
---|
71 | //-- Flags defined in Common.h (NewJob flags)
|
---|
72 |
|
---|
73 | DWORD flags;
|
---|
74 |
|
---|
75 | //-- Windows Specific -------------------------------------------------
|
---|
76 |
|
---|
77 | HWND hWnd;
|
---|
78 | HBITMAP hBmpBulbOn,hBmpBulbBusy,hBmpBulbOff,hBmpBulbError;
|
---|
79 | HBITMAP hBmpBulbOnSel,hBmpBulbBusySel,hBmpBulbOffSel,hBmpBulbErrorSel;
|
---|
80 |
|
---|
81 | //-- Miscelaneous Functions -------------------------------------------
|
---|
82 |
|
---|
83 | void UpdateManagerList ( HWND hWnd );
|
---|
84 | BOOL GetMaxFile ( HWND hWnd, TCHAR *name );
|
---|
85 |
|
---|
86 | public:
|
---|
87 |
|
---|
88 | //-- Render Output Info
|
---|
89 |
|
---|
90 | int width,height;
|
---|
91 | float pixelaspect;
|
---|
92 |
|
---|
93 | //-- Constructors/Destructors -----------------------------------------
|
---|
94 |
|
---|
95 | NETCEXPORT Client ( ClientInterface *i, Interface *max );
|
---|
96 | NETCEXPORT ~Client ( );
|
---|
97 | void Close ( );
|
---|
98 |
|
---|
99 | //-- Public Interface -------------------------------------------------
|
---|
100 | //
|
---|
101 |
|
---|
102 | NETCEXPORT BOOL JobAssignment ( HWND hWnd, int s, int e, int st, DWORD f );
|
---|
103 | NETCEXPORT BOOL QueueManagement ( HWND hWnd );
|
---|
104 | NETCEXPORT BOOL JobMonitor ( HWND hWnd );
|
---|
105 |
|
---|
106 | //-- Dialog Functions -------------------------------------------------
|
---|
107 | //
|
---|
108 |
|
---|
109 | BOOL JobDlg ( HWND,UINT,WPARAM,LPARAM );
|
---|
110 | BOOL PropDlg ( HWND,UINT,WPARAM,LPARAM );
|
---|
111 | BOOL QueueDlg ( HWND,UINT,WPARAM,LPARAM );
|
---|
112 |
|
---|
113 | BOOL SubmitJob ( HWND hWnd );
|
---|
114 | void LoadServerList ( HWND hWnd );
|
---|
115 | void ResetServerList ( HWND hWnd );
|
---|
116 | void HandleButtonState ( HWND hWnd );
|
---|
117 | void ShowServerProp ( HWND hWnd );
|
---|
118 | void FixJobName ( HWND hWnd );
|
---|
119 | BOOL ArchiveMaps ( TCHAR *maxfile, TCHAR *zipfile );
|
---|
120 |
|
---|
121 | //-- Miscelaneous -----------------------------------------------------
|
---|
122 | //
|
---|
123 |
|
---|
124 | Interface *Max ( ) { return max; }
|
---|
125 | void ReadCfg ( );
|
---|
126 | void WriteCfg ( );
|
---|
127 |
|
---|
128 | BOOL IsFile ( const TCHAR *filename );
|
---|
129 | void GetIniFile ( TCHAR *name );
|
---|
130 |
|
---|
131 | };
|
---|
132 |
|
---|
133 | //-----------------------------------------------------------------------------
|
---|
134 | //-- Interface
|
---|
135 |
|
---|
136 | NETCEXPORT void *ClientCreate ( ClientInterface *i, Interface *m );
|
---|
137 | NETCEXPORT void ClientDestroy ( Client *v);
|
---|
138 |
|
---|
139 | #endif
|
---|
140 |
|
---|
141 | //-- EOF: Client.h ------------------------------------------------------------
|
---|