35 #if !defined(Fl_X_H) && !defined(FL_DOXYGEN)
42 # elif defined(__APPLE__)
45 # if defined(_ABIN32) || defined(_ABI64) // fix for broken SGI Irix X .h files
46 # pragma set woff 3322
48 # include <X11/Xlib.h>
49 # include <X11/Xutil.h>
50 # if defined(_ABIN32) || defined(_ABI64)
51 # pragma reset woff 3322
53 # include <X11/Xatom.h>
54 # include "Fl_Window.H"
57 typedef Region Fl_Region;
59 FL_EXPORT
void fl_open_display();
60 FL_EXPORT
void fl_open_display(Display*);
61 FL_EXPORT
void fl_close_display();
64 extern FL_EXPORT Display *fl_display;
65 extern FL_EXPORT
int fl_screen;
66 extern FL_EXPORT XVisualInfo *fl_visual;
67 extern FL_EXPORT Colormap fl_colormap;
71 extern FL_EXPORT GC fl_gc;
72 extern FL_EXPORT Window fl_window;
79 FL_EXPORT
int fl_handle(
const XEvent&);
82 extern FL_EXPORT
const XEvent* fl_xevent;
83 extern FL_EXPORT
ulong fl_event_time;
86 typedef ulong Fl_Offscreen;
87 # define fl_create_offscreen(w,h) \
88 XCreatePixmap(fl_display, \
89 (Fl_Surface_Device::surface() == Fl_Display_Device::display_device() ? \
90 fl_window : fl_xid(Fl::first_window()) ) , \
91 w, h, fl_visual->depth)
93 # define fl_begin_offscreen(pixmap) \
94 Window _sw=fl_window; fl_window=pixmap; \
95 Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); Fl_Display_Device::display_device()->set_current(); \
97 # define fl_end_offscreen() \
98 fl_pop_clip(); fl_window = _sw; _ss->set_current()
100 extern void fl_copy_offscreen(
int x,
int y,
int w,
int h, Fl_Offscreen pixmap,
int srcx,
int srcy);
101 # define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)
104 typedef ulong Fl_Bitmask;
106 extern FL_EXPORT Fl_Bitmask fl_create_bitmask(
int w,
int h,
const uchar *data);
107 extern FL_EXPORT Fl_Bitmask fl_create_alphamask(
int w,
int h,
int d,
int ld,
const uchar *data);
108 extern FL_EXPORT
void fl_delete_bitmask(Fl_Bitmask bm);
110 #if defined(FL_LIBRARY) || defined(FL_INTERNALS)
111 extern FL_EXPORT Window fl_message_window;
112 extern FL_EXPORT
void *fl_xftfont;
113 FL_EXPORT Fl_Region XRectangleRegion(
int x,
int y,
int w,
int h);
122 class Fl_XFont_On_Demand
125 Fl_XFont_On_Demand(XFontStruct* p = NULL) : ptr(p) { }
126 Fl_XFont_On_Demand& operator=(
const Fl_XFont_On_Demand& x)
127 { ptr = x.ptr;
return *
this; }
128 Fl_XFont_On_Demand& operator=(XFontStruct* p)
129 { ptr = p;
return *
this; }
130 XFontStruct* value();
131 operator XFontStruct*() {
return value(); }
132 XFontStruct& operator*() {
return *value(); }
133 XFontStruct* operator->() {
return value(); }
134 bool operator==(
const Fl_XFont_On_Demand& x) {
return ptr == x.ptr; }
135 bool operator!=(
const Fl_XFont_On_Demand& x) {
return ptr != x.ptr; }
139 extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
144 class FL_EXPORT Fl_X {
151 char wait_for_expose;
154 static Fl_X* i(
const Fl_Window* wi) {
return wi->i;}
155 void setwindow(
Fl_Window* wi) {w=wi; wi->i=
this;}
159 static void make_xid(
Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap);
160 static Fl_X* set_xid(
Fl_Window*, Window);
162 void flush() {w->
flush();}
163 static void x(
Fl_Window* wi,
int X) {wi->
x(X);}
164 static void y(
Fl_Window* wi,
int Y) {wi->
y(Y);}
165 static int ewmh_supported();
168 extern FL_EXPORT
char fl_override_redirect;
169 extern FL_EXPORT
int fl_background_pixel;
171 inline Window fl_xid(
const Fl_Window* w) { Fl_X *xTemp = Fl_X::i(w);
return xTemp ? xTemp->xid : 0; }
175 extern Window fl_xid_(
const Fl_Window* w);
176 #define fl_xid(w) fl_xid_(w)
178 #endif // FL_LIBRARY || FL_INTERNALS
180 FL_EXPORT
Fl_Window* fl_find(Window xid);
186 extern FL_EXPORT
int fl_parse_color(
const char* p,
uchar& r,
uchar& g,
uchar& b);
This widget produces an actual window.
Definition: Fl_Window.H:50
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:888
void fl_clip_region(Fl_Region r)
Replaces the top of the clipping stack with a clipping region of any shape.
Definition: fl_draw.H:136
void fl_open_callback(void(*cb)(const char *))
Register a function called for each file dropped onto an application icon.
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:168
unsigned long ulong
unsigned long
Definition: fl_types.h:32
This file contains type definitions and general enumerations.
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
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:774
virtual void flush()
Forces the window to be drawn, this window is also made current and calls draw(). ...
Definition: Fl.cxx:1761
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:98
Mac OS X-specific symbols.
unsigned char uchar
unsigned char
Definition: fl_types.h:30