|
GnuCash 2.4.99
|
00001 /********************************************************************\ 00002 * gnc-dense-cal.h : a custom densely-dispalyed calendar widget * 00003 * Copyright (C) 2002,2006 Joshua Sled <jsled@asynchronous.org> * 00004 * * 00005 * This program is free software; you can redistribute it and/or * 00006 * modify it under the terms of the GNU General Public License as * 00007 * published by the Free Software Foundation, under version 2 and/or version 3 of * 00008 * the License. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License* 00016 * along with this program; if not, contact: * 00017 * * 00018 * Free Software Foundation Voice: +1-617-542-5942 * 00019 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 * 00020 * Boston, MA 02110-1301, USA gnu@gnu.org * 00021 \********************************************************************/ 00022 00023 #ifndef _GNC_DENSE_CAL_H 00024 #define _GNC_DENSE_CAL_H 00025 00026 #include "config.h" 00027 00028 #include <glib.h> 00029 #include "gnc-dense-cal-model.h" 00030 #include <gtk/gtk.h> 00031 00032 G_BEGIN_DECLS 00033 00034 #define GNC_TYPE_DENSE_CAL (gnc_dense_cal_get_type ()) 00035 #define GNC_DENSE_CAL(obj) GTK_CHECK_CAST (obj, gnc_dense_cal_get_type (), GncDenseCal) 00036 #define GNC_DENSE_CAL_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gnc_dense_cal_get_type (), GncDenseCalClass) 00037 #define GNC_IS_DENSE_CAL(obj) GTK_CHECK_TYPE (obj, gnc_dense_cal_get_type ()) 00038 00039 typedef struct _GncDenseCal GncDenseCal; 00040 typedef struct _GncDenseCalClass GncDenseCalClass; 00041 00042 typedef struct _gdc_month_coords 00043 { 00044 gint x, y; 00045 } gdc_month_coords; 00046 00047 enum GDC_COLORS 00048 { 00049 MONTH_THIS = 0, 00050 MONTH_THAT, 00051 MAX_COLORS 00052 }; 00053 00054 struct _GncDenseCal 00055 { 00056 GtkVBox widget; 00057 00058 GtkComboBox *view_options; 00059 GtkDrawingArea *cal_drawing_area; 00060 00061 GdkPixmap *drawbuf; 00062 00063 gboolean initialized; 00064 00065 gboolean showPopup; 00066 GtkWindow *transPopup; 00067 00068 gint min_x_scale; 00069 gint min_y_scale; 00070 00071 gint x_scale; 00072 gint y_scale; 00073 00074 gint numMonths; 00075 gint monthsPerCol; 00076 gint num_weeks; /* computed */ 00077 00078 GDateMonth month; 00079 gint year; 00080 gint firstOfMonthOffset; 00081 00082 gint leftPadding; 00083 gint topPadding; 00084 00085 gdc_month_coords monthPositions[12]; 00086 00087 GdkColor weekColors[MAX_COLORS]; 00088 00089 guint label_width; 00090 guint label_height; 00091 gint dayLabelHeight; 00092 00093 GncDenseCalModel *model; 00094 00095 guint lastMarkTag; 00096 00097 gint week_starts_monday; 00098 00102 GList *markData; 00103 int numMarks; 00104 /* array of GList*s of per-cell markings. */ 00105 GList **marks; 00106 00107 int disposed; /* private */ 00108 }; 00109 00110 struct _GncDenseCalClass 00111 { 00112 GtkVBoxClass parent_class; 00113 }; 00114 00115 typedef struct _gdc_mark_data 00116 { 00117 gchar *name; 00118 gchar *info; 00119 guint tag; 00123 GList *ourMarks; 00124 } gdc_mark_data; 00125 00126 GtkWidget* gnc_dense_cal_new (void); 00127 GtkWidget* gnc_dense_cal_new_with_model (GncDenseCalModel *model); 00128 GType gnc_dense_cal_get_type (void); 00129 00130 void gnc_dense_cal_set_model(GncDenseCal *cal, GncDenseCalModel *model); 00131 00132 void gnc_dense_cal_set_month(GncDenseCal *dcal, GDateMonth mon); 00133 GDateMonth gnc_dense_cal_get_month( GncDenseCal *dcal ); 00137 void gnc_dense_cal_set_year( GncDenseCal *dcal, guint year ); 00138 GDateYear gnc_dense_cal_get_year( GncDenseCal *dcal ); 00139 00140 void gnc_dense_cal_set_num_months( GncDenseCal *dcal, guint num_months ); 00141 guint gnc_dense_cal_get_num_months( GncDenseCal *dcal ); 00142 00143 void gnc_dense_cal_set_months_per_col( GncDenseCal *dcal, guint monthsPerCol ); 00144 00145 G_END_DECLS 00146 00147 #endif /* _GNC_DENSE_CAL_H */
1.7.4