1998-10-19 21:39:29 +00:00
|
|
|
//
|
2022-02-21 20:23:49 +01:00
|
|
|
// Windows platform header file for the Fast Light Tool Kit (FLTK).
|
1998-10-19 21:39:29 +00:00
|
|
|
//
|
2022-02-21 20:23:49 +01:00
|
|
|
// Copyright 1998-2022 by Bill Spitzak and others.
|
1998-10-19 21:39:29 +00:00
|
|
|
//
|
2011-07-19 04:49:30 +00:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
2020-07-01 18:03:10 +02:00
|
|
|
// https://www.fltk.org/COPYING.php
|
1998-10-19 21:39:29 +00:00
|
|
|
//
|
2020-07-01 18:03:10 +02:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-04-16 00:13:17 +00:00
|
|
|
//
|
2020-07-01 18:03:10 +02:00
|
|
|
// https://www.fltk.org/bugs.php
|
1998-10-19 21:39:29 +00:00
|
|
|
//
|
1998-10-06 19:14:55 +00:00
|
|
|
|
2018-01-31 21:17:17 +00:00
|
|
|
// Do not directly include this file, instead use <FL/platform.H>. It will
|
2018-02-09 14:39:42 +00:00
|
|
|
// include this file if _WIN32 is defined. This is to encourage
|
1998-10-06 19:14:55 +00:00
|
|
|
// portability of even the system-specific code...
|
|
|
|
|
2022-03-15 06:42:06 +01:00
|
|
|
#ifdef FL_DOXYGEN
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
Definitions of functions specific to the Windows platform.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Returns the Windows-specific window reference corresponding to the given Fl_Window object */
|
|
|
|
extern HWND fl_win32_xid(const Fl_Window *win);
|
|
|
|
/** Returns the Fl_Window corresponding to the given Windows-specific window reference */
|
|
|
|
extern Fl_Window *fl_win32_find(HWND);
|
|
|
|
/** Returns the Windows-specific GL rendering context corresponding to the given GLContext */
|
|
|
|
extern HGLRC fl_win32_glcontext(GLContext rc);
|
|
|
|
/** Returns the Windows-specific graphics context for the current window */
|
|
|
|
extern HDC fl_win32_gc();
|
|
|
|
/** Returns the Windows-specific display in use */
|
|
|
|
extern HINSTANCE fl_win32_display();
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2018-01-31 22:34:48 +00:00
|
|
|
#ifndef FL_PLATFORM_H
|
2018-01-31 21:17:17 +00:00
|
|
|
# error "Never use <FL/win32.H> directly; include <FL/platform.H> instead."
|
2018-01-31 22:34:48 +00:00
|
|
|
#endif // !FL_PLATFORM_H
|
2002-06-07 15:06:32 +00:00
|
|
|
|
1998-10-06 19:14:55 +00:00
|
|
|
#include <windows.h>
|
2011-01-17 23:52:32 +00:00
|
|
|
typedef HWND Window;
|
|
|
|
|
2022-03-15 06:42:06 +01:00
|
|
|
typedef struct HGLRC__ *HGLRC;
|
|
|
|
extern FL_EXPORT HGLRC fl_win32_glcontext(GLContext rc);
|
|
|
|
extern FL_EXPORT HWND fl_win32_xid(const Fl_Window *win);
|
|
|
|
extern FL_EXPORT Fl_Window *fl_win32_find(HWND);
|
|
|
|
|
2011-01-17 23:52:32 +00:00
|
|
|
// this part is included only when compiling the FLTK library or if requested explicitly
|
2020-07-01 18:03:10 +02:00
|
|
|
#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
|
2011-01-17 23:52:32 +00:00
|
|
|
|
1998-11-05 16:04:53 +00:00
|
|
|
// In some of the distributions, the gcc header files are missing some stuff:
|
1998-10-06 19:14:55 +00:00
|
|
|
#ifndef LPMINMAXINFO
|
|
|
|
#define LPMINMAXINFO MINMAXINFO*
|
1998-11-05 16:04:53 +00:00
|
|
|
#endif
|
|
|
|
#ifndef VK_LWIN
|
1998-10-06 19:14:55 +00:00
|
|
|
#define VK_LWIN 0x5B
|
|
|
|
#define VK_RWIN 0x5C
|
|
|
|
#define VK_APPS 0x5D
|
|
|
|
#endif
|
|
|
|
|
2002-07-01 20:14:08 +00:00
|
|
|
extern FL_EXPORT UINT fl_wake_msg;
|
1999-02-16 22:00:04 +00:00
|
|
|
extern FL_EXPORT char fl_override_redirect; // hack into Fl_Window::make_xid()
|
2011-01-17 23:52:32 +00:00
|
|
|
extern FL_EXPORT HPALETTE fl_palette; // non-zero only on 8-bit displays!
|
2016-08-09 14:11:42 +00:00
|
|
|
extern void fl_release_dc(HWND w, HDC dc);
|
2011-01-17 23:52:32 +00:00
|
|
|
extern FL_EXPORT void fl_save_dc( HWND w, HDC dc);
|
|
|
|
|
|
|
|
#endif // FL_LIBRARY || FL_INTERNALS
|
|
|
|
|
1998-10-06 19:14:55 +00:00
|
|
|
// most recent fl_color() or fl_rgbcolor() points at one of these:
|
1999-02-16 22:00:04 +00:00
|
|
|
extern FL_EXPORT struct Fl_XMap {
|
2020-07-01 18:03:10 +02:00
|
|
|
COLORREF rgb; // this should be the type the RGB() macro returns
|
|
|
|
HPEN pen; // pen, 0 if none created yet
|
|
|
|
int brush; // ref to solid brush, 0 if none created yet
|
2017-06-27 12:17:29 +00:00
|
|
|
int pwidth; // the width of the pen, if present
|
1998-10-06 19:14:55 +00:00
|
|
|
} *fl_current_xmap;
|
|
|
|
inline COLORREF fl_RGB() {return fl_current_xmap->rgb;}
|
|
|
|
inline HPEN fl_pen() {return fl_current_xmap->pen;}
|
1999-02-16 22:00:04 +00:00
|
|
|
FL_EXPORT HBRUSH fl_brush(); // allocates a brush if necessary
|
2005-09-12 23:03:34 +00:00
|
|
|
FL_EXPORT HBRUSH fl_brush_action(int); // now does the real work
|
1998-10-06 19:14:55 +00:00
|
|
|
|
1999-03-09 18:16:45 +00:00
|
|
|
extern FL_EXPORT HINSTANCE fl_display;
|
2022-03-15 06:42:06 +01:00
|
|
|
extern FL_EXPORT HINSTANCE fl_win32_display();
|
1999-03-09 18:16:45 +00:00
|
|
|
extern FL_EXPORT HDC fl_gc;
|
2022-03-15 06:42:06 +01:00
|
|
|
extern FL_EXPORT HDC fl_win32_gc();
|
1999-03-09 18:16:45 +00:00
|
|
|
extern FL_EXPORT MSG fl_msg;
|
2011-01-17 23:52:32 +00:00
|
|
|
extern FL_EXPORT HDC fl_GetDC(Window);
|
|
|
|
extern FL_EXPORT HDC fl_makeDC(HBITMAP);
|
1998-10-06 19:14:55 +00:00
|
|
|
|
2008-09-18 19:09:34 +00:00
|
|
|
#endif // FL_DOXYGEN
|