| Guifications Library Reference Manual |
|---|
PrimitivesPrimitives — Primitive shape API |
GfLine;
GfPoint;
GfRectangle;
GfSegment;
gboolean gf_rectangle_intersect (const GfRectangle *src1,
const GfRectangle *src2,
GfRectangle *dest);
void gf_rectangle_union (const GfRectangle *src1,
const GfRectangle *src2,
GfRectangle *dest);
To aid in user interface abstraction, we need common way to look at basic shapes. This API is designed to accomidate that.
typedef struct {
gint x1;
gint y1;
gint x2;
gint y2;
} GfLine;
A Line
gint x1; |
The x-coordinate of the start point. |
gint y1; |
The y-coordinate of the start point. |
gint x2; |
The x-coordinate of the end point. |
gint y2; |
The y-coordinate of the end point. |
typedef struct {
gint x;
gint y;
} GfPoint;
A Point
gint x; |
The x-coordinate. |
gint y; |
The y-coordinate. |
typedef struct {
gint x;
gint y;
gint width;
gint height;
} GfRectangle;
A Rectangle
gint x; |
The x-coordinate of the rectangle. |
gint y; |
The y-coordinate of the rectangle. |
gint width; |
The width of the rectangle. |
gint height; |
The height of the rectangle. |
typedef struct {
gint x1;
gint y1;
gint x2;
gint y2;
} GfSegment;
A Segment
gint x1; |
The x-coordinate of the start point. |
gint y1; |
The y-coordinate of the start point. |
gint x2; |
The x-coordinate of the end point. |
gint y2; |
The y-coordinate of the end point. |
gboolean gf_rectangle_intersect (const GfRectangle *src1, const GfRectangle *src2, GfRectangle *dest);
Calculates the intersection of src1 and src2.
src1 : |
A GfRectangle. |
src2 : |
A GfRectangle. |
dest : |
The return address for the intersection of src1 and src2.
|
| Returns : | TRUE if src1 and src2 intersect, FALSE if they don't.
|
void gf_rectangle_union (const GfRectangle *src1, const GfRectangle *src2, GfRectangle *dest);
Calculates the smallest GfRectangle that includes src1 and src2.
src1 : |
A GfRectangle. |
src2 : |
A GfRectangle. |
dest : |
The return address for the union of src1 and src2.
|
| << GfImage | GfFont >> |