Top |
Functions
gboolean | rb_rating_render_stars () |
double | rb_rating_get_rating_from_widget () |
void | rb_rating_pixbufs_free () |
void | rb_rating_install_rating_property () |
Description
A few helper functions for dealing with ratings. These are shared between RBRating and RBCellRendererRating.
Functions
rb_rating_render_stars ()
gboolean rb_rating_render_stars (GtkWidget *widget
,cairo_t *cr
,RBRatingPixbufs *pixbufs
,int x
,int y
,int x_offset
,int y_offset
,gdouble rating
,gboolean selected
);
Renders a rating as a row of stars. floor(rating
) large stars
are drawn, followed by 5-floor(rating
) small stars.
Parameters
widget |
a GtkWidget to render on behalf of |
|
cr |
cairo context to render into |
|
pixbufs |
a RBRatingPixbufs structure |
|
x |
source X coordinate within the rating pixbufs (usually 0) |
|
y |
source Y coordinate within the rating pixbufs (usually 0) |
|
x_offset |
destination X coordinate within the window |
|
y_offset |
destination Y coordinate within the window |
|
rating |
the rating to display (between 0.0 and 5.0) |
|
selected |
TRUE if the widget is currently selected for input |
rb_rating_get_rating_from_widget ()
double rb_rating_get_rating_from_widget (GtkWidget *widget
,gint widget_x
,gint widget_width
,double current_rating
);
Updates the rating for a widget after the user clicks on the rating. If the user clicks on the Nth star, the rating is set to N, unless the rating is already N, in which case the rating is set to N-1. This allows the user to set the rating to 0.
Parameters
widget |
the GtkWidget displaying the rating |
|
widget_x |
x component of the position to query |
|
widget_width |
width of the widget |
|
current_rating |
the current rating displayed in the widget |
rb_rating_pixbufs_free ()
void
rb_rating_pixbufs_free (RBRatingPixbufs *pixbufs
);
Frees a set of rating pixbufs.
rb_rating_install_rating_property ()
void rb_rating_install_rating_property (GObjectClass *klass
,gulong prop
);
Installs a 'rating' property in the specified class.