Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
3.8 KiB

  1. //-----------------------------------------------------------------------------
  2. // Name: FontMaker.h
  3. //
  4. // Desc: Defines the class behaviors for the application.
  5. //
  6. // Hist: 09.06.02 - Revised Fontmaker sample
  7. //
  8. // Copyright (c) Microsoft Corporation. All rights reserved.
  9. //-----------------------------------------------------------------------------
  10. #ifndef FONTMAKER_H
  11. #define FONTMAKER_H
  12. #include "resource.h"
  13. #include "BitmapFontFile.h"
  14. #include <math.h>
  15. #include "..\toollib\toollib.h"
  16. #include "..\toollib\scriplib.h"
  17. #include "..\toollib\piclib.h"
  18. //-----------------------------------------------------------------------------
  19. // Name: class CFontMakerView
  20. // Desc: The scroll view class for viewing the font texture image
  21. //-----------------------------------------------------------------------------
  22. class CFontMakerView : public CScrollView
  23. {
  24. protected:
  25. CFontMakerView() {}
  26. DECLARE_DYNCREATE(CFontMakerView)
  27. CDC m_memDC;
  28. public:
  29. VOID OnNewFontGlyphs();
  30. virtual ~CFontMakerView();
  31. public:
  32. // Overridden functions
  33. //{{AFX_VIRTUAL(CFontMakerView)
  34. public:
  35. virtual void OnDraw(CDC* pDC);
  36. virtual void OnInitialUpdate();
  37. protected:
  38. //}}AFX_VIRTUAL
  39. protected:
  40. // Message map functions
  41. //{{AFX_MSG(CFontMakerView)
  42. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  43. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  44. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  45. //}}AFX_MSG
  46. DECLARE_MESSAGE_MAP()
  47. };
  48. //-----------------------------------------------------------------------------
  49. // Name: class CFontMakerFrameWnd
  50. // Desc: The main frame window class for the app, which contains the dialog bar
  51. // full of controls and the scroll view to view the font texture image.
  52. //-----------------------------------------------------------------------------
  53. class CFontMakerFrameWnd : public CFrameWnd
  54. {
  55. public:
  56. CFontMakerFrameWnd() {}
  57. virtual ~CFontMakerFrameWnd() {}
  58. CDialogBar m_wndDialogBar;
  59. CDialogBar* GetDialogBar() { return &m_wndDialogBar; }
  60. protected:
  61. DECLARE_DYNCREATE(CFontMakerFrameWnd)
  62. // Message map functions
  63. //{{AFX_MSG(CFontMakerFrameWnd)
  64. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  65. //}}AFX_MSG
  66. DECLARE_MESSAGE_MAP()
  67. };
  68. //-----------------------------------------------------------------------------
  69. // Name: class CFontMakerApp
  70. // Desc: The main app class
  71. //-----------------------------------------------------------------------------
  72. class CFontMakerApp : public CWinApp
  73. {
  74. CDialogBar* m_pDialogBar;
  75. CFontMakerView* m_pView;
  76. HCURSOR m_hWaitCursor;
  77. public:
  78. CFontMakerApp() {}
  79. ~CFontMakerApp() {}
  80. VOID UpdateSelectedGlyph( BOOL bGlyphSelected, int iSelectedGlyph = 0 );
  81. HRESULT CalculateAndRenderGlyphs();
  82. VOID InsertGlyph();
  83. void SetTextureSize( int width, int height );
  84. // Overrides
  85. //{{AFX_VIRTUAL(CFontMakerApp)
  86. public:
  87. virtual BOOL InitInstance();
  88. virtual int ExitInstance();
  89. //}}AFX_VIRTUAL
  90. // Implementation
  91. //{{AFX_MSG(CFontMakerApp)
  92. afx_msg void OnNewFontButton();
  93. afx_msg void OnEffectsCheck();
  94. afx_msg void OnGlyphsFromRangeRadio();
  95. afx_msg void OnChangeGlpyhsRangeEdit();
  96. afx_msg void OnGlyphsFromFileRadio();
  97. afx_msg void OnChangeGlyphsFileEdit();
  98. afx_msg void OnGlyphsFileSelectorButton();
  99. afx_msg void OnTextureSizeButton();
  100. afx_msg void OnMagnifyButton();
  101. afx_msg void OnGlyphSpecial();
  102. afx_msg void OnUpdateButton( CCmdUI* pCmdUI );
  103. afx_msg void OnSaveButton();
  104. afx_msg void OnExit();
  105. afx_msg void OnAbout();
  106. afx_msg void OnHelp();
  107. afx_msg void OnGlyphsCustom();
  108. afx_msg void OnLoadButton();
  109. afx_msg void OnLoadCustomFontButton();
  110. //}}AFX_MSG
  111. DECLARE_MESSAGE_MAP()
  112. };
  113. // External reference to the unique application instance
  114. extern CFontMakerApp theApp;
  115. #endif // FONTMAKER_H