GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnucash-cursor.h
1 /********************************************************************\
2  * This program is free software; you can redistribute it and/or *
3  * modify it under the terms of the GNU General Public License as *
4  * published by the Free Software Foundation; either version 2 of *
5  * the License, or (at your option) any later version. *
6  * *
7  * This program is distributed in the hope that it will be useful, *
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
10  * GNU General Public License for more details. *
11  * *
12  * You should have received a copy of the GNU General Public License*
13  * along with this program; if not, contact: *
14  * *
15  * Free Software Foundation Voice: +1-617-542-5942 *
16  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
17  * Boston, MA 02110-1301, USA [email protected] *
18  * *
19 \********************************************************************/
20 
21 #ifndef GNUCASH_CURSOR_H
22 #define GNUCASH_CURSOR_H
23 
24 #include "gnucash-grid.h"
25 #include "gnucash-sheet.h"
26 #include <libgnomecanvas/libgnomecanvas.h>
27 
28 
29 #define GNUCASH_TYPE_CURSOR (gnucash_cursor_get_type ())
30 #define GNUCASH_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUCASH_TYPE_CURSOR, GnucashCursor))
31 #define GNUCASH_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_CURSOR, GnucashCursorClass))
32 #define GNUCASH_IS_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNUCASH_TYPE_CURSOR))
33 
34 #define GNUCASH_TYPE_ITEM_CURSOR (gnucash_item_cursor_get_type ())
35 #define GNUCASH_ITEM_CURSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNUCASH_TYPE_ITEM_CURSOR, GnucashItemCursor))
36 #define GNUCASH_ITEM_CURSOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNUCASH_TYPE_ITEM_CURSOR, GnucashItemCursorClass))
37 #define GNUCASH_IS_ITEM_CURSOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNUCASH_TYPE_ITEM_CURSOR))
38 
39 
40 GType gnucash_item_cursor_get_type (void);
41 GType gnucash_cursor_get_type (void);
42 
43 
44 enum
45 {
46  GNUCASH_CURSOR_CELL,
47  GNUCASH_CURSOR_BLOCK,
48  GNUCASH_CURSOR_NUM
49 };
50 
51 
52 typedef struct
53 {
54  GnomeCanvasItem canvas_item;
55 
56  gint type;
57 
58  gint row;
59  gint col;
60 
61  /* precomputed pixel coords for the item cursor*/
62  gint x, y, w, h;
64 
65 
66 typedef struct
67 {
68  GnomeCanvasGroup canvas_group;
69 
70  GnomeCanvasItem *cursor[GNUCASH_CURSOR_NUM];
71 
72  GnucashSheet *sheet;
73  GnucashGrid *grid;
74 
75  /* precomputed pixel coords for the block cursor*/
76  gint x, y, w, h;
77 
78  GdkGC *gc;
79  SheetBlockStyle *style;
81 
82 
83 typedef struct
84 {
85  GnomeCanvasItemClass parent_class;
87 
88 
89 typedef struct
90 {
91  GnomeCanvasGroupClass parent_class;
93 
94 
95 GnomeCanvasItem *gnucash_cursor_new (GnomeCanvasGroup *parent);
96 
97 void gnucash_cursor_get_virt (GnucashCursor *cursor,
98  VirtualLocation *virt_loc);
99 
100 void gnucash_cursor_set (GnucashCursor *cursor, VirtualLocation virt_loc);
101 
102 void gnucash_cursor_set_style (GnucashCursor *cursor, SheetBlockStyle *style);
103 
104 void gnucash_cursor_configure (GnucashCursor *cursor);
105 
106 
107 #endif /* GNUCASH_CURSOR_H */
108 
109