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

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

unix.superglobalmegacorp.com

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