summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2014-09-18 20:23:59 +0000
committerManolo Gouy <Manolo>2014-09-18 20:23:59 +0000
commit527190420cf0a773b1ef8213e773c9050587fd5f (patch)
tree093392190566eb60da6c298f04b012258441e4b7
parentd5698e8ed9adcff51f31e8ddbcce30bf370128f9 (diff)
Allow compilation with Mac OS SDK 10.10 and the i386 architecture
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10321 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Quartz_Printer.mm38
1 files changed, 28 insertions, 10 deletions
diff --git a/src/Fl_Quartz_Printer.mm b/src/Fl_Quartz_Printer.mm
index fc17ef15e..57e46e1bb 100644
--- a/src/Fl_Quartz_Printer.mm
+++ b/src/Fl_Quartz_Printer.mm
@@ -24,6 +24,21 @@
#include <FL/fl_draw.H>
#import <Cocoa/Cocoa.h>
+typedef OSStatus (*PMSessionSetDocumentFormatGeneration_type)(
+ PMPrintSession printSession,
+ CFStringRef docFormat,
+ CFArrayRef graphicsContextTypes,
+ CFTypeRef options);
+typedef OSStatus (*PMSessionBeginDocumentNoDialog_type)(
+ PMPrintSession printSession,
+ PMPrintSettings printSettings,
+ PMPageFormat pageFormat);
+typedef OSStatus
+(*PMSessionGetGraphicsContext_type)(
+ PMPrintSession printSession,
+ CFStringRef graphicsContextType,
+ void ** graphicsContext);
+
extern void fl_quartz_restore_line_style_();
Fl_System_Printer::Fl_System_Printer(void)
@@ -69,9 +84,9 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
if(topage && *topage > pagecount) *topage = pagecount;
status = PMSessionBeginCGDocumentNoDialog(printSession, printSettings, pageFormat);//from 10.4
}
- else {
+ else
#endif
-
+ {
#if !__LP64__
Boolean accepted;
status = PMCreateSession(&printSession);
@@ -112,14 +127,16 @@ int Fl_System_Printer::start_job (int pagecount, int *frompage, int *topage)
CFStringRef mystring[1];
mystring[0] = kPMGraphicsContextCoreGraphics;
CFArrayRef array = CFArrayCreate(NULL, (const void **)mystring, 1, &kCFTypeArrayCallBacks);
+ PMSessionSetDocumentFormatGeneration_type PMSessionSetDocumentFormatGeneration =
+ (PMSessionSetDocumentFormatGeneration_type)Fl_X::get_carbon_function("PMSessionSetDocumentFormatGeneration");
status = PMSessionSetDocumentFormatGeneration(printSession, kPMDocumentFormatDefault, array, NULL);
CFRelease(array);
+ PMSessionBeginDocumentNoDialog_type PMSessionBeginDocumentNoDialog =
+ (PMSessionBeginDocumentNoDialog_type)Fl_X::get_carbon_function("PMSessionBeginDocumentNoDialog");
status = PMSessionBeginDocumentNoDialog(printSession, printSettings, pageFormat);
#endif //__LP64__
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
}
-#endif
+
if (status != noErr) return 1;
y_offset = x_offset = 0;
this->set_current();
@@ -224,14 +241,15 @@ int Fl_System_Printer::start_page (void)
if ( PMSessionGetCGGraphicsContext != NULL ) {
status = PMSessionGetCGGraphicsContext(printSession, &fl_gc);
}
- else {
+ else
#endif
-#if ! __LP64__
- status = PMSessionGetGraphicsContext(printSession,NULL,(void **)&fl_gc);
+ {
+#if ! __LP64_
+ PMSessionGetGraphicsContext_type PMSessionGetGraphicsContext =
+ (PMSessionGetGraphicsContext_type)Fl_X::get_carbon_function("PMSessionGetGraphicsContext");
+ status = PMSessionGetGraphicsContext(printSession, NULL, (void **)&fl_gc);
#endif
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
}
-#endif
PMRect pmRect;
float win_scale_x, win_scale_y;