| Guifications Library Reference Manual |
|---|
GfItemShapeGfItemShape — GfItemShape Object API |
GfItemShape;
enum GfItemShapeType;
GfItemShape* gf_item_shape_new (GfItemShapeType type);
GfItemShapeType gf_item_shape_get_type (const GfItemShape *shape);
void gf_item_shape_set_type (GfItemShape *shape,
GfItemShapeType type);
void gf_item_shape_set_x (GfItemShape *shape,
gint x);
gint gf_item_shape_get_x (const GfItemShape *shape);
void gf_item_shape_set_y (GfItemShape *shape,
gint y);
gint gf_item_shape_get_y (const GfItemShape *shape);
void gf_item_shape_set_width (GfItemShape *shape,
guint width);
guint gf_item_shape_get_width (const GfItemShape *shape);
void gf_item_shape_set_height (GfItemShape *shape,
guint height);
guint gf_item_shape_get_height (const GfItemShape *shape);
void gf_item_shape_add_point (GfItemShape *shape,
gint x,
gint y);
gboolean gf_item_shape_remove_point (GfItemShape *shape,
gint x,
gint y);
void gf_item_shape_set_angle_start (GfItemShape *shape,
gint angle);
gint gf_item_shape_get_angle_start (const GfItemShape *shape);
void gf_item_shape_set_angle_end (GfItemShape *shape,
gint angle);
gint gf_item_shape_get_angle_end (const GfItemShape *shape);
guint gf_item_shape_get_number_of_points
(const GfItemShape *shape);
GList* gf_item_shape_get_points (const GfItemShape *shape);
#define gf_item_shape_type_from_string (str)
#define gf_item_shape_type_to_string (type, i18n)
"angle-end" gint : Read / Write "angle-start" gint : Read / Write "height" guint : Read / Write "num-points" guint : Read "type" GfItemShapeType : Read / Write "width" guint : Read / Write "x" gint : Read / Write "y" gint : Read / Write
typedef struct _GfItemShape GfItemShape;
GfItemShape is an opaque structure that should not be used directly.
typedef enum _GfItemShapeType {
GF_ITEM_SHAPE_UNKNOWN = -1,
GF_ITEM_SHAPE_ARC,
GF_ITEM_SHAPE_CIRCLE,
GF_ITEM_SHAPE_LINE,
GF_ITEM_SHAPE_POLYGON,
GF_ITEM_SHAPE_RECTANGLE,
GF_ITEM_SHAPE_SEGMENT,
GF_ITEM_SHAPES
} GfItemShapeType;
Shape Types
GF_ITEM_SHAPE_UNKNOWN |
Unknown |
GF_ITEM_SHAPE_ARC |
Arc |
GF_ITEM_SHAPE_CIRCLE |
Circle |
GF_ITEM_SHAPE_LINE |
Line |
GF_ITEM_SHAPE_POLYGON |
Polygon |
GF_ITEM_SHAPE_RECTANGLE |
Rectangle |
GF_ITEM_SHAPE_SEGMENT |
Segment |
GF_ITEM_SHAPES |
Total Shapes |
GfItemShape* gf_item_shape_new (GfItemShapeType type);
Creates a new GfItemShape instance.
type : |
The GfItemShapeType to use. |
| Returns : | The new GfItemShape instance. |
GfItemShapeType gf_item_shape_get_type (const GfItemShape *shape);
Gets the shape type for shape.
shape : |
The GfItemShape instance. |
| Returns : | The GfItemShapeType for shape.
|
void gf_item_shape_set_type (GfItemShape *shape, GfItemShapeType type);
Sets the type for shape.
shape : |
The GfItemShape instance. |
type : |
The new GfItemShapeType. |
void gf_item_shape_set_x (GfItemShape *shape, gint x);
Sets the x-coordinate for shape.
shape : |
The GfItemShape instance. |
x : |
The x-coordinate. |
gint gf_item_shape_get_x (const GfItemShape *shape);
Gets the x-coordinate for shape.
shape : |
The GfItemShape instance. |
| Returns : | The x-coordinate for shape.
|
void gf_item_shape_set_y (GfItemShape *shape, gint y);
Sets the y-coordinate for shape.
shape : |
The GfItemShape instance. |
y : |
The y-coordinate. |
gint gf_item_shape_get_y (const GfItemShape *shape);
Gets the y-coordinate for shape.
shape : |
The GfItemShape instance. |
| Returns : | The y-coordinate for shape.
|
void gf_item_shape_set_width (GfItemShape *shape, guint width);
Sets the width for shape.
shape : |
The GfItemShape instance. |
width : |
The new width. |
guint gf_item_shape_get_width (const GfItemShape *shape);
Gets the width for shape.
shape : |
The GfItemShape. |
| Returns : | The width for shape.
|
void gf_item_shape_set_height (GfItemShape *shape, guint height);
Sets the height for shape.
shape : |
The GfItemShape instance. |
height : |
The new height. |
guint gf_item_shape_get_height (const GfItemShape *shape);
Gets the height for shape.
shape : |
The GfItemShape instance. |
| Returns : | The height for shape.
|
void gf_item_shape_add_point (GfItemShape *shape, gint x, gint y);
Adds a point to shape.
shape : |
The GfItemShape instance. |
x : |
The x-coordinate of the point. |
y : |
The y-coordinate of the point. |
gboolean gf_item_shape_remove_point (GfItemShape *shape, gint x, gint y);
Removes a point from shape.
Note: If there is more than one instance of the point in shape, only the
first instance will be removed.
Note: After calling this function, the width and height will be recalculated to fit the remaining points.
shape : |
The GfItemShape instance. |
x : |
The x-coordinate of the point. |
y : |
The y-coordinate of the point. |
| Returns : | TRUE on success. |
void gf_item_shape_set_angle_start (GfItemShape *shape, gint angle);
Sets the start angle for shape.
Note: angles are only used in Arcs. Setting an angle on a circle has no effect.
shape : |
The GfItemShape instance. |
angle : |
The angle. |
gint gf_item_shape_get_angle_start (const GfItemShape *shape);
Gets the start angle for shape.
shape : |
The GfItemShape instance. |
| Returns : | The start angle for shape.
|
void gf_item_shape_set_angle_end (GfItemShape *shape, gint angle);
Sets the end angle for shape.
Note: Angles are used only for Arcs. Setting an angle on a circle has no effect.
shape : |
The GfItemShape instance. |
angle : |
The new end angle. |
gint gf_item_shape_get_angle_end (const GfItemShape *shape);
Gets the angle end for shape.
shape : |
The GfItemShape instance. |
| Returns : | The angle end for shape.
|
guint gf_item_shape_get_number_of_points
(const GfItemShape *shape);
Gets the number of points in shape.
Note: This number only has meaning if shape is a polygon.
shape : |
The GfItemShape instance. |
| Returns : | The number of points in shape.
|
GList* gf_item_shape_get_points (const GfItemShape *shape);
Gets the list of points from shape.
Note: This list should _NOT_ be modified directly!
Note: This list has meaning only if shape is a polygon.
shape : |
The GfItemShape instance. |
| Returns : | The list of points from shape.
|
#define gf_item_shape_type_from_string(str)
Gets a GfItemShapeType from a string.
Note: str MUST be the untranslated string!
str : |
The string. |
| Returns : | The GfItemShapeType. |
#define gf_item_shape_type_to_string(type, i18n)
Gets a string from a GfItemShapeType.
type : |
The GfItemShapeType. |
i18n : |
TRUE for the translated version. |
| Returns : | The string. |
angle-end" property"angle-end" gint : Read / Write
The end angle of an arc or circle.
Default value: 360
angle-start" property"angle-start" gint : Read / Write
The start angle of an arc or circle.
Default value: 0
num-points" property"num-points" guint : Read
The number of points in this shape.
Allowed values: <= G_MAXINT
Default value: 0
| << GfItem | GfItemImage >> |