Updates for 10.5 API changes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27962 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-02-23 20:42:32 +00:00
parent 845a701069
commit 24d43481a8
138 changed files with 2094 additions and 1536 deletions

View file

@ -52,15 +52,15 @@ extern "C" {
/**
<example>{
float x;
float y;
CGFloat x;
CGFloat y;
}</example>
<p>Represents a 2-d cartesian position.</p> */
typedef struct _NSPoint NSPoint;
struct _NSPoint
{
float x;
float y;
CGFloat x;
CGFloat y;
};
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@ -72,15 +72,15 @@ typedef NSPoint *NSPointPointer;
/**
<example>{
float width;
float height;
CGFloat width;
CGFloat height;
}</example>
<p>Floating point rectangle size.</p> */
typedef struct _NSSize NSSize;
struct _NSSize
{
float width;
float height;
CGFloat width;
CGFloat height;
};
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
@ -111,6 +111,13 @@ typedef NSRect *NSRectArray;
typedef NSRect *NSRectPointer;
#endif
enum
{
NSMinXEdge = 0,
NSMinYEdge = 1,
NSMaxXEdge = 2,
NSMaxYEdge = 3
};
/** Sides of a rectangle.
<example>
{
@ -121,13 +128,7 @@ typedef NSRect *NSRectPointer;
}
</example>
*/
typedef enum _NSRectEdge
{
NSMinXEdge = 0,
NSMinYEdge = 1,
NSMaxXEdge = 2,
NSMaxYEdge = 3
} NSRectEdge;
typedef NSUInteger NSRectEdge;
/** Point at 0,0 */
static const NSPoint NSZeroPoint __attribute__((unused)) = {0.0,0.0};
@ -156,11 +157,11 @@ static const NSSize NSZeroSize __attribute__((unused)) = {0.0,0.0};
/** Create Basic Structures... **/
GS_GEOM_SCOPE NSPoint
NSMakePoint(float x, float y) GS_GEOM_ATTR;
NSMakePoint(CGFloat x, CGFloat y) GS_GEOM_ATTR;
/** Returns an NSPoint having x-coordinate X and y-coordinate Y. */
GS_GEOM_SCOPE NSPoint
NSMakePoint(float x, float y)
NSMakePoint(CGFloat x, CGFloat y)
{
NSPoint point;
@ -170,11 +171,11 @@ NSMakePoint(float x, float y)
}
GS_GEOM_SCOPE NSSize
NSMakeSize(float w, float h) GS_GEOM_ATTR;
NSMakeSize(CGFloat w, CGFloat h) GS_GEOM_ATTR;
/** Returns an NSSize having width w and height h. */
GS_GEOM_SCOPE NSSize
NSMakeSize(float w, float h)
NSMakeSize(CGFloat w, CGFloat h)
{
NSSize size;
@ -184,11 +185,11 @@ NSMakeSize(float w, float h)
}
GS_GEOM_SCOPE NSRect
NSMakeRect(float x, float y, float w, float h) GS_GEOM_ATTR;
NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h) GS_GEOM_ATTR;
/** Returns an NSRect having point of origin (x, y) and size {w, h}. */
GS_GEOM_SCOPE NSRect
NSMakeRect(float x, float y, float w, float h)
NSMakeRect(CGFloat x, CGFloat y, CGFloat w, CGFloat h)
{
NSRect rect;
@ -201,81 +202,81 @@ NSMakeRect(float x, float y, float w, float h)
/** Get a Rectangle's Coordinates... **/
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMaxX(NSRect aRect) GS_GEOM_ATTR;
/** Returns the greatest x-coordinate value still inside aRect. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMaxX(NSRect aRect)
{
return aRect.origin.x + aRect.size.width;
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMaxY(NSRect aRect) GS_GEOM_ATTR;
/** Returns the greatest y-coordinate value still inside aRect. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMaxY(NSRect aRect)
{
return aRect.origin.y + aRect.size.height;
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMidX(NSRect aRect) GS_GEOM_ATTR;
/** Returns the x-coordinate of aRect's middle point. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMidX(NSRect aRect)
{
return aRect.origin.x + (aRect.size.width / 2.0);
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMidY(NSRect aRect) GS_GEOM_ATTR;
/** Returns the y-coordinate of aRect's middle point. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMidY(NSRect aRect)
{
return aRect.origin.y + (aRect.size.height / 2.0);
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMinX(NSRect aRect) GS_GEOM_ATTR;
/** Returns the least x-coordinate value still inside aRect. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMinX(NSRect aRect)
{
return aRect.origin.x;
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMinY(NSRect aRect) GS_GEOM_ATTR;
/** Returns the least y-coordinate value still inside aRect. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSMinY(NSRect aRect)
{
return aRect.origin.y;
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSWidth(NSRect aRect) GS_GEOM_ATTR;
/** Returns aRect's width. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSWidth(NSRect aRect)
{
return aRect.size.width;
}
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSHeight(NSRect aRect) GS_GEOM_ATTR;
/** Returns aRect's height. */
GS_GEOM_SCOPE float
GS_GEOM_SCOPE CGFloat
NSHeight(NSRect aRect)
{
return aRect.size.height;
@ -295,12 +296,12 @@ NSIsEmptyRect(NSRect aRect)
/** Modify a Copy of a Rectangle... **/
GS_GEOM_SCOPE NSRect
NSOffsetRect(NSRect aRect, float dx, float dy) GS_GEOM_ATTR;
NSOffsetRect(NSRect aRect, CGFloat dx, CGFloat dy) GS_GEOM_ATTR;
/** Returns the rectangle obtained by translating aRect
* horizontally by dx and vertically by dy. */
GS_GEOM_SCOPE NSRect
NSOffsetRect(NSRect aRect, float dx, float dy)
NSOffsetRect(NSRect aRect, CGFloat dx, CGFloat dy)
{
NSRect rect = aRect;
@ -310,7 +311,7 @@ NSOffsetRect(NSRect aRect, float dx, float dy)
}
GS_GEOM_SCOPE NSRect
NSInsetRect(NSRect aRect, float dX, float dY) GS_GEOM_ATTR;
NSInsetRect(NSRect aRect, CGFloat dX, CGFloat dY) GS_GEOM_ATTR;
/** Returns the rectangle obtained by moving each of aRect's
* horizontal sides inward by dy and each of aRect's vertical
@ -319,7 +320,7 @@ NSInsetRect(NSRect aRect, float dX, float dY) GS_GEOM_ATTR;
* a rectanglew with nagative width or height, strange as that seems.
*/
GS_GEOM_SCOPE NSRect
NSInsetRect(NSRect aRect, float dX, float dY)
NSInsetRect(NSRect aRect, CGFloat dX, CGFloat dY)
{
NSRect rect;
@ -337,7 +338,7 @@ GS_EXPORT void
NSDivideRect(NSRect aRect,
NSRect *slice,
NSRect *remainder,
float amount,
CGFloat amount,
NSRectEdge edge);
/** Returns a rectangle obtained by expanding aRect minimally