xref: /petsc/src/sys/classes/draw/impls/win32/win32draw.h (revision 9dd11ecf0918283bb567d8b33a92f53ac4ea7840)
1*a4963045SJacob Faibussowitsch #pragma once
25c6c1daeSBarry Smith 
35c6c1daeSBarry Smith #if defined(PETSC_HAVE_WINDOWS_H)
45c6c1daeSBarry Smith   #include <windows.h>
55c6c1daeSBarry Smith #endif
65c6c1daeSBarry Smith #if defined(PETSC_HAVE_WINDOWSX_H)
75c6c1daeSBarry Smith   #include <windowsx.h>
85c6c1daeSBarry Smith #endif
95c6c1daeSBarry Smith #include <petscdraw.h>
105c6c1daeSBarry Smith 
115c6c1daeSBarry Smith /* Nodes that record mouse actions when needed */
125c6c1daeSBarry Smith typedef struct _p_MouseNode *MouseNode;
135c6c1daeSBarry Smith struct _p_MouseNode {
145c6c1daeSBarry Smith   PetscDrawButton Button;
155c6c1daeSBarry Smith   POINT           user;
165c6c1daeSBarry Smith   POINT           phys;
175c6c1daeSBarry Smith   MouseNode       mnext;
185c6c1daeSBarry Smith   int             Length;
195c6c1daeSBarry Smith };
205c6c1daeSBarry Smith 
215c6c1daeSBarry Smith /* nodes that contain handle to all user created windows */
225c6c1daeSBarry Smith typedef struct _p_WindowNode *WindowNode;
235c6c1daeSBarry Smith struct _p_WindowNode {
245c6c1daeSBarry Smith   HWND       hWnd;
255c6c1daeSBarry Smith   WindowNode wnext, wprev;
265c6c1daeSBarry Smith   HANDLE     event;
275c6c1daeSBarry Smith   MouseNode  MouseListHead;
285c6c1daeSBarry Smith   MouseNode  MouseListTail;
295c6c1daeSBarry Smith   BOOL       IsGetMouseOn;
305c6c1daeSBarry Smith   PetscBool  DoubleBuffered;
315c6c1daeSBarry Smith   HDC        Buffer, DoubleBuffer;
325c6c1daeSBarry Smith   HBITMAP    BufferBit, DoubleBufferBit;
335c6c1daeSBarry Smith   HGDIOBJ    store, dbstore;
345c6c1daeSBarry Smith   int        bitwidth, bitheight;
355c6c1daeSBarry Smith };
365c6c1daeSBarry Smith 
375c6c1daeSBarry Smith /* Nodes that hold all information about a windows device context */
385c6c1daeSBarry Smith typedef struct {
395c6c1daeSBarry Smith   HDC        hdc;
405c6c1daeSBarry Smith   HWND       hWnd;
415c6c1daeSBarry Smith   int        linewidth;
425c6c1daeSBarry Smith   int        pointdiameter;
435c6c1daeSBarry Smith   COLORREF   currentcolor;
445c6c1daeSBarry Smith   int        stringheight;
455c6c1daeSBarry Smith   int        stringwidth;
465c6c1daeSBarry Smith   int        pause;
475c6c1daeSBarry Smith   PetscBool  haveresized;
485c6c1daeSBarry Smith   HANDLE     hReadyEvent;
495c6c1daeSBarry Smith   int        x, y, w, h; /* Size and location of window */
505c6c1daeSBarry Smith   WindowNode node;       /* so we can grab windownode info if needed */
515c6c1daeSBarry Smith   DWORD      popup, caption, overlapped;
525c6c1daeSBarry Smith 
535c6c1daeSBarry Smith } PetscDraw_Win32;
54