44#if !defined(Fl_X_H) && !defined(FL_DOXYGEN)
48#include <FL/Fl_Cairo.H>
52# elif defined(__APPLE__)
55# if defined(_ABIN32) || defined(_ABI64)
59# include <X11/Xutil.h>
60# if defined(_ABIN32) || defined(_ABI64)
61# pragma reset woff 3322
63# include <X11/Xatom.h>
64# include "Fl_Window.H"
67typedef cairo_region_t * Fl_Region;
69FL_EXPORT
void fl_open_display();
70FL_EXPORT
void fl_open_display(Display*);
71FL_EXPORT
void fl_close_display();
74extern FL_EXPORT Display *fl_display;
75extern FL_EXPORT
int fl_screen;
76extern FL_EXPORT XVisualInfo *fl_visual;
77extern FL_EXPORT Colormap fl_colormap;
81extern FL_EXPORT GC fl_gc;
82extern FL_EXPORT Window fl_window;
89FL_EXPORT
int fl_handle(
const XEvent&);
92extern FL_EXPORT
const XEvent* fl_xevent;
93extern FL_EXPORT
ulong fl_event_time;
96typedef ulong Fl_Offscreen;
97FL_EXPORT
void fl_offscreen_get_dimensions ( Fl_Offscreen p,
unsigned int *w,
unsigned int *h );
98# define fl_create_offscreen(w,h) \
99 XCreatePixmap(fl_display, \
100 (Fl_Surface_Device::surface()->class_name() == Fl_Display_Device::class_id ? \
101 fl_window : fl_xid(Fl::first_window()) ) , \
102 w, h, fl_visual->depth)
104# define fl_begin_offscreen(pixmap) \
105 Window _sw=fl_window; fl_window=pixmap; \
106 Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); Fl_Display_Device::display_device()->set_current(); \
107 unsigned int _W, _H; \
108 fl_offscreen_get_dimensions( pixmap, &_W, &_H ); \
109 cairo_surface_t *_cs = Fl::cairo_create_surface( fl_window, _W, _H ); \
110 cairo_t *_old_cc = fl_cairo_context; \
111 fl_cairo_context = cairo_create( _cs ); \
112 cairo_surface_destroy( _cs ); \
114# define fl_end_offscreen() \
115 fl_pop_clip(); fl_window = _sw; _ss->set_current(); \
116 cairo_destroy( fl_cairo_context ); \
117 fl_cairo_context = _old_cc
119extern void fl_copy_offscreen(
int x,
int y,
int w,
int h, Fl_Offscreen pixmap,
int srcx,
int srcy);
120# define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap)
123typedef ulong Fl_Bitmask;
125extern FL_EXPORT Fl_Bitmask fl_create_bitmask(
int w,
int h,
const uchar *data);
126extern FL_EXPORT Fl_Bitmask fl_create_alphamask(
int w,
int h,
int d,
int ld,
const uchar *data);
127extern FL_EXPORT
void fl_delete_bitmask(Fl_Bitmask bm);
129#if defined(FL_LIBRARY) || defined(FL_INTERNALS)
130extern FL_EXPORT Window fl_message_window;
131extern FL_EXPORT
void *fl_xftfont;
132FL_EXPORT Fl_Region XRectangleRegion(
int x,
int y,
int w,
int h);
141class Fl_XFont_On_Demand
144 Fl_XFont_On_Demand(XFontStruct* p = NULL) : ptr(p) { }
145 Fl_XFont_On_Demand& operator=(
const Fl_XFont_On_Demand& x)
146 { ptr = x.ptr;
return *
this; }
147 Fl_XFont_On_Demand& operator=(XFontStruct* p)
148 { ptr = p;
return *
this; }
149 XFontStruct* value();
150 operator XFontStruct*() {
return value(); }
151 XFontStruct& operator*() {
return *value(); }
152 XFontStruct* operator->() {
return value(); }
153 bool operator==(
const Fl_XFont_On_Demand& x) {
return ptr == x.ptr; }
154 bool operator!=(
const Fl_XFont_On_Demand& x) {
return ptr != x.ptr; }
158extern FL_EXPORT Fl_XFont_On_Demand fl_xfont;
163class FL_EXPORT Fl_X {
172 char wait_for_expose;
173 char cairo_surface_invalid;
175 static Fl_X* i(
const Fl_Window* wi) {
return wi->i;}
176 void setwindow(
Fl_Window* wi) {w=wi; wi->i=
this;}
178 static void make_xid(
Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap);
179 static Fl_X* set_xid(
Fl_Window*, Window);
181 void flush() {w->
flush();}
182 static void x(
Fl_Window* wi,
int X) {wi->
x(X);}
183 static void y(
Fl_Window* wi,
int Y) {wi->
y(Y);}
186extern FL_EXPORT
char fl_override_redirect;
187extern FL_EXPORT
int fl_background_pixel;
188extern FL_EXPORT Window fl_parent_window;
190inline Window fl_xid(
const Fl_Window* w) { Fl_X *temp = Fl_X::i(w);
return temp ? temp->xid : 0; }
194extern Window fl_xid_(
const Fl_Window* w);
195#define fl_xid(w) fl_xid_(w)
200FL_EXPORT
void fl_embed (
Fl_Window *w, Window parent );
201extern FL_EXPORT
bool fl_embed_called;
206extern FL_EXPORT
int fl_parse_color(
const char* p,
uchar& r,
uchar& g,
uchar& b);
This file contains type definitions and general enumerations.
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
This widget produces an actual window.
Definition: Fl_Window.H:58
virtual void flush()
Forces the window to be drawn, this window is also made current and calls draw().
Definition: Fl.cxx:1751
unsigned char uchar
unsigned char
Definition: fl_types.h:39
unsigned long ulong
unsigned long
Definition: fl_types.h:41
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:147
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:58
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:145
void fl_open_callback(void(*cb)(const char *))
Register a function called for each file dropped onto an application icon.