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

add NONE:BOOLEAN


2003-04-22  Jody Goldberg <jody@gnome.org>

	* src/gnm-marshalers.list : add NONE:BOOLEAN

	* src/sheet-control-gui.c (scg_select_all) : pretend that we
	  drag selected the range to fire an update signal even if the
	  exprentry's update_policy is discontinuous.
	(scg_rangesel_extend) : keyboard changes cause an update too.
	(scg_rangesel_move) : ditto.
	* src/item-bar.c (item_bar_event) : ditto.
parent ba0d332c
2003-04-22 Jody Goldberg <jody@gnome.org>
* src/gnm-marshalers.list : add NONE:BOOLEAN
* src/sheet-control-gui.c (scg_select_all) : pretend that we
drag selected the range to fire an update signal even if the
exprentry's update_policy is discontinuous.
(scg_rangesel_extend) : keyboard changes cause an update too.
(scg_rangesel_move) : ditto.
* src/item-bar.c (item_bar_event) : ditto.
2003-04-22 Morten Welinder <terra@gnome.org>
* src/gui-clipboard.c (x_request_clipboard): Follow cut-and-paste
......
......@@ -11,6 +11,7 @@ Jody:
* Make the edit item smarter at the right edge
* Handle saving too many merged cells for 1 xls record
* Fix internal hashing bug with styles containing auto colors
* Improve update semantics of ExprEntry in preparation for graphs
Jukka:
* Added shuffling tool.
......
2003-04-22 Jody Goldberg <jody@gnome.org>
* src/gnm-marshalers.list : add NONE:BOOLEAN
* src/sheet-control-gui.c (scg_select_all) : pretend that we
drag selected the range to fire an update signal even if the
exprentry's update_policy is discontinuous.
(scg_rangesel_extend) : keyboard changes cause an update too.
(scg_rangesel_move) : ditto.
* src/item-bar.c (item_bar_event) : ditto.
2003-04-22 Morten Welinder <terra@gnome.org>
* src/gui-clipboard.c (x_request_clipboard): Follow cut-and-paste
......
2003-04-22 Jody Goldberg <jody@gnome.org>
* src/gnm-marshalers.list : add NONE:BOOLEAN
* src/sheet-control-gui.c (scg_select_all) : pretend that we
drag selected the range to fire an update signal even if the
exprentry's update_policy is discontinuous.
(scg_rangesel_extend) : keyboard changes cause an update too.
(scg_rangesel_move) : ditto.
* src/item-bar.c (item_bar_event) : ditto.
2003-04-22 Morten Welinder <terra@gnome.org>
* src/gui-clipboard.c (x_request_clipboard): Follow cut-and-paste
......
......@@ -23,8 +23,9 @@
BOOLEAN:POINTER
INT:INT
POINTER:INT,INT
NONE:INT,INT
NONE:NONE
NONE:POINTER
NONE:OBJECT
NONE:STRING
VOID:INT,INT
VOID:VOID
VOID:BOOLEAN
VOID:POINTER
VOID:OBJECT
VOID:STRING
......@@ -940,8 +940,7 @@ item_bar_event (FooCanvasItem *item, GdkEvent *e)
break;
}
case GDK_BUTTON_RELEASE:
{
case GDK_BUTTON_RELEASE: {
gboolean needs_ungrab = FALSE;
/* Ignore scroll wheel events */
......@@ -953,6 +952,8 @@ item_bar_event (FooCanvasItem *item, GdkEvent *e)
if (ib->start_selection >= 0) {
needs_ungrab = TRUE;
ib->start_selection = -1;
gnm_expr_entry_signal_update (
wbcg_get_entry_logical (scg->wbcg), TRUE);
}
if (ib->colrow_being_resized >= 0) {
if (ib->has_resize_guides) {
......
......@@ -1138,7 +1138,8 @@ item_grid_event (FooCanvasItem *item, GdkEvent *event)
gnm_simple_canvas_ungrab (item, event->button.time);
if (selecting == ITEM_GRID_SELECTING_FORMULA_RANGE)
gnm_expr_entry_end_of_drag (wbcg_get_entry_logical (scg->wbcg));
gnm_expr_entry_signal_update (
wbcg_get_entry_logical (scg->wbcg), TRUE);
if (selecting == ITEM_GRID_SELECTING_CELL_RANGE) {
CellPos const *pos = sv_is_singleton_selected (sc_view (sc));
......
......@@ -467,6 +467,8 @@ scg_select_all (SheetControlGUI *scg)
if (rangesel) {
scg_rangesel_bound (scg,
0, 0, SHEET_MAX_COLS-1, SHEET_MAX_ROWS-1);
gnm_expr_entry_signal_update (
wbcg_get_entry_logical (scg->wbcg), TRUE);
} else if (!wbcg_edit_has_guru (scg->wbcg)) {
scg_mode_edit (SHEET_CONTROL (sc));
wbcg_edit_finish (scg->wbcg, FALSE);
......@@ -2303,6 +2305,8 @@ scg_rangesel_move (SheetControlGUI *scg, int n, gboolean jump_to_bound,
else
scg_rangesel_start (scg, tmp.col, tmp.row, tmp.col, tmp.row);
scg_make_cell_visible (scg, tmp.col, tmp.row, FALSE, TRUE);
gnm_expr_entry_signal_update (
wbcg_get_entry_logical (scg->wbcg), FALSE);
}
void
......@@ -2330,6 +2334,8 @@ scg_rangesel_extend (SheetControlGUI *scg, int n,
scg_make_cell_visible (scg,
scg->rangesel.move_corner.col,
scg->rangesel.move_corner.row, FALSE, TRUE);
gnm_expr_entry_signal_update (
wbcg_get_entry_logical (scg->wbcg), FALSE);
} else
scg_rangesel_move (scg, n, jump_to_bound, horiz);
}
......
2003-04-22 Jody Goldberg <jody@gnome.org>
* gnumeric-expr-entry.c (cb_entry_activate) : queue an update.
(gnm_expr_entry_signal_update) : queue the updates in an idle handler
so that we can get some rudimentary motion compression for keyboard
edits.
2003-04-22 Jody Goldberg <jody@gnome.org>
* gnumeric-expr-entry.c : Tidy up the namespacing.
......
......@@ -66,8 +66,9 @@ struct _GnmExprEntry {
typedef struct _GnmExprEntryClass {
GtkHBoxClass base;
void (* update) (GnmExprEntry *gee);
void (* changed) (GnmExprEntry *gee);
void (* update) (GnmExprEntry *gee, gboolean user_requested_update);
void (* changed) (GnmExprEntry *gee);
void (* activate) (GnmExprEntry *gee);
} GnmExprEntryClass;
/* Signals */
......@@ -93,9 +94,7 @@ static GQuark signals [LAST_SIGNAL] = { 0 };
static void gee_rangesel_reset (GnmExprEntry *gee);
static void gee_rangesel_update_text (GnmExprEntry *gee);
static void gee_detach_scg (GnmExprEntry *gee);
static gboolean gee_update_timeout (gpointer data);
static void gee_remove_update_timer (GnmExprEntry *range);
static void gee_reset_update_timer (GnmExprEntry *gee);
static void gee_notify_cursor_position (GObject *object, GParamSpec *pspec,
GnmExprEntry *gee);
......@@ -197,6 +196,7 @@ static void
cb_entry_activate (G_GNUC_UNUSED GtkWidget *w, GObject *gee)
{
g_signal_emit (G_OBJECT (gee), signals [ACTIVATE], 0);
gnm_expr_entry_signal_update (gee, TRUE);
}
static void
......@@ -409,22 +409,21 @@ gee_class_init (GObjectClass *gobject_class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GnmExprEntryClass, update),
(GSignalAccumulator) NULL, NULL,
gnm__VOID__VOID,
gnm__VOID__BOOLEAN,
G_TYPE_NONE,
0, G_TYPE_NONE);
1, G_TYPE_BOOLEAN);
signals [CHANGED] = g_signal_new ("changed",
GNM_EXPR_ENTRY_TYPE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GnmExprEntryClass, changed),
(GSignalAccumulator) NULL, NULL,
gnm__VOID__VOID,
G_TYPE_NONE,
0, G_TYPE_NONE);
G_TYPE_NONE, 0);
signals[ACTIVATE] =
g_signal_new ("activate",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GtkEntryClass, activate),
G_STRUCT_OFFSET (GnmExprEntryClass, activate),
(GSignalAccumulator) NULL, NULL,
gnm__VOID__VOID,
G_TYPE_NONE, 0);
......@@ -723,26 +722,17 @@ gee_detach_scg (GnmExprEntry *gee)
/***************************************************************************/
/**
* gnm_expr_entry_end_of_drag:
* @gee :
*
* Signal the expression entry clients that a drag selection has just finished.
* This is useful for knowing when to attempt to parse and update things that
* depend on the modified expression without doing it in real time.
**/
void
gnm_expr_entry_end_of_drag (GnmExprEntry *gee)
{
g_signal_emit (G_OBJECT (gee), signals [UPDATE], 0);
}
typedef struct {
GnmExprEntry *gee;
gboolean user_requested;
} GEETimerClosure;
static gboolean
gee_update_timeout (gpointer data)
cb_gee_update_timeout (GEETimerClosure const *info)
{
GnmExprEntry *gee = GNM_EXPR_ENTRY (data);
gee->update_timeout_id = 0;
g_signal_emit (G_OBJECT (gee), signals [UPDATE], 0);
info->gee->update_timeout_id = 0;
g_signal_emit (G_OBJECT (info->gee), signals [UPDATE], 0,
info->user_requested);
return FALSE;
}
......@@ -754,15 +744,32 @@ gee_remove_update_timer (GnmExprEntry *range)
range->update_timeout_id = 0;
}
}
static void
gee_reset_update_timer (GnmExprEntry *gee)
gee_reset_update_timer (GnmExprEntry *gee, gboolean user_requested)
{
GEETimerClosure *dat = g_new (GEETimerClosure, 1);
gee_remove_update_timer (gee);
gee->update_timeout_id = g_timeout_add (300,
gee_update_timeout, gee);
dat->gee = gee;
dat->user_requested = user_requested;
gee->update_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 300,
(GSourceFunc) cb_gee_update_timeout, dat, g_free);
}
/**
* gnm_expr_entry_signal_update:
* @gee :
* @user_requested : is the update requested by the user (eg activation)
*
* Higher level operations know when they are logically complete and can notify
* ExperEntry clients. eg button up after a drag selection indicates a logical
* end to the change and offers a good time to update.
**/
void
gnm_expr_entry_signal_update (GnmExprEntry *gee, gboolean user_requested)
{
gee_reset_update_timer (gee, user_requested);
}
static void
gee_notify_cursor_position (G_GNUC_UNUSED GObject *object,
......@@ -838,7 +845,7 @@ gnm_expr_entry_thaw (GnmExprEntry *gee)
gee_rangesel_update_text (gee);
switch (gee->update_policy) {
case GTK_UPDATE_DELAYED :
gee_reset_update_timer (gee);
gee_reset_update_timer (gee, FALSE);
break;
default :
......@@ -846,7 +853,7 @@ gnm_expr_entry_thaw (GnmExprEntry *gee)
if (gee->scg->rangesel.active)
break;
case GTK_UPDATE_CONTINUOUS:
g_signal_emit (G_OBJECT (gee), signals [UPDATE], 0);
g_signal_emit (G_OBJECT (gee), signals [UPDATE], 0, FALSE);
};
}
}
......
......@@ -71,6 +71,6 @@ void gnm_expr_entry_grab_focus (GnmExprEntry *e, gboolean select_all);
gboolean gnm_expr_entry_editing_canceled (GnmExprEntry *e);
/* private : for internal use */
void gnm_expr_entry_end_of_drag (GnmExprEntry *gee);
void gnm_expr_entry_signal_update (GnmExprEntry *gee, gboolean user_requested);
#endif /* GNUMERIC_EXPR_ENTRY_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment