Annotation of mstools/samples/rpc/mandel/mandel.h, revision 1.1.1.2

1.1       root        1: /****************************************************************************
                      2: 
                      3:     MANDEL.H -- Constants and function definitions for MANDEL.C 
                      4: 
1.1.1.2 ! root        5:     Copyright (C) 1990, 1992 Microsoft Corporation.
1.1       root        6: 
                      7: ****************************************************************************/
                      8: 
                      9: #define IDM_ABOUT 100
                     10: #define IDM_ZOOMIN 101
                     11: #define IDM_ZOOMOUT 105
                     12: #define IDM_TOP    106
                     13: #define IDM_REDRAW 107
                     14: #define IDM_EXIT   108
                     15: #define IDM_CONTINUOUS 109
                     16: 
                     17: #define IDM_1LINE       200
                     18: #define IDM_2LINES      201
                     19: #define IDM_4LINES      202
                     20: 
                     21: #define ID_OK           304
                     22: 
                     23: #define WM_DOSOMEWORK           (WM_USER+0)
                     24: #define WM_PAINTLINE            (WM_USER+1)
                     25: 
                     26: #define LBID_SERVERS    102
                     27: 
                     28: #define WIDTH           300
                     29: #define HEIGHT          300
                     30: 
1.1.1.2 ! root       31: #define MAXLINES       16
1.1       root       32: 
                     33: #ifndef MAXPATHLEN
                     34: #define MAXPATHLEN      260
                     35: #endif
                     36: 
                     37: #define MAXID           64    // saved zoomin operations
                     38: 
                     39: #define MAX_BUFSIZE         (HEIGHT * sizeof(long) * MAXLINES)
                     40: 
                     41: extern int iLines;
                     42: 
                     43: // A table of servers we know about
                     44: typedef struct _svr_table {
                     45:     char    name[16+1];                 // name of remote server
                     46:     int     hfPipe;                     // RPC handle
                     47:     int     iStatus;                    // status of connection
                     48:     int     cPicture;                   // picture id for this line
                     49:     DWORD   dwLine;                     // line we're drawing
                     50:     int     cLines;                     // lines in this chunk
                     51: } svr_table;
                     52: 
                     53: // if RPC, this data is defined within the IDL file
                     54: #ifndef RPC
                     55: typedef struct _cpoint {
                     56:     double    real;
                     57:     double    imag;
                     58: } CPOINT;
                     59: 
                     60: typedef CPOINT * PCPOINT;
                     61: 
                     62: typedef struct _LONGRECT {     /* rcl */
                     63:     long    xLeft;
                     64:     long    yBottom;
                     65:     long    xRight;
                     66:     long    yTop;
                     67: } LONGRECT;
                     68: 
                     69: typedef LONGRECT *PLONGRECT;
                     70: 
                     71: typedef struct _LINEBUF {
                     72:     WORD adw[MAX_BUFSIZE];
                     73: } LINEBUF;
                     74: 
                     75: typedef LINEBUF * PLINEBUF;
                     76: #endif
                     77: 
                     78: extern svr_table    SvrTable[];         // the table
                     79: extern int          SvrTableSz;         // # of objects in it
                     80: extern int          cPictureID;         // current picture; index to table
                     81: 
                     82: extern RECT         rcHistory[];
                     83: int APIENTRY WinMain(HANDLE, HANDLE, LPSTR, int);
                     84: BOOL InitApplication(HANDLE);
                     85: BOOL InitInstance(HANDLE, int);
                     86: LONG APIENTRY MainWndProc(HWND, UINT, UINT, LONG);
                     87: BOOL APIENTRY About(HWND, UINT, UINT, LONG);
                     88: BOOL APIENTRY SaveAsDlgProc(HWND, UINT, UINT, LONG);
                     89: void DoSomeWork(HWND, BOOL);
                     90: void IncPictureID(void);
                     91: 
                     92: void InitHistogram(void);
                     93: void CountHistogram(void);
                     94: void CalcHistogram(int  x,
                     95:          int       y,
                     96:          DWORD  dwIter,
                     97:          DWORD  dwThreshold);
                     98: #define NCOLORS 11
                     99: 
                    100: extern int fContinueZoom;
                    101: extern int fZoomIn;
                    102: extern int iHistMaxI;
                    103: extern int iHistMaxJ;
                    104: extern int Histogram[4][4][NCOLORS+1];
                    105: extern int ColorCount[4][4];
                    106: extern BOOL fRectDefined;
                    107: 
                    108: extern char pszFail[];
                    109: 
                    110: BOOL InitRemote( HWND );
                    111: void PollForServers( void );
                    112: void CheckPoll( void );
                    113: BOOL CheckDrawStatus( HWND);
                    114: void RetryConnections( void );
                    115: void SetNewCalc( CPOINT cptUL, double dPrecision, RECT rcl);
                    116: BOOL CheckDrawingID( int );
                    117: 
                    118: extern BOOL    fLocalWork;
                    119: extern BOOL    fRemoteWork;
                    120: 
                    121: 
                    122: // Status of connection to server
                    123: 
                    124: #define SS_DISCONN      0
                    125: #define SS_IDLE         1
                    126: #define SS_READPENDING  2
                    127: #define SS_PAINTING     3
                    128: #define SS_LOCAL        4
                    129: 
                    130: 
                    131: // Buffer routines
                    132: 
                    133: BOOL TakeDrawBuffer( void );
                    134: PDWORD GetDrawBuffer( void );
                    135: void FreeDrawBuffer( void );
                    136: void ReturnDrawBuffer( void );
                    137: DWORD QueryThreshold( void );
                    138: 
                    139: int GetServerCount( void );
                    140: void GetServerName( int, char *);
                    141: 
                    142: 
                    143: extern RECT rcZoom;
                    144: extern double dPrec;
                    145: 
                    146: #define MINPREC  5.0E-9
                    147: #define MAXPREC  5.0E-3
                    148: 
                    149: // if RPC version, this routine is defined within the IDL file
                    150: #ifndef RPC
                    151: void MandelCalc( PCPOINT   pcptLL,
                    152:                 PLONGRECT prcDraw,
                    153:                  double    precision,
                    154:                  DWORD     ulThreshold,
                    155:                  PLINEBUF  pbBuf);
                    156: #endif
                    157: 
                    158: typedef struct _calcbuf {
                    159:     LONGRECT  rclDraw;
                    160:     double    dblPrecision;
                    161:     DWORD     dwThreshold;
                    162:     CPOINT    cptLL;
                    163: } CALCBUF;
                    164: 
                    165: short calcmand(double dreal, double dimag, short maxit);
                    166: 
                    167: typedef struct _mults {
                    168:     double     rs;             /* real squared */
                    169:     double     is;             /* imag squared */
                    170:     double     ri;             /* real * imaginary */
                    171: } mults;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.