Blame gtk/gtkcalendar.h

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