Coconut Data Framework
beta
|
Define basic data types for graphics. More...
#import "CNAlign.h"
Go to the source code of this file.
Classes | |
struct | CNPoint2D |
Enumerations | |
enum | { CNPointXPos = 0, CNPointYPos = 1, CNPointZPos = 2 } |
Functions | |
static void | CNSetPoint (NSPoint *dst, CGFloat x, CGFloat y) |
Set value to NSPoint. | |
static BOOL | CNIsSamePoint (const NSPoint *a, const NSPoint *b) |
Compare NSPoint objects. | |
static void | CNAddPoint (NSPoint *dst, const NSPoint *a, const NSPoint *b) |
Add 2 points. | |
static void | CNDiffPoint (NSPoint *dst, const NSPoint *a, const NSPoint *b) |
Get difference of points. | |
static void | CNSetSize (NSSize *dst, CGFloat w, CGFloat h) |
Set value to NSSize. | |
static BOOL | CNIsZeroSize (const NSSize *src) |
Check the size is empty or not. | |
static BOOL | CNIsSameSize (const NSSize *a, const NSSize *b) |
Compare NSSize objects. | |
static void | CNSetRect (NSRect *dst, CGFloat x, CGFloat y, CGFloat width, CGFloat height) |
Set values for NSRect. | |
static void | CNInitRect (NSRect *dst) |
Initialize NSRect object. | |
static BOOL | CNIsSameRect (const NSRect *a, const NSRect *b) |
Compare NSRect objects. | |
void | CNUnionRect (NSRect *dst, const NSRect *src0, const NSRect *src1) |
Get unioned rectangle. | |
static BOOL | CNIsValidRect (const NSRect *src) |
Validate the rectangle. | |
static BOOL | CNIsOverwrapperdRect (const NSRect *a, const NSRect *b) |
Check the rectangles are overwrapper. | |
void | CNAlignRect (NSRect *dst, CNAlign align, const NSRect *bounds, const NSSize *src) |
Place the src rectangle to the center of the frame. | |
static void | CNSetPoint2D (struct CNPoint2D *dst, CGFloat x, CGFloat y) |
Set parameters for 2D point. | |
static const CGFloat * | CNVectorOfPoint2D (const struct CNPoint2D *src) |
Get vector of 2D point. |
Define basic data types for graphics.
anonymous enum |
static void CNSetPoint | ( | NSPoint * | dst, |
CGFloat | x, | ||
CGFloat | y | ||
) | [inline, static] |
Set value to NSPoint.
dst | Destination point |
x | Source X position |
y | Source Y position |
Referenced by CNSetRect().
static BOOL CNIsSamePoint | ( | const NSPoint * | a, |
const NSPoint * | b | ||
) | [inline, static] |
Compare NSPoint objects.
TRUE | They have same values |
FALSE | They have different value |
a | Source point A |
b | Source point B |
Referenced by CNIsSameRect().
static void CNAddPoint | ( | NSPoint * | dst, |
const NSPoint * | a, | ||
const NSPoint * | b | ||
) | [inline, static] |
Add 2 points.
dst | Destination to set result |
a | Source point A |
b | Source point B |
static void CNDiffPoint | ( | NSPoint * | dst, |
const NSPoint * | a, | ||
const NSPoint * | b | ||
) | [inline, static] |
Get difference of points.
dst | Difference of given source points |
a | Source point A |
b | Source point B |
static void CNSetSize | ( | NSSize * | dst, |
CGFloat | w, | ||
CGFloat | h | ||
) | [inline, static] |
Set value to NSSize.
dst | Destination size |
w | Source width value |
h | Source height value |
Referenced by CNSetRect().
static BOOL CNIsZeroSize | ( | const NSSize * | src | ) | [inline, static] |
Check the size is empty or not.
TRUE | The width and height of the source size is zero |
FALSE | The width or height of the source size is NOT zero |
src | Source size |
static BOOL CNIsSameSize | ( | const NSSize * | a, |
const NSSize * | b | ||
) | [inline, static] |
Compare NSSize objects.
TRUE | They have same values |
FALSE | They have different value |
a | Source size A |
b | Source size B |
Referenced by CNIsSameRect().
static void CNSetRect | ( | NSRect * | dst, |
CGFloat | x, | ||
CGFloat | y, | ||
CGFloat | width, | ||
CGFloat | height | ||
) | [inline, static] |
Set values for NSRect.
dst | Destination rectangle |
x | Source X origin |
y | Source Y origin |
width | Width of rect |
height | Height of rect |
References CNSetPoint(), and CNSetSize().
Referenced by CNInitRect().
static void CNInitRect | ( | NSRect * | dst | ) | [inline, static] |
Initialize NSRect object.
dst | Destination rect |
References CNSetRect().
static BOOL CNIsSameRect | ( | const NSRect * | a, |
const NSRect * | b | ||
) | [inline, static] |
Compare NSRect objects.
TRUE | They have same values |
FALSE | They have different value |
a | Source rect A |
b | Source rect B |
References CNIsSamePoint(), and CNIsSameSize().
void CNUnionRect | ( | NSRect * | dst, |
const NSRect * | src0, | ||
const NSRect * | src1 | ||
) |
Get unioned rectangle.
dst | Destination to set result |
src0 | Source rectangle 0 |
src1 | Source rectangle 1 |
static BOOL CNIsValidRect | ( | const NSRect * | src | ) | [inline, static] |
Validate the rectangle.
TRUE | Source rectangle is valid |
FALSE | Source rectangle is NOT valid |
src | Source rectangle |
static BOOL CNIsOverwrapperdRect | ( | const NSRect * | a, |
const NSRect * | b | ||
) | [inline, static] |
Check the rectangles are overwrapper.
TRUE | 2 rectangles are overwrapped |
FALSE | 2 rectangles are NOT overwrapped |
a | Source rectangle A |
b | Source rectangle B |
void CNAlignRect | ( | NSRect * | dst, |
CNAlign | align, | ||
const NSRect * | bounds, | ||
const NSSize * | src | ||
) |
Place the src rectangle to the center of the frame.
dst | Destination bound rectangle |
align | Alignment for source |
bounds | Bound rectanble |
src | Source rectangle size |
static void CNSetPoint2D | ( | struct CNPoint2D * | dst, |
CGFloat | x, | ||
CGFloat | y | ||
) | [inline, static] |
Set parameters for 2D point.
dst | Destination 2D point |
x | Source X pos |
y | Source Y pos |
References CNPointXPos, CNPointYPos, and CNPoint2D::vector.
static const CGFloat* CNVectorOfPoint2D | ( | const struct CNPoint2D * | src | ) | [inline, static] |
Get vector of 2D point.
src | Source 2D point |
References CNPoint2D::vector.