crcanvas: A GTK/Cairo Canvas Widget | ||||
---|---|---|---|---|
CrPathCrPath — A canvas item capable of rendering a cairo_path_t. |
CrPath; CrItem* cr_path_new (CrItem *parent, const gchar *first_arg_name, ...); void cr_path_set_color (cairo_t *c, guint rgba); void cr_path_setup_line (CrPath *path, cairo_t *c);
GObject +----CrItem +----CrPath +----CrLine +----CrRectangle +----CrEllipse +----CrVector +----CrArrow
"cap" CrCap : Read / Write "dash" CrDash* : Read / Write "fill-color" gchar* : Read / Write "fill-color-rgba" guint : Read / Write "fill-rule" CrFillRule : Read / Write "join" CrJoin : Read / Write "line-scaleable" gboolean : Read / Write "line-width" gdouble : Read / Write "line-width-use-y" gboolean : Read / Write "outline-color" gchar* : Read / Write "outline-color-rgba" guint : Read / Write "path" gpointer : Read / Write "pattern" CrPattern* : Read / Write "pattern-scaleable" gboolean : Read / Write "test-fill" gboolean : Read / Write
This is the base class for canvas items that are drawn from the cairo_path_t such as CrEllipse, CrRectangle, and CrLine.
CrItem* cr_path_new (CrItem *parent, const gchar *first_arg_name, ...);
A convenience function to create a path item and add it to a canvas item parent group in one step.
|
The parent canvas item. |
|
|
|
|
Returns : |
A reference to a new CrItem. You must call g_object_ref if you intend to keep it around. |
void cr_path_set_color (cairo_t *c, guint rgba);
A convenience function to set the rgba integer into the cairo context. It may be called by derived CrPath inplementations.
|
A cairo context to set the color into. |
|
An integer representing RGBA as four characters. |
void cr_path_setup_line (CrPath *path, cairo_t *c);
A convenience function to set up the "line-width", "line-scaleable", and "dash" properties into the cairo context. It may be called by derived implementations of CrPath.
|
The path object. |
|
The current cairo context. |
"cap"
property"cap" CrCap : Read / Write
The enumeration for the style of line endings. See #cairo_line_cap_t for more information.
Default value: CAIRO_LINE_CAP_BUTT
"dash"
property"dash" CrDash* : Read / Write
a boxed array indicating the dash pattern to be used by Cairo. See #cairo_set_dash for more information.
"fill-color"
property"fill-color" gchar* : Read / Write
A string color such as 'red', or '#123456' to be used to fill the path.
Default value: NULL
"fill-color-rgba"
property"fill-color-rgba" guint : Read / Write
Region fill color, red,grn,blue,alpha.
Default value: 0
"fill-rule"
property"fill-rule" CrFillRule : Read / Write
The enumeration used to determine how paths are filled. See #cairo_fill_rule_t for more information.
Default value: CAIRO_FILL_RULE_WINDING
"join"
property"join" CrJoin : Read / Write
The enumeration for determining how line segments are joined together. See #cairo_line_join_t for more information.
Default value: CAIRO_LINE_JOIN_MITER
"line-scaleable"
property"line-scaleable" gboolean : Read / Write
If line width should be scaleable.
Default value: TRUE
"line-width"
property"line-width" gdouble : Read / Write
Path line width in user units when #CrPath:line-scaleable is TRUE. When #CrPath:line-scaleable is FALSE this is in device units.
Default value: 2
"line-width-use-y"
property"line-width-use-y" gboolean : Read / Write
If the Y axis should be used for determining the device coordinates for the line-width. This property only applies when line-scalable is FALSE, outline-color is set, and the canvas widget has the maintain-aspect property set to FALSE. The default is to use the x-axis transformation to determine device line-width.
Default value: FALSE
"outline-color"
property"outline-color" gchar* : Read / Write
A string color such as 'red', or '#123456' to be used to sroke the path.
Default value: NULL
"outline-color-rgba"
property"outline-color-rgba" guint : Read / Write
Path color, red,grn,blue,alpha.
Default value: 0
"path"
property"path" gpointer : Read / Write
a cairo_path_t. On set the item owns it. On get the item still owns it. This is exclusive with points.
"pattern-scaleable"
property"pattern-scaleable" gboolean : Read / Write
If pattern should scale.
Default value: TRUE
"test-fill"
property"test-fill" gboolean : Read / Write
If the fill area should be grabbable by the pointer regardless of if it is filled. The most common use for this is as an invisible child of a very small item that would be difficult to grab on its own.
Default value: FALSE
"make-path"
signalgboolean user_function (CrPath *path, CrContext *c, gpointer user_data) : Run Last
This signal is part of the calculate-bounds signal for path items. First the path is constructed, then the bounds are calculated. By overriding this signal and not overriding calculate-bounds, it is possible to render the path here and allow the default handler to calculate the bounds. The path will be copied from the cairo_t*.
|
|
|
Cairo context with transformation set to match the current item. |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the path from the cairo_t* should be used. FALSE to use whatever path was created previously if any. |