xref: /petsc/src/sys/classes/draw/impls/win32/win32draw.h (revision 5c6c1daec53e1d9ab0bec9db5309fd8fc7645b8d)
1*5c6c1daeSBarry Smith #if !defined(__WIN32DRAW_H)
2*5c6c1daeSBarry Smith #define __WIN32DRAW_H
3*5c6c1daeSBarry Smith 
4*5c6c1daeSBarry Smith #include <stdio.h>
5*5c6c1daeSBarry Smith #if defined(PETSC_HAVE_WINDOWS_H)
6*5c6c1daeSBarry Smith #include <windows.h>
7*5c6c1daeSBarry Smith #endif
8*5c6c1daeSBarry Smith #if defined(PETSC_HAVE_WINDOWSX_H)
9*5c6c1daeSBarry Smith #include <windowsx.h>
10*5c6c1daeSBarry Smith #endif
11*5c6c1daeSBarry Smith #include <math.h>
12*5c6c1daeSBarry Smith #if defined(PETSC_HAVE_TIME_H)
13*5c6c1daeSBarry Smith #include <time.h>
14*5c6c1daeSBarry Smith #endif
15*5c6c1daeSBarry Smith #if defined(PETSC_HAVE_STDLIB_H)
16*5c6c1daeSBarry Smith #include <stdlib.h>
17*5c6c1daeSBarry Smith #endif
18*5c6c1daeSBarry Smith #include <petscdraw.h>
19*5c6c1daeSBarry Smith 
20*5c6c1daeSBarry Smith /* Nodes that record mouse actions when needed */
21*5c6c1daeSBarry Smith typedef struct _p_MouseNode *MouseNode;
22*5c6c1daeSBarry Smith struct _p_MouseNode{
23*5c6c1daeSBarry Smith   PetscDrawButton Button;
24*5c6c1daeSBarry Smith   POINT      user;
25*5c6c1daeSBarry Smith   POINT      phys;
26*5c6c1daeSBarry Smith   MouseNode  mnext;
27*5c6c1daeSBarry Smith   int        Length;
28*5c6c1daeSBarry Smith };
29*5c6c1daeSBarry Smith 
30*5c6c1daeSBarry Smith /* nodes that contain handle to all user created windows */
31*5c6c1daeSBarry Smith typedef struct _p_WindowNode *WindowNode;
32*5c6c1daeSBarry Smith struct _p_WindowNode {
33*5c6c1daeSBarry Smith   HWND       hWnd;
34*5c6c1daeSBarry Smith   WindowNode wnext,wprev;
35*5c6c1daeSBarry Smith   HANDLE     event;
36*5c6c1daeSBarry Smith   MouseNode  MouseListHead;
37*5c6c1daeSBarry Smith   MouseNode  MouseListTail;
38*5c6c1daeSBarry Smith   BOOL       IsGetMouseOn;
39*5c6c1daeSBarry Smith   PetscBool  DoubleBuffered;
40*5c6c1daeSBarry Smith   HDC        Buffer,DoubleBuffer;
41*5c6c1daeSBarry Smith   HBITMAP    BufferBit,DoubleBufferBit;
42*5c6c1daeSBarry Smith   HGDIOBJ    store,dbstore;
43*5c6c1daeSBarry Smith   int        bitwidth,bitheight;
44*5c6c1daeSBarry Smith };
45*5c6c1daeSBarry Smith 
46*5c6c1daeSBarry Smith /* Nodes that hold all information about a windows device context */
47*5c6c1daeSBarry Smith typedef struct  {
48*5c6c1daeSBarry Smith   HDC        hdc;
49*5c6c1daeSBarry Smith   HWND       hWnd;
50*5c6c1daeSBarry Smith   int        linewidth;
51*5c6c1daeSBarry Smith   int        pointdiameter;
52*5c6c1daeSBarry Smith   COLORREF   currentcolor;
53*5c6c1daeSBarry Smith   int        stringheight;
54*5c6c1daeSBarry Smith   int        stringwidth;
55*5c6c1daeSBarry Smith   int        pause;
56*5c6c1daeSBarry Smith   PetscBool  haveresized;
57*5c6c1daeSBarry Smith   HANDLE     hReadyEvent;
58*5c6c1daeSBarry Smith   int        x,y,w,h;  /* Size and location of window */
59*5c6c1daeSBarry Smith   WindowNode node;/* so we can grab windownode info if needed */
60*5c6c1daeSBarry Smith   DWORD      popup,caption,overlapped;
61*5c6c1daeSBarry Smith 
62*5c6c1daeSBarry Smith } PetscDraw_Win32;
63*5c6c1daeSBarry Smith 
64*5c6c1daeSBarry Smith 
65*5c6c1daeSBarry Smith 
66*5c6c1daeSBarry Smith #endif
67