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