g_object_unref (priv->view);
priv->view = NULL;
}
- GtkCalExViewDay *vd = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date);
+ GtkCalExViewDay *vd = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date, FALSE);
priv->view = G_OBJECT (vd);
break;
- case GTK_CALEX_VIEW_TYPE_WORK_WEEK:
+ case GTK_CALEX_VIEW_TYPE_WORKING_WEEK:
if (priv->view != NULL)
{
g_object_unref (priv->view);
priv->view = NULL;
}
- GtkCalExViewDay *vww = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date);
+ GtkCalExViewDay *vww = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date, TRUE);
priv->view = G_OBJECT (vww);
break;
g_object_unref (priv->view);
priv->view = NULL;
}
- GtkCalExViewDay *vw = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date);
+ GtkCalExViewWeek *vw = gtk_calex_view_week_new (priv->goo_canvas_root, priv->date);
priv->view = G_OBJECT (vw);
break;
g_object_unref (priv->view);
priv->view = NULL;
}
- GtkCalExViewDay *vm = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date);
+ GtkCalExViewDay *vm = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date, FALSE);
priv->view = G_OBJECT (vm);
break;
g_object_unref (priv->view);
priv->view = NULL;
}
- GtkCalExViewDay *vl = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date);
+ GtkCalExViewDay *vl = gtk_calex_view_day_new (priv->goo_canvas_root, priv->date, FALSE);
priv->view = G_OBJECT (vl);
break;
static void
gtk_calex_clean_canvas (GtkCalEx *gtk_calex)
{
- guint children;
- guint i;
+ gint children;
+ gint i;
g_return_if_fail (IS_GTK_CALEX (gtk_calex));
GtkCalExPrivate *priv = GTK_CALEX_GET_PRIVATE (gtk_calex);
children = goo_canvas_item_get_n_children (priv->goo_canvas_root);
- for (i = 0; i < children; i++)
+ for (i = children - 1; i >= 0; i--)
{
goo_canvas_item_remove (goo_canvas_item_get_child (priv->goo_canvas_root, i));
}
typedef enum {
GTK_CALEX_VIEW_TYPE_DAY,
- GTK_CALEX_VIEW_TYPE_WORK_WEEK,
+ GTK_CALEX_VIEW_TYPE_WORKING_WEEK,
GTK_CALEX_VIEW_TYPE_WEEK,
GTK_CALEX_VIEW_TYPE_MONTH,
GTK_CALEX_VIEW_TYPE_LIST
{
GooCanvasItem *goo_canvas_root;
GDate *date;
+ gboolean working_week;
};
G_DEFINE_TYPE (GtkCalExViewDay, gtk_calex_view_day, G_TYPE_OBJECT)
/**
* gtk_calex_view_day_new:
+ * @root:
+ * @date:
+ * @working_week:
*
* Returns: the newly created #GtkCalExViewDay object.
*/
GtkCalExViewDay
-*gtk_calex_view_day_new (GooCanvasItem *root, GDate *date)
+*gtk_calex_view_day_new (GooCanvasItem *root, GDate *date, gboolean working_week)
{
GtkCalExViewDay *gtk_calex_view_day = GTK_CALEX_VIEW_DAY (g_object_new (gtk_calex_view_day_get_type (), NULL));
priv->goo_canvas_root = root;
priv->date = date;
+ priv->working_week = working_week;
gtk_calex_view_day_draw (gtk_calex_view_day);
GType gtk_calex_view_day_get_type (void) G_GNUC_CONST;
-GtkCalExViewDay *gtk_calex_view_day_new (GooCanvasItem *root, GDate *date);
+GtkCalExViewDay *gtk_calex_view_day_new (GooCanvasItem *root, GDate *date, gboolean working_week);
G_END_DECLS
GValue *value,
GParamSpec *pspec);
+static void gtk_calex_view_week_draw (GtkCalExViewWeek *gtk_calex_view_week);
+
#define GTK_CALEX_VIEW_WEEK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GTK_CALEX_VIEW_WEEK, GtkCalExViewWeekPrivate))
typedef struct _GtkCalExViewWeekPrivate GtkCalExViewWeekPrivate;
struct _GtkCalExViewWeekPrivate
{
- gpointer foo;
+ GooCanvasItem *goo_canvas_root;
+ GDate *date;
};
G_DEFINE_TYPE (GtkCalExViewWeek, gtk_calex_view_week, G_TYPE_OBJECT)
/**
* gtk_calex_view_week_new:
+ * @root:
+ * @date:
*
* Returns: the newly created #GtkCalExViewWeek object.
*/
GtkCalExViewWeek
-*gtk_calex_view_week_new ()
+*gtk_calex_view_week_new (GooCanvasItem *root, GDate *date)
{
GtkCalExViewWeek *gtk_calex_view_week = GTK_CALEX_VIEW_WEEK (g_object_new (gtk_calex_view_week_get_type (), NULL));
+ GtkCalExViewWeekPrivate *priv = GTK_CALEX_VIEW_WEEK_GET_PRIVATE (gtk_calex_view_week);
+
+ priv->goo_canvas_root = root;
+ priv->date = date;
+
+ gtk_calex_view_week_draw (gtk_calex_view_week);
+
return gtk_calex_view_week;
}
+
+static void
+gtk_calex_view_week_draw (GtkCalExViewWeek *gtk_calex_view_week)
+{
+ g_return_if_fail (IS_GTK_CALEX_VIEW_WEEK (gtk_calex_view_week));
+
+ GtkCalExViewWeekPrivate *priv = GTK_CALEX_VIEW_WEEK_GET_PRIVATE (gtk_calex_view_week);
+}
GType gtk_calex_view_week_get_type (void) G_GNUC_CONST;
-GtkCalExViewWeek *gtk_calex_view_week_new (void);
+GtkCalExViewWeek *gtk_calex_view_week_new (GooCanvasItem *root, GDate *date);
G_END_DECLS
on_tbtn_view_type_wweek_toggled (GtkToggleToolButton *toggle_tool_button,
gpointer user_data)
{
- gtk_calex_set_view_type (GTK_CALEX (calex), GTK_CALEX_VIEW_TYPE_WORK_WEEK);
+ gtk_calex_set_view_type (GTK_CALEX (calex), GTK_CALEX_VIEW_TYPE_WORKING_WEEK);
}
G_MODULE_EXPORT void