~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/wsci/wgnuplib.h

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* /wgnuplib.h */
 
2
/* from GNUPLOT - win/wgnuplib.h */
 
3
/*
 
4
 * Copyright (C) 1992   Russell Lang
 
5
 *
 
6
 * Permission to use, copy, and distribute this software and its
 
7
 * documentation for any purpose with or without fee is hereby granted, 
 
8
 * provided that the above copyright notice appear in all copies and 
 
9
 * that both that copyright notice and this permission notice appear 
 
10
 * in supporting documentation.
 
11
 *
 
12
 * Permission to modify the software is granted, but not the right to
 
13
 * distribute the modified code.  Modifications are to be distributed 
 
14
 * as patches to released version.
 
15
 *  
 
16
 * This software is provided "as is" without express or implied warranty.
 
17
 * AUTHORS
 
18
 *   Russell Lang
 
19
 * 
 
20
 * Modified for Scilab (1997)
 
21
 *   Jean-Philippe Chancelier 
 
22
 */
 
23
 
 
24
#ifdef _WINDOWS
 
25
#define _Windows
 
26
#endif
 
27
 
 
28
#ifdef __DLL__ 
 
29
/** XXXXX #define EXPORT extern "C" __declspec (dllexport) **/
 
30
#define EXPORT __declspec (dllexport) 
 
31
#else
 
32
#define EXPORT 
 
33
#endif
 
34
 
 
35
/** Get reference to functions if DLL **/
 
36
#ifdef __DLL__
 
37
#define MyGetProcAddress(strProc,Proc) GetProcAddress(hdllInstance,strProc);
 
38
#else
 
39
#define MyGetProcAddress(strProc,Proc) Proc 
 
40
#endif
 
41
 
 
42
#define WSCILABVERSION  "1.0   1996"
 
43
 
 
44
EXPORT BOOL WINAPI CheckWScilabVersion(LPSTR str);
 
45
 
 
46
/*****************************************
 
47
 * wprinter.c - windows printer routines 
 
48
 *****************************************/
 
49
 
 
50
typedef struct tagPRINT {
 
51
        HDC             hdcPrn;
 
52
        HWND    hDlgPrint;
 
53
        BOOL    bUserAbort;
 
54
        POINT   pdef;
 
55
        POINT   psize;
 
56
        POINT   poff;
 
57
        struct tagPRINT  *next;
 
58
} PRINT;
 
59
 
 
60
typedef PRINT *  LPPRINT; 
 
61
 
 
62
/*****************************************
 
63
 * wpause.c - pause window structure *
 
64
 *****************************************/
 
65
 
 
66
typedef struct tagPW
 
67
{
 
68
        HINSTANCE       hInstance;              /* required */
 
69
        HINSTANCE       hPrevInstance;  /* required */
 
70
        LPSTR   Title;                  /* required */
 
71
        LPSTR   Message;                /* required */
 
72
        POINT   Origin;                 /* optional */
 
73
        HWND    hWndParent;             /* optional */
 
74
        HWND    hWndPause;
 
75
        HWND    hOK;
 
76
        HWND    hCancel;
 
77
        BOOL    bPause;
 
78
        BOOL    bPauseCancel;
 
79
        BOOL    bDefOK;
 
80
        WNDPROC lpfnOK;
 
81
        WNDPROC lpfnCancel;
 
82
        WNDPROC lpfnPauseButtonProc;
 
83
} PW;
 
84
typedef PW *  LPPW;
 
85
 
 
86
EXPORT int  WINAPI  PauseBox(LPPW lppw);
 
87
 
 
88
/*****************************************
 
89
 * wmenu.c - menu structure *
 
90
 *****************************************/
 
91
 
 
92
#define BUTTONMAX 20
 
93
 
 
94
typedef struct tagMW
 
95
{
 
96
  LPSTR szMenuName;             /* required */
 
97
  HMENU hMenu;
 
98
  BYTE          **macro;
 
99
  BYTE          *macrobuf;
 
100
  int           nCountMenu;
 
101
  DLGPROC       lpProcInput;
 
102
  char          *szPrompt;
 
103
  char          *szAnswer;
 
104
  int           nChar;
 
105
  int           nButton;
 
106
  HWND          hButton[BUTTONMAX];
 
107
  int           hButtonID[BUTTONMAX];
 
108
  WNDPROC       lpfnMenuButtonProc;
 
109
  WNDPROC       lpfnButtonProc[BUTTONMAX];
 
110
} MW;
 
111
typedef MW  *LPMW;
 
112
 
 
113
/*****************************************
 
114
 * wtext.c text window structure 
 
115
 * If an optional item is not specified it must be zero 
 
116
 *****************************************/
 
117
 
 
118
#define SCI_DEFAULT_CHARSET ANSI_CHARSET
 
119
 
 
120
#define MAXFONTNAME 80
 
121
typedef struct tagTW
 
