aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/week-view.c
blob: 89e489a92dd391e60e41afa53e7af447dfa816a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* Week view display for gncal
 *
 * Copyright (C) 1998 The Free Software Foundation
 *
 * Author: Federico Mena <federico@nuclecu.unam.mx>
 */

#include <config.h>
#include "year-view.h"


static void week_view_class_init (WeekViewClass *class);
static void week_view_init       (WeekView      *wv);


GtkType
week_view_get_type (void)
{
    static GtkType week_view_type = 0;

    if (!week_view_type) {
        GtkTypeInfo week_view_info = {
            "WeekView",
            sizeof (WeekView),
            sizeof (WeekViewClass),
            (GtkClassInitFunc) week_view_class_init,
            (GtkObjectInitFunc) week_view_init,
            NULL, /* reserved_1 */
            NULL, /* reserved_2 */
            (GtkClassInitFunc) NULL
        };

        week_view_type = gtk_type_unique (gnome_canvas_get_type (), &week_view_info);
    }

    return week_view_type;
}

static void
week_view_class_init (WeekViewClass *class)
{
    /* FIXME */
}

static void
week_view_init (WeekView *wv)
{
    GnomeCanvasGroup *root;

    root = gnome_canvas_root (GNOME_CANVAS (wv));

    /* Title */

    wv->title = gnome_canvas_item_new (root,
                       gnome_canvas_text_get_type (),
                       "anchor", GTK_ANCHOR_N,
                       "font", HEADING_FONT,
                       "fill_color", "black",
                       NULL);
}

GtkWidget *
week_view_new (GnomeCalendar *calendar, time_t week)
{
    WeekView *wv;

    g_return_val_if_fail (calendar != NULL, NULL);
    g_return_val_if_fail (GNOME_IS_CALENDAR (calendar), NULL);

    wv = gtk_type_new (week_view_get_type ());
    wv->calendar = calendar;

    week_view_colors_changed (wv);
    week_view_set (wv, week);
    return GTK_WIDGET (wv);
}

void
week_view_update (WeekView *wv, iCalObject *ico, int flags)
{
    /* FIXME */
}

void
week_view_set (WeekView *wv, time_t week)
{
    /* FIXME */
}

void
week_view_time_format_changed (WeekView *wv)
{
    /* FIXME */
}

void
week_view_colors_changed (WeekView *wv)
{
    /* FIXME */
}