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