Commit a3602968 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Initialize fully, add prepared_to_drag_flag. (item_cursor_selection_event)


2000-11-08  Jody Goldberg <jgoldberg@home.com>

	* src/item-cursor.c (item_cursor_init) : Initialize fully, add
	  prepared_to_drag_flag.
	(item_cursor_selection_event) : Move most of the state change
	  associated with BUTTON_PRESS into MOTION_NOTIFY.  And use the
	  prepared_to_drag_flag flag to indicate a requirement to initiate a
	  drag. Move most of the double click handling here.  The resone for
	  these changes was that there was a race condition in the old
	  version.  We were creating a new item cursor when we did a button
	  press.  It started in exactly the same position as the current
	  cursor.  2BUTTON_PRESS were sometimes being sent to the new cusor
	  and sometimes showing up as PRESS events on the old with no RELEASE.
	  This patch attempts to delay creating the new drag cursor until we
	  are sure this is not a double click so that the proper event
	  sequence is sent to the main cursor.

	* src/border.c (style_border_unref) : Unref the colour.
	(style_border_fetch) : unref the colour when needed.
parent 2e771461
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_init) : Initialize fully, add
prepared_to_drag_flag.
(item_cursor_selection_event) : Move most of the state change
associated with BUTTON_PRESS into MOTION_NOTIFY. And use the
prepared_to_drag_flag flag to indicate a requirement to initiate a
drag. Move most of the double click handling here. The resone for
these changes was that there was a race condition in the old
version. We were creating a new item cursor when we did a button
press. It started in exactly the same position as the current
cursor. 2BUTTON_PRESS were sometimes being sent to the new cusor
and sometimes showing up as PRESS events on the old with no RELEASE.
This patch attempts to delay creating the new drag cursor until we
are sure this is not a double click so that the proper event
sequence is sent to the main cursor.
* src/border.c (style_border_unref) : Unref the colour.
(style_border_fetch) : unref the colour when needed.
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_is_region_empty) : New function.
2000-11-08 Morten Welinder <terra@diku.dk>
* src/complex.c (complex_from_string): Handle overflow.
......
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_init) : Initialize fully, add
prepared_to_drag_flag.
(item_cursor_selection_event) : Move most of the state change
associated with BUTTON_PRESS into MOTION_NOTIFY. And use the
prepared_to_drag_flag flag to indicate a requirement to initiate a
drag. Move most of the double click handling here. The resone for
these changes was that there was a race condition in the old
version. We were creating a new item cursor when we did a button
press. It started in exactly the same position as the current
cursor. 2BUTTON_PRESS were sometimes being sent to the new cusor
and sometimes showing up as PRESS events on the old with no RELEASE.
This patch attempts to delay creating the new drag cursor until we
are sure this is not a double click so that the proper event
sequence is sent to the main cursor.
* src/border.c (style_border_unref) : Unref the colour.
(style_border_fetch) : unref the colour when needed.
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_is_region_empty) : New function.
2000-11-08 Morten Welinder <terra@diku.dk>
* src/complex.c (complex_from_string): Handle overflow.
......
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_init) : Initialize fully, add
prepared_to_drag_flag.
(item_cursor_selection_event) : Move most of the state change
associated with BUTTON_PRESS into MOTION_NOTIFY. And use the
prepared_to_drag_flag flag to indicate a requirement to initiate a
drag. Move most of the double click handling here. The resone for
these changes was that there was a race condition in the old
version. We were creating a new item cursor when we did a button
press. It started in exactly the same position as the current
cursor. 2BUTTON_PRESS were sometimes being sent to the new cusor
and sometimes showing up as PRESS events on the old with no RELEASE.
This patch attempts to delay creating the new drag cursor until we
are sure this is not a double click so that the proper event
sequence is sent to the main cursor.
* src/border.c (style_border_unref) : Unref the colour.
(style_border_fetch) : unref the colour when needed.
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_is_region_empty) : New function.
2000-11-08 Morten Welinder <terra@diku.dk>
* src/complex.c (complex_from_string): Handle overflow.
......
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_init) : Initialize fully, add
prepared_to_drag_flag.
(item_cursor_selection_event) : Move most of the state change
associated with BUTTON_PRESS into MOTION_NOTIFY. And use the
prepared_to_drag_flag flag to indicate a requirement to initiate a
drag. Move most of the double click handling here. The resone for
these changes was that there was a race condition in the old
version. We were creating a new item cursor when we did a button
press. It started in exactly the same position as the current
cursor. 2BUTTON_PRESS were sometimes being sent to the new cusor
and sometimes showing up as PRESS events on the old with no RELEASE.
This patch attempts to delay creating the new drag cursor until we
are sure this is not a double click so that the proper event
sequence is sent to the main cursor.
* src/border.c (style_border_unref) : Unref the colour.
(style_border_fetch) : unref the colour when needed.
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_is_region_empty) : New function.
2000-11-08 Morten Welinder <terra@diku.dk>
* src/complex.c (complex_from_string): Handle overflow.
......
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/item-cursor.c (item_cursor_init) : Initialize fully, add
prepared_to_drag_flag.
(item_cursor_selection_event) : Move most of the state change
associated with BUTTON_PRESS into MOTION_NOTIFY. And use the
prepared_to_drag_flag flag to indicate a requirement to initiate a
drag. Move most of the double click handling here. The resone for
these changes was that there was a race condition in the old
version. We were creating a new item cursor when we did a button
press. It started in exactly the same position as the current
cursor. 2BUTTON_PRESS were sometimes being sent to the new cusor
and sometimes showing up as PRESS events on the old with no RELEASE.
This patch attempts to delay creating the new drag cursor until we
are sure this is not a double click so that the proper event
sequence is sent to the main cursor.
* src/border.c (style_border_unref) : Unref the colour.
(style_border_fetch) : unref the colour when needed.
2000-11-08 Jody Goldberg <jgoldberg@home.com>
* src/sheet.c (sheet_is_region_empty) : New function.
2000-11-08 Morten Welinder <terra@diku.dk>
* src/complex.c (complex_from_string): Handle overflow.
......
......@@ -120,6 +120,7 @@ GNUMERIC_BASE_SOURCES = \
gnumeric.h \
gui-clipboard.c \
gui-clipboard.h \
gui-gnumeric.h \
gutils.c \
gutils.h \
history.c \
......
......@@ -136,6 +136,12 @@ style_border_none (void)
return none;
}
/**
* style_border_fetch :
*
* Fetches a StyleBorder from the cache, creating one if necessary.
* Absorbs the colour reference.
*/
MStyleBorder *
style_border_fetch (StyleBorderType const line_type,
StyleColor *color,
......@@ -147,8 +153,11 @@ style_border_fetch (StyleBorderType const line_type,
g_return_val_if_fail (line_type >= STYLE_BORDER_NONE, 0);
g_return_val_if_fail (line_type < STYLE_BORDER_MAX, 0);
if (line_type == STYLE_BORDER_NONE)
if (line_type == STYLE_BORDER_NONE) {
if (color)
style_color_unref (color);
return style_border_ref (style_border_none ());
}
g_return_val_if_fail (color != NULL, NULL);
key.line_type = line_type;
......@@ -156,8 +165,11 @@ style_border_fetch (StyleBorderType const line_type,
if (border_hash) {
border = g_hash_table_lookup (border_hash, &key);
if (border != NULL)
if (border != NULL) {
if (color)
style_color_unref (color);
return style_border_ref (border);
}
} else
border_hash = g_hash_table_new (style_border_hash,
style_border_equal);
......@@ -318,6 +330,11 @@ style_border_unref (MStyleBorder *border)
*/
g_return_if_fail (border != style_border_none ());
if (border->color) {
style_color_unref (border->color);
border->color = NULL;
}
if (border->gc) {
gdk_gc_unref (border->gc);
border->gc = NULL;
......
......@@ -7,6 +7,7 @@
#include "config.h"
#include "gnumeric.h"
#include "cell.h"
#include "sheet.h"
#include "cell-comment.h"
#include "sheet-view.h"
#include "gnumeric-sheet.h"
......
......@@ -6,12 +6,12 @@
*/
#include <config.h>
#include <gnome.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <string.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "item-bar.h"
#include "item-cursor.h"
#include "item-edit.h"
#include "item-grid.h"
#include "sheet-view.h"
#include "gnumeric-util.h"
#include "color.h"
#include "selection.h"
......
#ifndef GNUMERIC_GNUMERIC_SHEET_H
#define GNUMERIC_GNUMERIC_SHEET_H
#include "item-grid.h"
#include "item-cursor.h"
#include "item-bar.h"
#include "item-edit.h"
#include "sheet.h"
#include "gui-gnumeric.h"
#define GNUMERIC_TYPE_SHEET (gnumeric_sheet_get_type ())
#define GNUMERIC_SHEET(obj) (GTK_CHECK_CAST((obj), GNUMERIC_TYPE_SHEET, GnumericSheet))
#define GNUMERIC_SHEET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GNUMERIC_TYPE_SHEET))
#define GNUMERIC_IS_SHEET(o) (GTK_CHECK_TYPE((o), GNUMERIC_TYPE_SHEET))
typedef struct {
struct _GnumericSheet {
GnomeCanvas canvas;
SheetView *sheet_view;
......@@ -44,7 +40,7 @@ typedef struct {
*/
ItemBar *colbar;
ItemBar *rowbar;
} GnumericSheet;
};
GtkType gnumeric_sheet_get_type (void);
......
......@@ -6,12 +6,12 @@
*/
#include <config.h>
#include <gnome.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <string.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "item-bar.h"
#include "item-cursor.h"
#include "item-edit.h"
#include "item-grid.h"
#include "sheet-view.h"
#include "gnumeric-util.h"
#include "color.h"
#include "selection.h"
......
#ifndef GNUMERIC_GNUMERIC_SHEET_H
#define GNUMERIC_GNUMERIC_SHEET_H
#include "item-grid.h"
#include "item-cursor.h"
#include "item-bar.h"
#include "item-edit.h"
#include "sheet.h"
#include "gui-gnumeric.h"
#define GNUMERIC_TYPE_SHEET (gnumeric_sheet_get_type ())
#define GNUMERIC_SHEET(obj) (GTK_CHECK_CAST((obj), GNUMERIC_TYPE_SHEET, GnumericSheet))
#define GNUMERIC_SHEET_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), GNUMERIC_TYPE_SHEET))
#define GNUMERIC_IS_SHEET(o) (GTK_CHECK_TYPE((o), GNUMERIC_TYPE_SHEET))
typedef struct {
struct _GnumericSheet {
GnomeCanvas canvas;
SheetView *sheet_view;
......@@ -44,7 +40,7 @@ typedef struct {
*/
ItemBar *colbar;
ItemBar *rowbar;
} GnumericSheet;
};
GtkType gnumeric_sheet_get_type (void);
......
#ifndef GUI_GNUMERIC_H
#define GUI_GNUMERIC_H
#include "gnumeric.h"
#include <gnome.h>
typedef struct _ItemCursor ItemCursor;
typedef struct _ItemGrid ItemGrid;
typedef struct _ItemBar ItemBar;
typedef struct _ItemEdit ItemEdit;
typedef struct _GnumericSheet GnumericSheet;
typedef struct _SheetView SheetView; /*FIXME : finish the split and make this a control-gui */
typedef struct _WorkbookControlGUI WorkbookControlGUI;
#endif /* GUI_GNUMERIC_H */
......@@ -7,11 +7,12 @@
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "item-bar.h"
#include "item-debug.h"
#include "item-grid.h"
#include "gnumeric-sheet.h"
#include "sheet-view.h"
#include "sheet.h"
#include "parse-util.h"
#include "gnumeric-util.h"
#include "selection.h"
......
#ifndef GNUMERIC_ITEM_BAR_H
#define GNUMERIC_ITEM_BAR_H
#include "sheet.h"
#include "gui-gnumeric.h"
#define ITEM_BAR(obj) (GTK_CHECK_CAST((obj), item_bar_get_type (), ItemBar))
#define ITEM_BAR_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), item_bar_get_type (), ItemBarType))
#define IS_ITEM_BAR(o) (GTK_CHECK_TYPE((o), item_bar_get_type ()))
typedef struct {
struct _ItemBar {
GnomeCanvasItem canvas_item;
SheetView *sheet_view;
int first_element;
......@@ -32,7 +32,7 @@ typedef struct {
/* Where the selection started */
int start_selection;
} ItemBar;
};
#define ITEM_BAR_IS_SELECTING(ib) ((ib)->start_selection != -1)
......
......@@ -6,10 +6,9 @@
*/
#include <config.h>
#include <gnome.h>
#include "gnumeric.h"
#include "item-cursor.h"
#include "gnumeric-sheet.h"
#include "sheet-view.h"
#include "color.h"
#include "clipboard.h"
#include "selection.h"
......@@ -52,17 +51,17 @@ item_cursor_animation_callback (ItemCursor *item_cursor)
static void
item_cursor_stop_animation (ItemCursor *item_cursor)
{
if (item_cursor->tag == -1)
if (item_cursor->animation_timer == -1)
return;
gtk_timeout_remove (item_cursor->tag);
item_cursor->tag = -1;
gtk_timeout_remove (item_cursor->animation_timer);
item_cursor->animation_timer = -1;
}
static void
item_cursor_start_animation (ItemCursor *item_cursor)
{
item_cursor->tag = gtk_timeout_add (
item_cursor->animation_timer = gtk_timeout_add (
150, (GtkFunction)(item_cursor_animation_callback),
item_cursor);
}
......@@ -218,7 +217,7 @@ item_cursor_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, in
int premove = 0;
GdkColor *fore = NULL, *back = NULL;
GdkRectangle clip_rect;
int const xd = item_cursor->cached_x;
int const yd = item_cursor->cached_y;
int const w = item_cursor->cached_w;
......@@ -235,7 +234,7 @@ item_cursor_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, in
dy0 = yd - y;
dx1 = dx0 + w;
dy1 = dy0 + h;
draw_external = 0;
draw_internal = 0;
draw_handle = 0;
......@@ -260,7 +259,7 @@ item_cursor_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, in
draw_external = 1;
draw_stippled = 0;
break;
case ITEM_CURSOR_SELECTION:
draw_internal = 1;
draw_external = 1;
......@@ -296,7 +295,7 @@ item_cursor_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, in
fore = &item_cursor->color;
back = &item_cursor->color;
}
item_cursor->auto_fill_handle_at_top = (draw_handle >= 2);
clip_rect.x = 0;
......@@ -534,12 +533,11 @@ item_cursor_setup_auto_fill (ItemCursor *item_cursor, ItemCursor const *parent,
}
static void
item_cursor_set_cursor (GnomeCanvas *canvas, GnomeCanvasItem *item, int x, int y)
item_cursor_set_cursor (GnomeCanvas *canvas, ItemCursor *ic, int x, int y)
{
ItemCursor *item_cursor = ITEM_CURSOR (item);
int cursor;
if (IS_LITTLE_SQUARE (item_cursor, x, y))
if (IS_LITTLE_SQUARE (ic, x, y))
cursor = E_CURSOR_THIN_CROSS;
else
cursor = E_CURSOR_ARROW;
......@@ -561,23 +559,21 @@ item_cursor_selection_event (GnomeCanvasItem *item, GdkEvent *event)
gnome_canvas_w2c (
canvas, event->crossing.x, event->crossing.y, &x, &y);
item_cursor_set_cursor (canvas, item, x, y);
item_cursor_set_cursor (canvas, ic, x, y);
return TRUE;
case GDK_MOTION_NOTIFY:
gnome_canvas_w2c (
canvas, event->motion.x, event->motion.y, &x, &y);
item_cursor_set_cursor (canvas, item, x, y);
return TRUE;
case GDK_BUTTON_PRESS: {
GnomeCanvasGroup *group;
case GDK_MOTION_NOTIFY: {
int style;
gnome_canvas_w2c (
canvas, event->button.x, event->button.y, &x, &y);
group = GNOME_CANVAS_GROUP (canvas->root);
canvas, event->motion.x, event->motion.y, &x, &y);
if (!ic->prepared_to_drag) {
item_cursor_set_cursor (canvas, ic, x, y);
return TRUE;
}
ic->prepared_to_drag = FALSE;
gnome_canvas_item_ungrab (item, event->button.time);
/*
* determine which part of the cursor was clicked:
......@@ -589,7 +585,7 @@ item_cursor_selection_event (GnomeCanvasItem *item, GdkEvent *event)
style = ITEM_CURSOR_DRAG;
new_item = gnome_canvas_item_new (
group,
GNOME_CANVAS_GROUP (canvas->root),
item_cursor_get_type (),
"ItemCursor::SheetView", ic->sheet_view,
"ItemCursor::Grid", ic->item_grid,
......@@ -649,8 +645,91 @@ item_cursor_selection_event (GnomeCanvasItem *item, GdkEvent *event)
NULL,
event->button.time);
/*
* We flush after the grab to ensure that the new item-cursor
* gets created. If it is not ready in time double click
* events will be disrupted and it will appear as if we are
* doing an button_press with a missing release.
*/
gdk_flush ();
return TRUE;
}
case GDK_2BUTTON_PRESS: {
Sheet *sheet = ic->sheet_view->sheet;
int final_row = ic->base_row + ic->base_rows;
int final_col = ic->base_col + ic->base_cols;
g_return_val_if_fail (ic->prepared_to_drag, TRUE);
ic->prepared_to_drag = FALSE;
/*
* We flush after the ungrab, to have the ungrab take
* effect immediately (the copy operation might take
* long, and we do not want the mouse to be grabbed
* all this time).
*/
gnome_canvas_item_ungrab (item, event->button.time);
gdk_flush ();
workbook_finish_editing (ic->sheet_view->wbcg, TRUE);
if (sheet_is_region_empty (sheet, ic->base_col, ic->base_row,
final_row, final_col))
return TRUE;
/* fill current column to boundary of column to left
* OR current row to boundary of row above
*/
if (event->button.state & GDK_MOD1_MASK)
final_col = sheet_find_boundary_horizontal (sheet,
ic->base_col,
MAX(0, ic->base_row-1),
1, TRUE);
else
final_row = sheet_find_boundary_vertical (sheet,
MAX(0, ic->base_col-1),
ic->base_row,
1, TRUE);
/* fill the row/column */
cmd_autofill (WORKBOOK_CONTROL (ic->sheet_view->wbcg), sheet,
ic->base_col, ic->base_row,
ic->base_cols+1, ic->base_rows+1,
final_col, final_row);
return TRUE;
}
case GDK_BUTTON_PRESS:
g_return_val_if_fail (!ic->prepared_to_drag, TRUE);
ic->prepared_to_drag = TRUE;
/* prepare to create fill or drag cursors, but dont until we
* move. If we did create them here there would be problems
* with race conditions when the new cursors pop into existence
* during a double-click
*/
gnome_canvas_item_grab (
item,
GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_PRESS_MASK,
NULL,
event->button.time);
/* Be extra paranoid. Ensure that the grab is registered */
gdk_flush ();
return TRUE;
case GDK_BUTTON_RELEASE:
/* Double clicks may have already released the drag prep */
if (ic->prepared_to_drag) {
ic->prepared_to_drag = FALSE;
gnome_canvas_item_ungrab (item, event->button.time);
gdk_flush ();
}
return TRUE;
default:
return FALSE;
}
......@@ -1083,46 +1162,6 @@ item_cursor_autofill_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_MOTION_NOTIFY:
item_cursor_handle_motion (item_cursor, event, &cb_autofill_scroll);
return TRUE;
case GDK_2BUTTON_PRESS: {
Sheet *sheet = item_cursor->sheet_view->sheet;
int final_row = item_cursor->base_row + item_cursor->base_rows;
int final_col = item_cursor->base_col + item_cursor->base_cols;
/*
* We flush after the ungrab, to have the ungrab take
* effect inmediately (the copy operation might take
* long, and we do not want the mouse to be grabbed
* all this time).
*/
gnome_canvas_item_ungrab (item, event->button.time);
gdk_flush ();
workbook_finish_editing (item_cursor->sheet_view->wbcg, TRUE);
/* fill current column to boundary of column to left
* OR current row to boundary of row above
*/
if (event->button.state & GDK_MOD1_MASK)
final_col = sheet_find_boundary_horizontal (sheet,
item_cursor->base_col,
MAX(0, item_cursor->base_row-1),
1, TRUE);
else
final_row = sheet_find_boundary_vertical (sheet,
MAX(0, item_cursor->base_col-1),
item_cursor->base_row,
1, TRUE);
/* fill the row/column */
cmd_autofill (WORKBOOK_CONTROL (item_cursor->sheet_view->wbcg), sheet,
item_cursor->base_col, item_cursor->base_row,
item_cursor->base_cols+1, item_cursor->base_rows+1,
final_col, final_row);
gtk_object_destroy (GTK_OBJECT (item));
return TRUE;
}
default:
return FALSE;
......@@ -1134,6 +1173,16 @@ item_cursor_event (GnomeCanvasItem *item, GdkEvent *event)
{
ItemCursor *item_cursor = ITEM_CURSOR (item);
#if 0
switch (event->type)
{
case GDK_BUTTON_RELEASE: printf ("release %d\n", item_cursor->style); break;
case GDK_BUTTON_PRESS: printf ("press %d\n", item_cursor->style); break;
case GDK_2BUTTON_PRESS: printf ("2press %d\n", item_cursor->style); break;
default :
break;
};
#endif
switch (item_cursor->style){
case ITEM_CURSOR_ANTED:
case ITEM_CURSOR_SELECTION:
......@@ -1170,12 +1219,17 @@ item_cursor_init (ItemCursor *item_cursor)
item_cursor->col_delta = 0;
item_cursor->row_delta = 0;
item_cursor->tip = NULL;
item_cursor->style = ITEM_CURSOR_SELECTION;
item_cursor->tag = -1;
item_cursor->gc = NULL;
item_cursor->state = 0;
item_cursor->animation_timer = -1;
item_cursor->visible = TRUE;
item_cursor->auto_fill_handle_at_top = FALSE;
item_cursor->visible = 1;
item_cursor->prepared_to_drag = FALSE;
}
static void
......@@ -1183,7 +1237,7 @@ item_cursor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
{
GnomeCanvasItem *item;
ItemCursor *item_cursor;
item = GNOME_CANVAS_ITEM (o);
item_cursor = ITEM_CURSOR (o);
......@@ -1201,7 +1255,7 @@ item_cursor_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
case ARG_COLOR: {
GdkColor color;
char *color_name;
color_name = GTK_VALUE_STRING (*arg);
if (gnome_canvas_get_color (item->canvas, color_name, &color)){
item_cursor->color = color;
......
#ifndef GNUMERIC_ITEM_CURSOR_H
#define GNUMERIC_ITEM_CURSOR_H
#include "gnumeric.h"
#include "item-grid.h"
#include "gui-gnumeric.h"
#define ITEM_CURSOR(obj) (GTK_CHECK_CAST((obj), item_cursor_get_type (), ItemCursor))
#define ITEM_CURSOR_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), item_cursor_get_type (), ItemCursorClass))
......@@ -17,7 +16,7 @@ typedef enum {
ITEM_CURSOR_BLOCK
} ItemCursorStyle;
typedef struct {
struct _ItemCursor {
GnomeCanvasItem canvas_item;
SheetView *sheet_view;
......@@ -33,7 +32,7 @@ typedef struct {
ItemCursorStyle style;
GdkGC *gc;
int state;
int tag;
int animation_timer;
/*
* For the autofill mode:
......@@ -56,10 +55,11 @@ typedef struct {
int use_color:1;
/* Location of auto fill handle */
int auto_fill_handle_at_top:1;
int prepared_to_drag:1;
GdkPixmap *stipple;
GdkColor color;
} ItemCursor;
};
GtkType item_cursor_get_type (void);
......
......@@ -16,20 +16,21 @@
*/
#include <config.h>
#include <gnome.h>
#include <ctype.h>
#include <string.h>
#include "gnumeric.h"
#include "gnumeric-sheet.h"
#include "item-edit.h"
#include "item-cursor.h"
#include "item-grid.h"
#include "gnumeric-sheet.h"
#include "sheet-view.h"
#include "value.h"
#include "ranges.h"
#include "parse-util.h"
#include "sheet.h"
#include "workbook.h"
#include "workbook-edit.h"
#include "gnumeric-util.h"
#include <ctype.h>
#include <string.h>
static GnomeCanvasItem *item_edit_parent_class;
/* The arguments we take */
......
#ifndef GNUMERIC_ITEM_EDIT_H
#define GNUMERIC_ITEM_EDIT_H
#include "gnumeric.h"
#include "item-grid.h"
#include "gui-gnumeric.h"
#define ITEM_EDIT(obj) (GTK_CHECK_CAST((obj), item_edit_get_type (), ItemEdit))
#define ITEM_EDIT_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), item_edit_get_type (), ItemEditClass))
#define IS_ITEM_EDIT(o) (GTK_CHECK_TYPE((o), item_edit_get_type ()))
typedef struct {
<