From 297e8a43aff85f7bb3a312897594847c0539a184 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 14 Feb 2009 20:26:45 +0000 Subject: [PATCH] New files. git-svn-id: http://saetta.homelinux.org/svn/gtkcalendarex/trunk@3 7d3eb3ea-7290-43d7-a45e-e3c8929cbc33 --- src/gtkcalex.c | 92 ++++++++++++++++++++++++++++++++--------- src/gtkcalex.h | 12 ++++++ src/gtkcalexviewday.c | 0 src/gtkcalexviewday.h | 0 src/gtkcalexviewmonth.c | 0 src/gtkcalexviewmonth.h | 0 src/gtkcalexviewweek.c | 0 src/gtkcalexviewweek.h | 0 8 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 src/gtkcalexviewday.c create mode 100644 src/gtkcalexviewday.h create mode 100644 src/gtkcalexviewmonth.c create mode 100644 src/gtkcalexviewmonth.h create mode 100644 src/gtkcalexviewweek.c create mode 100644 src/gtkcalexviewweek.h diff --git a/src/gtkcalex.c b/src/gtkcalex.c index 89331e3..b4e312c 100644 --- a/src/gtkcalex.c +++ b/src/gtkcalex.c @@ -18,22 +18,26 @@ #include "gtkcalex.h" +#include + enum { - PROP_0 + PROP_0, + PROP_VIEW_TYPE, + PROP_DATE }; static void gtk_calex_class_init (GtkCalExClass *klass); static void gtk_calex_init (GtkCalEx *gtk_calex); static void gtk_calex_set_property (GObject *object, - guint property_id, - const GValue *value, - GParamSpec *pspec); + guint property_id, + const GValue *value, + GParamSpec *pspec); static void gtk_calex_get_property (GObject *object, - guint property_id, - GValue *value, - GParamSpec *pspec); + guint property_id, + GValue *value, + GParamSpec *pspec); #define GTK_CALEX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GTK_CALEX, GtkCalExPrivate)) @@ -41,6 +45,9 @@ static void gtk_calex_get_property (GObject *object, typedef struct _GtkCalExPrivate GtkCalExPrivate; struct _GtkCalExPrivate { + GtkWidget *scrolledw; + GtkWidget *goo_canvas; + GooCanvasItem *goo_canvas_root; }; GType @@ -88,19 +95,6 @@ gtk_calex_init (GtkCalEx *gtk_calex) GtkCalExPrivate *priv = GTK_CALEX_GET_PRIVATE (gtk_calex); } -/** - * gtk_calex_new: - * - * Returns: the newly created #GtkCalEx object. - */ -GtkCalEx -*gtk_calex_new () -{ - GtkCalEx *gtk_calex = GTK_CALEX (g_object_new (gtk_calex_get_type (), NULL)); - - return gtk_calex; -} - static void gtk_calex_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { @@ -110,6 +104,12 @@ gtk_calex_set_property (GObject *object, guint property_id, const GValue *value, switch (property_id) { + case PROP_VIEW_TYPE: + break; + + case PROP_DATE: + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -125,8 +125,60 @@ gtk_calex_get_property (GObject *object, guint property_id, GValue *value, GPara switch (property_id) { + case PROP_VIEW_TYPE: + break; + + case PROP_DATE: + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } + +/** + * gtk_calex_new: + * + * Returns: the newly created #GtkCalEx object. + */ +GtkCalEx +*gtk_calex_new () +{ + GtkWidget *viewport; + + GtkCalEx *gtk_calex = GTK_CALEX (g_object_new (gtk_calex_get_type (), NULL)); + + GtkCalExPrivate *priv = GTK_CALEX_GET_PRIVATE (gtk_calex); + + priv->scrolledw = gtk_scrolled_window_new (NULL, NULL); + + viewport = gtk_viewport_new (); + gtk_container_add (GTK_CONTAINER (priv->scrolledw), viewport); + + priv->goo_canvas = goo_canvas_new (); + + priv->goo_canvas_root = goo_canvas_get_root_item (GOO_CANVAS (priv->goo_canvas)); + + return gtk_calex; +} + +GtkCalExViewType +gtk_calex_get_view_type (GtkCalEx *calex) +{ +} + +void +gtk_calex_set_view_type (GtkCalEx *calex, GtkCalExTypeView type) +{ +} + +GDate +*gtk_calex_get_date (GtkCalEx *calex) +{ +} + +void +gtk_calex_set_date (GetCalEx *calex, GDate *date) +{ +} diff --git a/src/gtkcalex.h b/src/gtkcalex.h index 8e34c88..50dd641 100644 --- a/src/gtkcalex.h +++ b/src/gtkcalex.h @@ -52,6 +52,18 @@ GType gtk_calex_get_type (void) G_GNUC_CONST; GtkCalEx *gtk_calex_new (void); +typedef enum { + GTK_CALEX_VIEW_TYPE_DAY, + GTK_CALEX_VIEW_TYPE_WORK_WEEK, + GTK_CALEX_VIEW_TYPE_WEEK, + GTK_CALEX_VIEW_TYPE_MONTH +} GtkCalExViewType; + +GtkCalExViewType gtk_calex_get_view_type (GtkCalEx *calex); +void gtk_calex_set_view_type (GtkCalEx *calex, GtkCalExTypeView type); + +GDate *gtk_calex_get_date (GtkCalEx *calex); +void gtk_calex_set_date (GetCalEx *calex, GDate *date); G_END_DECLS diff --git a/src/gtkcalexviewday.c b/src/gtkcalexviewday.c new file mode 100644 index 0000000..e69de29 diff --git a/src/gtkcalexviewday.h b/src/gtkcalexviewday.h new file mode 100644 index 0000000..e69de29 diff --git a/src/gtkcalexviewmonth.c b/src/gtkcalexviewmonth.c new file mode 100644 index 0000000..e69de29 diff --git a/src/gtkcalexviewmonth.h b/src/gtkcalexviewmonth.h new file mode 100644 index 0000000..e69de29 diff --git a/src/gtkcalexviewweek.c b/src/gtkcalexviewweek.c new file mode 100644 index 0000000..e69de29 diff --git a/src/gtkcalexviewweek.h b/src/gtkcalexviewweek.h new file mode 100644 index 0000000..e69de29 -- 2.49.0