home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Plotting / aa_Intel_Only / Gnuplot / Unused / win / wgnuplib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-12  |  7.8 KB  |  300 lines

  1. /*
  2.  * $Id: wgnuplib.h%v 3.38.2.74 1993/02/19 01:19:51 woo Exp woo $
  3.  */
  4.  
  5. /* GNUPLOT - win/wgnuplib.h */
  6. /*
  7.  * Copyright (C) 1992   Russell Lang
  8.  *
  9.  * Permission to use, copy, and distribute this software and its
  10.  * documentation for any purpose with or without fee is hereby granted, 
  11.  * provided that the above copyright notice appear in all copies and 
  12.  * that both that copyright notice and this permission notice appear 
  13.  * in supporting documentation.
  14.  *
  15.  * Permission to modify the software is granted, but not the right to
  16.  * distribute the modified code.  Modifications are to be distributed 
  17.  * as patches to released version.
  18.  *  
  19.  * This software is provided "as is" without express or implied warranty.
  20.  * 
  21.  *
  22.  * AUTHORS
  23.  * 
  24.  *   Russell Lang
  25.  * 
  26.  * Send your comments or suggestions to 
  27.  *  info-gnuplot@dartmouth.edu.
  28.  * This is a mailing list; to join it send a note to 
  29.  *  info-gnuplot-request@dartmouth.edu.  
  30.  * Send bug reports to
  31.  *  bug-gnuplot@dartmouth.edu.
  32.  */
  33.  
  34. /* this file contains items to be visible outside wgnuplot.dll */
  35.  
  36. #ifdef _WINDOWS
  37. #define _Windows
  38. #endif
  39.  
  40. #ifdef __DLL__
  41. #define WDPROC WINAPI _export
  42. #else
  43. #define WDPROC WINAPI
  44. #endif
  45.  
  46. #define WGNUPLOTVERSION  "1.0   1993-02-08"
  47. BOOL WDPROC CheckWGNUPLOTVersion(LPSTR str);
  48.  
  49. /* ================================== */
  50. /* For WIN32 API's 
  51. #ifdef WIN32
  52. #define DEFAULT_CHARSET ANSI_CHARSET
  53. #define OFFSETOF(x)  (x)
  54. #define SELECTOROF(x)  (x)
  55. #define MoveTo(hdc,x,y) MoveToEx(hdc,x,y,(LPPOINT)NULL);
  56. #endif
  57.  
  58. /* ================================== */
  59. /* wprinter.c - windows printer routines */
  60. void WDPROC DumpPrinter(HWND hwnd, LPSTR szAppName, LPSTR szFileName);
  61.  
  62. typedef struct tagPRINT {
  63.     HDC        hdcPrn;
  64.     HWND    hDlgPrint;
  65.     BOOL    bUserAbort;
  66.     POINT    pdef;
  67.     POINT    psize;
  68.     POINT    poff;
  69.     struct tagPRINT FAR *next;
  70. } PRINT;
  71. typedef PRINT FAR*  LPPRINT;
  72.  
  73. /* ================================== */
  74. /* wpause.c - pause window structure */
  75. typedef struct tagPW
  76. {
  77.     HINSTANCE    hInstance;        /* required */
  78.     HINSTANCE    hPrevInstance;    /* required */
  79.     LPSTR    Title;            /* required */
  80.     LPSTR    Message;        /* required */
  81.     POINT    Origin;            /* optional */
  82.     HWND    hWndParent;        /* optional */
  83.     HWND    hWndPause;
  84.     HWND    hOK;
  85.     HWND    hCancel;
  86.     BOOL    bPause;
  87.     BOOL    bPauseCancel;
  88.     BOOL    bDefOK;
  89.     WNDPROC    lpfnOK;
  90.     WNDPROC    lpfnCancel;
  91.     WNDPROC    lpfnPauseButtonProc;
  92. } PW;
  93. typedef PW FAR*  LPPW;
  94.  
  95. int WDPROC PauseBox(LPPW lppw);
  96.  
  97. /* ================================== */
  98. /* wmenu.c - menu structure */
  99. #define BUTTONMAX 10
  100. typedef struct tagMW
  101. {
  102.     LPSTR    szMenuName;        /* required */
  103.     HMENU    hMenu;
  104.     BYTE FAR * FAR *macro;
  105.     BYTE FAR *macrobuf;
  106.     int        nCountMenu;
  107.     DLGPROC    lpProcInput;
  108.     char    *szPrompt;
  109.     char    *szAnswer;
  110.     int        nChar;
  111.     int        nButton;
  112.     HWND    hButton[BUTTONMAX];
  113.     int        hButtonID[BUTTONMAX];
  114.     WNDPROC    lpfnMenuButtonProc;
  115.     WNDPROC    lpfnButtonProc[BUTTONMAX];
  116. } MW;
  117. typedef MW FAR * LPMW;
  118.  
  119. /* ================================== */
  120. /* wtext.c text window structure */
  121. /* If an optional item is not specified it must be zero */
  122. #define MAXFONTNAME 80
  123. typedef struct tagTW
  124. {
  125.     LPPRINT    lpr;            /* must be first */
  126.     HINSTANCE hInstance;        /* required */
  127.     HINSTANCE hPrevInstance;    /* required */
  128.     LPSTR    Title;            /* required */
  129.     LPMW    lpmw;            /* optional */
  130.     POINT    ScreenSize;        /* optional */
  131.     unsigned int KeyBufSize;    /* optional */
  132.     LPSTR    IniFile;        /* optional */
  133.     LPSTR    IniSection;        /* optional */
  134.     LPSTR    DragPre;        /* optional */
  135.     LPSTR    DragPost;        /* optional */
  136.     int        nCmdShow;        /* optional */
  137.     FARPROC shutdown;        /* optional */
  138.     HICON    hIcon;            /* optional */
  139.     LPSTR   AboutText;        /* optional */
  140.     HMENU    hPopMenu;
  141.     HWND    hWndText;
  142.     HWND    hWndParent;
  143.     POINT    Origin;
  144.     POINT    Size;
  145.     BYTE FAR *ScreenBuffer;
  146.     BYTE FAR *AttrBuffer;
  147.     BYTE FAR *KeyBuf;
  148.     BYTE FAR *KeyBufIn;
  149.     BYTE FAR *KeyBufOut;
  150.     BYTE    Attr;
  151.     BOOL    bFocus;
  152.     BOOL    bGetCh;
  153.     char    fontname[MAXFONTNAME];    /* font name */
  154.     int        fontsize;                /* font size in pts */
  155.     HFONT    hfont;
  156.     int        CharAscent;
  157.     int        ButtonHeight;
  158.     int        CaretHeight;
  159.     int        CursorFlag;
  160.     POINT    CursorPos;
  161.     POINT    ClientSize;
  162.     POINT    CharSize;
  163.     POINT    ScrollPos;
  164.     POINT    ScrollMax;
  165.     POINT    MarkBegin;
  166.     POINT    MarkEnd;
  167.     BOOL    Marking;
  168. } TW;
  169. typedef TW FAR*  LPTW;
  170.  
  171.  
  172. /* ================================== */
  173. /* wtext.c - Text Window */
  174. void WDPROC TextMessage(void);
  175. int WDPROC TextInit(LPTW lptw);
  176. void WDPROC TextClose(LPTW lptw);
  177. void WDPROC TextToCursor(LPTW lptw);
  178. int WDPROC  TextKBHit(LPTW);
  179. int WDPROC TextGetCh(LPTW);
  180. int WDPROC TextGetChE(LPTW);
  181. LPSTR WDPROC TextGetS(LPTW lptw, LPSTR str, unsigned int size);
  182. int WDPROC TextPutCh(LPTW, BYTE);
  183. int WDPROC TextPutS(LPTW lptw, LPSTR str);
  184. void WDPROC TextGotoXY(LPTW lptw, int x, int y);
  185. int  WDPROC TextWhereX(LPTW lptw);
  186. int  WDPROC TextWhereY(LPTW lptw);
  187. void WDPROC TextCursorHeight(LPTW lptw, int height);
  188. void WDPROC TextClearEOL(LPTW lptw);
  189. void WDPROC TextClearEOS(LPTW lptw);
  190. void WDPROC TextInsertLine(LPTW lptw);
  191. void WDPROC TextDeleteLine(LPTW lptw);
  192. void WDPROC TextScrollReverse(LPTW lptw);
  193. void WDPROC TextAttr(LPTW lptw, BYTE attr);
  194. void WDPROC AboutBox(HWND hwnd, LPSTR str);
  195.  
  196. /* ================================== */
  197. /* wgraph.c - graphics window */
  198.  
  199. /* windows data */
  200. #define WGNUMPENS 15
  201.  
  202. #define GWOPMAX 4096
  203. /* GWOP is 8 bytes long. Array of GWOP kept in global block */
  204. struct GWOP {
  205.     WORD op;
  206.     WORD x, y; 
  207.     HLOCAL htext;
  208. };
  209.  
  210. /* memory block for graph operations */
  211. struct GWOPBLK {            /* kept in local memory */
  212.     struct GWOPBLK *next;
  213.     HGLOBAL hblk;            /* handle to a global block */
  214.     struct GWOP FAR *gwop;    /* pointer to global block if locked */
  215.     UINT used;                /* number of GWOP's used */
  216. };
  217.  
  218. /* ops */
  219. #define W_endoflist 0
  220. #define W_dot 10
  221. #define W_diamond 11
  222. #define W_plus 12
  223. #define W_box 13
  224. #define W_cross 14
  225. #define W_triangle 15
  226. #define W_star 16
  227. #define W_move 20
  228. #define W_vect 21
  229. #define W_line_type 22
  230. #define W_put_text 23
  231. #define W_justify 24
  232. #define W_text_angle 25
  233.  
  234. typedef struct tagGW {
  235.     LPPRINT    lpr;            /* must be first */
  236.     HINSTANCE    hInstance;        /* required */
  237.     HINSTANCE    hPrevInstance;    /* required */
  238.     LPSTR    Title;            /* required */
  239.     int        xmax;            /* required */
  240.     int        ymax;            /* required */
  241.     LPTW    lptw;        /* optional */  /* associated text window */
  242.     POINT    Origin;        /* optional */    /* origin of graph window */
  243.     POINT    Size;        /* optional */    /* size of graph window */
  244.     LPSTR    IniFile;    /* optional */
  245.     LPSTR    IniSection;    /* optional */
  246.     HWND    hWndGraph;    /* window handle */
  247.     HMENU    hPopMenu;    /* popup menu */
  248.     int        numsolid;    /* number of solid pen styles */
  249.     int        pen;        /* current pen number */
  250.     int        htic;        /* horizontal size of point symbol (xmax units) */
  251.     int     vtic;        /* vertical size of point symbol (ymax units)*/
  252.     int        hchar;        /* horizontal size of character (xmax units) */
  253.     int        vchar;        /* vertical size of character (ymax units)*/
  254.     int        angle;        /* text angle */
  255.     BOOL    rotate;        /* can text be rotated 90 degrees ? */
  256.     char    fontname[MAXFONTNAME];    /* font name */
  257.     int        fontsize;    /* font size in pts */
  258.     HFONT    hfonth;        /* horizonal font */
  259.     HFONT    hfontv;        /* vertical font */
  260.     BOOL    resized;    /* has graph window been resized? */
  261.     BOOL    graphtotop;    /* bring graph window to top after every plot? */
  262.     BOOL    color;                    /* color pens? */
  263.     HPEN    hbpen;                    /* border pen */
  264.     HPEN    hapen;                    /* axis pen */
  265.     HPEN    hpen[WGNUMPENS];        /* pens */
  266.     LOGPEN    colorpen[WGNUMPENS+2];    /* logical color pens */
  267.     LOGPEN    monopen[WGNUMPENS+2];    /* logical mono pens */
  268.     COLORREF background;            /* background color */
  269.     HBRUSH   hbrush;                /* background brush */
  270.     struct GWOPBLK *gwopblk_head;
  271.     struct GWOPBLK *gwopblk_tail;
  272.     unsigned int nGWOP;
  273.     BOOL    locked;                /* locked if being written */
  274. } GW;
  275. typedef GW FAR*  LPGW;
  276.  
  277. #define WINFONTSIZE 10
  278. #define WIN30FONT "Courier"
  279. #define WINFONT "Arial"
  280.  
  281. #ifndef LEFT
  282. #define LEFT 0
  283. #endif
  284. #ifndef CENTRE
  285. #define CENTRE 1
  286. #endif
  287. #ifndef RIGHT
  288. #define RIGHT 2
  289. #endif
  290.  
  291. void WDPROC GraphInit(LPGW lpgw);
  292. void WDPROC GraphClose(LPGW lpgw);
  293. void WDPROC GraphStart(LPGW lpgw);
  294. void WDPROC GraphEnd(LPGW lpgw);
  295. void WDPROC GraphOp(LPGW lpgw, WORD op, WORD x, WORD y, LPSTR str);
  296. void WDPROC GraphPrint(LPGW lpgw);
  297. void WDPROC GraphRedraw(LPGW lpgw);
  298.  
  299. /* ================================== */
  300.