|
GnuCash 2.4.99
|
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_CURSOR_H 00022 #define GNUCASH_CURSOR_H 00023 00024 #include <gnome.h> 00025 00026 #include "gnucash-grid.h" 00027 #include "gnucash-sheet.h" 00028 00029 00030 #define GNUCASH_TYPE_CURSOR (gnucash_cursor_get_type ()) 00031 #define GNUCASH_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUCASH_TYPE_CURSOR, GnucashCursor)) 00032 #define GNUCASH_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_CURSOR, GnucashCursorClass)) 00033 #define GNUCASH_IS_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNUCASH_TYPE_CURSOR)) 00034 00035 #define GNUCASH_TYPE_ITEM_CURSOR (gnucash_item_cursor_get_type ()) 00036 #define GNUCASH_ITEM_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUCASH_TYPE_ITEM_CURSOR, GnucashItemCursor)) 00037 #define GNUCASH_ITEM_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_ITEM_CURSOR, GnucashItemCursorClass)) 00038 #define GNUCASH_IS_ITEM_CURSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNUCASH_TYPE_ITEM_CURSOR)) 00039 00040 00041 GType gnucash_item_cursor_get_type (void); 00042 GType gnucash_cursor_get_type (void); 00043 00044 00045 enum 00046 { 00047 GNUCASH_CURSOR_CELL, 00048 GNUCASH_CURSOR_BLOCK, 00049 GNUCASH_CURSOR_NUM 00050 }; 00051 00052 00053 typedef struct 00054 { 00055 GnomeCanvasItem canvas_item; 00056 00057 gint type; 00058 00059 gint row; 00060 gint col; 00061 00062 /* precomputed pixel coords for the item cursor*/ 00063 gint x, y, w, h; 00064 } GnucashItemCursor; 00065 00066 00067 typedef struct 00068 { 00069 GnomeCanvasGroup canvas_group; 00070 00071 GnomeCanvasItem *cursor[GNUCASH_CURSOR_NUM]; 00072 00073 GnucashSheet *sheet; 00074 GnucashGrid *grid; 00075 00076 /* precomputed pixel coords for the block cursor*/ 00077 gint x, y, w, h; 00078 00079 GdkGC *gc; 00080 SheetBlockStyle *style; 00081 } GnucashCursor; 00082 00083 00084 typedef struct 00085 { 00086 GnomeCanvasItemClass parent_class; 00087 } GnucashItemCursorClass; 00088 00089 00090 typedef struct 00091 { 00092 GnomeCanvasGroupClass parent_class; 00093 } GnucashCursorClass; 00094 00095 00096 GnomeCanvasItem *gnucash_cursor_new (GnomeCanvasGroup *parent); 00097 00098 void gnucash_cursor_get_virt (GnucashCursor *cursor, 00099 VirtualLocation *virt_loc); 00100 00101 void gnucash_cursor_set (GnucashCursor *cursor, VirtualLocation virt_loc); 00102 00103 void gnucash_cursor_set_style (GnucashCursor *cursor, SheetBlockStyle *style); 00104 00105 void gnucash_cursor_configure (GnucashCursor *cursor); 00106 00107 00108 #endif /* GNUCASH_CURSOR_H */ 00109 00110
1.7.4