Add gtk_calendar_day_is_marked() function

The marked state of calendar day is not accessible

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=627028
This commit is contained in:
Javier Jardón 2010-08-29 19:14:24 +02:00
parent 6afa615690
commit f84707d6f9
4 changed files with 32 additions and 0 deletions

View File

@ -594,6 +594,7 @@ gtk_calendar_select_month
gtk_calendar_select_day
gtk_calendar_mark_day
gtk_calendar_unmark_day
gtk_calendar_get_day_is_marked
gtk_calendar_clear_marks
<SUBSECTION>

View File

@ -554,6 +554,7 @@ gtk_button_set_use_underline
#if IN_FILE(__GTK_CALENDAR_C__)
gtk_calendar_clear_marks
gtk_calendar_get_date
gtk_calendar_get_day_is_marked
gtk_calendar_get_detail_height_rows
gtk_calendar_get_detail_width_chars
gtk_calendar_get_display_options

View File

@ -4029,6 +4029,33 @@ gtk_calendar_mark_day (GtkCalendar *calendar,
}
}
/**
* gtk_calendar_get_day_is_marked:
* @calendar: a #GtkCalendar
* @day: the day number between 1 and 31.
*
* Returns if the @day of the @calendar is already marked.
*
* Returns: whether the day is marked.
*
* Since: 3.0
*/
gboolean
gtk_calendar_get_day_is_marked (GtkCalendar *calendar,
guint day)
{
GtkCalendarPrivate *priv;
g_return_val_if_fail (GTK_IS_CALENDAR (calendar), FALSE);
priv = calendar->priv;
if (day >= 1 && day <= 31)
return priv->marked_date[day - 1];
return FALSE;
}
/**
* gtk_calendar_unmark_day:
* @calendar: a #GtkCalendar.

View File

@ -157,6 +157,9 @@ void gtk_calendar_set_detail_height_rows (GtkCalendar *calendar,
gint gtk_calendar_get_detail_width_chars (GtkCalendar *calendar);
gint gtk_calendar_get_detail_height_rows (GtkCalendar *calendar);
gboolean gtk_calendar_get_day_is_marked (GtkCalendar *calendar,
guint day);
G_END_DECLS
#endif /* __GTK_CALENDAR_H__ */