wgnuplib.h

Go to the documentation of this file.
00001 #ifndef __WGNUPLIB_H__
00002 #define __WGNUPLIB_H__
00003 
00004 
00005 /* from GNUPLOT - win/wgnuplib.h */
00006 /*
00007  * Copyright (C) 1992   Russell Lang
00008  *
00009  * Permission to use, copy, and distribute this software and its
00010  * documentation for any purpose with or without fee is hereby granted, 
00011  * provided that the above copyright notice appear in all copies and 
00012  * that both that copyright notice and this permission notice appear 
00013  * in supporting documentation.
00014  *
00015  * Permission to modify the software is granted, but not the right to
00016  * distribute the modified code.  Modifications are to be distributed 
00017  * as patches to released version.
00018  *  
00019  * This software is provided "as is" without express or implied warranty.
00020  * AUTHORS
00021  *   Russell Lang
00022  * 
00023  * Modified for Scilab (1997)
00024  *   Jean-Philippe Chancelier
00025  *   Allan CORNET INRIA 2005
00026  */
00027 
00028 #include <windows.h>
00029 
00030 #ifdef __DLL__ 
00031 
00032 #define EXPORT __declspec (dllexport) 
00033 #else
00034 #define EXPORT 
00035 #endif
00036 
00038 #ifdef __DLL__
00039 #define MyGetProcAddress(strProc,Proc) GetProcAddress(hdllInstance,strProc);
00040 #else
00041 #define MyGetProcAddress(strProc,Proc) Proc 
00042 #endif
00043 
00044 /*****************************************
00045  * wprinter.c - windows printer routines 
00046  *****************************************/
00047 
00048 typedef struct tagPRINT {
00049         HDC             hdcPrn;
00050         HWND    hDlgPrint;
00051         BOOL    bUserAbort;
00052         POINT   pdef;
00053         POINT   psize;
00054         POINT   poff;
00055         struct tagPRINT  *next;
00056 } PRINT;
00057 
00058 typedef PRINT *  LP_PRINT; 
00059 
00060 /*****************************************
00061  * wmenu.c - menu structure *
00062  *****************************************/
00063 
00064 #define BUTTONMAX 20
00065 
00066 typedef struct tagMW
00067 {
00068   LPSTR szMenuName;             /* required */
00069   HMENU hMenu;
00070   BYTE          **macro;
00071   BYTE          *macrobuf;
00072   int           nCountMenu;
00073   DLGPROC       lpProcInput;
00074   char          *szPrompt;
00075   char          *szAnswer;
00076   int           nChar;
00077   int           nButton;
00078   HWND      hButton[BUTTONMAX];
00079   int           hButtonID[BUTTONMAX];
00080   WNDPROC       lpfnMenuButtonProc;
00081   WNDPROC       lpfnButtonProc[BUTTONMAX];
00082   BOOL          IsAIcon[BUTTONMAX];
00083   int           PositionX[BUTTONMAX];
00084   BOOL          ShowToolBar;
00085   BOOL          LockToolBar;
00086   int           CodeLanguage;
00087   
00088 } MW;
00089 typedef MW  *LPMW;
00090 
00091 /*****************************************
00092  * wtext.c text window structure 
00093  * If an optional item is not specified it must be zero 
00094  *****************************************/
00095 
00096 #define SCI_DEFAULT_CHARSET ANSI_CHARSET
00097 
00098 #define MAXFONTNAME 80
00099 typedef struct tagTW
00100 {
00101   LP_PRINT      lpr;            /* must be first */
00102   HINSTANCE hInstance;          /* required */
00103   HINSTANCE hPrevInstance;      /* required */
00104   LPSTR Title;                  /* required */
00105   LPMW  lpmw;                   /* optional */
00106   POINT ScreenSize;             /* optional */
00107   unsigned int KeyBufSize;      /* optional */
00108   int           nCmdShow;       /* optional */
00109   HICON hIcon;                  /* optional */
00110   HMENU hPopMenu;
00111   HWND  hWndText;
00112   HWND  hWndParent;
00113   POINT Origin;
00114   POINT Size;
00115   BYTE  *ScreenBuffer;
00116   BYTE  *AttrBuffer;
00117   BYTE  *KeyBuf;
00118   BYTE  *KeyBufIn;
00119   BYTE  *KeyBufOut;
00120   BYTE  Attr;
00121   BOOL  bFocus;
00122   BOOL  bGetCh;
00123   BOOL  bSysColors;
00124   HBRUSH        hbrBackground;
00125   char  fontname[MAXFONTNAME];  /* font name */
00126   int           fontsize;                               /* font size in pts */
00127   HFONT hfont;
00128   int           CharAscent;
00129   int           ButtonHeight;
00130   int           CaretHeight;
00131   int           CursorFlag;
00132   POINT CursorPos;
00133   POINT ClientSize;
00134   POINT CharSize;
00135   POINT ScrollPos;
00136   POINT ScrollMax;
00137   POINT MarkBegin;
00138   POINT MarkEnd;
00139   BOOL  Marking;
00140 } TW;
00141 typedef TW *  LPTW;
00142 
00143 
00144 /*****************************************
00145  * wtext.c - Text Window *
00146  *****************************************/
00147 
00148 EXPORT void WINAPI TextMessage(void);
00149 EXPORT void TextMessage1(int);
00150 EXPORT int  WINAPI  TextInit(LPTW lptw);
00151 EXPORT void WINAPI  TextClose(LPTW lptw);
00152 EXPORT void WINAPI  TextToCursor(LPTW lptw);
00153 EXPORT int  WINAPI   TextKBHit(LPTW);
00154 EXPORT int  WINAPI  TextGetCh(LPTW);
00155 EXPORT int  WINAPI  TextGetChE(LPTW);
00156 EXPORT LPSTR WINAPI  TextGetS(LPTW lptw, LPSTR str, unsigned int size);
00157 EXPORT int  WINAPI  TextPutCh(LPTW, BYTE);
00158 EXPORT int  WINAPI  TextPutS(LPTW lptw, LPSTR str);
00159 EXPORT void WINAPI  TextGotoXY(LPTW lptw, int x, int y);
00160 EXPORT int WINAPI  TextWhereX(LPTW lptw);
00161 EXPORT int WINAPI  TextWhereY(LPTW lptw);
00162 EXPORT void WINAPI  TextCursorHeight(LPTW lptw, int height);
00163 EXPORT void WINAPI  TextClearEOL(LPTW lptw);
00164 EXPORT void WINAPI  TextClearEOS(LPTW lptw);
00165 EXPORT void WINAPI  TextInsertLine(LPTW lptw);
00166 EXPORT void WINAPI  TextDeleteLine(LPTW lptw);
00167 EXPORT void WINAPI  TextScrollReverse(LPTW lptw);
00168 EXPORT void WINAPI  TextAttr(LPTW lptw, BYTE attr);
00169 EXPORT void WINAPI  AboutBox(HWND hwnd);
00170 
00171 /*****************************************
00172  * wgraph.c - graphics window *
00173  *****************************************/
00174 
00175 typedef struct tagGW {
00176   LP_PRINT      lpr;            /* must be first */
00177   HINSTANCE     hInstance;      /* required */
00178   HINSTANCE     hPrevInstance;  /* required */
00179   LPSTR Title;                  /* required */
00180   int           xmax;           /* required */
00181   int           ymax;           /* required */
00182   LPTW  lptw;           /* optional */  /* associated text window */
00183   POINT Origin;         /* optional */  /* origin of graph window */
00184   POINT Size;           /* optional */  /* size of graph window */
00185   HMENU hPopMenu;       /* popup menu */
00186   BOOL  resized;        /* has graph window been resized? */
00187   BOOL  graphtotop;     /* bring graph window to top after every plot? */
00188   BOOL  locked;         /* locked if being written */
00189   int   ButtonHeight; /* */
00190   LPSTR szMenuName;             /* required */
00191 } GW;
00192 
00193 typedef GW *  LPGW;
00194 
00195 #define SCILEX "scilex.exe"
00196 #define WSCILEX "wscilex.exe"
00197 
00198 /*****************************
00199 menu for exporting to ps or xfig 
00200 ***************************/
00201 
00202 typedef struct tagLS
00203         {
00204         int colored;
00205         int land;
00206         int use_printer;
00207         int ps_type;
00208         }
00209 LS;
00210 /*************************/
00211 
00212 #endif /*  __WGNUPLIB_H__ */

Generated on Sun Mar 4 15:03:54 2007 for Scilab [trunk] by  doxygen 1.5.1