diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt index 7fe3248331..9fd1b888b3 100644 --- a/docs/reference/gtk/gtk3-sections.txt +++ b/docs/reference/gtk/gtk3-sections.txt @@ -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 diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 5505b23449..c1cff5a66e 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -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 diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 5dfffebfd9..b9057eb3e8 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -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. diff --git a/gtk/gtkcalendar.h b/gtk/gtkcalendar.h index feafd48d9e..df086373f8 100644 --- a/gtk/gtkcalendar.h +++ b/gtk/gtkcalendar.h @@ -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__ */