![]() |
![]() |
liblunar Reference Manual | ||
---|---|---|---|---|
#include <lunar/lunar.h> LunarCalendar; enum LunarCalendarDisplayOptions; GtkWidget* lunar_calendar_new (void); gboolean lunar_calendar_select_month (LunarCalendar *calendar, guint month, guint year); void lunar_calendar_select_day (LunarCalendar *calendar, guint day); gboolean lunar_calendar_mark_day (LunarCalendar *calendar, guint day); gboolean lunar_calendar_unmark_day (LunarCalendar *calendar, guint day); void lunar_calendar_clear_marks (LunarCalendar *calendar); LunarCalendarDisplayOptions lunar_calendar_get_display_options (LunarCalendar *calendar); void lunar_calendar_set_display_options (LunarCalendar *calendar, LunarCalendarDisplayOptions flags); void lunar_calendar_display_options (LunarCalendar *calendar, LunarCalendarDisplayOptions flags); void lunar_calendar_get_date (LunarCalendar *calendar, guint *year, guint *month, guint *day); void lunar_calendar_freeze (LunarCalendar *calendar); void lunar_calendar_thaw (LunarCalendar *calendar);
typedef struct { GtkWidget widget; 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]; LunarCalendarDisplayOptions display_flags; GdkColor marked_date_color[31]; GdkGC *gc; /* unused */ GdkGC *xor_gc; /* unused */ gint focus_row; gint focus_col; gint highlight_row; gint highlight_col; LunarCalendarPrivate *priv; gchar grow_space [32]; /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); void (*_gtk_reserved3) (void); void (*_gtk_reserved4) (void); } LunarCalendar;
typedef enum { LUNAR_CALENDAR_SHOW_HEADING = 1 << 0, LUNAR_CALENDAR_SHOW_DAY_NAMES = 1 << 1, LUNAR_CALENDAR_NO_MONTH_CHANGE = 1 << 2, LUNAR_CALENDAR_SHOW_WEEK_NUMBERS = 1 << 3, LUNAR_CALENDAR_WEEK_START_MONDAY = 1 << 4, LUNAR_CALENDAR_SHOW_LUNAR = 1 << 5 } LunarCalendarDisplayOptions;
GtkWidget* lunar_calendar_new (void);
Creates a new calendar, with the current date being selected.
Returns : |
a newly LunarCalendar widget |
gboolean lunar_calendar_select_month (LunarCalendar *calendar, guint month, guint year);
Shifts the calendar to a different month.
|
a LunarCalendar |
|
a month number between 0 and 11. |
|
the year the month is in. |
Returns : |
TRUE , always
|
void lunar_calendar_select_day (LunarCalendar *calendar, guint day);
Selects a day from the current month.
|
a LunarCalendar. |
|
the day number between 1 and 31, or 0 to unselect the currently selected day. |
gboolean lunar_calendar_mark_day (LunarCalendar *calendar, guint day);
Places a visual marker on a particular day.
|
a LunarCalendar |
|
the day number to mark between 1 and 31. |
Returns : |
TRUE , always
|
gboolean lunar_calendar_unmark_day (LunarCalendar *calendar, guint day);
Removes the visual marker from a particular day.
|
a LunarCalendar. |
|
the day number to unmark between 1 and 31. |
Returns : |
TRUE , always
|
void lunar_calendar_clear_marks (LunarCalendar *calendar);
Remove all visual markers.
|
a LunarCalendar |
LunarCalendarDisplayOptions lunar_calendar_get_display_options (LunarCalendar *calendar);
Returns the current display options of calendar
.
|
a LunarCalendar |
Returns : |
the display options. |
Since 2.4
void lunar_calendar_set_display_options (LunarCalendar *calendar, LunarCalendarDisplayOptions flags);
Sets display options (whether to display the heading and the month headings).
|
a LunarCalendar |
|
the display options to set |
Since 2.4
void lunar_calendar_display_options (LunarCalendar *calendar, LunarCalendarDisplayOptions flags);
lunar_calendar_display_options
has been deprecated since version 2.4 and should not be used in newly-written code. Use lunar_calendar_set_display_options()
instead
Sets display options (whether to display the heading and the month headings).
|
a LunarCalendar. |
|
the display options to set. |
void lunar_calendar_get_date (LunarCalendar *calendar, guint *year, guint *month, guint *day);
Obtains the selected date from a LunarCalendar.
|
a LunarCalendar |
|
location to store the year number, or NULL
|
|
location to store the month number (between 0 and 11), or NULL
|
|
location to store the day number (between 1 and 31), or NULL
|
void lunar_calendar_freeze (LunarCalendar *calendar);
lunar_calendar_freeze
has been deprecated since version 2.8 and should not be used in newly-written code.
Does nothing. Previously locked the display of the calendar until
it was thawed with lunar_calendar_thaw()
.
|
a LunarCalendar |
void lunar_calendar_thaw (LunarCalendar *calendar);
lunar_calendar_thaw
has been deprecated since version 2.8 and should not be used in newly-written code.
Does nothing. Previously defrosted a calendar; all the changes made
since the last lunar_calendar_freeze()
were displayed.
|
a LunarCalendar |