25 # error "Never use <FL/mac.H> directly; include <FL/x.H> instead."
30 typedef FLWindow *Window;
32 typedef class FLWindow_opaque *Window;
35 #if !(defined(FL_LIBRARY) || defined(FL_INTERNALS)) // this part is used when compiling an application program
38 typedef struct flCocoaRegion* Fl_Region;
39 typedef struct CGContext* CGContextRef;
40 typedef struct OpaquePMPrintSettings* PMPrintSettings;
41 typedef struct OpaquePMPageFormat* PMPageFormat;
42 typedef struct OpaquePMPrintSession* PMPrintSession;
43 typedef struct CGImage* CGImageRef;
44 typedef CGContextRef Fl_Offscreen;
46 #else // this part must be compiled when building the FLTK libraries
49 #include <ApplicationServices/ApplicationServices.h>
50 #undef check // because of Fl::check()
52 typedef CGContextRef Fl_Offscreen;
54 typedef struct flCocoaRegion {
59 # include "Fl_Window.H"
62 struct XPoint {
int x, y; };
63 struct XRectangle {
int x, y, width, height;};
64 #ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h
65 #if defined(__LP64__) && __LP64__
66 typedef double CGFloat;
68 typedef float CGFloat;
70 #endif // CGFLOAT_DEFINED
72 extern CGRect fl_cgrectmake_cocoa(
int x,
int y,
int w,
int h);
73 inline Fl_Region XRectangleRegion(
int x,
int y,
int w,
int h) {
74 Fl_Region R = (Fl_Region)malloc(
sizeof(*R));
76 R->rects = (CGRect *)malloc(
sizeof(CGRect));
77 *(R->rects) = fl_cgrectmake_cocoa(x, y, w, h);
80 inline void XDestroyRegion(Fl_Region r) {
86 extern void *fl_system_menu;
87 extern void *fl_default_cursor;
95 Fl_Offscreen other_xid;
100 Fl_X *xidChildren, *xidNext;
104 static Fl_X* i(
const Fl_Window* w) {
return w->i;}
105 static int fake_X_wm(
const Fl_Window*,
int&,
int&,
int&,
int&,
int&);
110 static void q_fill_context();
111 static void q_clear_clipping();
112 static void q_release_context(Fl_X *x=0);
113 static void q_begin_image(CGRect&,
int x,
int y,
int w,
int h);
114 static void q_end_image();
119 int unlink(Fl_X* start = NULL);
121 WindowRef window_ref(
void);
122 void set_key_window(
void);
125 static CGImageRef CGImage_from_window_rect(
Fl_Window *win,
int x,
int y,
int w,
int h);
126 static unsigned char *bitmap_from_window_rect(
Fl_Window *win,
int x,
int y,
int w,
int h,
int *bytesPerPixel);
127 static Fl_Region intersect_region_and_rect(Fl_Region current,
int x,
int y,
int w,
int h);
128 static CGContextRef watch_cursor_image(
void);
129 static CGContextRef help_cursor_image(
void);
130 static CGContextRef nesw_cursor_image(
void);
131 static CGContextRef nwse_cursor_image(
void);
132 static CGContextRef none_cursor_image(
void);
133 static void *get_carbon_function(
const char *name);
134 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int n);
140 extern Window fl_window;
142 #endif // FL_LIBRARY || FL_INTERNALS
144 #ifndef MAC_OS_X_VERSION_10_4
145 #define MAC_OS_X_VERSION_10_4 1040
147 #ifndef MAC_OS_X_VERSION_10_5
148 #define MAC_OS_X_VERSION_10_5 1050
150 #ifndef MAC_OS_X_VERSION_10_6
151 #define MAC_OS_X_VERSION_10_6 1060
153 #ifndef MAC_OS_X_VERSION_10_7
154 #define MAC_OS_X_VERSION_10_7 1070
156 #ifndef MAC_OS_X_VERSION_10_8
157 #define MAC_OS_X_VERSION_10_8 1080
160 typedef CGImageRef Fl_Bitmask;
162 extern CGContextRef fl_gc;
169 extern Fl_Bitmask fl_create_bitmask(
int w,
int h,
const uchar *data);
170 extern Fl_Bitmask fl_create_alphamask(
int w,
int h,
int d,
int ld,
const uchar *data);
171 extern void fl_delete_bitmask(Fl_Bitmask bm);
173 extern void fl_copy_offscreen(
int x,
int y,
int w,
int h, Fl_Offscreen gWorld,
int srcx,
int srcy);
178 extern int fl_parse_color(
const char* p,
uchar& r,
uchar& g,
uchar& b);
179 extern void fl_open_display();
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_delete_offscreen(Fl_Offscreen ctx)
Deletion of an offscreen graphics buffer.
Definition: Fl_Double_Window.cxx:301
void fl_open_callback(void(*cb)(const char *))
Register a function called for each file dropped onto an application icon.
void fl_begin_offscreen(Fl_Offscreen ctx)
Send all subsequent drawing commands to this offscreen buffer.
Definition: Fl_Double_Window.cxx:318
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
Fl_Offscreen fl_create_offscreen(int w, int h)
Creation of an offscreen graphics buffer.
Definition: Fl_Double_Window.cxx:260
int fl_mac_os_version
The version number of the running Mac OS X (e.g., 100604 for 10.6.4)
void fl_mac_set_about(Fl_Callback *cb, void *user_data, int shortcut=0)
Attaches a callback to the "About myprog" item of the system application menu.
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
unsigned char uchar
unsigned char
Definition: fl_types.h:30
void fl_end_offscreen()
Quit sending drawing commands to the current offscreen buffer.
Definition: Fl_Double_Window.cxx:336