Blame gtk/gtkcalendar.h

Packit 98cdb6
/* GTK - The GIMP Toolkit
Packit 98cdb6
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
Packit 98cdb6
 *
Packit 98cdb6
 * GTK Calendar Widget
Packit 98cdb6
 * Copyright (C) 1998 Cesar Miquel and Shawn T. Amundson
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Packit 98cdb6
 * Lesser General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
 * License along with this library; if not, write to the Free
Packit 98cdb6
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
/*
Packit 98cdb6
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
Packit 98cdb6
 * file for a list of people on the GTK+ Team.  See the ChangeLog
Packit 98cdb6
 * files for a list of changes.  These files are distributed with
Packit 98cdb6
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#ifndef __GTK_CALENDAR_H__
Packit 98cdb6
#define __GTK_CALENDAR_H__
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
Packit 98cdb6
#error "Only <gtk/gtk.h> can be included directly."
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
#include <gtk/gtkwidget.h>
Packit 98cdb6
Packit 98cdb6
/* Not needed, retained for compatibility -Yosh */
Packit 98cdb6
#include <gtk/gtksignal.h>
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
G_BEGIN_DECLS
Packit 98cdb6
Packit 98cdb6
#define GTK_TYPE_CALENDAR                  (gtk_calendar_get_type ())
Packit 98cdb6
#define GTK_CALENDAR(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CALENDAR, GtkCalendar))
Packit 98cdb6
#define GTK_CALENDAR_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CALENDAR, GtkCalendarClass))
Packit 98cdb6
#define GTK_IS_CALENDAR(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CALENDAR))
Packit 98cdb6
#define GTK_IS_CALENDAR_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CALENDAR))
Packit 98cdb6
#define GTK_CALENDAR_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CALENDAR, GtkCalendarClass))
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
typedef struct _GtkCalendar	       GtkCalendar;
Packit 98cdb6
typedef struct _GtkCalendarClass       GtkCalendarClass;
Packit 98cdb6
Packit 98cdb6
typedef struct _GtkCalendarPrivate     GtkCalendarPrivate;
Packit 98cdb6
Packit 98cdb6
/**
Packit 98cdb6
 * GtkCalendarDisplayOptions:
Packit 98cdb6
 * @GTK_CALENDAR_SHOW_HEADING: Specifies that the month and year should be displayed.
Packit 98cdb6
 * @GTK_CALENDAR_SHOW_DAY_NAMES: Specifies that three letter day descriptions should be present.
Packit 98cdb6
 * @GTK_CALENDAR_NO_MONTH_CHANGE: Prevents the user from switching months with the calendar.
Packit 98cdb6
 * @GTK_CALENDAR_SHOW_WEEK_NUMBERS: Displays each week numbers of the current year, down the
Packit 98cdb6
 * left side of the calendar.
Packit 98cdb6
 * @GTK_CALENDAR_WEEK_START_MONDAY: Since GTK+ 2.4, this option is deprecated and ignored by GTK+.
Packit 98cdb6
 * The information on which day the calendar week starts is derived from the locale.
Packit 98cdb6
 * @GTK_CALENDAR_SHOW_DETAILS: Just show an indicator, not the full details
Packit 98cdb6
 * text when details are provided. See gtk_calendar_set_detail_func().
Packit 98cdb6
 *
Packit 98cdb6
 * These options can be used to influence the display and behaviour of a #GtkCalendar.
Packit 98cdb6
 */
