Actual source code: win32draw.h

  1: #pragma once

  3: #if defined(PETSC_HAVE_WINDOWS_H)
  4:   #include <windows.h>
  5: #endif
  6: #if defined(PETSC_HAVE_WINDOWSX_H)
  7:   #include <windowsx.h>
  8: #endif
  9: #include <petscdraw.h>

 11: /* Nodes that record mouse actions when needed */
 12: typedef struct _p_MouseNode *MouseNode;
 13: struct _p_MouseNode {
 14:   PetscDrawButton Button;
 15:   POINT           user;
 16:   POINT           phys;
 17:   MouseNode       mnext;
 18:   int             Length;
 19: };

 21: /* nodes that contain handle to all user created windows */
 22: typedef struct _p_WindowNode *WindowNode;
 23: struct _p_WindowNode {
 24:   HWND       hWnd;
 25:   WindowNode wnext, wprev;
 26:   HANDLE     event;
 27:   MouseNode  MouseListHead;
 28:   MouseNode  MouseListTail;
 29:   BOOL       IsGetMouseOn;
 30:   PetscBool  DoubleBuffered;
 31:   HDC        Buffer, DoubleBuffer;
 32:   HBITMAP    BufferBit, DoubleBufferBit;
 33:   HGDIOBJ    store, dbstore;
 34:   int        bitwidth, bitheight;
 35: };

 37: /* Nodes that hold all information about a windows device context */
 38: typedef struct {
 39:   HDC        hdc;
 40:   HWND       hWnd;
 41:   int        linewidth;
 42:   int        pointdiameter;
 43:   COLORREF   currentcolor;
 44:   int        stringheight;
 45:   int        stringwidth;
 46:   int        pause;
 47:   PetscBool  haveresized;
 48:   HANDLE     hReadyEvent;
 49:   int        x, y, w, h; /* Size and location of window */
 50:   WindowNode node;       /* so we can grab windownode info if needed */
 51:   DWORD      popup, caption, overlapped;

 53: } PetscDraw_Win32;