FLTK 1.4.4: win32.H Source File

FLTK 1.4.4

Loading...
Searching...
No Matches
win32.H
Go to the documentation of this file.
1//
2// Windows platform header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2022 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17// Do not directly include this file, instead use <FL/platform.H>. It will
18// include this file if _WIN32 is defined. This is to encourage
19// portability of even the system-specific code...
20
21#ifdef FL_DOXYGEN
22
26
28 extern HWND fl_win32_xid(const Fl_Window *win);
30 extern Fl_Window *fl_win32_find(HWND);
32 extern HGLRC fl_win32_glcontext(GLContext rc);
34 extern HDC fl_win32_gc();
36 extern HINSTANCE fl_win32_display();
37
38#else
39
40#ifndef FL_PLATFORM_H
41# error "Never use <FL/win32.H> directly; include <FL/platform.H> instead."
42#endif // !FL_PLATFORM_H
43
44#include <windows.h>
45typedef HWND Window;
46
47typedef struct HGLRC__ *HGLRC;
48extern FL_EXPORT HGLRC fl_win32_glcontext(GLContext rc);
49extern FL_EXPORT HWND fl_win32_xid(const Fl_Window *win);
50extern FL_EXPORT Fl_Window *fl_win32_find(HWND);
51
52// this part is included only when compiling the FLTK library or if requested explicitly
53#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
54
55// In some of the distributions, the gcc header files are missing some stuff:
56#ifndef LPMINMAXINFO
57#define LPMINMAXINFO MINMAXINFO*
58#endif
59#ifndef VK_LWIN
60#define VK_LWIN 0x5B
61#define VK_RWIN 0x5C
62#define VK_APPS 0x5D
63#endif
64
65extern FL_EXPORT UINT fl_wake_msg;
66extern FL_EXPORT char fl_override_redirect; // hack into Fl_Window::make_xid()
67extern FL_EXPORT HPALETTE fl_palette; // non-zero only on 8-bit displays!
68extern void fl_release_dc(HWND w, HDC dc);
69extern FL_EXPORT void fl_save_dc( HWND w, HDC dc);
70
71#endif // FL_LIBRARY || FL_INTERNALS
72
73// most recent fl_color() or fl_rgbcolor() points at one of these:
74extern FL_EXPORT struct Fl_XMap {
75 COLORREF rgb; // this should be the type the RGB() macro returns
76 HPEN pen; // pen, 0 if none created yet
77 int brush; // ref to solid brush, 0 if none created yet
78 int pwidth; // the width of the pen, if present
79} *fl_current_xmap;
80inline COLORREF fl_RGB() {return fl_current_xmap->rgb;}
81inline HPEN fl_pen() {return fl_current_xmap->pen;}
82FL_EXPORT HBRUSH fl_brush(); // allocates a brush if necessary
83FL_EXPORT HBRUSH fl_brush_action(int); // now does the real work
84
85extern FL_EXPORT HINSTANCE fl_display;
86extern FL_EXPORT HINSTANCE fl_win32_display();
87extern FL_EXPORT HDC fl_gc;
88extern FL_EXPORT HDC fl_win32_gc();
89extern FL_EXPORT MSG fl_msg;
90extern FL_EXPORT HDC fl_GetDC(Window);
91extern FL_EXPORT HDC fl_makeDC(HBITMAP);
92
93#endif // FL_DOXYGEN
Fl_Window
This widget produces an actual window.
Definition Fl_Window.H:55
GLContext
struct opaque * GLContext
Pointer to a platform-specific structure representing the window's OpenGL rendering context.
Definition platform_types.h:66
fl_win32_find
Fl_Window * fl_win32_find(HWND)
Returns the Fl_Window corresponding to the given Windows-specific window reference.
fl_win32_xid
HWND fl_win32_xid(const Fl_Window *win)
Returns the Windows-specific window reference corresponding to the given Fl_Window object.
fl_win32_glcontext
HGLRC fl_win32_glcontext(GLContext rc)
Returns the Windows-specific GL rendering context corresponding to the given GLContext.
fl_win32_gc
HDC fl_win32_gc()
Returns the Windows-specific graphics context for the current window.
fl_win32_display
HINSTANCE fl_win32_display()
Returns the Windows-specific display in use.