win32.H 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // "$Id: win32.H 12273 2017-06-27 12:17:29Z manolo $"
  3. //
  4. // WIN32 header file for the Fast Light Tool Kit (FLTK).
  5. //
  6. // Copyright 1998-2016 by Bill Spitzak and others.
  7. //
  8. // This library is free software. Distribution and use rights are outlined in
  9. // the file "COPYING" which should have been included with this file. If this
  10. // file is missing or damaged, see the license at:
  11. //
  12. // http://www.fltk.org/COPYING.php
  13. //
  14. // Please report all bugs and problems on the following page:
  15. //
  16. // http://www.fltk.org/str.php
  17. //
  18. // Do not directly include this file, instead use <FL/x.H>. It will
  19. // include this file if WIN32 is defined. This is to encourage
  20. // portability of even the system-specific code...
  21. #ifndef FL_DOXYGEN
  22. #ifndef Fl_X_H
  23. # error "Never use <FL/win32.H> directly; include <FL/x.H> instead."
  24. #endif // !Fl_X_H
  25. #include <windows.h>
  26. typedef HWND Window;
  27. // this part is included only when compiling the FLTK library or if requested explicitly
  28. #if defined(FL_LIBRARY) || defined(FL_INTERNALS)
  29. // In some of the distributions, the gcc header files are missing some stuff:
  30. #ifndef LPMINMAXINFO
  31. #define LPMINMAXINFO MINMAXINFO*
  32. #endif
  33. #ifndef VK_LWIN
  34. #define VK_LWIN 0x5B
  35. #define VK_RWIN 0x5C
  36. #define VK_APPS 0x5D
  37. #endif
  38. extern FL_EXPORT UINT fl_wake_msg;
  39. extern FL_EXPORT char fl_override_redirect; // hack into Fl_Window::make_xid()
  40. extern FL_EXPORT int fl_background_pixel; // hack into Fl_Window::make_xid()
  41. extern FL_EXPORT HPALETTE fl_palette; // non-zero only on 8-bit displays!
  42. extern void fl_release_dc(HWND w, HDC dc);
  43. extern FL_EXPORT void fl_save_dc( HWND w, HDC dc);
  44. #endif // FL_LIBRARY || FL_INTERNALS
  45. // most recent fl_color() or fl_rgbcolor() points at one of these:
  46. extern FL_EXPORT struct Fl_XMap {
  47. COLORREF rgb; // this should be the type the RGB() macro returns
  48. HPEN pen; // pen, 0 if none created yet
  49. int brush; // ref to solid brush, 0 if none created yet
  50. #ifdef FLTK_HIDPI_SUPPORT
  51. int pwidth; // the width of the pen, if present
  52. #endif
  53. } *fl_current_xmap;
  54. inline COLORREF fl_RGB() {return fl_current_xmap->rgb;}
  55. inline HPEN fl_pen() {return fl_current_xmap->pen;}
  56. FL_EXPORT HBRUSH fl_brush(); // allocates a brush if necessary
  57. FL_EXPORT HBRUSH fl_brush_action(int); // now does the real work
  58. extern FL_EXPORT HINSTANCE fl_display;
  59. extern FL_EXPORT HDC fl_gc;
  60. extern FL_EXPORT MSG fl_msg;
  61. extern FL_EXPORT HDC fl_GetDC(Window);
  62. extern FL_EXPORT HDC fl_makeDC(HBITMAP);
  63. #endif // FL_DOXYGEN
  64. //
  65. // End of "$Id: win32.H 12273 2017-06-27 12:17:29Z manolo $".
  66. //