![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
RBRatingPixbufs; #define RB_RATING_MAX_SCORE gboolean rb_rating_render_stars (GtkWidget *widget, GdkWindow *window, RBRatingPixbufs *pixbufs, gulong x, gulong y, gulong x_offset, gulong y_offset, gdouble rating, gboolean selected); double rb_rating_get_rating_from_widget (GtkWidget *widget, gint widget_x, gint widget_width, double current_rating); RBRatingPixbufs* rb_rating_pixbufs_new (void); void rb_rating_pixbufs_free (RBRatingPixbufs *pixbufs); void rb_rating_install_rating_property (GObjectClass *klass, gulong prop);
A few helper functions for dealing with ratings. These are shared between RBRating and RBCellRendererRating.
gboolean rb_rating_render_stars (GtkWidget *widget, GdkWindow *window, RBRatingPixbufs *pixbufs, gulong x, gulong y, gulong x_offset, gulong 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.
|
a GtkWidget to render on behalf of |
|
the GdkWindow being rendered to |
|
a RBRatingPixbufs structure |
|
source X coordinate within the rating pixbufs (usually 0) |
|
source Y coordinate within the rating pixbufs (usually 0) |
|
destination X coordinate within the window |
|
destination Y coordinate within the window |
|
the rating to display (between 0.0 and 5.0) |
|
TRUE if the widget is currently selected for input |
Returns : |
TRUE if the stars were drawn successfully |
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.
|
the GtkWidget displaying the rating |
|
|
|
width of the widget |
|
the current rating displayed in the widget |
Returns : |
the updated rating |
RBRatingPixbufs* rb_rating_pixbufs_new (void);
Creates and returns a structure holding a set of pixbufs to use to display ratings.
Returns : |
RBRatingPixbufs structure, or NULL if not all of the pixbufs could be loaded. |
void rb_rating_pixbufs_free (RBRatingPixbufs *pixbufs);
Frees a set of rating pixbufs.
|
RBRatingPixbufs instance |
void rb_rating_install_rating_property (GObjectClass *klass, gulong prop);
Installs a 'rating' property in the specified class.
|
a GObjectClass to add the property to |
|
property index to use |