1
/* GTK - The GIMP Toolkit
2
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
5
* Copyright (C) 1998 Cesar Miquel and Shawn T. Amundson
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free
19
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
24
* file for a list of people on the GTK+ Team. See the ChangeLog
25
* files for a list of changes. These files are distributed with
26
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
30
* Some minor modifications and adaptation to OSMO - a handy personal
31
* manager by pasp@users.sourceforge.net
34
#ifndef _CALENDAR_WIDGET_H
35
#define _CALENDAR_WIDGET_H
38
#include <gtk/gtkwidget.h>
40
/* Not needed, retained for compatibility -Yosh */
41
#include <gtk/gtksignal.h>
46
#define GUI_TYPE_CALENDAR (gui_calendar_get_type ())
47
#define GUI_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GUI_TYPE_CALENDAR, GuiCalendar))
48
#define GUI_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GUI_TYPE_CALENDAR, GuiCalendarClass))
49
#define GUI_IS_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GUI_TYPE_CALENDAR))
50
#define GUI_IS_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GUI_TYPE_CALENDAR))
51
#define GUI_CALENDAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GUI_TYPE_CALENDAR, GuiCalendarClass))
54
typedef struct _GuiCalendar GuiCalendar;
55
typedef struct _GuiCalendarClass GuiCalendarClass;
57
typedef struct _GuiCalendarPrivate GuiCalendarPrivate;
60
GUI_CALENDAR_SHOW_HEADING = 1 << 0,
61
GUI_CALENDAR_SHOW_DAY_NAMES = 1 << 1,
62
GUI_CALENDAR_NO_MONTH_CHANGE = 1 << 2,
63
GUI_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3,
64
GUI_CALENDAR_WEEK_START_MONDAY = 1 << 4
65
} GuiCalendarDisplayOptions;
75
GtkStyle *header_style;
76
GtkStyle *label_style;
85
gint tc_num_marked_dates;
86
gint tc_marked_date[31];
88
gint num_marked_dates;
90
GuiCalendarDisplayOptions display_flags;
91
GdkColor marked_date_color[31];
93
GdkColor header_color;
94
GdkColor weekend_color;
95
GdkColor selector_color;
96
GdkColor tc_mark_color;
100
gint frame_cursor_thickness;
102
gboolean enable_cursor;
104
GdkGC *gc; /* unused */
105
GdkGC *xor_gc; /* unused */
113
GuiCalendarPrivate *priv;
114
gchar grow_space [32];
116
/* Padding for future expansion */
117
void (*_gtk_reserved1) (void);
118
void (*_gtk_reserved2) (void);
119
void (*_gtk_reserved3) (void);
120
void (*_gtk_reserved4) (void);
123
struct _GuiCalendarClass {
124
GtkWidgetClass parent_class;
126
/* Signal handlers */
127
void (* month_changed) (GuiCalendar *calendar);
128
void (* day_selected) (GuiCalendar *calendar);
129
void (* day_selected_double_click) (GuiCalendar *calendar);
130
void (* prev_month) (GuiCalendar *calendar);
131
void (* next_month) (GuiCalendar *calendar);
132
void (* prev_year) (GuiCalendar *calendar);
133
void (* next_year) (GuiCalendar *calendar);
137
GType gui_calendar_get_type (void) G_GNUC_CONST;
138
GtkWidget* gui_calendar_new (void);
140
gboolean gui_calendar_select_month (GuiCalendar *calendar, guint month, guint year);
141
void gui_calendar_select_day (GuiCalendar *calendar, guint day);
143
gboolean gui_calendar_mark_day (GuiCalendar *calendar, guint day);
144
gboolean gui_calendar_tc_mark_day (GuiCalendar *calendar, guint day);
145
gboolean gui_calendar_mark_day_color (GuiCalendar *calendar, guint day, gchar *color_str);
146
gboolean gui_calendar_unmark_day (GuiCalendar *calendar, guint day);
147
gboolean gui_calendar_tc_unmark_day (GuiCalendar *calendar, guint day);
148
void gui_calendar_clear_marks (GuiCalendar *calendar);
149
void gui_calendar_tc_clear_marks (GuiCalendar *calendar);
152
void gui_calendar_set_display_options (GuiCalendar *calendar, GuiCalendarDisplayOptions flags);
153
GuiCalendarDisplayOptions gui_calendar_get_display_options (GuiCalendar *calendar);
155
void gui_calendar_get_date (GuiCalendar *calendar, guint *year, guint *month, guint *day);
157
void gui_calendar_set_header_color (GuiCalendar *calendar, const char *color);
158
void gui_calendar_set_weekend_color (GuiCalendar *calendar, const char *color);
159
void gui_calendar_set_selector_color (GuiCalendar *calendar, const char *color);
160
void gui_calendar_set_tc_mark_color (GuiCalendar *calendar, const gchar *color);
161
void gui_calendar_set_mark_symbol (GuiCalendar *calendar, const gchar *symbol);
163
void gui_calendar_set_cursor_type (GuiCalendar *calendar, gint cursor_type);
164
void gui_calendar_set_frame_cursor_thickness (GuiCalendar *calendar, gint thickness);
165
void gui_calendar_enable_cursor (GuiCalendar *calendar, gboolean state);
167
guint weeks_in_year (guint year);
168
guint week_number (guint year, guint mm, guint dd);
169
guint day_of_week (guint year, guint mm, guint dd);
173
#endif /* _CALENDAR_WIDGET_H */