aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gnome-month-item.h
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-08-11 12:22:05 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-08-11 12:22:05 +0800
commit1596825b7da24002e23d90a236d6def417d7dd58 (patch)
tree9f1ec2b869985e722c230ec2589440aedf44d2bd /calendar/gnome-month-item.h
parentf91ebfeae9cdbc0d4866e08fc538f7e466ab70f8 (diff)
downloadgsoc2013-evolution-1596825b7da24002e23d90a236d6def417d7dd58.tar.gz
gsoc2013-evolution-1596825b7da24002e23d90a236d6def417d7dd58.tar.zst
gsoc2013-evolution-1596825b7da24002e23d90a236d6def417d7dd58.zip
Start of the month view widget. This will use the generic month item and
1998-08-10 Federico Mena Quintero <federico@nuclecu.unam.mx> * month-view.[ch]: Start of the month view widget. This will use the generic month item and extend it to have the semantics desired for the gnomecal month view. * gnome-month-item.[ch]: New generic canvas item for the month view and the "small calendars". This is intended to be a high-level display engine for monthly calendars. This is a work in progress. * gnome-cal.h (GnomeCalendar): Added a month_view field. * gnome-cal.c (setup_widgets): Create the month view and insert it into the notebook. * Makefile.am: Added month-view.[ch] and gnome-month-item.[ch] to the sources. svn path=/trunk/; revision=307
Diffstat (limited to 'calendar/gnome-month-item.h')
-rw-r--r--calendar/gnome-month-item.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/calendar/gnome-month-item.h b/calendar/gnome-month-item.h
new file mode 100644
index 0000000000..2260186c6d
--- /dev/null
+++ b/calendar/gnome-month-item.h
@@ -0,0 +1,68 @@
+/* General-purpose monthly calendar canvas item for GNOME
+ *
+ * Copyright (C) 1998 Red Hat Software, Inc.
+ *
+ * Author: Federico Mena <federico@nuclecu.unam.mx>
+ */
+
+#ifndef GNOME_MONTH_ITEM_H
+#define GNOME_MONTH_ITEM_H
+
+#include <libgnome/gnome-defs.h>
+#include <gtk/gtkpacker.h> /* why the hell is GtkAnchorType here and not in gtkenums.h? */
+#include <libgnomeui/gnome-canvas.h>
+
+
+BEGIN_GNOME_DECLS
+
+
+#define GNOME_TYPE_MONTH_ITEM (gnome_month_item_get_type ())
+#define GNOME_MONTH_ITEM(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_MONTH_ITEM, GnomeMonthItem))
+#define GNOME_MONTH_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GNOME_TYPE_MONTH_ITEM, GnomeMonthItemClass))
+#define GNOME_IS_MONTH_ITEM(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_MONTH_ITEM))
+#define GNOME_IS_MONTH_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_MONTH_ITEM))
+
+
+typedef struct _GnomeMonthItem GnomeMonthItem;
+typedef struct _GnomeMonthItemClass GnomeMonthItemClass;
+
+struct _GnomeMonthItem {
+ GnomeCanvasGroup group;
+
+ int year; /* Year to show (full, no two-digit crap) */
+ int month; /* Month to show (0-11) */
+
+ double x, y; /* Position at anchor */
+ double width, height; /* Size of calendar */
+ GtkAnchorType anchor; /* Anchor side for calendar */
+
+ double padding; /* Padding to use between division lines and text */
+
+ char *day_names[7]; /* Names to use for the day labels, starting from Sunday */
+
+ double head_height; /* Height of the headings row */
+ GtkAnchorType head_anchor; /* Anchor side for the heading labels */
+
+ GnomeCanvasItem **items; /* All the items that make up the calendar */
+
+ int start_on_monday : 1; /* Start the week on Monday? If false, then start from Sunday */
+};
+
+struct _GnomeMonthItemClass {
+ GnomeCanvasGroupClass parent_class;
+};
+
+
+/* Standard Gtk function */
+GtkType gnome_month_item_get_type (void);
+
+/* Creates a new month item with the specified group as parent */
+GnomeCanvasItem *gnome_month_item_new (GnomeCanvasGroup *parent);
+
+/* Constructor function useful for derived classes */
+void gnome_month_item_construct (GnomeMonthItem *mitem);
+
+
+END_GNOME_DECLS
+
+#endif