GfItemShape

GfItemShape — GfItemShape Object API

Synopsis




            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)

Object Hierarchy


  GObject
   +----GfObject
         +----GfItem
               +----GfItemShape

Properties


  "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

Description

GfItemShape is used to draw shapes on GfNotifications.

Details

GfItemShape

typedef struct _GfItemShape GfItemShape;

GfItemShape is an opaque structure that should not be used directly.


enum GfItemShapeType

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

gf_item_shape_new ()

GfItemShape* gf_item_shape_new              (GfItemShapeType type);

Creates a new GfItemShape instance.

type : The GfItemShapeType to use.
Returns : The new GfItemShape instance.

gf_item_shape_get_type ()

GfItemShapeType gf_item_shape_get_type      (const GfItemShape *shape);

Gets the shape type for shape.

shape : The GfItemShape instance.
Returns : The GfItemShapeType for shape.

gf_item_shape_set_type ()

void        gf_item_shape_set_type          (GfItemShape *shape,
                                             GfItemShapeType type);

Sets the type for shape.

shape : The GfItemShape instance.
type : The new GfItemShapeType.

gf_item_shape_set_x ()

void        gf_item_shape_set_x             (GfItemShape *shape,
                                             gint x);

Sets the x-coordinate for shape.

shape : The GfItemShape instance.
x : The x-coordinate.

gf_item_shape_get_x ()

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.

gf_item_shape_set_y ()

void        gf_item_shape_set_y             (GfItemShape *shape,
                                             gint y);

Sets the y-coordinate for shape.

shape : The GfItemShape instance.
y : The y-coordinate.

gf_item_shape_get_y ()

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.

gf_item_shape_set_width ()

void        gf_item_shape_set_width         (GfItemShape *shape,
                                             guint width);

Sets the width for shape.

shape : The GfItemShape instance.
width : The new width.

gf_item_shape_get_width ()

guint       gf_item_shape_get_width         (const GfItemShape *shape);

Gets the width for shape.

shape : The GfItemShape.
Returns : The width for shape.

gf_item_shape_set_height ()

void        gf_item_shape_set_height        (GfItemShape *shape,
                                             guint height);

Sets the height for shape.

shape : The GfItemShape instance.
height : The new height.

gf_item_shape_get_height ()

guint       gf_item_shape_get_height        (const GfItemShape *shape);

Gets the height for shape.

shape : The GfItemShape instance.
Returns : The height for shape.

gf_item_shape_add_point ()

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.

gf_item_shape_remove_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.

gf_item_shape_set_angle_start ()

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.

gf_item_shape_get_angle_start ()

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.

gf_item_shape_set_angle_end ()

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.

gf_item_shape_get_angle_end ()

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.

gf_item_shape_get_number_of_points ()

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.

gf_item_shape_get_points ()

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.

gf_item_shape_type_from_string()

#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.

gf_item_shape_type_to_string()

#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.

Properties

The "angle-end" property

  "angle-end"            gint                  : Read / Write

The end angle of an arc or circle.

Default value: 360


The "angle-start" property

  "angle-start"          gint                  : Read / Write

The start angle of an arc or circle.

Default value: 0


The "height" property

  "height"               guint                 : Read / Write

The height of the shape.

Default value: 0


The "num-points" property

  "num-points"           guint                 : Read

The number of points in this shape.

Allowed values: <= G_MAXINT

Default value: 0


The "type" property

  "type"                 GfItemShapeType       : Read / Write

The type of shape.

Default value: Unknown


The "width" property

  "width"                guint                 : Read / Write

The width of the shape.

Default value: 0


The "x" property

  "x"                    gint                  : Read / Write

The x-coordinate for the shape.

Default value: 0


The "y" property

  "y"                    gint                  : Read / Write

The y-coordinate for the shape.

Default value: 0