Packit 98cdb6
typedef enum
Packit 98cdb6
{
Packit 98cdb6
  GTK_CALENDAR_SHOW_HEADING		= 1 << 0,
Packit 98cdb6
  GTK_CALENDAR_SHOW_DAY_NAMES		= 1 << 1,
Packit 98cdb6
  GTK_CALENDAR_NO_MONTH_CHANGE		= 1 << 2,
Packit 98cdb6
  GTK_CALENDAR_SHOW_WEEK_NUMBERS	= 1 << 3,
Packit 98cdb6
  GTK_CALENDAR_WEEK_START_MONDAY	= 1 << 4,
Packit 98cdb6
  GTK_CALENDAR_SHOW_DETAILS		= 1 << 5
Packit 98cdb6
} GtkCalendarDisplayOptions;
Packit 98cdb6
Packit 98cdb6
/**
Packit 98cdb6
 * GtkCalendarDetailFunc:
Packit 98cdb6
 * @calendar: a #GtkCalendar.
Packit 98cdb6
 * @year: the year for which details are needed.
Packit 98cdb6
 * @month: the month for which details are needed.
Packit 98cdb6
 * @day: the day of @month for which details are needed.
Packit 98cdb6
 * @user_data: the data passed with gtk_calendar_set_detail_func().
Packit 98cdb6
 *
Packit 98cdb6
 * This kind of functions provide Pango markup with detail information for the
Packit 98cdb6
 * specified day. Examples for such details are holidays or appointments. The
Packit 98cdb6
 * function returns %NULL when no information is available.
Packit 98cdb6
 *
Packit 98cdb6
 * Since: 2.14
Packit 98cdb6
 *
Packit 98cdb6
 * Return value: Newly allocated string with Pango markup with details
Packit 98cdb6
 * for the specified day, or %NULL.
Packit 98cdb6
 */
Packit 98cdb6
typedef gchar* (*GtkCalendarDetailFunc) (GtkCalendar *calendar,
Packit 98cdb6
                                         guint        year,
Packit 98cdb6
                                         guint        month,
Packit 98cdb6
                                         guint        day,
Packit 98cdb6
                                         gpointer     user_data);
