Inheritance diagram for CP_Graphics_Imp_Quartz:
Public Member Functions | |
Getters | |
virtual float | GetLineWidth () |
virtual float | GetAlpha () |
virtual CP_ARGBColor | GetStrokeColor () |
virtual CP_ARGBColor | GetFillColor () |
CP_Canvas | GetCanvas () |
Getters | |
virtual float | GetLineWidth () |
virtual float | GetAlpha () |
virtual CP_ARGBColor | GetStrokeColor () |
virtual CP_ARGBColor | GetFillColor () |
CP_Canvas | GetCanvas () |
Gradient | |
virtual void | SetGradientColor (const SInt16, const CP_ARGBColor &) |
Text | |
virtual void | SetTextRenderingFlags (SInt16) |
Getters | |
virtual float | GetLineWidth () |
virtual float | GetAlpha () |
virtual CP_ARGBColor | GetStrokeColor () |
virtual CP_ARGBColor | GetFillColor () |
CP_Canvas | GetCanvas () |
Constructor / Destructor | |
CP_Graphics_Imp_Quartz (CP_Canvas &inDestCanvas, bool inSynchronizeWithPort=true) | |
Constructor. | |
virtual | ~CP_Graphics_Imp_Quartz () |
Destructor. | |
Context | |
CGContextRef | GetCGContext () |
Setters | |
virtual void | SetAlpha (float inAlpha) |
virtual void | SetLineWidth (float lineWidth) |
virtual void | SetLineJoin (CP_E_GraphicsLineJoin inLineJoin) |
virtual void | SetLineCap (CP_E_GraphicsLineCap inLineCap) |
virtual void | SetStrokeColor (CP_ARGBColor &inStrokeColor) |
virtual void | SetFillColor (CP_ARGBColor &inFillColor) |
Graphics State | |
virtual void | SaveState () |
virtual void | RestoreState () |
virtual void | ScaleCTM (float inHorAmt, float inVerAmt) |
virtual void | TranslateCTM (float inHorAmt, float inVerAmt) |
virtual void | RotateCTM (float inAngle) |
Arcs | |
virtual void | StrokeArc (float inHorCenter, float inVerCenter, float inRadius, float inStartAngle, float inEndAngle) |
virtual void | FillArc (float inHorCenter, float inVerCenter, float inRadius, float inStartAngle, float inEndAngle) |
Bezier Curves | |
virtual void | StrokeBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inControlPointTwo, const CP_Point &inEndPoint) |
virtual void | StrokeQuadBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inEndPoint) |
Gradient | |
virtual void | DrawGradient (CP_E_GradientType inGradientType, CP_Rect &inDestBounds) |
virtual void | SetGradientAngle (SInt16 inAngle) |
virtual void | SetGradientColor (const SInt16 inIndex, const CP_ARGBColor &inColour) |
virtual void | SetGradientCount (SInt16 inGradientCount) |
Icons | |
virtual void | DrawIcon (const CP_Rect &inBounds, CP_E_IconStyle inIconType, SInt16 inIconID) |
virtual void | DrawIcon (CP_OSIcon &inPicture, const CP_Rect &inBounds) |
Images | |
virtual void | DrawImage (SInt16 inImageResID, CP_Rect &inDestBounds) |
virtual void | DrawImage (const CP_FileSystemSpec &inImageSpec, CP_Rect &inDestBounds) |
virtual void | DrawImage (const CP_FileSystemSpec &inImageSpec, CP_Rect &inSourceBounds, CP_Rect &inDestBounds) |
Lines | |
virtual void | Line (const CP_Point &inPoint, const CP_Size &inSize) |
virtual void | Line (float inStartHorLocation, float inStartVerLocation, float inEndHorLocation, float inEndVerLocation) |
Paths | |
virtual void | BeginPath () |
virtual void | ClosePath () |
virtual void | StrokePath () |
virtual void | FillPath () |
virtual void | DrawPath (CP_E_PathDrawingMode inPathDrawMode) |
virtual void | PathMoveTo (const CP_Point &inPoint) |
virtual void | PathMoveTo (float inHorLocation, float inVerLocation) |
virtual void | PathAddLineTo (const CP_Point &inPoint) |
virtual void | PathAddLines (const CP_Point inPoint[], SInt16 inNumberPoints) |
virtual void | PathAddLine (const CP_Point &inStartPoint, const CP_Point &inEndPoint) |
virtual void | PathAddLine (float inStartH, float inStartV, float inEndH, float inEndV) |
virtual void | PathAddRect (const CP_Rect &inBounds) |
virtual void | PathAddBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inControlPointTwo, const CP_Point &inEndPoint) |
virtual void | PathAddQuadBezier (const CP_Point &inStartPoint, const CP_Point &inControlPointOne, const CP_Point &inEndPoint) |
virtual void | PathAddArc (float x, float y, float radius, float startAngle, float endAngle, SInt16 clockwise) |
virtual void | PathAddArcToPoint (float x1, float y1, float x2, float y2, float radius) |
virtual void | PathAddOval (const CP_Rect &inBounds) |
virtual void | PathAddPoly (CP_Point_Array &inPoints) |
virtual void | ClipPath () |
Polygons | |
virtual void | StrokePoly (CP_Point_Array &inPoints) |
virtual void | FillPoly (CP_Point_Array &inPoints) |
Rects | |
virtual void | StrokeRect (const CP_Rect &inBounds) |
virtual void | FillRect (const CP_Rect &inBounds) |
Regions | |
virtual void | StrokeRegion (const CP_Region &inRegion) |
virtual void | FillRegion (const CP_Region &inRegion) |
Round Rects | |
virtual void | StrokeRoundRect (const CP_Rect &inBounds, SInt16 inHorRadius, SInt16 inVerRadius) |
virtual void | FillRoundRect (const CP_Rect &inBounds, SInt16 inHorRadius, SInt16 inVerRadius) |
Oval | |
virtual void | StrokeOval (const CP_Rect &inBounds) |
virtual void | FillOval (const CP_Rect &inBounds) |
Text | |
virtual void | DrawString (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Point &inStartPoint) |
virtual void | DrawQuartzString (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Point &inStartPoint) |
virtual void | DrawText (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Rect &inBounds, SInt16 inHorAlign=CP_E_TextAlign_HorLeft, SInt16 inVerAlign=CP_E_TextAlign_VerTop, bool inWrapText=true) |
virtual void | DrawTrunc (CP_FontSpec &inFontSpec, const CP_String &inText, const CP_Rect &inBounds, SInt16 inHorAlign=CP_E_TextAlign_HorLeft, SInt16 inVerAlign=CP_E_TextAlign_VerTop) |
Getters | |
virtual float | GetLineWidth () |
virtual float | GetAlpha () |
virtual CP_ARGBColor | GetStrokeColor () |
virtual CP_ARGBColor | GetFillColor () |
CP_Canvas | GetCanvas () |
State | |
virtual void | SkewCTM (float, float) |
Gradient | |
virtual void | SetGradientColor (const SInt16, const CP_ARGBColor &) |
Images | |
virtual void | DrawPicture (CP_OSPicture &, const CP_Rect &) |
Paths | |
virtual void | FillPath (CP_Pattern &) |
virtual void | PathAddLines (const CP_Point[], SInt16) |
Rects | |
virtual void | EraseRect (const CP_Rect &) |
Text | |
virtual void | SetTextRenderingFlags (SInt16) |
Protected Attributes | |
CGContextRef | fContextRef |
CFBundleRef | fAppServicesFrameworkBundle |
CGContextSetAlphaFuncPtr | fSetAlphaFP |
CGContextSetLineWidthFuncPtr | fSetLineWidthFP |
CGContextSetLineJoinFuncPtr | fLineJoinFP |
CGContextSetLineCapFuncPtr | fLineCapFP |
CGContextSetRGBStrokeColorFuncPtr | fStrokeColorFP |
CGContextSetRGBFillColorFuncPtr | fFillColorFP |
CGContextSaveGStateFuncPtr | fSaveGStateFP |
CGContextRestoreGStateFuncPtr | fRestoreGStateFP |
CGContextScaleCTMFuncPtr | fScaleCTMFP |
CGContextTranslateCTMFuncPtr | fTranslateCTMFP |
CGContextRotateCTMFuncPtr | fRotateCTMFP |
CGContextAddCurveToPointFuncPtr | fCurveToFP |
CGContextAddQuadCurveToPointFuncPtr | fQuadCurveToFP |
CGColorSpaceCreateDeviceRGBFuncPtr | fColorSpaceCreateDeviceRGBFP |
CGColorSpaceReleaseFuncPtr | fColorSpaceReleaseFP |
CGContextMoveToPointFuncPtr | fMoveToFP |
CGContextAddLineToPointFuncPtr | fLineToFP |
CGDataProviderReleaseFuncPtr | fDataProviderReleaseFP |
CGDataProviderCreateWithDataFuncPtr | fDataProviderCreateWithDataFP |
CGImageReleaseFuncPtr | fImageReleaseFP |
CGContextDrawImageFuncPtr | fContextDrawImageFP |
CGImageCreateFuncPtr | fImageCreateFP |
CGContextBeginPathFuncPtr | fBeginPathFP |
CGContextClosePathFuncPtr | fClosePathFP |
CGContextStrokePathFuncPtr | fStrokePathFP |
CGContextFillPathFuncPtr | fFillPathFP |
CGContextDrawPathFuncPtr | fDrawPathFP |
CGContextAddRectFuncPtr | fAddRectFP |
CGContextAddArcFuncPtr | fAddArcFP |
CGContextAddArcToPointFuncPtr | fAddArcToPointFP |
CGContextClipFuncPtr | fClipFP |
CP_Point_Array | fPoints |
CGContextFillRectFuncPtr | fFillRectFP |
CGContextStrokeRectFuncPtr | fStrokeRectFP |
CGContextShowTextAtPointFuncPtr | fShowTextAtPoint |
CGContextSelectFontFuncPtr | fSelectFont |
CGAffineTransformScaleFuncPtr | fAffineTransformScale |
CGContextSetTextMatrixFuncPtr | fSetTextMatrix |
CP_E_GradientType | fGradientType |
SInt16 | fGradientCount |
CP_RGBColor | fColors [kCP_MaxGradientColors] |
SInt16 | fOffsets [kCP_MaxGradientColors] |
SInt16 | fGradientAngle |
CP_Region | fDestRegion |
CP_Canvas | fDestCanvas |
float | fAlpha |
float | fLineWidth |
CP_ARGBColor | fStrokeColor |
CP_ARGBColor | fFillColor |
Private Member Functions | |
Misc | |
void | Init () |
void | MakeRoundRect (const CP_Rect &inBounds, SInt16 inHorRadius, SInt16 inVerRadius) |
void | MakeOval (CGPoint inCenter, float a, float b) |
Gradient | |
void | DrawGradient_imp (CP_E_GradientType inGradietType, CP_Rect &inDestBounds) |
virtual void | BuildGradient (CP_Rect &inDestBounds, CP_Point &inCenterPoint) |
void | InitGradient () |
CP_E_GradientType | GetGradiientType () |
SInt16 | GetGradientAngle () |
SInt16 | GetNumberGradients () |
SInt32 | CalcGradientRange (CP_Rect &inBounds, CP_Point &inCenterPoint) |
void | CalcGradientColors (SInt32 inRange, CP_RGBColor &inOutColorOne, CP_RGBColor &inOutColorTwo, CP_E_GradientColorInfo *inOutGradientInfo) |
void | AdjustColor (CP_RGBColor &inOutColor, CP_E_GradientColorInfo *inOutGradientInfo) |
void | CalcEnclosingBounds (CP_Rect &inOutBounds, CP_Point &inCenterPoint) |
void | BuildRect (CP_Rect &inDestBounds, CP_Point &inCenterPoint, CP_E_GradientType inGradientType) |
void | BuildRadial (CP_Rect &inBounds, CP_Point &inCenterPoint) |
void | BuildSunburst (CP_Rect &inBounds, CP_Point &inCenterPoint, CP_E_GradientType inGradientType) |
void | BuildShapeburst (CP_Rect &inBounds, CP_Point &inCenterPoint) |
void | BuildAngled (CP_Rect &inBounds) |
UInt16 | CP_FixedToColor (CP_Fixed inValue) |
Images | |
void | ReadBitmapInfo (GraphicsImportComponent gi, CP_S_QuartzBitmapInfo *bi) |
void | GetBitmapData (GraphicsImportComponent gi, CP_S_QuartzBitmapInfo *bi) |
Polygons | |
void | CreatePolyShape () |
|
Constructor.
|
|
Destructor.
|
|
|
|
Sets the alpha value used when drawing.
Reimplemented from CP_Graphics_Imp. |
|
Sets the line width used in stroking.
Reimplemented from CP_Graphics_Imp. |
|
Sets the line join for determing how lines will be drawn when they join. Note: Some platforms do not support line join, and they will be drawn in the normal style. Current values for inLineJoint can be:
Reimplemented from CP_Graphics_Imp. |
|
Sets the line cap for determing how lines ending will be drawn. Note: Some platforms do not support line caps, and they will be drawn in the normal style. Current values for inLineCap can be:
Reimplemented from CP_Graphics_Imp. |
|
Sets the color used in stroking objects.
Reimplemented from CP_Graphics_Imp. |
|
Sets the color used in filling objects.
Reimplemented from CP_Graphics_Imp. |
|
Saves the current graphics state.
Reimplemented from CP_Graphics_Imp. |
|
Restore the current graphics state. Each RestoreState needs to have a matching SaveState called before calling this.
CP_Graphics graphics( inDestCanvas ); graphics.SaveState(); do some drawing and state changes here, such as setting colors, line styles graphics.RestoreState();
Reimplemented from CP_Graphics_Imp. |
|
Sets the scaling amount to be used in the current transformation matrix.
Reimplemented from CP_Graphics_Imp. |
|
Sets the translation amount to be used in the current transformation matrix.
Reimplemented from CP_Graphics_Imp. |
|
Sets the rotation amount to be used in the current transformation matrix.
Reimplemented from CP_Graphics_Imp. |
|
Draws an arc using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
Reimplemented from CP_Graphics_Imp. |
|
Draws an arc using the passed in parameters, and then fills it, using the current fill color.
Reimplemented from CP_Graphics_Imp. |
|
Draws a Bezier curve using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
Reimplemented from CP_Graphics_Imp. |
|
Draws a Quad Bezier curve using the passed in parameters, and then strokes it, using the current stroke color and stroke line width.
Reimplemented from CP_Graphics_Imp. |
|
Draws a gradient in the specified bounds. The gradient can be of the following types:
Reimplemented from CP_Graphics_Imp. |
|
Reimplemented from CP_Graphics_Imp. |
|
Sets one of the colors used in the gradient drawing.
|
|
Reimplemented from CP_Graphics_Imp. |
|
Draws a icon resource in the passed in bounds. The image will be scaled to fit the rectangle.
Reimplemented from CP_Graphics_Imp. |
|
Draws the CP_OSicon in the passed in bounds. The image will be scaled to fit the rectangle.
Reimplemented from CP_Graphics_Imp. |
|
Draws a picture image into the specified area. The image will be scaled to fit into the destination area.
Reimplemented from CP_Graphics_Imp. |
|
Draws a picture image into the specified area. The image will be scaled to fit into the destination area. The image is located in the passed in file spec.
Reimplemented from CP_Graphics_Imp. |
|
Draw the passed in image object in the destination bounds, scaling the image to fit. This versions copies inSourceBounds portion of the image to the destination.
Reimplemented from CP_Graphics_Imp. |
|
Draws a line from the passed in start location and going for the distance specified in inSize.
|
|
Draws a line from the passed in start location to the ending location.
Reimplemented from CP_Graphics_Imp. |
|
Marks the beginning of a path. This indicates that all subsequent drawing operations until ClosePath is called is collected into the current path. After ClosePath is called, you can then stroke or fill the path. The only drawing calls that are added, are the ones that begin with Path, such as PathMoveTo, PathAddOval, PathAddRect, etc.
CP_Graphics graphics( inDestCanvas ); graphics.BeginPath(); do some path drawing commands here graphics.EndPath(); graphics.StrokePath();
Reimplemented from CP_Graphics_Imp. |
|
Closes the current path. Every call to ClosePath needs to have a corresponding BeginPath call.
Reimplemented from CP_Graphics_Imp. |
|
Strokes the current path.
Reimplemented from CP_Graphics_Imp. |
|
Fills the current path.
Reimplemented from CP_Graphics_Imp. |
|
Draws the current path using the passed in path drawing mode, which can be one of the following:
Reimplemented from CP_Graphics_Imp. |
|
Sets the current point in the path to that of the passed in point. This is the location where subsequent drawing operations will begin unless the call specifies a new starting point in its params.
Reimplemented from CP_Graphics_Imp. |
|
Sets the current point in the path to that of the passed in coordinates. This is the location where subsequent drawing operations will begin unless the call specifies a new starting point in its params.
Reimplemented from CP_Graphics_Imp. |
|
Adds a line to our path. The line will be drawn from the current point to the location specified in inPoint.
Reimplemented from CP_Graphics_Imp. |
|
Add inNumberPoints lines to our path. The first point is the starting point, then each additional point has a line drawn from the last point to that point.
|
|
Adds a starting and ending point to the current path.
Reimplemented from CP_Graphics_Imp. |
|
Adds a line to the current path using the specified coordinates.
Reimplemented from CP_Graphics_Imp. |
|
Adds a rect to the current path.
Reimplemented from CP_Graphics_Imp. |
|
Adds a bezier curve to the current path.
Reimplemented from CP_Graphics_Imp. |
|
Adds a quadratic bezier curve to the current path.
Reimplemented from CP_Graphics_Imp. |
|
Add an arc of a circle to the context's path, possibly preceded by a straight line segment. `(inHorCenter, inVerCenter)' is the center of the arc; `inRadius' is its radius; `inStartAngle' is the angle to the first endpoint of the arc; `inEndAngle' is the angle to the second endpoint of the arc; and `inClockwise' is 1 if the arc is to be drawn clockwise, 0 otherwise. `inStartAngle' and `inEndAngle' are measured in radians.
Reimplemented from CP_Graphics_Imp. |
|
Add an arc of a circle to the context's path, possibly preceded by a straight line segment. `radius' is the radius of the arc. The arc is tangent to the line from the current point to `(x1, y1)', and the line from `(x1, y1)' to `(x2, y2)'
|
|
Adds an oval to the current path.
Reimplemented from CP_Graphics_Imp. |
|
Adds a polygon to the current path as specified in the passed in points array.
Reimplemented from CP_Graphics_Imp. |
|
Sets the clipping path of the canvas being drawn into to that of the current path.
Reimplemented from CP_Graphics_Imp. |
|
Draws the polygon specified by the passed in points array, then strokes it.
Reimplemented from CP_Graphics_Imp. |
|
Draws the polygon specified by the passed in points array, and fills it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a rect specified by the passed in bounds, then strokes it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a rect specified by the passed in bounds, then fills it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a region specified by the passed in region, then strokes it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a region specified by the passed in region, then fills it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a rounded rect specified by the passed in rect, then strokes it.
Reimplemented from CP_Graphics_Imp. |
|
Draws a rounded rect specified by the passed in rect, then fills it.
Reimplemented from CP_Graphics_Imp. |
|
Draws an oval specified by the passed in rect, then strokes it.
Reimplemented from CP_Graphics_Imp. |
|
Draws an oval specified by the passed in rect, then fills it.
Reimplemented from CP_Graphics_Imp. |
|
Draws the passed in text at the location specified. The text will not be wrapped.
Reimplemented from CP_Graphics_Imp. |
|
Draws the passed in text at the location specified. The text will not be wrapped. This version calls on Quartz directly to draw the string.
|
|
Draws the passed in text at the locatio specified. The text will be wrapped to fit in the passed in bounds.
Reimplemented from CP_Graphics_Imp. |
|
Reimplemented from CP_Graphics_Imp. |
|
Finish initializing the members of this class.
|
|
Private routine to create a round rect out of Quartz drawing routines.
|
|
Private routine to create an oval out of Quartz drawing routines.
|
|
Private routine that draws a gradient in the specified bounds. The gradient can be of the following types:
|
|
Build our gradient in our offscreen canvas object.
|
|
Initialize our gradient to a default top to bottom, black & white pattern.
|
|
|
|
|
|
|
|
Calculate the number of pixels for the given range.
|
|
Calculate the colors and increments for our gradient.
|
|
Adjust the passed in color based on information stored in the passed in CP_E_GradientColorInfo structure.
|
|
Calculate our enclosing bounds based on the passed in center point.
|
|
Build a gradient with rectangular orientation into our offscreen port canvas. This will be 1 of our 4 orientations, top to bottom, bottom to top, left to right, right to left.
|
|
Build a gradient with radial (from center point outward) orientation into our offscreen port canvas.
|
|
Build a gradient with sunburst orientation into our offscreen port canvas.
|
|
Build a gradient with shapeburst orientation into our offscreen port canvas.
|
|
Build a gradient with an angled (as set by the class member fGradientAngle) orientation into our offscreen port canvas.
|
|
Convert the passed in CP_Fixed to a UInt16 color.
|
|
Read the image data and store information into the passed in bitmap info structure.
|
|
Returns the bitmap information from the passed in graphics importer.
|
|
Private routine to draw the polygon from the points specified previously.
|
|
Returns the current width used in drawing lines.
|
|
Returns the current alpha value used when drawing.
|
|
Returns the current color used in stroking.
|
|
Returns the current color used in filling.
|
|
Returns the CP_Canvas object to be drawn into.
|
|
Sets the skewing amount to be used in the current transformation matrix.
|
|
Sets one of the colors used to draw the gradient.
|
|
Draw the passed in OSPicture in the destination bounds, scaling the image as needed to fit.
Reimplemented in CP_Graphics_Imp_GDI. |
|
Fills the current path with the passed in pattern.
Reimplemented in CP_Graphics_Imp_GDI. |
|
Add inNumberPoints lines to our path. The first point is the starting point, then each additional point has a line drawn from the last point to that point.
|
|
Erases the passed in rect using the canvases current background color.
Reimplemented in CP_Graphics_Imp_GDI. |
|
Sets a flag to indicate how the text will be drawn in the destination canvas, if the platform supports them. Such as transparent or opaque.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Destination canvas to draw into. |
|
Alpha value for drawing. |
|
Line width for the current stroking. Reimplemented in CP_Graphics_Imp_GDI. |
|
Color used in stroking. Reimplemented in CP_Graphics_Imp_GDI. |