client.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. #ifndef _CLIENTINCLUDE_
  17. #define _CLIENTINCLUDE_
  18. #ifndef NETCEXPORT
  19. #define NETCEXPORT __declspec( dllimport )
  20. #endif
  21. //-----------------------------------------------------------------------------
  22. //-- Interface Class ---------------------------------------------------------
  23. //-----------------------------------------------------------------------------
  24. class ClientInterface {
  25. public:
  26. virtual HINSTANCE HostInst () = 0;
  27. virtual HWND HostWnd () = 0;
  28. virtual TCHAR *GetDir (int i) = 0;
  29. virtual TCHAR *GetAppDir () = 0;
  30. virtual TSTR GetMaxFileName () = 0;
  31. virtual void SaveMaxFile (TCHAR *name) = 0;
  32. virtual int ArchiveToFile (const TCHAR *fname) = 0;
  33. };
  34. //-----------------------------------------------------------------------------
  35. //-- Base Class Definition ---------------------------------------------------
  36. //-----------------------------------------------------------------------------
  37. // #> Client
  38. //
  39. class Client {
  40. private:
  41. TCPcomm *tcp;
  42. ConnectionInfo ci;
  43. #define DEFNUMMANAGERS 4
  44. char manager[DEFNUMMANAGERS][MAX_PATH];
  45. WORD mgrport;
  46. Tab<ServerList> Servers;
  47. ServerReg sReg;
  48. ClientInterface *iface;
  49. Interface *max;
  50. int curServer;
  51. int numSel;
  52. int *selBuf;
  53. int start,end,step;
  54. //-- Flags defined in Common.h (NewJob flags)
  55. DWORD flags;
  56. //-- Windows Specific -------------------------------------------------
  57. HWND hWnd;
  58. HBITMAP hBmpBulbOn,hBmpBulbBusy,hBmpBulbOff,hBmpBulbError;
  59. HBITMAP hBmpBulbOnSel,hBmpBulbBusySel,hBmpBulbOffSel,hBmpBulbErrorSel;
  60. //-- Miscelaneous Functions -------------------------------------------
  61. void UpdateManagerList ( HWND hWnd );
  62. BOOL GetMaxFile ( HWND hWnd, TCHAR *name );
  63. public:
  64. //-- Render Output Info
  65. int width,height;
  66. float pixelaspect;
  67. //-- Constructors/Destructors -----------------------------------------
  68. NETCEXPORT Client ( ClientInterface *i, Interface *max );
  69. NETCEXPORT ~Client ( );
  70. void Close ( );
  71. //-- Public Interface -------------------------------------------------
  72. //
  73. NETCEXPORT BOOL JobAssignment ( HWND hWnd, int s, int e, int st, DWORD f );
  74. NETCEXPORT BOOL QueueManagement ( HWND hWnd );
  75. NETCEXPORT BOOL JobMonitor ( HWND hWnd );
  76. //-- Dialog Functions -------------------------------------------------
  77. //
  78. BOOL JobDlg ( HWND,UINT,WPARAM,LPARAM );
  79. BOOL PropDlg ( HWND,UINT,WPARAM,LPARAM );
  80. BOOL QueueDlg ( HWND,UINT,WPARAM,LPARAM );
  81. BOOL SubmitJob ( HWND hWnd );
  82. void LoadServerList ( HWND hWnd );
  83. void ResetServerList ( HWND hWnd );
  84. void HandleButtonState ( HWND hWnd );
  85. void ShowServerProp ( HWND hWnd );
  86. void FixJobName ( HWND hWnd );
  87. BOOL ArchiveMaps ( TCHAR *maxfile, TCHAR *zipfile );
  88. //-- Miscelaneous -----------------------------------------------------
  89. //
  90. Interface *Max ( ) { return max; }
  91. void ReadCfg ( );
  92. void WriteCfg ( );
  93. BOOL IsFile ( const TCHAR *filename );
  94. void GetIniFile ( TCHAR *name );
  95. };
  96. //-----------------------------------------------------------------------------
  97. //-- Interface
  98. NETCEXPORT void *ClientCreate ( ClientInterface *i, Interface *m );
  99. NETCEXPORT void ClientDestroy ( Client *v);
  100. #endif
  101. //-- EOF: Client.h ------------------------------------------------------------