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 #ifndef MAC_OS_X_VERSION_10_4
53 #define MAC_OS_X_VERSION_10_4 1040
55 #ifndef MAC_OS_X_VERSION_10_5
56 #define MAC_OS_X_VERSION_10_5 1050
58 #ifndef MAC_OS_X_VERSION_10_6
59 #define MAC_OS_X_VERSION_10_6 1060
61 #ifndef MAC_OS_X_VERSION_10_7
62 #define MAC_OS_X_VERSION_10_7 1070
64 #ifndef MAC_OS_X_VERSION_10_8
65 #define MAC_OS_X_VERSION_10_8 1080
67 #ifndef MAC_OS_X_VERSION_10_9
68 #define MAC_OS_X_VERSION_10_9 1090
70 #ifndef MAC_OS_X_VERSION_10_10
71 #define MAC_OS_X_VERSION_10_10 101000
80 typedef CGContextRef Fl_Offscreen;
82 typedef struct flCocoaRegion {
88 # include "../src/Fl_Font.H"
91 struct XPoint {
int x, y; };
92 struct XRectangle {
int x, y, width, height;};
93 #ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h
94 #if defined(__LP64__) && __LP64__
95 typedef double CGFloat;
97 typedef float CGFloat;
99 #endif // CGFLOAT_DEFINED
101 extern CGRect fl_cgrectmake_cocoa(
int x,
int y,
int w,
int h);
102 inline Fl_Region XRectangleRegion(
int x,
int y,
int w,
int h) {
103 Fl_Region R = (Fl_Region)malloc(
sizeof(*R));
105 R->rects = (CGRect *)malloc(
sizeof(CGRect));
106 *(R->rects) = fl_cgrectmake_cocoa(x, y, w, h);
109 inline void XDestroyRegion(Fl_Region r) {
115 extern NSCursor *fl_default_cursor;
123 Fl_Offscreen other_xid;
128 Fl_X *xidChildren, *xidNext;
132 static Fl_X* i(
const Fl_Window* w) {
return w->i;}
133 static int fake_X_wm(
const Fl_Window*,
int&,
int&,
int&,
int&,
int&);
138 static void q_fill_context();
139 static void q_clear_clipping();
140 static void q_release_context(Fl_X *x=0);
141 static void q_begin_image(CGRect&,
int x,
int y,
int w,
int h);
142 static void q_end_image();
147 int unlink(Fl_X* start = NULL);
149 WindowRef window_ref(
void);
150 void set_key_window(
void);
152 static void set_default_icons(
const Fl_RGB_Image*[],
int) {};
156 static CGImageRef CGImage_from_window_rect(
Fl_Window *win,
int x,
int y,
int w,
int h);
157 static unsigned char *bitmap_from_window_rect(
Fl_Window *win,
int x,
int y,
int w,
int h,
int *bytesPerPixel);
158 static CFDataRef CGBitmapContextToTIFF(CGContextRef c);
159 static Fl_Region intersect_region_and_rect(Fl_Region current,
int x,
int y,
int w,
int h);
160 static CGContextRef watch_cursor_image(
void);
161 static CGContextRef help_cursor_image(
void);
162 static CGContextRef nesw_cursor_image(
void);
163 static CGContextRef nwse_cursor_image(
void);
164 static CGContextRef none_cursor_image(
void);
165 static void *get_carbon_function(
const char *name);
166 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int n);
167 static int next_marked_length;
168 static int insertion_point_location(
int *px,
int *py,
int *pheight);
169 static const int CoreText_threshold;
176 extern Window fl_window;
178 #endif // FL_LIBRARY || FL_INTERNALS
180 typedef CGImageRef Fl_Bitmask;
182 extern CGContextRef fl_gc;
188 extern Fl_Bitmask fl_create_bitmask(
int w,
int h,
const uchar *data);
189 extern Fl_Bitmask fl_create_alphamask(
int w,
int h,
int d,
int ld,
const uchar *data);
190 extern void fl_delete_bitmask(Fl_Bitmask bm);
192 extern void fl_copy_offscreen(
int x,
int y,
int w,
int h, Fl_Offscreen gWorld,
int srcx,
int srcy);
197 extern int fl_parse_color(
const char* p,
uchar& r,
uchar& g,
uchar& b);
198 extern void fl_open_display();
This widget produces an actual window.
Definition: Fl_Window.H:57
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:910
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:298
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:315
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:183
class Fl_Sys_Menu_Bar * fl_sys_menu_bar
The system menu bar.
Definition: Fl_Sys_Menu_Bar.mm:60
Fl_Offscreen fl_create_offscreen(int w, int h)
Creation of an offscreen graphics buffer.
Definition: Fl_Double_Window.cxx:257
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.
Definition: Fl_Sys_Menu_Bar.mm:191
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:333