+
+wxMetafileRefData::wxMetafileRefData( int width, int height)
+{
+ Init();
+
+ m_width = width;
+ m_height = height;
+
+ CGRect r = CGRectMake( 0 , 0 , width , height );
+
+ CFMutableDataRef data = CFDataCreateMutable(kCFAllocatorDefault, 0);
+ m_data.reset(data);
+ CGDataConsumerRef dataConsumer = wxMacCGDataConsumerCreateWithCFData(data);
+ m_context = CGPDFContextCreate( dataConsumer, (width != 0 && height != 0) ? &r : NULL , NULL );
+ CGDataConsumerRelease( dataConsumer );
+ if ( m_context )
+ {
+ CGPDFContextBeginPage(m_context, NULL);
+
+ CGColorSpaceRef genericColorSpace = wxMacGetGenericRGBColorSpace();
+
+ CGContextSetFillColorSpace( m_context, genericColorSpace );
+ CGContextSetStrokeColorSpace( m_context, genericColorSpace );
+
+ CGContextTranslateCTM( m_context , 0 , height ) ;
+ CGContextScaleCTM( m_context , 1 , -1 ) ;
+ }
+}
+
+wxMetafileRefData::~wxMetafileRefData()
+{
+}
+
+void wxMetafileRefData::Init()
+{
+ m_context = NULL;
+ m_width = -1;
+ m_height = -1;
+}
+
+void wxMetafileRefData::Close()