FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gnuplot/src/win/wgnuplib.h at master · gnuplot/gnuplot · GitHub
gnuplot
gnuplot
Repository navigation
Code
Pull requests
2
(2)
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
gnuplot
/
src
/
win
/
wgnuplib.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
520 lines (458 loc) · 14.7 KB
Breadcrumbs
gnuplot
/
src
/
win
/
wgnuplib.h
Copy path
File metadata and controls
520 lines (458 loc) · 14.7 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
/* GNUPLOT - win/wgnuplib.h */
/*[
* Copyright 1982 - 1993, 1998, 2004 Russell Lang
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
/*
* AUTHORS
*
* Russell Lang
*/
#ifndef
WGNUPLIB_H
#define
WGNUPLIB_H
#include
<windows.h>
#ifdef
__cplusplus
extern
"C"
{
#endif
#include
"screenbuf.h"
#include
"term_api.h"
/* ================================== */
/* symbols for the two icons */
#define
TEXTICON
123
#define
GRPICON
124
/* ================================== */
/* For WIN32 API's */
/* #define DEFAULT_CHARSET ANSI_CHARSET */
# define
MoveTo
(
hdc
,
x
,
y
) MoveToEx(hdc,x,y,(LPPOINT)NULL);
/* printf format for TCHAR arguments */
#ifdef
UNICODE
# define
TCHARFMT
"%ls"
#else
# define
TCHARFMT
"%hs"
#endif
/* ================================== */
/* wprinter.c - windows printer routines */
void
DumpPrinter
(
HWND
hwnd
,
LPTSTR
szAppName
,
LPTSTR
szFileName
);
typedef
struct
tagPRINT
{
HDC
hdcPrn
;
HWND
hDlgPrint
;
BOOL
bUserAbort
;
LPCTSTR
szTitle
;
POINT
pdef
;
POINT
psize
;
POINT
poff
;
BOOL
bDriverChanged
;
void
*
services
;
struct
tagPRINT
*
next
;
}
GP_PRINT
;
typedef
GP_PRINT
*
GP_LPPRINT
;
/* ================================== */
/* wpause.c - pause window structure */
typedef
struct
tagPW
{
HINSTANCE
hInstance
;
/* required */
HINSTANCE
hPrevInstance
;
/* required */
LPWSTR
Title
;
/* required */
LPWSTR
Message
;
/* required */
POINT
Origin
;
/* optional */
HWND
hWndParent
;
/* optional */
HWND
hWndPause
;
HWND
hOK
;
HWND
hCancel
;
BOOL
bPause
;
BOOL
bPauseCancel
;
BOOL
bDefOK
;
WNDPROC
lpfnOK
;
WNDPROC
lpfnCancel
;
WNDPROC
lpfnPauseButtonProc
;
}
PW
;
typedef
PW
*
LPPW
;
TBOOLEAN
MousableWindowOpened
(
void
);
int
PauseBox
(
LPPW
lppw
);
/* ================================== */
/* wmenu.c - menu structure */
#define
BUTTONMAX
10
typedef
struct
tagMW
{
LPTSTR
szMenuName
;
/* required */
HMENU
hMenu
;
BYTE
*
*
macro
;
BYTE
*
macrobuf
;
int
nCountMenu
;
DLGPROC
lpProcInput
;
LPWSTR
szPrompt
;
LPWSTR
szAnswer
;
int
nChar
;
int
nButton
;
HWND
hToolbar
;
HWND
hButton
[
BUTTONMAX
];
int
hButtonID
[
BUTTONMAX
];
}
MW
;
typedef
MW
*
LPMW
;
/* ================================== */
/* wtext.c text window structure */
/* If an optional item is not specified it must be zero */
#define
MAXFONTNAME
80
typedef
struct
tagTW
{
GP_LPPRINT
lpr
;
/* must be first */
HINSTANCE
hInstance
;
/* required */
HINSTANCE
hPrevInstance
;
/* required */
LPWSTR
Title
;
/* required */
LPMW
lpmw
;
/* optional */
POINT
ScreenSize
;
/* optional */
/* size of the visible screen in characters */
unsigned
int
KeyBufSize
;
/* optional */
LPTSTR
IniFile
;
/* optional */
LPTSTR
IniSection
;
/* optional */
LPWSTR
DragPre
;
/* optional */
LPWSTR
DragPost
;
/* optional */
int
nCmdShow
;
/* optional */
FARPROC
shutdown
;
/* optional */
HICON
hIcon
;
/* optional */
LPTSTR
AboutText
;
/* optional */
HMENU
hPopMenu
;
HWND
hWndText
;
HWND
hWndParent
;
HWND
hWndToolbar
;
HWND
hStatusbar
;
HWND
hWndSeparator
;
HWND
hWndFocus
;
/* window with input focus */
POINT
Origin
;
POINT
Size
;
SB
ScreenBuffer
;
BOOL
bWrap
;
/* wrap long lines */
BYTE
*
KeyBuf
;
BYTE
*
KeyBufIn
;
BYTE
*
KeyBufOut
;
BYTE
Attr
;
BOOL
bFocus
;
BOOL
bGetCh
;
BOOL
bSysColors
;
HBRUSH
hbrBackground
;
TCHAR
fontname
[
MAXFONTNAME
];
/* font name */
int
fontsize
;
/* font size in pts */
HFONT
hfont
;
int
CharAscent
;
int
ButtonHeight
;
int
StatusHeight
;
int
CaretHeight
;
int
CursorFlag
;
/* scroll to cursor after \n & \r */
POINT
CursorPos
;
/* cursor position on screen */
POINT
ClientSize
;
/* size of the client window in pixels */
POINT
CharSize
;
POINT
ScrollPos
;
POINT
ScrollMax
;
POINT
MarkBegin
;
POINT
MarkEnd
;
BOOL
Marking
;
int
bSuspend
;
int
MaxCursorPos
;
/* variables for docked graphs */
UINT
nDocked
;
UINT
VertFracDock
;
UINT
HorzFracDock
;
UINT
nDockCols
;
UINT
nDockRows
;
UINT
SeparatorWidth
;
COLORREF
SeparatorColor
;
BOOL
bFracChanging
;
}
TW
;
typedef
TW
*
LPTW
;
#ifndef
WGP_CONSOLE
/* ================================== */
/* wtext.c - Text Window */
void
TextMessage
(
void
);
int
TextInit
(
LPTW
lptw
);
void
TextClose
(
LPTW
lptw
);
int
TextKBHit
(
LPTW
);
int
TextGetCh
(
LPTW
);
int
TextGetChE
(
LPTW
);
LPSTR
TextGetS
(
LPTW
lptw
,
LPSTR
str
,
unsigned
int
size
);
int
TextPutCh
(
LPTW
,
BYTE
);
int
TextPutChW
(
LPTW
lptw
,
WCHAR
ch
);
int
TextPutS
(
LPTW
lptw
,
LPSTR
str
);
void
TextStartEditing
(
LPTW
lptw
);
void
TextStopEditing
(
LPTW
lptw
);
#if
0
/* The new screen buffer currently does not support these */
void
TextGotoXY
(
LPTW
lptw
,
int
x
,
int
y
);
int
TextWhereX
(
LPTW
lptw
);
int
TextWhereY
(
LPTW
lptw
);
void
TextCursorHeight
(
LPTW
lptw
,
int
height
);
void
TextClearEOL
(
LPTW
lptw
);
void
TextClearEOS
(
LPTW
lptw
);
void
TextInsertLine
(
LPTW
lptw
);
void
TextDeleteLine
(
LPTW
lptw
);
void
TextScrollReverse
(
LPTW
lptw
);
#endif
void
TextAttr
(
LPTW
lptw
,
BYTE
attr
);
#endif
/* WGP_CONSOLE */
void
AboutBox
(
HWND
hwnd
,
LPTSTR
str
);
/* ================================== */
/* wgraph.c - graphics window */
/* windows data */
/* number of different 'basic' pens supported (the ones you can modify
* by the 'Line styles...' dialog, and save to/from wgnuplot.ini). */
#define
WGNUMPENS
15
/* maximum number of different colors per palette, used to be hardcoded (256) */
#define
WIN_PAL_COLORS
4096
/* hypertext structure
*/
struct
tooltips
{
LPWSTR
text
;
RECT
rect
;
};
/* Information about one graphical operation to be stored by the
* driver for the sake of redraws. Array of GWOP kept in global block */
struct
GWOP
{
UINT
op
;
UINT
x
,
y
;
void
*
pdata
;
};
/* memory block for graph operations */
struct
GWOPBLK
{
/* kept in local memory */
struct
GWOPBLK
*
next
;
struct
GWOP
*
gwop
;
/* pointer to global block if locked */
UINT
used
;
/* number of GWOP's used */
};
/* Maximum number of GWOPBLK arrays to be remembered. */
#define
GWOPMAX
(4*4096)
/* point types */
enum
win_pointtypes
{
W_invalid_pointtype
=
0
,
W_dot
=
10
,
W_plus
,
W_cross
,
W_star
,
W_box
,
W_fbox
,
W_circle
,
W_fcircle
,
W_itriangle
,
W_fitriangle
,
W_triangle
,
W_ftriangle
,
W_diamond
,
W_fdiamond
,
W_pentagon
,
W_fpentagon
,
W_last_pointtype
=
W_fpentagon
};
// The dot is reserved for pt 0, number of (remaining) point types:
#define
WIN_POINT_TYPES
(W_last_pointtype - W_plus + 1)
/* ops */
enum
win_draw_commands
{
W_endoflist
=
0
,
W_point
=
9
,
W_pointsize
=
30
,
W_setcolor
,
W_setcolorrgb
,
W_polyline
,
W_line_type
,
W_dash_type
,
W_line_width
,
W_put_text
,
W_enhanced_text
,
W_boxedtext
,
W_text_encoding
,
W_font
,
W_justify
,
W_text_angle
,
W_filled_polygon_draw
,
W_filled_polygon_pt
,
W_fillstyle
,
W_move
,
W_boxfill
,
W_image
,
W_layer
,
W_hypertext
};
typedef
struct
tagGW
{
GP_LPPRINT
lpr
;
/* must be first */
/* window properties etc. */
HINSTANCE
hInstance
;
/* required */
HINSTANCE
hPrevInstance
;
/* required */
int
Id
;
/* plot number */
LPTSTR
Title
;
/* required */
LPTW
lptw
;
/* associated text window, optional */
LPTSTR
IniFile
;
/* optional */
LPTSTR
IniSection
;
/* optional */
/* window size and position */
BOOL
bDocked
;
/* is the graph docked to the text window? */
POINT
Origin
;
/* origin of graph window */
POINT
Size
;
/* size of graph window */
POINT
Canvas
;
/* requested size of the canvas */
POINT
Decoration
;
/* extent of the window decorations */
int
StatusHeight
;
/* height of status line area */
int
ToolbarHeight
;
/* height of the toolbar */
/* (subwindow) handles */
HWND
hWndGraph
;
/* window handle of the top window */
HWND
hGraph
;
/* window handle of the actual graph */
HWND
hStatusbar
;
/* window handle of status bar */
HWND
hToolbar
;
/* window handle of the toolbar */
HMENU
hPopMenu
;
/* popup menu */
HWND
hTooltip
;
/* tooltip windows for hypertext */
/* command list */
struct
GWOPBLK
*
gwopblk_head
;
/* graph command list */
struct
GWOPBLK
*
gwopblk_tail
;
unsigned
int
nGWOP
;
BOOL
locked
;
/* locked if being written */
/* off-screen bitmap used by GDI, GDI+ and D2D DCRenderer */
HBITMAP
hBitmap
;
/* bitmap of current graph */
BOOL
buffervalid
;
/* indicates if hBitmap is valid */
/* state */
BOOL
initialized
;
/* already initialized? */
BOOL
rotating
;
/* are we currently rotating the graph? */
/* options */
BOOL
graphtotop
;
/* bring graph window to top after every plot? */
BOOL
color
;
/* colored graph? */
BOOL
oversample
;
/* oversampling? */
BOOL
gdiplus
;
/* Use GDI+ only backend? */
BOOL
d2d
;
/* Use Direct2D backend? */
BOOL
antialiasing
;
/* anti-aliasing? */
BOOL
polyaa
;
/* anti-aliasing for polygons ? */
BOOL
fastrotation
;
/* rotate without anti-aliasing? */
COLORREF
background
;
/* background color */
/* plot properties */
int
xmax
;
/* required */
int
ymax
;
/* required */
int
htic
;
/* horizontal size of point symbol (xmax units) */
int
vtic
;
/* vertical size of point symbol (ymax units)*/
int
hchar
;
/* horizontal size of character (xmax units) */
int
vchar
;
/* vertical size of character (ymax units)*/
/* layers */
unsigned
int
numplots
;
BOOL
hasgrid
;
BOOL
hidegrid
;
BOOL
*
hideplot
;
/* array for handling hidden plots */
unsigned
int
maxhideplots
;
unsigned
int
nhidebuttons
;
LPRECT
keyboxes
;
unsigned
int
maxkeyboxes
;
/* hypertext */
struct
tooltips
*
tooltips
;
unsigned
int
maxtooltips
;
unsigned
int
numtooltips
;
/* points and lines */
double
pointscale
;
/* scale factor for point sizes */
double
org_pointsize
;
/* original pointsize */
BOOL
dashed
;
/* dashed lines? */
BOOL
rounded
;
/* rounded line caps and joins? */
double
linewidth
;
/* scale factor for linewidth */
LOGPEN
colorpen
[
WGNUMPENS
+
2
];
/* color pen definitions */
LOGPEN
monopen
[
WGNUMPENS
+
2
];
/* mono pen definitions */
/* fonts */
double
fontscale
;
/* scale factor for font sizes */
TCHAR
deffontname
[
MAXFONTNAME
];
/* default font name */
int
deffontsize
;
/* default font size */
TCHAR
fontname
[
MAXFONTNAME
];
/* current font name */
int
fontsize
;
/* current font size in pts */
int
angle
;
/* text angle */
BOOL
rotate
;
/* can text be rotated? */
int
justify
;
/* text justification */
int
encoding_error
;
/* last unknown encoding */
enum
set_encoding_id
encoding
;
/* text encoding */
LONG
tmHeight
;
/* text metric of current font */
LONG
tmAscent
;
LONG
tmDescent
;
#ifdef
USE_WINGDI
/* GDI resources */
HPEN
hapen
;
/* stored current pen */
HPEN
hsolid
;
/* solid sibling of current pen */
HPEN
hnull
;
/* empty null pen */
HBRUSH
colorbrush
[
WGNUMPENS
+
2
];
/* brushes to fill points */
HBRUSH
hbrush
;
/* background brush */
HBRUSH
hcolorbrush
;
/* color fill brush */
HFONT
hfonth
;
/* horizontal font */
HFONT
hfontv
;
/* rotated font (arbitrary angle) */
LOGFONT
lf
;
/* cached to speed up rotated fonts */
#endif
#ifdef
HAVE_D2D
/* Direct2D resources */
#if
!defined(
HAVE_D2D11
)
||
defined(
DCRENDERER
)
struct
ID2D1RenderTarget
*
pRenderTarget
;
#else
struct
ID2D1Device
*
pDirect2dDevice
;
struct
ID2D1DeviceContext
*
pRenderTarget
;
struct
IDXGISwapChain1
*
pDXGISwapChain
;
#endif
int
dpi
;
/* (nominal) resolution of output device */
#endif
struct
tagGW
*
next
;
/* pointer to next window */
}
GW
;
typedef
GW
*
LPGW
;
typedef
struct
{
LPGW
lpgw
;
/* graph window */
LPRECT
rect
;
/* rect to update */
BOOL
opened_string
;
/* started processing of substring? */
BOOL
show
;
/* print this substring? */
int
overprint
;
/* overprint flag */
BOOL
widthflag
;
/* FALSE for zero width boxes */
BOOL
sizeonly
;
/* only measure length of substring? */
double
base
;
/* current baseline position (above initial baseline) */
int
xsave
,
ysave
;
/* save text position for overprinted text */
int
x
,
y
;
/* current text position */
TCHAR
fontname
[
MAXFONTNAME
];
/* current font name */
double
fontsize
;
/* current font size */
int
totalwidth
;
/* total width of printed text */
int
totalasc
;
/* total height above center line */
int
totaldesc
;
/* total height below center line */
double
res_scale
;
/* scaling due to different resolution (printers) */
int
shift
;
/* baseline alignment */
void
(
*
set_font
)(
void
);
unsigned
(
*
text_length
)(
char
*
);
void
(
*
put_text
)(
int
,
int
,
char
*
);
void
(
*
cleanup
)(
void
);
}
enhstate_struct
;
extern
enhstate_struct
enhstate
;
/* No TEXT Macro required for fonts */
#define
WINFONTSIZE
10
#ifndef
WINFONT
# define
WINFONT
"Tahoma"
#endif
#ifndef
WINJPFONT
# define
WINJPFONT
"MS PGothic"
#endif
#define
WINGRAPHTITLE
TEXT("gnuplot graph")
extern
termentry
*
WIN_term
;
extern
TCHAR
WIN_inifontname
[
MAXFONTNAME
];
extern
int
WIN_inifontsize
;
void
GraphInitStruct
(
LPGW
lpgw
);
void
GraphInit
(
LPGW
lpgw
);
void
GraphUpdateWindowPosSize
(
LPGW
lpgw
);
void
GraphClose
(
LPGW
lpgw
);
void
GraphStart
(
LPGW
lpgw
,
double
pointsize
);
void
GraphEnd
(
LPGW
lpgw
);
void
GraphChangeTitle
(
LPGW
lpgw
);
void
GraphResume
(
LPGW
lpgw
);
void
GraphOp
(
LPGW
lpgw
,
UINT
op
,
UINT
x
,
UINT
y
,
LPCSTR
str
);
void
GraphOpSize
(
LPGW
lpgw
,
UINT
op
,
UINT
x
,
UINT
y
,
LPCSTR
str
,
DWORD
size
);
void
GraphPrint
(
LPGW
lpgw
);
void
GraphRedraw
(
LPGW
lpgw
);
void
GraphModifyPlots
(
LPGW
lpgw
,
unsigned
int
operations
,
int
plotno
);
void
win_close_terminal_window
(
LPGW
lpgw
);
TBOOLEAN
GraphHasWindow
(
LPGW
lpgw
);
LPTSTR
GraphDefaultFont
(
void
);
#ifdef
USE_MOUSE
void
Graph_set_cursor
(
LPGW
lpgw
,
int
c
,
int
x
,
int
y
);
void
Graph_set_ruler
(
LPGW
lpgw
,
int
x
,
int
y
);
void
Graph_put_tmptext
(
LPGW
lpgw
,
int
i
,
LPCSTR
str
);
void
Graph_set_clipboard
(
LPGW
lpgw
,
LPCSTR
s
);
#endif
/* BM: callback functions for enhanced text */
void
GraphEnhancedOpen
(
char
*
fontname
,
double
fontsize
,
double
base
,
TBOOLEAN
widthflag
,
TBOOLEAN
showflag
,
int
overprint
);
void
GraphEnhancedFlush
(
void
);
LPWSTR
UnicodeTextWithEscapes
(
LPCSTR
str
,
enum
set_encoding_id
encoding
);
void
WIN_update_options
(
void
);
/* ================================== */
#ifdef
__cplusplus
}
#endif
#endif
Back
|
FazBrowse Home
|
New Git URL