GnuCash 2.4.99
gnucash-grid.h
00001 /********************************************************************\
00002  * This program is free software; you can redistribute it and/or    *
00003  * modify it under the terms of the GNU General Public License as   *
00004  * published by the Free Software Foundation; either version 2 of   *
00005  * the License, or (at your option) any later version.              *
00006  *                                                                  *
00007  * This program is distributed in the hope that it will be useful,  *
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00010  * GNU General Public License for more details.                     *
00011  *                                                                  *
00012  * You should have received a copy of the GNU General Public License*
00013  * along with this program; if not, contact:                        *
00014  *                                                                  *
00015  * Free Software Foundation           Voice:  +1-617-542-5942       *
00016  * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
00017  * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
00018  *                                                                  *
00019 \********************************************************************/
00020 
00021 #ifndef GNUCASH_GRID_H
00022 #define GNUCASH_GRID_H
00023 
00024 #include <gnome.h>
00025 
00026 #include "table-allgui.h"
00027 #include "gnucash-sheet.h"
00028 
00029 
00030 #define GNUCASH_TYPE_GRID     (gnucash_grid_get_type ())
00031 #define GNUCASH_GRID(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), GNUCASH_TYPE_GRID, GnucashGrid))
00032 #define GNUCASH_GRID_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_GRID, GnucashGridClass))
00033 #define GNUCASH_IS_GRID(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), GNUCASH_TYPE_GRID))
00034 
00035 
00036 typedef struct
00037 {
00038     GnomeCanvasItem canvas_item;
00039 
00040     GnucashSheet *sheet;
00041 
00042     /* The first and last displayed block */
00043     int        top_block;
00044     int        bottom_block;
00045 
00046     /* Offset from spreadsheet origin in units */
00047     long       top_offset;
00048     long       left_offset;
00049 
00050     GdkGC      *grid_gc;        /* Draw grid gc */
00051     GdkGC      *fill_gc;        /* Default background fill gc */
00052     GdkGC      *gc;             /* Color used for the cell */
00053 
00054     GdkColor   background;
00055     GdkColor   grid_color;
00056     GdkColor   default_color;
00057 } GnucashGrid;
00058 
00059 
00060 typedef struct
00061 {
00062     GnomeCanvasItemClass parent_class;
00063 } GnucashGridClass;
00064 
00065 
00066 GType      gnucash_grid_get_type (void);
00067 GtkWidget *gnucash_grid_new      (GnucashSheet *sheet);
00068 
00069 gboolean   gnucash_grid_find_loc_by_pixel (GnucashGrid *grid, gint x, gint y,
00070         VirtualLocation *vcell_loc);
00071 
00072 void       gnucash_draw_hatching (GdkDrawable *drawable, GdkGC *gc,
00073                                   int x, int y, int width, int height);
00074 
00075 #endif /* GNUCASH_GRID_H */
00076 
00077 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines