diff options
author | Tim Janik <timj@gtk.org> | 1998-10-01 13:24:42 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-10-01 13:24:42 +0000 |
commit | b89ed0c35f513007c26323b43c355b7f32a8f0ee (patch) | |
tree | c2c4f70af6ca8ea0ebea56894123aab3a5c66117 /gtk/gtkcalendar.h | |
parent | fa5c68f7c677e76d42a1f8d26aefd95c68c729e3 (diff) | |
download | gtk+-b89ed0c35f513007c26323b43c355b7f32a8f0ee.tar.gz |
new function. (gtk_clist_insert): added g_return_val_if_fail() statements.
Thu Oct 1 10:40:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h (gtk_clist_prepend):
* gtk/gtkclist.c (gtk_clist_prepend): new function.
(gtk_clist_insert): added g_return_val_if_fail()
statements. accept a row parameter < 0 or > clist->rows to indicate
append mode.
(real_clear): first clean up all internal pointers and lists (e.g.
clist->row_list or clist->rows), then delete the distinct rows. this
is required because of destroy notifiers, we need to have all internal
structures updated and be reentrant.
* gtk/gtkcalendar.h:
* gtk/gtkcalendar.c: removed the `gtk_calendar_' prefix from the
GtkCalendarClass signal methods.
GtkType and macro fixups, put `void' into () prototypes, avoid C++
style comments, indentation fixes, fixed some g_return_if_fail()
statements.
(gtk_calendar_paint_header):
(gtk_calendar_paint_day_names):
(gtk_calendar_paint_week_numbers):
(gtk_calendar_paint_main): made these static functions.
(gtk_calendar_select_month):
(gtk_calendar_select_day):
(gtk_calendar_mark_day):
(gtk_calendar_unmark_day):
(gtk_calendar_get_date): signedness corrections, use guints
rather than gints.
(gtk_calendar_size_request): removed unused variables.
Diffstat (limited to 'gtk/gtkcalendar.h')
-rw-r--r-- | gtk/gtkcalendar.h | 113 |
1 files changed, 64 insertions, 49 deletions
diff --git a/gtk/gtkcalendar.h b/gtk/gtkcalendar.h index b09a95d791..c49f373eff 100644 --- a/gtk/gtkcalendar.h +++ b/gtk/gtkcalendar.h @@ -11,39 +11,43 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - #ifndef __GTK_CALENDAR_H__ #define __GTK_CALENDAR_H__ #include <gdk/gdk.h> #include <gtk/gtksignal.h> #include <gtk/gtkwidget.h> -#include <gtk/gtkfeatures.h> + #ifdef __cplusplus extern "C" { +#pragma } #endif /* __cplusplus */ -#define GTK_CALENDAR(obj) GTK_CHECK_CAST (obj, gtk_calendar_get_type (), GtkCalendar) -#define GTK_CALENDAR_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_calendar_get_type (), GtkCalendarClass) -#define GTK_IS_CALENDAR(obj) GTK_CHECK_TYPE (obj, gtk_calendar_get_type ()) -typedef struct _GtkCalendar GtkCalendar; +#define GTK_TYPE_CALENDAR (gtk_calendar_get_type ()) +#define GTK_CALENDAR(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_CALENDAR, GtkCalendar)) +#define GTK_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_CALENDAR, GtkCalendarClass)) +#define GTK_IS_CALENDAR(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CALENDAR)) +#define GTK_IS_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CALENDAR)) + + +typedef struct _GtkCalendar GtkCalendar; typedef struct _GtkCalendarClass GtkCalendarClass; typedef enum { - GTK_CALENDAR_SHOW_HEADING = 1 << 0, - GTK_CALENDAR_SHOW_DAY_NAMES = 1 << 1, - GTK_CALENDAR_NO_MONTH_CHANGE = 1 << 2, - GTK_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3, + GTK_CALENDAR_SHOW_HEADING = 1 << 0, + GTK_CALENDAR_SHOW_DAY_NAMES = 1 << 1, + GTK_CALENDAR_NO_MONTH_CHANGE = 1 << 2, + GTK_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3, GTK_CALENDAR_WEEK_START_MONDAY = 1 << 4 } GtkCalendarDisplayOptions; @@ -51,47 +55,47 @@ struct _GtkCalendar { /* This widget is derived from GtkWidget */ GtkWidget widget; - + GdkWindow *header_win, *day_name_win, *main_win, *week_win; gint header_h, day_name_h, main_h; GtkStyle *header_style; GtkStyle *label_style; - + gint month; gint year; gint selected_day; - + gint day_month[6][7]; gint day[6][7]; - + gint num_marked_dates; gint marked_date[31]; GtkCalendarDisplayOptions display_flags; GdkColor marked_date_color[31]; - + /* Header Information */ GdkWindow *arrow_win[4]; - gint arrow_state[4]; - gint arrow_width; - gint max_month_width; - gint max_year_width; - + gint arrow_state[4]; + gint arrow_width; + gint max_month_width; + gint max_year_width; + /* Other info */ gint calstarty, calnumrows; - + /* Style parameters for this widget */ GdkGC *gc; GdkCursor *cross; - + gint day_width; gint week_width; GdkRectangle header_button[4]; GdkRectangle rect_days[6][7]; - + gint highlight_row; gint highlight_col; - + gint min_day_width; gint max_day_char_width; gint max_day_char_ascent; @@ -105,7 +109,7 @@ struct _GtkCalendar unsigned int dirty_main:1; unsigned int dirty_week:1; unsigned int frozen; - + gint week_num_w; gint font_width_day_name, font_width_day; char grow_space [32]; @@ -114,39 +118,50 @@ struct _GtkCalendar struct _GtkCalendarClass { GtkWidgetClass parent_class; - + /* Signal handlers */ - void (* gtk_calendar_month_changed) (GtkCalendarClass *); - void (* gtk_calendar_day_selected) (GtkCalendarClass *); - void (* gtk_calendar_day_selected_double_click) (GtkCalendarClass *); - void (* gtk_calendar_prev_month) (GtkCalendarClass *); - void (* gtk_calendar_next_month) (GtkCalendarClass *); - void (* gtk_calendar_prev_year) (GtkCalendarClass *); - void (* gtk_calendar_next_year) (GtkCalendarClass *); - + void (* month_changed) (GtkCalendarClass *calendar); + void (* day_selected) (GtkCalendarClass *calendar); + void (* day_selected_double_click) (GtkCalendarClass *calendar); + void (* prev_month) (GtkCalendarClass *calendar); + void (* next_month) (GtkCalendarClass *calendar); + void (* prev_year) (GtkCalendarClass *calendar); + void (* next_year) (GtkCalendarClass *calendar); + }; -guint gtk_calendar_get_type (void); -GtkWidget* gtk_calendar_new (void); +GtkType gtk_calendar_get_type (void); +GtkWidget* gtk_calendar_new (void); + +gint gtk_calendar_select_month (GtkCalendar *calendar, + guint month, + guint year); +void gtk_calendar_select_day (GtkCalendar *calendar, + guint day); + +gint gtk_calendar_mark_day (GtkCalendar *calendar, + guint day); +gint gtk_calendar_unmark_day (GtkCalendar *calendar, + guint day); +void gtk_calendar_clear_marks (GtkCalendar *calendar); + + +void gtk_calendar_display_options (GtkCalendar *calendar, + GtkCalendarDisplayOptions flags); -gint gtk_calendar_select_month (GtkCalendar *calendar, - gint month, gint year); -void gtk_calendar_select_day (GtkCalendar *calendar, gint day); +void gtk_calendar_get_date (GtkCalendar *calendar, + guint *year, + guint *month, + guint *day); +void gtk_calendar_freeze (GtkCalendar *calendar); +void gtk_calendar_thaw (GtkCalendar *calendar); -gint gtk_calendar_mark_day (GtkCalendar *calendar, gint day); -gint gtk_calendar_unmark_day (GtkCalendar *calendar, gint day); -void gtk_calendar_clear_marks (GtkCalendar *calendar); -void gtk_calendar_display_options (GtkCalendar *calendar, - GtkCalendarDisplayOptions flags); -void gtk_calendar_get_date (GtkCalendar *calendar, - gint *year, gint *month, gint *day); -void gtk_calendar_freeze (GtkCalendar *calendar); -void gtk_calendar_thaw (GtkCalendar *calendar); #ifdef __cplusplus +#pragma { } #endif /* __cplusplus */ |