2018-01-31 20:46:48 +03:00
|
|
|
//
|
|
|
|
// Platform header file for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2023-02-02 20:48:13 +03:00
|
|
|
// Copyright 1998-2023 by Bill Spitzak and others.
|
2018-01-31 20:46:48 +03: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-02-03 17:58:13 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2018-01-31 20:46:48 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2018-01-31 20:46:48 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2018-01-31 20:46:48 +03:00
|
|
|
//
|
|
|
|
|
|
|
|
// These are FLTK symbols that are necessary or useful for calling
|
|
|
|
// platform specific functions. This file #include's certain platform
|
|
|
|
// specific system header files that are necessary to declare platform
|
|
|
|
// specific FLTK functions, for instance "Windows.h" under Windows.
|
|
|
|
|
|
|
|
// You should include this file if (and ONLY if) you need to call
|
|
|
|
// platform specific functions directly.
|
|
|
|
|
|
|
|
// See FLTK documentation: chapter "Operating System Issues" on when
|
|
|
|
// you need to #include <FL/platform.H>
|
|
|
|
|
|
|
|
#if !defined(FL_PLATFORM_H) && !defined(FL_DOXYGEN)
|
|
|
|
# define FL_PLATFORM_H
|
|
|
|
|
|
|
|
# include <FL/Fl_Export.H>
|
2022-01-04 20:36:45 +03:00
|
|
|
# include <FL/platform_types.h> // will bring in FL/fl_config.h
|
2018-01-31 20:46:48 +03:00
|
|
|
# include <FL/fl_types.h> // for uchar
|
|
|
|
class Fl_Window;
|
|
|
|
|
2018-02-09 17:39:42 +03:00
|
|
|
# ifdef _WIN32
|
2018-01-31 20:46:48 +03:00
|
|
|
# include "win32.H"
|
2022-03-04 17:40:29 +03:00
|
|
|
# elif defined(FLTK_USE_WAYLAND)
|
|
|
|
# include "wayland.H"
|
2022-01-04 20:36:45 +03:00
|
|
|
# elif defined(FLTK_USE_X11)
|
2022-01-05 09:46:49 +03:00
|
|
|
# include "x11.H"
|
2023-02-02 20:48:13 +03:00
|
|
|
# elif defined(__APPLE__)
|
|
|
|
# include "mac.H"
|
2022-01-05 09:46:49 +03:00
|
|
|
# endif // _WIN32
|
2018-01-31 20:46:48 +03:00
|
|
|
|
|
|
|
//
|
|
|
|
// cross-platform declarations
|
|
|
|
//
|
|
|
|
#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
|
|
|
|
# include <FL/Fl_Window.H>
|
|
|
|
|
|
|
|
class FL_EXPORT Fl_X {
|
|
|
|
public:
|
2022-03-15 08:42:06 +03:00
|
|
|
fl_uintptr_t xid;
|
2018-01-31 20:46:48 +03:00
|
|
|
Fl_Window* w;
|
|
|
|
Fl_Region region;
|
|
|
|
Fl_X *next;
|
|
|
|
// static variables, static functions and member functions
|
|
|
|
static Fl_X* first;
|
2023-01-13 23:16:17 +03:00
|
|
|
static Fl_X* flx(const Fl_Window* w) {return w ? (Fl_X*)w->flx_ : 0;}
|
2022-09-09 16:19:15 +03:00
|
|
|
# if defined(FLTK_USE_X11) && FLTK_USE_X11 // for backward compatibility
|
2018-01-31 20:46:48 +03:00
|
|
|
static void make_xid(Fl_Window*, XVisualInfo* =fl_visual, Colormap=fl_colormap);
|
|
|
|
static Fl_X* set_xid(Fl_Window*, Window);
|
2023-01-13 23:16:17 +03:00
|
|
|
static inline Fl_X* i(const Fl_Window* w) {return flx(w);}
|
2018-01-31 20:46:48 +03:00
|
|
|
# endif
|
|
|
|
};
|
|
|
|
|
2023-01-13 23:16:17 +03:00
|
|
|
inline Window fl_xid(const Fl_Window* w) { Fl_X *xTemp = Fl_X::flx(w); return xTemp ? (Window)xTemp->xid : 0; }
|
2018-01-31 20:46:48 +03:00
|
|
|
#else
|
|
|
|
extern FL_EXPORT Window fl_xid_(const Fl_Window* w);
|
|
|
|
# define fl_xid(w) fl_xid_(w)
|
|
|
|
#endif // FL_LIBRARY || FL_INTERNALS
|
|
|
|
|
|
|
|
extern FL_EXPORT Fl_Window* fl_find(Window xid);
|
|
|
|
extern FL_EXPORT void fl_open_display();
|
|
|
|
extern FL_EXPORT void fl_close_display();
|
|
|
|
extern FL_EXPORT Window fl_window;
|
|
|
|
extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b);
|
|
|
|
extern FL_EXPORT void fl_open_callback(void (*)(const char *));
|
|
|
|
|
|
|
|
#endif // !FL_PLATFORM_H
|