enginep.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. #ifndef _enginep_h_
  2. #define _enginep_h_
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Global hacks
  6. //
  7. //////////////////////////////////////////////////////////////////////////////
  8. extern bool g_bMDLLog;
  9. extern bool g_bWindowLog;
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // Direct Draw includes
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. //
  16. // DirectX Stuff
  17. //
  18. typedef IDirectDraw4 IDirectDrawX;
  19. typedef IDirectDrawSurface4 IDirectDrawSurfaceX;
  20. typedef IDirectDrawClipper IDirectDrawClipperX;
  21. typedef IDirectDrawPalette IDirectDrawPaletteX;
  22. typedef IDirectDrawGammaControl IDirectDrawGammaControlX;
  23. typedef IDirect3D3 IDirect3DX;
  24. typedef IDirect3DDevice3 IDirect3DDeviceX;
  25. typedef IDirect3DTexture2 IDirect3DTextureX;
  26. typedef IDirect3DViewport3 IDirect3DViewportX;
  27. typedef IDirect3DLight IDirect3DLightX;
  28. typedef IDirect3DMaterial3 IDirect3DMaterialX;
  29. #define IID_IDirectDrawX IID_IDirectDraw4
  30. #define IID_IDirectDrawSurfaceX IID_IDirectDrawSurface4
  31. #define IID_IDirect3DX IID_IDirect3D3
  32. #define IID_IDirect3DTextureX IID_IDirect3DTexture2
  33. #define IID_IDirectDrawGammaControlX IID_IDirectDrawGammaControl
  34. typedef DDSURFACEDESC2 DDSURFACEDESCX;
  35. typedef DDSCAPS2 DDSCAPSX;
  36. //
  37. // DirectX Wrapper Classes
  38. //
  39. #include "ddstruct.h"
  40. //////////////////////////////////////////////////////////////////////////////
  41. //
  42. // Direct Draw includes
  43. //
  44. //////////////////////////////////////////////////////////////////////////////
  45. bool FillDDPF(
  46. DDPixelFormat& ppdf,
  47. IDirectDrawX* pdd,
  48. HDC hdc,
  49. HBITMAP hbitmap,
  50. IDirectDrawPaletteX** pppalette
  51. );
  52. //////////////////////////////////////////////////////////////////////////////
  53. //
  54. // Direct Draw Asserts
  55. //
  56. //////////////////////////////////////////////////////////////////////////////
  57. #ifdef _DEBUG
  58. bool DDError(HRESULT hr, const char* pszCall, const char* pszFile, int line, const char* pszModule);
  59. bool DDSCallImpl(HRESULT hr, const char* pszCall, const char* pszFile, int line, const char* pszModule);
  60. #define DDCall(hr) DDError(hr, #hr, __FILE__, __LINE__, __MODULE__)
  61. #define DDSCall(hr) DDSCallImpl(hr, #hr, __FILE__, __LINE__, __MODULE__)
  62. #else
  63. bool DDSCallImpl(HRESULT hr);
  64. #define DDCall(hr) SUCCEEDED(hr)
  65. #define DDSCall(hr) SUCCEEDED(hr)
  66. #endif
  67. //////////////////////////////////////////////////////////////////////////////
  68. //
  69. // Forward Declarations
  70. //
  71. //////////////////////////////////////////////////////////////////////////////
  72. class PrivatePalette;
  73. class PrivateContext;
  74. class PrivateSurface;
  75. class PrivateEngine;
  76. class VideoSurface;
  77. class DDSurface;
  78. class Rasterizer;
  79. class D3DRasterizer;
  80. //////////////////////////////////////////////////////////////////////////////
  81. //
  82. // PrivatePalette
  83. //
  84. //////////////////////////////////////////////////////////////////////////////
  85. class PrivatePalette : public Palette {
  86. public:
  87. virtual IDirectDrawPaletteX* GetDDPal() = 0;
  88. };
  89. TRef<PrivatePalette> CreatePaletteImpl(IDirectDrawPaletteX* pddpal);
  90. //////////////////////////////////////////////////////////////////////////////
  91. //
  92. // D3DDevice
  93. //
  94. //////////////////////////////////////////////////////////////////////////////
  95. class D3DDevice : public IObject {
  96. public:
  97. virtual void Terminate() = 0;
  98. virtual IDirect3DDeviceX* GetD3DDeviceX() = 0;
  99. virtual PixelFormat* GetTextureFormat() = 0;
  100. virtual WinPoint GetMinTextureSize() = 0;
  101. virtual WinPoint GetMaxTextureSize() = 0;
  102. virtual bool IsHardwareAccelerated() = 0;
  103. };
  104. //////////////////////////////////////////////////////////////////////////////
  105. //
  106. // Direct Draw Device
  107. //
  108. //////////////////////////////////////////////////////////////////////////////
  109. class DDDevice : public IObject {
  110. public:
  111. virtual void Terminate() = 0;
  112. virtual void Reset(IDirectDrawX* pdd) = 0;
  113. virtual void FreeEverything() = 0;
  114. virtual HRESULT TestCooperativeLevel() = 0;
  115. virtual void AddRasterizer(Rasterizer* praster) = 0;
  116. virtual void RemoveD3DDevice(D3DDevice* pd3ddevice) = 0;
  117. virtual void RemoveRasterizer(Rasterizer* praster) = 0;
  118. virtual void RemoveSurface(DDSurface* pddsurface) = 0;
  119. virtual void SetPrimaryDevice(DDDevice* pdddevice) = 0;
  120. virtual PrivateEngine* GetEngine() = 0;
  121. virtual IDirectDrawX* GetDD() = 0;
  122. virtual IDirect3DX* GetD3D() = 0;
  123. virtual bool Has3DAcceleration() = 0;
  124. virtual bool GetAllow3DAcceleration() = 0;
  125. virtual PixelFormat* GetZBufferPixelFormat() = 0;
  126. virtual ZString GetName() = 0;
  127. virtual void SetAllow3DAcceleration(bool bAllow3DAcceleration) = 0;
  128. virtual WinPoint NextMode(const WinPoint& size) = 0;
  129. virtual WinPoint PreviousMode(const WinPoint& size) = 0;
  130. virtual void EliminateModes(const WinPoint& size) = 0;
  131. virtual int GetTotalTextureMemory() = 0;
  132. virtual int GetAvailableTextureMemory() = 0;
  133. virtual int GetTotalVideoMemory() = 0;
  134. virtual int GetAvailableVideoMemory() = 0;
  135. virtual IDirect3DTextureX* GetTextureX(D3DDevice* pd3dd, DDSurface* pddsurface) = 0;
  136. virtual void BeginScene() = 0;
  137. virtual void EndScene() = 0;
  138. virtual TRef<D3DDevice> CreateD3DDevice(DDSurface* pddsurface) = 0;
  139. virtual TRef<IDirectDrawSurfaceX> CreateSurface(
  140. const WinPoint& size,
  141. DWORD caps,
  142. PixelFormat* ppf,
  143. bool bAllocationCanFail
  144. ) = 0;
  145. virtual TRef<IDirectDrawSurfaceX> CreateMipMapTexture(
  146. const WinPoint& size,
  147. PixelFormat* ppf
  148. ) = 0;
  149. };
  150. TRef<D3DDevice> CreateD3DDevice(
  151. DDDevice* pdddevice,
  152. IDirect3DDeviceX* pd3dd,
  153. bool bHardwareAccelerated,
  154. PixelFormat* ppfPrefered
  155. );
  156. TRef<DDDevice> CreateDDDevice(PrivateEngine* pengine, bool bAllow3DAcceleration, IDirectDrawX* pdd);
  157. //////////////////////////////////////////////////////////////////////////////
  158. //
  159. // Rasterizer
  160. //
  161. //////////////////////////////////////////////////////////////////////////////
  162. class Rasterizer : public IObject {
  163. public:
  164. virtual void Terminate() = 0;
  165. //
  166. // State
  167. //
  168. virtual void SetShadeMode(ShadeMode shadeMode) = 0;
  169. virtual void SetBlendMode(BlendMode blendMode) = 0;
  170. virtual void SetTexture(Surface* psurfaceTexture) = 0;
  171. virtual void SetWrapMode(WrapMode wrapMode) = 0;
  172. virtual void SetCullMode(CullMode cullMode) = 0;
  173. virtual void SetZTest(bool bZTest) = 0;
  174. virtual void SetZWrite(bool bZWrite) = 0;
  175. virtual void SetLinearFilter(bool bLinearFilter) = 0;
  176. virtual void SetPerspectiveCorrection(bool bPerspectiveCorrection) = 0;
  177. virtual void SetDither(bool bDither) = 0;
  178. virtual void SetColorKey(bool bColorKey) = 0;
  179. virtual void BeginScene() = 0;
  180. virtual void EndScene() = 0;
  181. virtual void ClearZBuffer() = 0;
  182. virtual void SetClipRect(const Rect& rectClip) = 0;
  183. //
  184. // Attributes
  185. //
  186. virtual Point GetSurfaceSize() = 0;
  187. virtual bool Has3DAcceleration() = 0;
  188. //
  189. // Rendering
  190. //
  191. virtual void DrawTriangles(const VertexScreen* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  192. virtual void DrawLines(const VertexScreen* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  193. virtual void DrawPoints(const VertexScreen* pvertex, int vcount) = 0;
  194. };
  195. class D3DRasterizer : public Rasterizer {
  196. public:
  197. virtual TRef<IDirect3DDeviceX> GetD3DDeviceX() = 0;
  198. virtual TRef<IDirect3DX> GetD3D() = 0;
  199. virtual TRef<IDirect3DViewportX> GetViewport() = 0;
  200. virtual void DrawTrianglesD3D(const D3DLVertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  201. virtual void DrawLinesD3D(const D3DLVertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  202. virtual void DrawPointsD3D(const D3DLVertex* psource, int count ) = 0;
  203. virtual void DrawTrianglesD3D(const D3DVertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  204. virtual void DrawLinesD3D(const D3DVertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  205. virtual void DrawPointsD3D(const D3DVertex* psource, int count ) = 0;
  206. };
  207. TRef<D3DRasterizer> CreateD3DRasterizer(PrivateSurface* psurface);
  208. TRef<Rasterizer> CreateSoftwareRasterizer(PrivateSurface* psurface);
  209. //////////////////////////////////////////////////////////////////////////////
  210. //
  211. // 3D Device
  212. //
  213. //////////////////////////////////////////////////////////////////////////////
  214. class IDevice3D : public IObject {
  215. public:
  216. //
  217. // Capabilities
  218. //
  219. virtual bool Has3DAcceleration() = 0;
  220. //
  221. // State
  222. //
  223. virtual bool GetClipping() = 0;
  224. virtual const Matrix& GetMatrix() = 0;
  225. virtual const Matrix& GetInverseModelMatrix() = 0;
  226. virtual void AddClipPlane(const Plane& plane) = 0;
  227. virtual void RemoveClipPlane(int indexRemove) = 0;
  228. virtual void SetMatrix(const Matrix& mat) = 0;
  229. virtual void SetPerspectiveMatrix(const Matrix& mat) = 0;
  230. virtual void SetClipping(bool bClip) = 0;
  231. virtual void SetShadeMode(ShadeMode shadeMode) = 0;
  232. virtual void SetBlendMode(BlendMode blendMode) = 0;
  233. virtual void SetTexture(Surface* psurfaceTexture) = 0;
  234. virtual void SetMaterial(Material* pmaterial) = 0;
  235. virtual void SetWrapMode(WrapMode wrapMode) = 0;
  236. virtual void SetCullMode(CullMode cullMode) = 0;
  237. virtual void SetZTest(bool bZTest) = 0;
  238. virtual void SetZWrite(bool bZWrite) = 0;
  239. virtual void SetLinearFilter(bool bLinearFilter) = 0;
  240. virtual void SetPerspectiveCorrection(bool bPerspectiveCorrection) = 0;
  241. virtual void SetDither(bool bDither) = 0;
  242. virtual void SetColorKey(bool bColorKey) = 0;
  243. virtual void SetLineWidth(float width) = 0;
  244. virtual void SetDeformation(Deformation* pdeform) = 0;
  245. virtual void SetGlobalColor(const Color& color) = 0;
  246. virtual void DirectionalLight(const Vector& vec, const Color& color) = 0;
  247. virtual void BidirectionalLight(const Vector& vec, const Color& color, const Color& colorAlt) = 0;
  248. virtual void SetAmbientLevel(float level) = 0;
  249. //
  250. //
  251. //
  252. virtual void SetClipRect(const Rect& rectClip) = 0;
  253. virtual void BeginScene() = 0;
  254. virtual void EndScene() = 0;
  255. virtual void ClearZBuffer() = 0;
  256. //
  257. // VertexBuffer
  258. //
  259. virtual VertexL* GetVertexLBuffer(int count) = 0;
  260. virtual VertexScreen* GetVertexScreenBuffer(int count) = 0;
  261. //
  262. // Rendering
  263. //
  264. virtual void DrawTriangles(const D3DVertex* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  265. virtual void DrawLines(const D3DVertex* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  266. virtual void DrawPoints(const D3DVertex* pvertex, int vcount) = 0;
  267. virtual void DrawTriangles(const Vertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  268. virtual void DrawLines(const Vertex* psource, int count, const MeshIndex* pindex, int icount) = 0;
  269. virtual void DrawPoints(const Vertex* psource, int count) = 0;
  270. virtual void DrawTriangles(const VertexL* psource, int count, const MeshIndex* pindex, int icount) = 0;
  271. virtual void DrawLines(const VertexL* psource, int count, const MeshIndex* pindex, int icount) = 0;
  272. virtual void DrawPoints(const VertexL* psource, int count ) = 0;
  273. virtual void DrawTriangles(const VertexScreen* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  274. virtual void DrawLines(const VertexScreen* pvertex, int vcount, const MeshIndex* pindex, int icount) = 0;
  275. virtual void DrawPoints(const VertexScreen* pvertex, int vcount) = 0;
  276. //
  277. // Performance Counters
  278. //
  279. virtual int GetPerformanceCounter(Counter counter) = 0;
  280. virtual void ResetPerformanceCounters() = 0;
  281. };
  282. TRef<IDevice3D> CreateDevice3D(Rasterizer* prasterizer);
  283. //////////////////////////////////////////////////////////////////////////////
  284. //
  285. // PrivateContext
  286. //
  287. //////////////////////////////////////////////////////////////////////////////
  288. class PrivateContext : public Context {
  289. public:
  290. //
  291. // Called from Surface
  292. //
  293. virtual void BeginRendering() = 0;
  294. virtual void EndRendering() = 0;
  295. virtual PrivateSurface* GetSurface() = 0;
  296. };
  297. TRef<PrivateContext> CreateContextImpl(PrivateSurface* psurface);
  298. //////////////////////////////////////////////////////////////////////////////
  299. //
  300. //
  301. //
  302. //////////////////////////////////////////////////////////////////////////////
  303. class BinarySurfaceInfo {
  304. public:
  305. WinPoint m_size;
  306. int m_pitch;
  307. DWORD m_bitCount;
  308. DWORD m_redMask;
  309. DWORD m_greenMask;
  310. DWORD m_blueMask;
  311. DWORD m_alphaMask;
  312. bool m_bColorKey;
  313. };
  314. //////////////////////////////////////////////////////////////////////////////
  315. //
  316. // VideoSurface
  317. //
  318. //////////////////////////////////////////////////////////////////////////////
  319. class VideoSurface : public IObject {
  320. public:
  321. //
  322. // Attributes
  323. //
  324. virtual SurfaceType GetSurfaceType() = 0;
  325. virtual const WinPoint& GetSize() = 0;
  326. virtual int GetPitch() = 0;
  327. virtual PixelFormat* GetPixelFormat() = 0;
  328. virtual BYTE* GetPointer() = 0;
  329. virtual void ReleasePointer() = 0;
  330. virtual bool IsMemoryShared() = 0;
  331. virtual void SetColorKey(const Color& color) = 0;
  332. //
  333. // Stretch Blt
  334. //
  335. virtual void UnclippedBlt(const WinRect& rectTarget, VideoSurface* pvideoSurfaceSource, const WinRect& rectSource, bool bHasColorKey) = 0;
  336. //
  337. // Regular Blts
  338. //
  339. virtual void UnclippedBlt(const WinRect& rectTarget, IDirectDrawSurfaceX* pddsSource, const WinPoint& pointSource, bool bHasColorKey) = 0;
  340. virtual void UnclippedBlt(const WinRect& rectTarget, VideoSurface* pvideoSurfaceSource, const WinPoint& pointSource) = 0;
  341. virtual void UnclippedFill(const WinRect& rectTarget, Pixel pixel) = 0;
  342. //
  343. // GDI blts
  344. //
  345. virtual void BitBltFromDC(HDC hdc) = 0;
  346. //
  347. // Called from Context
  348. //
  349. virtual void BeginScene() = 0;
  350. virtual void EndScene() = 0;
  351. };
  352. //////////////////////////////////////////////////////////////////////////////
  353. //
  354. // DDSurface
  355. //
  356. //////////////////////////////////////////////////////////////////////////////
  357. class DDSurface : public VideoSurface {
  358. public:
  359. virtual bool HasZBuffer() = 0;
  360. virtual bool HasColorKey() = 0;
  361. virtual const Color& GetColorKey() = 0;
  362. virtual bool InVideoMemory() = 0;
  363. virtual DDDevice* GetDDDevice() = 0;
  364. virtual TRef<IDirectDrawSurface> GetDDS() = 0;
  365. virtual IDirectDrawSurfaceX* GetDDSX() = 0;
  366. virtual IDirectDrawSurfaceX* GetDDSX(PixelFormat* ppf) = 0;
  367. virtual IDirectDrawSurfaceX* GetDDSXZBuffer() = 0;
  368. virtual IDirect3DTextureX* GetTextureX(PixelFormat* ppf, const WinPoint& size, int& id) = 0;
  369. };
  370. //////////////////////////////////////////////////////////////////////////////
  371. //
  372. // DDSurface
  373. //
  374. //////////////////////////////////////////////////////////////////////////////
  375. TRef<DDSurface> CreateDDSurface(
  376. DDDevice* pdddevice,
  377. SurfaceType stype,
  378. PixelFormat* ppf,
  379. PrivatePalette* ppalette,
  380. const WinPoint& size
  381. );
  382. TRef<DDSurface> CreateDDSurface(
  383. DDDevice* pdddevice,
  384. SurfaceType stype,
  385. PixelFormat* ppf,
  386. PrivatePalette* ppalette,
  387. const WinPoint& size,
  388. int pitch,
  389. BYTE* pdata
  390. );
  391. TRef<DDSurface> CreateDDSurface(
  392. DDDevice* pdddevice,
  393. IDirectDrawSurfaceX* pdds,
  394. IDirectDrawSurfaceX* pddsZBuffer,
  395. PixelFormat* ppf,
  396. PrivatePalette* ppalette,
  397. SurfaceType stype
  398. );
  399. //////////////////////////////////////////////////////////////////////////////
  400. //
  401. // DeviceDependant
  402. //
  403. //////////////////////////////////////////////////////////////////////////////
  404. class DeviceDependant : public IObject {
  405. public:
  406. virtual void ClearDevice() = 0;
  407. };
  408. //////////////////////////////////////////////////////////////////////////////
  409. //
  410. // PrivateSurface
  411. //
  412. //////////////////////////////////////////////////////////////////////////////
  413. class PrivateSurface :
  414. public Surface,
  415. public DeviceDependant
  416. {
  417. public:
  418. virtual VideoSurface* GetVideoSurface() = 0;
  419. virtual VideoSurface* GetVideoSurfaceNoAlloc() = 0;
  420. virtual void SetPixelFormat(PixelFormat* ppf) = 0;
  421. virtual void BitBltFromDC(HDC hdc) = 0;
  422. };
  423. //////////////////////////////////////////////////////////////////////////////
  424. //
  425. // PrivateSurface
  426. //
  427. //////////////////////////////////////////////////////////////////////////////
  428. TRef<PrivateSurface> CreatePrivateSurface(
  429. PrivateEngine* pengine,
  430. PixelFormat* ppf,
  431. PrivatePalette* ppalette,
  432. const WinPoint& size,
  433. SurfaceType stype,
  434. SurfaceSite* psite
  435. );
  436. TRef<PrivateSurface> CreatePrivateSurface(
  437. PrivateEngine* pengine,
  438. PixelFormat* ppf,
  439. PrivatePalette* ppalette,
  440. const WinPoint& size,
  441. int pitch,
  442. BYTE* pdata,
  443. IObject* pobjectMemory
  444. );
  445. TRef<PrivateSurface> CreatePrivateSurface(
  446. PrivateEngine* pengine,
  447. VideoSurface* pvideoSurface,
  448. SurfaceSite* psite
  449. );
  450. //////////////////////////////////////////////////////////////////////////////
  451. //
  452. // PrivateEngine
  453. //
  454. //////////////////////////////////////////////////////////////////////////////
  455. class PrivateEngine : public Engine {
  456. public:
  457. virtual void AddDeviceDependant(DeviceDependant* pdeviceDependant) = 0;
  458. virtual void RemoveDeviceDependant(DeviceDependant* pdeviceDependant) = 0;
  459. virtual void RemovePrivateSurface(PrivateSurface* psurface) = 0;
  460. virtual DDDevice* GetCurrentDevice() = 0;
  461. virtual DDDevice* GetPrimaryDevice() = 0;
  462. virtual DDSDescription GetPrimaryDDSD() = 0;
  463. virtual PrivateSurface* GetBackBuffer() = 0;
  464. virtual TRef<PrivateSurface> CreateCompatibleSurface(
  465. PrivateSurface* psurface,
  466. const WinPoint& size,
  467. SurfaceType stype,
  468. SurfaceSite* psite
  469. ) = 0;
  470. virtual TRef<VideoSurface> CreateVideoSurface(
  471. SurfaceType stype,
  472. PixelFormat* ppf,
  473. PrivatePalette* ppalette,
  474. const WinPoint& size,
  475. int pitch,
  476. BYTE* pbits
  477. ) = 0;
  478. //
  479. // Pixel Formats
  480. //
  481. virtual PixelFormat* GetPrimaryPixelFormat() = 0;
  482. virtual TRef<PixelFormat> GetPixelFormat(const DDPixelFormat& ddpf) = 0;
  483. virtual TRef<PixelFormat> GetPixelFormat(
  484. int bits,
  485. DWORD redMask,
  486. DWORD greenMask,
  487. DWORD blueMask,
  488. DWORD alphaMask
  489. ) = 0;
  490. };
  491. //////////////////////////////////////////////////////////////////////////////
  492. //
  493. // IEngineFont
  494. //
  495. //////////////////////////////////////////////////////////////////////////////
  496. TRef<IEngineFont> CreateEngineFont(HFONT hfont);
  497. TRef<IEngineFont> CreateEngineFont(IBinaryReaderSite* psite);
  498. //////////////////////////////////////////////////////////////////////////////
  499. //
  500. // NameSpace stuff
  501. //
  502. //////////////////////////////////////////////////////////////////////////////
  503. TRef<INameSpaceInfo> CreateNameSpaceInfo(INameSpace* pns, const ZString& str);
  504. TRef<INameSpace> CreateNameSpace(const ZString& strName);
  505. TRef<INameSpace> CreateNameSpace(const ZString& strName, INameSpace* pnsParent);
  506. TRef<INameSpace> CreateNameSpace(const ZString& strName, INameSpaceList& parents);
  507. TRef<INameSpace> CreateNameSpace(const ZString& strName, Modeler* pmodeler, ZFile* pfile);
  508. TRef<INameSpace> CreateBinaryNameSpace(const ZString& strName, Modeler* pmodeler, ZFile* pfile);
  509. //////////////////////////////////////////////////////////////////////////////
  510. //
  511. // Popup stuff
  512. //
  513. //////////////////////////////////////////////////////////////////////////////
  514. class IPopupContainerPrivate : public IPopupContainer {
  515. public:
  516. virtual void Initialize(Engine* pengine, RectValue* prectValue) = 0;
  517. };
  518. TRef<IPopupContainerPrivate> CreatePopupContainer();
  519. #endif