Alphabetical Class Index   File Members   Compound Members   File List  

CHoopsView.h
1 //
2 // Copyright (c) 2000 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: b320e0211d41d5246d21d98e35212a2bfa0ba1c8 $
13 //
14 
15 // CHoopsView.h : interface of the CHoopsView class, derived from CView
16 // Adds encapsulation of a HOOPS View Object, which corresponds to an
17 // instance of a HOOPS driver
18 //
19 // Also provides high-level support for copying the view to the clipboard,
20 // printing and printpreview
21 
22 #ifndef _C_HOOPS_VIEW_
23 #define _C_HOOPS_VIEW_
24 
25 
26 #include "HBaseView.h"
27 #include "HMFCGlobals.h"
28 
29 class CHoopsDoc;
31 
32 // msw driver specific driver_option debug flags
33 
41 #define DEBUG_FORCE_FULL_COLOR 0x00000010
42 
47 #define DEBUG_NO_WINDOWS_HOOK 0x00000040
48 
54 #define DEBUG_SFB_COPY_TO_CLIPBOARD 0x00004000
55 
61 #define DEBUG_STARTUP_CLEAR_BLACK 0x00004000
62 
67 #define DEBUG_NO_RASTERS_IN_PRINTING 0x00020000
68 
73 #define DEBUG_PRINTING_MODE 0x00040000
74 
79 #define DEBUG_CLIPBOARD_MODE 0x00080000
80 
81 
87 #define DEBUG_PRINT_NOT_FRAMEBUFFER_MODE 0x00020000
88 
89 
94 #define DEBUG_PRINT_NOT_RASTER_REDUCTION 0x00200000
95 
100 #define DEBUG_FORCE_SOFTWARE 0x01000000
101 
107 #define DEBUG_NO_PAINTERS_PANELLING 0x00000008
108 
113 #define DEBUG_16BIT_ZBUFFER 0x00200000
114 
115 
119 #define WMF 0
120 
124 #define EMF 1
125 
126 
127 class DIDeviceInfo;
128 class DIDevice;
129 
131 
140 class HMFC_API CHoopsView : public CView
141 {
142 
143 protected: // create from serialization only
144  CHoopsView();
145 
146  DECLARE_DYNCREATE(CHoopsView);
147 
148 
149  CPalette *m_pViewPalette;
156 
161  DIDeviceInfo *di8_data;
162 
168 
171 
174 
177 
183 
190 
192  unsigned long MapFlags( unsigned long state );
193 
195  unsigned long MapKeyFlags( BYTE * virtual_key_state );
196 
197 public:
198 
199 
200  HRESULT UpdateDI8State( unsigned long devIndex );
201  HRESULT CHoopsView::InitDI8( void );
202 
203  DIDevice *dev_handle;
204  DIDeviceInfo *g_pDevice;
205  int g_nDevices;
206 
210  CHoopsDoc* GetDocument();
211 
213  HBaseView* GetHoopsView( void ) { return m_pHView; }
214 
219  CPalette* GetPalette();
220 
221 
226  void InitializePalette();
227 
228  // printing and metafile methods
229 
234  bool GetFastPrint (void) {return m_bFastPrint;};
235 
237  void SetFastPrint (bool fastprint) {m_bFastPrint = fastprint;};
238 
243  bool GetMetaPrint (void) {return m_bMetaPrint;};
244 
248  void SetMetaPrint (bool metaprint) {m_bMetaPrint = metaprint;};
249 
251  int GetMetafileType (void) { return m_MetafileType; };
252 
254  void SetMetafileType (int emf_or_wmf) { m_MetafileType = emf_or_wmf; };
255 
257  bool GetFirstUpdate(){return m_pHView->GetFirstUpdate();};
258 
260  void SetFirstUpdate(bool firstupdate){/* do nothing - quit lying*/ ;};
261 
263  bool GetClipboardTruecolor (void) { return m_bClipboardTruecolor; };
264 
266  void SetClipboardTruecolor (bool truecolor) { m_bClipboardTruecolor = truecolor; };
267 
268 
269  void SaveEMF(const char *filename, HOutputHandlerOptions * options = 0);
270 
271 
273  HC_KEY GetViewKey();
274 
277  HC_KEY GetSceneKey();
278 
280  void AdjustAxisWindow();
281 
282 // Overrides
283  // ClassWizard generated virtual function overrides
284  //{{AFX_VIRTUAL(CHoopsView)
285  public:
286  virtual void OnDraw(CDC* pDC);
287 
289  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
290 
295  virtual void OnInitialUpdate();
296 
298 #ifdef _UNICODE
299  virtual BOOL Create(__wchar_t const * lpszClassName, __wchar_t const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
300  virtual BOOL Create(unsigned short const * lpszClassName, unsigned short const * lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
301 #else
302  virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
303 #endif
304  protected:
305 
307  virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
308 
310  virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
311 
313  virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
314 
324  virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
325 
326 
327 #ifndef DOXYGEN_SHOULD_SKIP_THIS
328 
329  virtual void OnNcDestroy();
330 
331  virtual void PostNcDestroy();
332 
333 #endif // DOXYGEN_SHOULD_SKIP_THIS
334 
335 
336  //}}AFX_VIRTUAL
337 
338 // Implementation
339 public:
340  virtual ~CHoopsView();
341 #ifdef _DEBUG
342  virtual void AssertValid() const;
343  virtual void Dump(CDumpContext& dc) const;
344 #endif
345 
346 protected:
347 
352  virtual void OnDisplayChanged(int xres, int yres, int depth);
354  void GetIntRectangle( HIntRectangle *rectangle );
355 
357  void EditCopy(GDIExportInformation * pInfo);
358 
359 
360 // Generated message map functions
361 protected:
362  //{{AFX_MSG(CHoopsView)
363 
365  afx_msg virtual void OnPaint();
366 
367  afx_msg virtual void OnSize(UINT, int, int);
368 
373  afx_msg virtual void OnEditCopy();
374 
379  afx_msg virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
380 
385  afx_msg virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
386 
391  afx_msg virtual void OnLButtonDblClk(UINT nFlags, CPoint point);
392 
397  afx_msg virtual void OnLButtonDown(UINT nFlags, CPoint point);
398 
403  afx_msg virtual void OnLButtonUp(UINT nFlags, CPoint point);
404 
409  afx_msg virtual void OnMouseMove(UINT nFlags, CPoint point);
410 
415  afx_msg virtual void OnRButtonDblClk(UINT nFlags, CPoint point);
416 
421  afx_msg virtual void OnRButtonDown(UINT nFlags, CPoint point);
422 
427  afx_msg virtual void OnMButtonUp(UINT nFlags, CPoint point);
428 
433  afx_msg virtual void OnMButtonDown(UINT nFlags, CPoint point);
434 
439  afx_msg virtual void OnRButtonUp(UINT nFlags, CPoint point);
440 
445  afx_msg virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
446 
451 #if (_MSC_VER < 1400)
452  afx_msg virtual void OnTimer(UINT nIDEvent);
453 #else
454  afx_msg virtual void OnTimer(UINT_PTR nIDEvent);
455 #endif
456 
457 
464  static bool GetKeyState(unsigned int key, int &flags);
465 
466 
471  afx_msg virtual BOOL OnMouseWheel( UINT nFlags, short zDelta, CPoint pt );
472 
476  afx_msg virtual LRESULT OnAFXDisplayChange( WPARAM wparam, LPARAM lparam);
477 
478 
483  afx_msg virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult);
484 
485 
486  //}}AFX_MSG
487  DECLARE_MESSAGE_MAP()
488 };
489 
490 #ifndef _DEBUG
492  { return (CHoopsDoc*)m_pDocument; }
493 #endif
494 
495 #endif
496 
bool GetFastPrint(void)
Definition: CHoopsView.h:234
The CHoopsDoc class provides a HOOPS-specific implementation of the CDocument object.
Definition: CHoopsDoc.h:32
HC_KEY m_ViewKey
Definition: CHoopsView.h:182
bool m_bFastPrint
Definition: CHoopsView.h:155
void SetMetaPrint(bool metaprint)
Definition: CHoopsView.h:248
int m_MetafileType
Definition: CHoopsView.h:173
#define HC_KEY
bool GetClipboardTruecolor(void)
Definition: CHoopsView.h:263
CHoopsDoc * GetDocument()
Definition: CHoopsView.h:491
HBaseView * GetHoopsView(void)
Definition: CHoopsView.h:213
Definition: HIOUtilityGDIOutput.h:91
void SetClipboardTruecolor(bool truecolor)
Definition: CHoopsView.h:266
void SetFastPrint(bool fastprint)
Definition: CHoopsView.h:237
bool GetMetaPrint(void)
Definition: CHoopsView.h:243
void SetMetafileType(int emf_or_wmf)
Definition: CHoopsView.h:254
CPalette * m_pViewPalette
Definition: CHoopsView.h:149
bool m_bMetaPrint
Definition: CHoopsView.h:167
int GetMetafileType(void)
Definition: CHoopsView.h:251
HC_KEY m_SceneKey
Definition: CHoopsView.h:189
bool m_bUsingDI8Joystick
Definition: CHoopsView.h:160
HBaseView * m_pHView
Definition: CHoopsView.h:176
void SetFirstUpdate(bool firstupdate)
Definition: CHoopsView.h:260
The CHoopsView class provides a HOOPS-specific implementation of the CView object.
Definition: CHoopsView.h:140
bool m_bClipboardTruecolor
Definition: CHoopsView.h:170
bool GetFirstUpdate()
Definition: CHoopsView.h:257