122
{
 
123
  LPPRINT       lpr;            /* must be first */
 
124
  HINSTANCE hInstance;          /* required */
 
125
  HINSTANCE hPrevInstance;      /* required */
 
126
  LPSTR Title;                  /* required */
 
127
  LPMW  lpmw;                   /* optional */
 
128
  POINT ScreenSize;             /* optional */
 
129
  unsigned int KeyBufSize;      /* optional */
 
130
  LPSTR IniFile;                /* optional */
 
131
  LPSTR IniSection;             /* optional */
 
132
  LPSTR DragPre;                /* optional */
 
133
  LPSTR DragPost;               /* optional */
 
134
  int           nCmdShow;       /* optional */
 
135
  FARPROC shutdown;             /* optional */
 
136
  HICON hIcon;                  /* optional */
 
137
  LPSTR   AboutText;            /* optional */
 
138
  HMENU hPopMenu;
 
139
  HWND  hWndText;
 
140
  HWND  hWndParent;
 
141
  POINT Origin;
 
142
  POINT Size;
 
143
  BYTE  *ScreenBuffer;
 
144
  BYTE  *AttrBuffer;
 
145
  BYTE  *KeyBuf;
 
146
  BYTE  *KeyBufIn;
 
147
  BYTE  *KeyBufOut;
 
148
  BYTE  Attr;
 
149
  BOOL  bFocus;
 
150
  BOOL  bGetCh;
 
151
  BOOL  bSysColors;
 
152
  HBRUSH        hbrBackground;
 
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 *  LPTW;
 
170
 
 
171
 
 
172
/*****************************************
 
173
 * wtext.c - Text Window *
 
174
 *****************************************/
 
175
 
 
176
EXPORT void WINAPI TextMessage(void);
 
177
EXPORT void TextMessage2(void);
 
178
EXPORT void TextMessage1(int);
 
179
EXPORT int  WINAPI  TextInit(LPTW lptw);
 
180
EXPORT void WINAPI  TextClose(LPTW lptw);
 
181
EXPORT void WINAPI  TextToCursor(LPTW lptw);
 
182
EXPORT int  WINAPI   TextKBHit(LPTW);
 
183
EXPORT int  WINAPI  TextGetCh(LPTW);
 
184
EXPORT int  WINAPI  TextGetChE(LPTW);
 
185
EXPORT LPSTR WINAPI  TextGetS(LPTW lptw, LPSTR str, unsigned int size);
 
186
EXPORT int  WINAPI  TextPutCh(LPTW, BYTE);
 
187
EXPORT int  WINAPI  TextPutS(LPTW lptw, LPSTR str);
 
188
EXPORT void WINAPI  TextGotoXY(LPTW lptw, int x, int y);
 
189
EXPORT int WINAPI  TextWhereX(LPTW lptw);
 
190
EXPORT int WINAPI  TextWhereY(LPTW lptw);
 
191
EXPORT void WINAPI  TextCursorHeight(LPTW lptw, int height);
 
192
EXPORT void WINAPI  TextClearEOL(LPTW lptw);
 
193
EXPORT void WINAPI  TextClearEOS(LPTW lptw);
 
194
EXPORT void WINAPI  TextInsertLine(LPTW lptw);
 
195
EXPORT void WINAPI  TextDeleteLine(LPTW lptw);
 
196
EXPORT void WINAPI  TextScrollReverse(LPTW lptw);
 
197
EXPORT void WINAPI  TextAttr(LPTW lptw, BYTE attr);
 
198
EXPORT void WINAPI  AboutBox(HWND hwnd, LPSTR str);
 
199
 
 
200
/*****************************************
 
201
 * wgraph.c - graphics window *
 
202
 *****************************************/
 
203
 
 
204
typedef struct tagGW {
 
205
  LPPRINT       lpr;            /* must be first */
 
206
  HINSTANCE     hInstance;      /* required */
 
207
  HINSTANCE     hPrevInstance;  /* required */
 
208
  LPSTR Title;                  /* required */
 
209
  int           xmax;           /* required */
 
210
  int           ymax;           /* required */
 
211
  LPTW  lptw;           /* optional */  /* associated text window */
 
212
  POINT Origin;         /* optional */  /* origin of graph window */
 
213
  POINT Size;           /* optional */  /* size of graph window */
 
214
  LPSTR IniFile;        /* optional */
 
215
  LPSTR IniSection;     /* optional */
 
216
  /** HWND      hWndGraph;**/   /* window handle */
 
217
  HMENU hPopMenu;       /* popup menu */
 
218
  BOOL  resized;        /* has graph window been resized? */
 
219
  BOOL  graphtotop;     /* bring graph window to top after every plot? */
 
220
  BOOL  locked;         /* locked if being written */
 
221
  int   ButtonHeight; /* */
 
222
  LPSTR szMenuName;             /* required */
 
223
} GW;
 
224
 
 
225
typedef GW *  LPGW;
 
226
 
 
227
#define WINFONTSIZE 10
 
228
#define WIN30FONT "Courier"
 
229
#define WINFONT "Arial"
 
230
 
 
231
#ifndef LEFT
 
232
#define LEFT 0
 
233
#endif
 
234
#ifndef CENTRE
 
235
#define CENTRE 1
 
236
#endif
 
237
#ifndef RIGHT
 
238
#define RIGHT 2
 
239
#endif
 
240
 
 
241
/*************************/
 
242