GtkWidget *view;
- GList *calendars;
- GList *categories;
- GList *events;
+ GSList *calendars;
+ GSList *categories;
+ GSList *events;
};
G_DEFINE_TYPE (GtkCalEx, gtk_calex, GTK_TYPE_BIN)
return priv->view_type;
}
+/**
+ * gtk_calex_set_view_type:
+ * @calex:
+ * @type:
+ *
+ */
void
gtk_calex_set_view_type (GtkCalEx *calex, GtkCalExViewType type)
{
}
}
+/**
+ * gtk_calex_get_date:
+ * @calex:
+ *
+ */
GDate
*gtk_calex_get_date (GtkCalEx *calex)
{
return g_memdup (priv->date, sizeof (GDate));
}
+/**
+ * gtk_calex_set_date:
+ * @calex:
+ * @date:
+ *
+ */
void
gtk_calex_set_date (GtkCalEx *calex, GDate *date)
{
gtk_calex_view_set_date (GTK_CALEX_VIEW (priv->view), priv->date);
}
+/**
+ * gtk_calex_add_calendar:
+ * @calex:
+ * @calendar:
+ *
+ */
+void
+gtk_calex_add_calendar (GtkCalEx *calex, GtkCalExCalendar *calendar)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_if_fail (IS_GTK_CALEX (calex));
+ g_return_if_fail (IS_GTK_CALEX_CALENDAR (calendar));
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ priv->calendars = g_slist_append (priv->calendars, calendar);
+}
+
+/**
+ * gtk_calex_remove_calendar:
+ * @calex:
+ * @calendar:
+ *
+ */
+void
+gtk_calex_remove_calendar (GtkCalEx *calex, GtkCalExCalendar *calendar)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_if_fail (IS_GTK_CALEX (calex));
+ g_return_if_fail (IS_GTK_CALEX_CALENDAR (calendar));
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ /* TODO remove before events of this calendar */
+
+ priv->calendars = g_slist_remove (priv->calendars, calendar);
+}
+
+/**
+ * gtk_calex_get_calendars:
+ * @calex:
+ *
+ */
+GSList
+*gtk_calex_get_calendars (GtkCalEx *calex)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_CALEX (calex), NULL);
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ return priv->calendars;
+}
+
+/**
+ * gtk_calex_add_category:
+ * @calex:
+ * @category:
+ *
+ */
+void
+gtk_calex_add_category (GtkCalEx *calex, GtkCalExCategory *category)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_if_fail (IS_GTK_CALEX (calex));
+ g_return_if_fail (IS_GTK_CALEX_CATEGORY (category));
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ priv->categories = g_slist_append (priv->categories, category);
+}
+
+/**
+ * gtk_calex_remove_category:
+ * @calex:
+ * @category:
+ *
+ */
+void
+gtk_calex_remove_category (GtkCalEx *calex, GtkCalExCategory *category)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_if_fail (IS_GTK_CALEX (calex));
+ g_return_if_fail (IS_GTK_CALEX_CATEGORY (category));
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ /* TODO remove before events of this category */
+
+ priv->categories = g_slist_remove (priv->categories, category);
+}
+
+/**
+ * gtk_calex_get_categories:
+ * @calex:
+ *
+ */
+GSList
+*gtk_calex_get_categories (GtkCalEx *calex)
+{
+ GtkCalExPrivate *priv;
+
+ g_return_val_if_fail (IS_GTK_CALEX (calex), NULL);
+
+ priv = GTK_CALEX_GET_PRIVATE (calex);
+
+ return priv->categories;
+}
+
static void
gtk_calex_size_request (GtkWidget *widget,
GtkRequisition *requisition)
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
requisition->width += (border_width * 2);
requisition->height += (border_width * 2);
+
/*g_message("gtkcalex requisition %d %d",requisition->width,requisition->height);*/
}
void gtk_calex_add_calendar (GtkCalEx *calex, GtkCalExCalendar *calendar);
void gtk_calex_remove_calendar (GtkCalEx *calex, GtkCalExCalendar *calendar);
-GList *gtk_calex_get_calendars (GtkCalEx *calex);
+GSList *gtk_calex_get_calendars (GtkCalEx *calex);
void gtk_calex_add_category (GtkCalEx *calex, GtkCalExCategory *category);
void gtk_calex_remove_category (GtkCalEx *calex, GtkCalExCategory *category);
-GList *gtk_calex_get_categories (GtkCalEx *calex);
+GSList *gtk_calex_get_categories (GtkCalEx *calex);
void gtk_calex_add_event (GtkCalEx *calex, GtkCalExEvent *event);
void gtk_calex_remove_event (GtkCalEx *calex, GtkCalExEvent *event);
-GList *gtk_calex_get_events (GtkCalEx *calex);
+GSList *gtk_calex_get_events (GtkCalEx *calex);
+
+GSList *gtk_calex_get_events_by_calendar (GtkCalEx *calex, GtkCalExCalendar *calendar);
+GSList *gtk_calex_get_events_by_category (GtkCalEx *calex, GtkCalExCategory *category);
G_END_DECLS