Packit 98cdb6
Packit 98cdb6
struct _GtkCalendar
Packit 98cdb6
{
Packit 98cdb6
  GtkWidget widget;
Packit 98cdb6
  
Packit 98cdb6
  GtkStyle  *GSEAL (header_style);
Packit 98cdb6
  GtkStyle  *GSEAL (label_style);
Packit 98cdb6
  
Packit 98cdb6
  gint GSEAL (month);
Packit 98cdb6
  gint GSEAL (year);
Packit 98cdb6
  gint GSEAL (selected_day);
Packit 98cdb6
  
Packit 98cdb6
  gint GSEAL (day_month[6][7]);
Packit 98cdb6
  gint GSEAL (day[6][7]);
Packit 98cdb6
  
Packit 98cdb6
  gint GSEAL (num_marked_dates);
Packit 98cdb6
  gint GSEAL (marked_date[31]);
Packit 98cdb6
  GtkCalendarDisplayOptions  GSEAL (display_flags);
Packit 98cdb6
  GdkColor GSEAL (marked_date_color[31]);
Packit 98cdb6
  
Packit 98cdb6
  GdkGC *GSEAL (gc);			/* unused */
Packit 98cdb6
  GdkGC *GSEAL (xor_gc);		/* unused */
Packit 98cdb6
Packit 98cdb6
  gint GSEAL (focus_row);
Packit 98cdb6
  gint GSEAL (focus_col);
Packit 98cdb6
Packit 98cdb6
  gint GSEAL (highlight_row);
Packit 98cdb6
  gint GSEAL (highlight_col);
Packit 98cdb6
  
Packit 98cdb6
  GtkCalendarPrivate *GSEAL (priv);
Packit 98cdb6
  gchar GSEAL (grow_space [32]);
Packit 98cdb6
Packit 98cdb6
  /* Padding for future expansion */
Packit 98cdb6
  void (*_gtk_reserved1) (void);
Packit 98cdb6
  void (*_gtk_reserved2) (void);
Packit 98cdb6
  void (*_gtk_reserved3) (void);
Packit 98cdb6
  void (*_gtk_reserved4) (void);
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
struct _GtkCalendarClass
Packit 98cdb6
{
Packit 98cdb6
  GtkWidgetClass parent_class;
Packit 98cdb6
  
Packit 98cdb6
  /* Signal handlers */
Packit 98cdb6
  void (* month_changed)		(GtkCalendar *calendar);
Packit 98cdb6
  void (* day_selected)			(GtkCalendar *calendar);
Packit 98cdb6
  void (* day_selected_double_click)	(GtkCalendar *calendar);
Packit 98cdb6
  void (* prev_month)			(GtkCalendar *calendar);
Packit 98cdb6
  void (* next_month)			(GtkCalendar *calendar);
Packit 98cdb6
  void (* prev_year)			(GtkCalendar *calendar);
Packit 98cdb6
  void (* next_year)			(GtkCalendar *calendar);
Packit 98cdb6
  
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
GType	   gtk_calendar_get_type	(void) G_GNUC_CONST;
Packit 98cdb6
GtkWidget* gtk_calendar_new		(void);
Packit 98cdb6
Packit 98cdb6
gboolean   gtk_calendar_select_month	(GtkCalendar *calendar,
Packit 98cdb6
					 guint	      month,
Packit 98cdb6
					 guint	      year);
Packit 98cdb6
void	   gtk_calendar_select_day	(GtkCalendar *calendar,
Packit 98cdb6
					 guint	      day);
Packit 98cdb6
Packit 98cdb6
gboolean   gtk_calendar_mark_day	(GtkCalendar *calendar,
Packit 98cdb6
					 guint	      day);
Packit 98cdb6
gboolean   gtk_calendar_unmark_day	(GtkCalendar *calendar,
Packit 98cdb6
					 guint	      day);
Packit 98cdb6
void	   gtk_calendar_clear_marks	(GtkCalendar *calendar);
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
void	   gtk_calendar_set_display_options (GtkCalendar    	      *calendar,
Packit 98cdb6
					     GtkCalendarDisplayOptions flags);
Packit 98cdb6
GtkCalendarDisplayOptions
Packit 98cdb6
           gtk_calendar_get_display_options (GtkCalendar   	      *calendar);
Packit 98cdb6
#ifndef GTK_DISABLE_DEPRECATED
Packit 98cdb6
void	   gtk_calendar_display_options (GtkCalendar		  *calendar,
Packit 98cdb6
					 GtkCalendarDisplayOptions flags);
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
void	   gtk_calendar_get_date	(GtkCalendar *calendar, 
Packit 98cdb6
					 guint	     *year,
Packit 98cdb6
					 guint	     *month,
Packit 98cdb6
					 guint	     *day);
Packit 98cdb6
Packit 98cdb6
void       gtk_calendar_set_detail_func (GtkCalendar           *calendar,
Packit 98cdb6
                                         GtkCalendarDetailFunc  func,
Packit 98cdb6
                                         gpointer               data,
Packit 98cdb6
                                         GDestroyNotify         destroy);
Packit 98cdb6
Packit 98cdb6
void       gtk_calendar_set_detail_width_chars (GtkCalendar    *calendar,
Packit 98cdb6
                                                gint            chars);
Packit 98cdb6
void       gtk_calendar_set_detail_height_rows (GtkCalendar    *calendar,
Packit 98cdb6
                                                gint            rows);
Packit 98cdb6
Packit 98cdb6
gint       gtk_calendar_get_detail_width_chars (GtkCalendar    *calendar);
Packit 98cdb6
gint       gtk_calendar_get_detail_height_rows (GtkCalendar    *calendar);
Packit 98cdb6
Packit 98cdb6
#ifndef GTK_DISABLE_DEPRECATED
Packit 98cdb6
void	   gtk_calendar_freeze		(GtkCalendar *calendar);
Packit 98cdb6
void	   gtk_calendar_thaw		(GtkCalendar *calendar);
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
G_END_DECLS
Packit 98cdb6
Packit 98cdb6
#endif /* __GTK_CALENDAR_H__ */