22#if !defined(Fl_X_H) && !defined(FL_DOXYGEN)
29# elif defined(__APPLE__)
32# if defined(_ABIN32) || defined(_ABI64)
36# include <X11/Xutil.h>
37# if defined(_ABIN32) || defined(_ABI64)
38# pragma reset woff 3322
40# include <X11/Xatom.h>
43typedef Region Fl_Region;
45FL_EXPORT
void fl_open_display();
46FL_EXPORT
void fl_open_display(Display*);
47FL_EXPORT
void fl_close_display();
50extern FL_EXPORT Display *fl_display;
51extern FL_EXPORT
int fl_screen;
52extern FL_EXPORT XVisualInfo *fl_visual;
53extern FL_EXPORT Colormap fl_colormap;
57extern FL_EXPORT GC fl_gc;
58extern FL_EXPORT Window fl_window;
65FL_EXPORT
int fl_handle(
const XEvent&);
68extern FL_EXPORT
const XEvent* fl_xevent;
69extern FL_EXPORT
ulong fl_event_time;
72typedef ulong Fl_Offscreen;
73# define fl_create_offscreen(w,h) XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen), w, h, fl_visual->depth)
74# define fl_create_offscreen_with_alpha(w,h) XCreatePixmap(fl_display, RootWindow(fl_display, fl_screen), w, h, 32)
76# define fl_begin_offscreen(pixmap) \
77 Window _sw=fl_window; fl_window=pixmap; \
78 GC _sgc = fl_gc; if (!_sgc) fl_gc = XCreateGC(fl_display, pixmap, 0, 0); \
79 Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); Fl_Display_Device::display_device()->set_current(); \
81# define fl_end_offscreen() \
82 fl_pop_clip(); fl_window = _sw; _ss->set_current(); \
83 if (!_sgc) XFreeGC(fl_display, fl_gc); \
86extern FL_EXPORT
void fl_copy_offscreen(
int x,
int y,
int w,
int h, Fl_Offscreen pixmap,
int srcx,
int srcy);
87# define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)
90typedef ulong Fl_Bitmask;
92extern FL_EXPORT Fl_Bitmask fl_create_bitmask(
int w,
int h,
const uchar *data);
93extern FL_EXPORT Fl_Bitmask fl_create_alphamask(
int w,
int h,
int d,
int ld,
const uchar *data);
94extern FL_EXPORT
void fl_delete_bitmask(Fl_Bitmask bm);
96#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
97extern FL_EXPORT Window fl_message_window;
98extern FL_EXPORT
void *fl_xftfont;
99FL_EXPORT Fl_Region XRectangleRegion(
int x,
int y,
int w,
int h);
108class Fl_XFont_On_Demand
111 Fl_XFont_On_Demand(XFontStruct* p = NULL) : ptr(p) { }
112 Fl_XFont_On_Demand& operator=(
const Fl_XFont_On_Demand& x)
113 { ptr = x.ptr;
return *
this; }
114 Fl_XFont_On_Demand& operator=(XFontStruct* p)
115 { ptr = p;
return *
this; }
116 XFontStruct* value();
117 operator XFontStruct*() {
return value(); }
118 XFontStruct& operator*() {
return *value(); }
119 XFontStruct* operator->() {
return value(); }
120 bool operator==(
const Fl_XFont_On_Demand& x) {
return ptr == x.ptr; }
121 bool operator!=(
const Fl_XFont_On_Demand& x) {
return ptr != x.ptr; }
125extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
126extern FL_EXPORT XFontStruct* fl_X_core_font();
131class FL_EXPORT Fl_X {
138 char wait_for_expose;
141 static Fl_X* i(
const Fl_Window* wi) {
return wi->i;}
142 void setwindow(
Fl_Window* wi) {w=wi; wi->i=
this;}
144 static void set_default_icons(
const Fl_RGB_Image*[],
int);
148 static void make_xid(
Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap);
149 static Fl_X* set_xid(
Fl_Window*, Window);
151 void flush() {w->flush();}
152 static void x(
Fl_Window* wi,
int X) {wi->
x(X);}
153 static void y(
Fl_Window* wi,
int Y) {wi->
y(Y);}
154 static int ewmh_supported();
155 static int xrender_supported();
156 static void activate_window(Window w);
159extern FL_EXPORT
char fl_override_redirect;
160extern FL_EXPORT
int fl_background_pixel;
162inline Window fl_xid(
const Fl_Window* w) { Fl_X *xTemp = Fl_X::i(w);
return xTemp ? xTemp->xid : 0; }
166extern FL_EXPORT Window fl_xid_(
const Fl_Window* w);
167#define fl_xid(w) fl_xid_(w)
177extern FL_EXPORT
int fl_parse_color(
const char* p,
uchar& r,
uchar& g,
uchar& b);
This file contains type definitions and general enumerations.
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1046
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:932
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition Fl_Image.H:202
This widget produces an actual window.
Definition Fl_Window.H:57
unsigned char uchar
unsigned char
Definition fl_types.h:30
unsigned long ulong
unsigned long
Definition fl_types.h:32
ulong fl_xpixel(uchar r, uchar g, uchar b)
Returns the X pixel number used to draw the given rgb color.
Definition fl_color.cxx:150
Fl_Region fl_clip_region()
Returns the current clipping region.
Definition fl_draw.H:140
void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
Copy a rectangular area of the given offscreen buffer into the current drawing destination.
Definition Fl_Double_Window.cxx:94
void fl_open_callback(void(*cb)(const char *))
Register a function called for each file dropped onto an application icon.
Mac OS X-specific symbols.