Leaked source code of windows server 2003
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.

135 lines
3.6 KiB

  1. /****************************Module*Header***********************************\
  2. * Module Name: SCICALC.H
  3. *
  4. * Module Descripton: Main header file
  5. *
  6. * Warnings:
  7. *
  8. * Created:
  9. *
  10. * Author:
  11. \****************************************************************************/
  12. #define CALC_COMPILE
  13. /* To keep a buncha junk outa compiles */
  14. #define NOGDICAPMASKS
  15. #define NOSYSMETRICS
  16. #define NODRAWFRAME
  17. #define NOKEYSTATES
  18. #define OEMRESOURCE
  19. #define NOATOM
  20. #define NOMETAFILE
  21. #define NOOPENFILE
  22. #define NOSOUND
  23. #define NOWH
  24. #define NOCOMM
  25. #define NOKANJI
  26. #include <windows.h>
  27. #include <windowsx.h>
  28. #include "scimath.h"
  29. #include "resource.h"
  30. #include <htmlhelp.h>
  31. #define ASSERT(f)
  32. #define CSTRMAX 256 /* Maximum length of any one string. */
  33. #ifdef DEBUG
  34. #define CCHSTRINGSMAX 3
  35. #else
  36. #define CCHSTRINGSMAX 1024 /* Initial bytes to allocate for strings. */
  37. #endif
  38. #define CMS_CALC_TIMEOUT (10 * 1000) // initial timeout == 10 secs
  39. #define CMS_MAX_TIMEOUT (40 * 1000) // Max timeout == 40 secs
  40. #define xwParam(x,y) ((wParam >=x) && (wParam <=y))
  41. #define RSHF 7
  42. /* Error values. */
  43. #define SCERR_DIVIDEZERO 0
  44. #define SCERR_DOMAIN 1
  45. #define SCERR_UNDEFINED 2
  46. #define SCERR_POS_INFINITY 3
  47. #define SCERR_NEG_INFINITY 4
  48. #define SCERR_ABORTED 5
  49. /* F_INTMATH() returns TRUE if math should be intiger mode */
  50. //
  51. // Do int math if we are not in base ten
  52. //
  53. #define F_INTMATH() (nRadix != 10)
  54. ////////////////////////////////////////////////////////////////////////////
  55. //
  56. // Function prototypes.
  57. //
  58. ////////////////////////////////////////////////////////////////////////////
  59. /* Exports. */
  60. LRESULT APIENTRY CalcWndProc(HWND, UINT, WPARAM, LPARAM);
  61. INT_PTR APIENTRY StatBoxProc(HWND, UINT, WPARAM, LPARAM);
  62. /* Functions called from several modules. Must be FAR. */
  63. VOID APIENTRY DisplayError (INT);
  64. VOID APIENTRY EnableToggles(BOOL bEnable);
  65. VOID APIENTRY InitSciCalc (BOOL);
  66. VOID APIENTRY MenuFunctions(DWORD);
  67. VOID APIENTRY SciCalcFunctions (PHNUMOBJ phnoNum, DWORD wOp);
  68. VOID APIENTRY SetStat (BOOL);
  69. VOID APIENTRY StatFunctions (WPARAM);
  70. VOID DisplayNum (VOID);
  71. /* Internal near calls. */
  72. void DoOperation (INT nOperation, HNUMOBJ *phnoNum, HNUMOBJ hnoX);
  73. VOID NEAR ProcessCommands(WPARAM);
  74. VOID NEAR SetBox (int, BOOL);
  75. VOID NEAR SetRadix (DWORD);
  76. LONG NEAR StatAlloc (WORD, DWORD);
  77. VOID NEAR StatError (VOID);
  78. void SwitchModes(DWORD wRadix, int nDecMode, int nHexMode);
  79. void RecalcNumObjConstants(void);
  80. BOOL SetWaitCursor( BOOL fOn );
  81. void KillTimeCalc( void );
  82. void TimeCalc( BOOL fStart );
  83. BOOL SetDisplayText(HWND, LPCTSTR);
  84. // these functions are from SciKeys.c and are used to access data stored
  85. // in the key array
  86. COLORREF GetKeyColor( int iID );
  87. ULONG_PTR GetHelpID( int iID );
  88. #define INDEXFROMID( x ) (x-IDC_FIRSTCONTROL)
  89. ////////////////////////////////////////////////////////////////////////////
  90. //
  91. // Global Variables
  92. //
  93. ////////////////////////////////////////////////////////////////////////////
  94. extern HWND g_hwndDlg;
  95. extern HINSTANCE hInst;
  96. extern ANGLE_TYPE nDecMode;
  97. extern long nRadix;
  98. extern long nPrecision;
  99. extern long dwWordBitWidth;
  100. extern BOOL bInv;
  101. extern BOOL bHyp;
  102. extern int nCalc;
  103. extern int nHexMode;
  104. extern HNUMOBJ g_ahnoChopNumbers[];
  105. extern BOOL bFarEast;