-
-#if defined(_NEW_GC_DASHES_)
- const char *dashData = NULL ;
- char *userDashData = NULL ;
- float alphaArray[1];
-
- const char dotted[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 };
- const char dashed[] = { 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00 };
- const char short_dashed[] = { 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00 };
- const char dotted_dashed[] = { 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00 };
-
- switch (pen.GetStyle())
- {
- case wxSOLID:
- // default, undashed pen
- break;
-
- case wxDOT:
- dashData = dotted;
- count = WXSIZEOF(dotted);
- break;
- case wxLONG_DASH:
- dashData = dashed;
- count = WXSIZEOF(dashed);
- break;
- case wxSHORT_DASH:
- dashData = short_dashed;
- count = WXSIZEOF(short_dashed);
- break;
- case wxDOT_DASH:
- dashData = dotted_dashed;
- count = WXSIZEOF(dotted_dashed);
- break;
- case wxUSER_DASH:
- count = pen.GetDashes( (wxDash**)&userDashData );
- dashData = userDashData;
- break;
-
- default :
- break;
- }
-
- if ((dashData != NULL) && (count > 0))
- {
- CGPatternRef patternRef;
- RGBColor col;
- long result;
- bool useMultibit;
-
- useMultibit = true;
- result = CreatePatternFromDashes( &patternRef, (const wxDash*)dashData, count, useMultibit );
- if (result == 0)
- {
- col = MAC_WXCOLORREF( pen.GetColour().GetPixel() );
- CGContextSetRGBStrokeColor(
- m_cgContext, (float) col.red / 65536.0,
- (float) col.green / 65536.0, (float) col.blue / 65536.0, 1.0 );
-
- EstablishPatternColorSpace( m_cgContext, useMultibit, false );
-
- alphaArray[0] = 1.0;
- CGContextSetStrokePattern( m_cgContext, patternRef, alphaArray );
- CGPatternRelease( patternRef );
- }
-
- if (result != 0)
- wxLogDebug( wxT("CreatePatternFromDashes failed: result [%ld]"), result );
- }
-#else