diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl_Printer.H | 6 | ||||
| -rw-r--r-- | FL/mac.H | 84 |
2 files changed, 48 insertions, 42 deletions
diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index 59d36ce2c..00f85856a 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -58,9 +58,9 @@ private: float scale_x; float scale_y; float angle; // rotation angle in radians - PMPrintSession printSession; - PMPageFormat pageFormat; - PMPrintSettings printSettings; + Fl_PMPrintSession printSession; + Fl_PMPageFormat pageFormat; + Fl_PMPrintSettings printSettings; #elif defined(WIN32) int abortPrint; PRINTDLG pd; @@ -34,8 +34,28 @@ # error "Never use <FL/mac.H> directly; include <FL/x.H> instead." #endif // !Fl_X_H +typedef void* Window; // this is really a pointer to the subclass FLWindow of NSWindow +typedef void* Fl_Offscreen; // this is really a CGContextRef +typedef void* Fl_Bitmask; // this is really a CGImageRef + +#ifndef FL_LIBRARY // this part is used when compiling an application program + +typedef void* Fl_Region; +typedef void* Fl_CGContextRef; +typedef void* Fl_PMPrintSettings; +typedef void* Fl_PMPageFormat; +typedef void* Fl_PMPrintSession; + +#else // this part must be compiled when building the FLTK libraries + // Standard MacOS Carbon API includes... #include <Carbon/Carbon.h> +#undef check // because of Fl::check() + +typedef CGContextRef Fl_CGContextRef; +typedef PMPrintSettings Fl_PMPrintSettings; +typedef PMPageFormat Fl_PMPageFormat; +typedef PMPrintSession Fl_PMPrintSession; #ifndef MAC_OS_X_VERSION_10_3 #define MAC_OS_X_VERSION_10_3 1030 @@ -53,6 +73,16 @@ #define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_3 #endif +typedef struct flCocoaRegion { + int count; + CGRect *rects; +} *Fl_Region; // a region is the union of a series of rectangles + +# include "Fl_Window.H" + +// Some random X equivalents +struct XPoint { int x, y; }; +struct XRectangle {int x, y, width, height;}; #ifndef CGFLOAT_DEFINED //appears with 10.5 in CGBase.h #if defined(__LP64__) && __LP64__ typedef double CGFloat; @@ -61,21 +91,7 @@ typedef float CGFloat; #endif #endif // CGFLOAT_DEFINED - -// Now make some fixes to the headers... -#undef check // Dunno where this comes from... - -// Some random X equivalents -struct XPoint { int x, y; }; -struct XRectangle {int x, y, width, height;}; - -typedef void *Window; // this is really a pter to the subclass FLWindow of NSWindow -typedef struct flCocoaRegion { - int count; - CGRect *rects; -} *Fl_Region; // a region is the union of a series of rectangles extern CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h); - inline Fl_Region XRectangleRegion(int x, int y, int w, int h) { Fl_Region R = (Fl_Region)malloc(sizeof(*R)); R->count = 1; @@ -85,18 +101,12 @@ inline Fl_Region XRectangleRegion(int x, int y, int w, int h) { } inline void XDestroyRegion(Fl_Region r) { if(r) { - free(r->rects); - free(r); - } + free(r->rects); + free(r); + } } -extern void *fl_default_cursor; extern void *fl_system_menu; -typedef CGContextRef Fl_Offscreen; -typedef CGImageRef Fl_Bitmask; - -void fl_clip_region(Fl_Region); - -# include "Fl_Window.H" +extern void *fl_default_cursor; // This object contains all mac-specific stuff about a window: // WARNING: this object is highly subject to change! @@ -104,7 +114,7 @@ class Fl_X { public: Window xid; // pointer to the Cocoa window object (FLWindow*) - Fl_Offscreen other_xid; // pointer for offscreen bitmaps (doublebuffer) + Fl_Offscreen other_xid; // pointer for offscreen bitmaps (overlay window) Fl_Window *w; // FLTK window for Fl_Region region; Fl_Region subRegion; // region for this specific subwindow @@ -147,36 +157,32 @@ private: static void relink(Fl_Window*, Fl_Window*); }; -inline Window fl_xid(const Fl_Window*w) -{ - return Fl_X::i(w)->xid; -} - extern struct Fl_XMap { RGBColor rgb; ulong pen; } *fl_current_xmap; - -extern FL_EXPORT void *fl_display; extern FL_EXPORT Window fl_window; -extern FL_EXPORT CGContextRef fl_gc; + +#endif // FL_LIBRARY + +extern FL_EXPORT Fl_CGContextRef fl_gc; extern FL_EXPORT class Fl_Sys_Menu_Bar *fl_sys_menu_bar; +extern Window fl_xid(const Fl_Window*); +void fl_clip_region(Fl_Region); +extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data); +extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data); +extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm); extern Fl_Offscreen fl_create_offscreen(int w, int h); extern void fl_copy_offscreen(int x,int y,int w,int h, Fl_Offscreen gWorld, int srcx,int srcy); extern void fl_delete_offscreen(Fl_Offscreen gWorld); extern void fl_begin_offscreen(Fl_Offscreen gWorld); extern void fl_end_offscreen(); - -extern FL_EXPORT Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *data); -extern FL_EXPORT Fl_Bitmask fl_create_alphamask(int w, int h, int d, int ld, const uchar *data); -extern FL_EXPORT void fl_delete_bitmask(Fl_Bitmask bm); - +extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); extern void fl_open_display(); -extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); #endif // FL_DOXYGEN /** \defgroup group_macosx Mac OS X-specific functions |
