Commit 5964be29 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Dump in the work from the trip

2004-07-12  Jody Goldberg <jody@gnome.org>

	* src/workbook-control-gui.c (wbcg_cur_sheet) :  new convenience
	  routine

	* src/wbcg-actions.c : tidy up a bit

	* src/wbc-gtk.c (wbc_gtk_init_undo_redo) : tie sensitivity of repeat
	  to undo.

2004-07-11  Jody Goldberg <jody@gnome.org>

	* src/commands.c (cmd_set_text_repeat) : new
	  (missing validation support)
	(cmd_area_set_text_repeat) :  new.
	(cmd_ins_del_colrow_repeat) : new.
	(cmd_clear_repeat) :  new.
	(cmd_format_repeat) :  new.
	(cmd_colrow_hide_repeat) :  new.
	(cmd_group_repeat) : new.
	(cmd_paste_copy_repeat) : new.
	(cmd_autofill_repeat) : new.
	(cmd_autoformat_repeat) : new.
	(cmd_unmerge_cells_repeat) : new.
	(cmd_merge_cells_repeat) : new.
	(cmd_clone_sheet_repeat) : new.

2004-07-09  Jody Goldberg <jody@gnome.org>

	* src/GNOME_Gnumeric-gtk.xml : Add repeat as an accelerator
	* src/commands.c (func) : add some hooks for repeat

2004-07-09  Jody Goldberg <jody@gnome.org>

	http://bugzilla.gnome.org/show_bug.cgi?id=146486
	* src/expr.c (cb_bin_arith) : handle VALUE_EMPTY for implicit
	  iteration with arithmetic operators.

	http://bugzilla.gnome.org/show_bug.cgi?id=146511
	* src/func.c (function_call_with_list) : Use value_get rather than
	  value_fetch
	* src/sheet.c (sheet_foreach_cell_in_range) : check for empty values too

2004-07-12  Jody Goldberg <jody@gnome.org>

	* graph/plugins/plot_pie/gog-pie.c (gog_pie_view_info_at_point) :
	  expand this to offer name and override creation.

	* graph/gog-view.c (gog_view_info_at_point) :  expand this interface a
	  bit. I'm still not happy with it.

	* graph/gog-series.c :  keep a sorted list of overrides in place

	* graph/gog-plot.c (gog_plot_foreach_elem) :  handle point overrides

	* graph/gog-object.c (gog_object_emit_changed) :  handle updates for
	  objects not yet connected to parents.
parent ec158731
2004-07-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_cur_sheet) : new convenience
routine
* src/wbcg-actions.c : tidy up a bit
* src/wbc-gtk.c (wbc_gtk_init_undo_redo) : tie sensitivity of repeat
to undo.
2004-07-11 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_set_text_repeat) : new
(missing validation support)
(cmd_area_set_text_repeat) : new.
(cmd_ins_del_colrow_repeat) : new.
(cmd_clear_repeat) : new.
(cmd_format_repeat) : new.
(cmd_colrow_hide_repeat) : new.
(cmd_group_repeat) : new.
(cmd_paste_copy_repeat) : new.
(cmd_autofill_repeat) : new.
(cmd_autoformat_repeat) : new.
(cmd_unmerge_cells_repeat) : new.
(cmd_merge_cells_repeat) : new.
(cmd_clone_sheet_repeat) : new.
2004-07-09 Jody Goldberg <jody@gnome.org>
* src/GNOME_Gnumeric-gtk.xml : Add repeat as an accelerator
* src/commands.c (func) : add some hooks for repeat
2004-07-12 Morten Welinder <terra@gnome.org>
* src/wbcg-actions.c: Use gtk about icon if available.
2004-07-09 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=146486
* src/expr.c (cb_bin_arith) : handle VALUE_EMPTY for implicit
iteration with arithmetic operators.
http://bugzilla.gnome.org/show_bug.cgi?id=146511
* src/func.c (function_call_with_list) : Use value_get rather than
value_fetch
......
......@@ -61,7 +61,8 @@ Jody:
* fix grid printing
* fix merged cell printing and diagonal borders
* Allow themed series with gradients
* Fix prop dialog
* Fix application prop dialog
* Support repeat for several commands
Morten:
* Fix crash related to database functions (#138600). [backported]
......
2004-07-12 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (wbcg_cur_sheet) : new convenience
routine
* src/wbcg-actions.c : tidy up a bit
* src/wbc-gtk.c (wbc_gtk_init_undo_redo) : tie sensitivity of repeat
to undo.
2004-07-11 Jody Goldberg <jody@gnome.org>
* src/commands.c (cmd_set_text_repeat) : new
(missing validation support)
(cmd_area_set_text_repeat) : new.
(cmd_ins_del_colrow_repeat) : new.
(cmd_clear_repeat) : new.
(cmd_format_repeat) : new.
(cmd_colrow_hide_repeat) : new.
(cmd_group_repeat) : new.
(cmd_paste_copy_repeat) : new.
(cmd_autofill_repeat) : new.
(cmd_autoformat_repeat) : new.
(cmd_unmerge_cells_repeat) : new.
(cmd_merge_cells_repeat) : new.
(cmd_clone_sheet_repeat) : new.
2004-07-09 Jody Goldberg <jody@gnome.org>
* src/GNOME_Gnumeric-gtk.xml : Add repeat as an accelerator
* src/commands.c (func) : add some hooks for repeat
2004-07-12 Morten Welinder <terra@gnome.org>
* src/wbcg-actions.c: Use gtk about icon if available.
2004-07-09 Jody Goldberg <jody@gnome.org>
http://bugzilla.gnome.org/show_bug.cgi?id=146486
* src/expr.c (cb_bin_arith) : handle VALUE_EMPTY for implicit
iteration with arithmetic operators.
http://bugzilla.gnome.org/show_bug.cgi?id=146511
* src/func.c (function_call_with_list) : Use value_get rather than
value_fetch
......
......@@ -297,4 +297,5 @@
<accelerator name="FormatAsTime" action="FormatAsTime"/>
<accelerator name="FormatAddBorders" action="FormatAddBorders"/>
<accelerator name="FormatClearBorders" action="FormatClearBorders"/>
<accelerator name="Repeat" action="Repeat"/>
</ui>
......@@ -165,7 +165,7 @@ gnm_app_clipboard_clear (gboolean drop_selection)
g_return_if_fail (app != NULL);
if (app->clipboard_copied_contents) {
cellregion_free (app->clipboard_copied_contents);
cellregion_unref (app->clipboard_copied_contents);
app->clipboard_copied_contents = NULL;
}
if (app->clipboard_sheet_view != NULL) {
......
......@@ -575,22 +575,28 @@ cellregion_new (Sheet *origin_sheet)
cr->content = NULL;
cr->styles = NULL;
cr->merged = NULL;
cr->ref_count = 1;
return cr;
}
/**
* cellregion_free :
* @content :
*
* A convenience routine to free the memory associated with a GnmCellRegion.
*/
void
cellregion_free (GnmCellRegion *cr)
cellregion_ref (GnmCellRegion *cr)
{
g_return_if_fail (cr != NULL);
cr->ref_count++;
}
void
cellregion_unref (GnmCellRegion *cr)
{
CellCopyList *ptr;
g_return_if_fail (cr != NULL);
if (cr->ref_count > 1) {
cr->ref_count--;
return;
}
for (ptr = cr->content; ptr; ptr = ptr->next) {
CellCopy *this_cell = ptr->data;
......@@ -632,7 +638,7 @@ cellregion_free (GnmCellRegion *cr)
* Renders a GnmCellRegion as a sequence of strings.
*/
char *
cellregion_to_string (PangoContext *context, GnmCellRegion const *cr)
cellregion_to_string (GnmCellRegion const *cr, PangoContext *context)
{
GString *all, *line;
CellCopyList *ptr;
......
......@@ -66,6 +66,7 @@ struct _GnmCellRegion {
GnmStyleList *styles;
GSList *merged;
gboolean not_as_content;
unsigned ref_count;
};
struct _GnmPasteTarget {
......@@ -75,14 +76,15 @@ struct _GnmPasteTarget {
};
GnmCellRegion *clipboard_copy_range (Sheet *sheet, GnmRange const *r);
gboolean clipboard_paste_region (GnmCellRegion const *content,
GnmPasteTarget const *pt,
GnmCmdContext *cc);
gboolean clipboard_paste_region (GnmCellRegion const *content,
GnmPasteTarget const *pt,
GnmCmdContext *cc);
GnmPasteTarget*paste_target_init (GnmPasteTarget *pt,
Sheet *sheet, GnmRange const *r, int flags);
Sheet *sheet, GnmRange const *r, int flags);
GnmCellRegion *cellregion_new (Sheet *origin_sheet);
void cellregion_free (GnmCellRegion *content);
char *cellregion_to_string (PangoContext *context, GnmCellRegion const *content);
void cellregion_ref (GnmCellRegion *content);
void cellregion_unref (GnmCellRegion *content);
char *cellregion_to_string (GnmCellRegion const *content, PangoContext *context);
#endif /* GNUMERIC_CLIPBOARD_H */
This diff is collapsed.
......@@ -5,8 +5,9 @@
#include "gnumeric.h"
#include "tools/tools.h"
void command_undo (WorkbookControl *wbc);
void command_redo (WorkbookControl *wbc);
void command_undo (WorkbookControl *wbc);
void command_redo (WorkbookControl *wbc);
void command_repeat (WorkbookControl *wbc);
void command_setup_combos (WorkbookControl *wbc);
void command_list_release (GSList *cmds);
......
2004-07-12 Jody Goldberg <jody@gnome.org>
* graph/plugins/plot_pie/gog-pie.c (gog_pie_view_info_at_point) :
expand this to offer name and override creation.
* graph/gog-view.c (gog_view_info_at_point) : expand this interface a
bit. I'm still not happy with it.
* graph/gog-series.c : keep a sorted list of overrides in place
* graph/gog-plot.c (gog_plot_foreach_elem) : handle point overrides
* graph/gog-object.c (gog_object_emit_changed) : handle updates for
objects not yet connected to parents.
2004-07-11 Christopher James Lahey <clahey@ximian.com>
* drawing/Makefile.am (libgoffice_drawing_la_SOURCES): Added
......
......@@ -962,15 +962,14 @@ cb_canvas_select_item (FooCanvas *canvas, GdkEventButton *event,
g_object_get (G_OBJECT (s->sample_graph_item), "renderer", &rend, NULL);
g_object_get (G_OBJECT (rend), "view", &view, NULL);
foo_canvas_window_to_world (canvas, event->x, event->y, &x, &y);
s->search_target = gog_view_point (view,
x * canvas->pixels_per_unit,
y * canvas->pixels_per_unit);
gog_view_info_at_point (view,
x * canvas->pixels_per_unit, y * canvas->pixels_per_unit,
s->prop_object, &s->search_target, NULL);
if (s->search_target == NULL)
return FALSE;
gtk_tree_model_foreach (GTK_TREE_MODEL (s->prop_model),
(GtkTreeModelForeachFunc) cb_find_item, s);
g_object_unref (s->search_target);
s->search_target = NULL;
return TRUE;
}
......
......@@ -675,8 +675,10 @@ gog_object_emit_changed (GogObject *obj, gboolean resize)
if (gog_klass->use_parent_as_proxy) {
obj = obj->parent;
g_return_if_fail (IS_GOG_OBJECT (obj));
gog_object_emit_changed (obj, resize);
if (obj != NULL) {
g_return_if_fail (IS_GOG_OBJECT (obj));
gog_object_emit_changed (obj, resize);
}
return;
}
g_signal_emit (G_OBJECT (obj),
......
......@@ -335,11 +335,12 @@ gog_plot_foreach_elem (GogPlot *plot, gboolean only_visible,
{
GSList *ptr;
GogSeries const *series;
GogStyle *style;
GogStyle *style, *tmp_style;
GODataVector *labels;
unsigned i, n, num_labels = 0;
char *label = NULL;
GogTheme *theme = gog_object_get_theme (GOG_OBJECT (plot));
GList *overrides;
g_return_if_fail (GOG_PLOT (plot) != NULL);
g_return_if_fail (plot->cardinality_valid);
......@@ -367,8 +368,15 @@ gog_plot_foreach_elem (GogPlot *plot, gboolean only_visible,
}
style = gog_style_dup (series->base.style);
n = only_visible ? plot->visible_cardinality : plot->full_cardinality;
for (i = 0; i < n ; i++) {
gog_theme_fillin_style (theme, style, GOG_OBJECT (series),
for (overrides = series->overrides, i = 0; i < n ; i++) {
if (overrides != NULL &&
(GOG_SERIES_ELEMENT (overrides->data)->index == i)) {
tmp_style = GOG_STYLED_OBJECT (overrides->data)->style;
overrides = overrides->next;
} else
tmp_style = style;
gog_theme_fillin_style (theme, tmp_style, GOG_OBJECT (series),
plot->index_num + i, FALSE);
if (labels != NULL)
label = (i < num_labels)
......@@ -377,7 +385,7 @@ gog_plot_foreach_elem (GogPlot *plot, gboolean only_visible,
label = NULL;
if (label == NULL)
label = g_strdup_printf ("%d", i);
(func) (i, style, label, data);
(func) (i, tmp_style, label, data);
g_free (label);
}
g_object_unref (style);
......
......@@ -78,8 +78,9 @@ struct _GogSeries {
GogPlot *plot;
GogDatasetElement *values;
unsigned num_elements;
gboolean has_legend;
unsigned num_elements;
GList *overrides; /* individual points */
GogSeriesElementStyleList *element_style_overrides;
};
......
......@@ -43,7 +43,7 @@
#include <string.h>
int gog_series_get_valid_element_index (GogSeries *series, int old_index, int desired_index);
/*****************************************************************************/
static GObjectClass *gse_parent_klass;
......@@ -52,15 +52,27 @@ enum {
ELEMENT_INDEX
};
static gint element_compare (GogSeriesElement *gse_a, GogSeriesElement *gse_b)
{
return gse_a->index - gse_b->index;
}
static void
gog_series_element_set_property (GObject *obj, guint param_id,
GValue const *value, GParamSpec *pspec)
{
GogSeriesElement *gse = GOG_SERIES_ELEMENT (obj);
GogObject *gobj = GOG_OBJECT (obj);
switch (param_id) {
case ELEMENT_INDEX :
gse->index = g_value_get_int (value);
if (gobj->parent != NULL) {
GogSeries *series = GOG_SERIES (gobj->parent);
series->overrides = g_list_remove (series->overrides, gse);
series->overrides = g_list_insert_sorted (series->overrides, gse,
(GCompareFunc) element_compare);
}
break;
default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
return; /* NOTE : RETURN */
......@@ -97,7 +109,7 @@ cb_index_changed (GtkSpinButton *spin_button, GogSeriesElement *element)
GOG_SERIES (gog_object_get_parent (GOG_OBJECT (element))),
element->index, value);
if (index != value)
if (index != value)
gtk_spin_button_set_value (spin_button, index);
g_object_set (element, "index", (int) index, NULL);
......@@ -126,7 +138,7 @@ gog_series_element_editor (GogObject *gobj,
FALSE, FALSE, 0);
spin_button = gtk_spin_button_new_with_range (0, G_MAXINT, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button),
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button),
GOG_SERIES_ELEMENT(gobj)->index);
g_signal_connect (G_OBJECT (spin_button),
"value_changed",
......@@ -150,12 +162,12 @@ gog_series_element_init_style (GogStyledObject *gso, GogStyle *style)
{
GogSeries *series = GOG_SERIES (GOG_OBJECT (gso)->parent);
GogStyle *parent_style;
g_return_if_fail (GOG_SERIES (series) != NULL);
parent_style = gog_styled_object_get_style (GOG_STYLED_OBJECT (series));
style->interesting_fields = parent_style->interesting_fields;
style->interesting_fields = parent_style->interesting_fields;
}
static void
......@@ -168,7 +180,7 @@ gog_series_element_class_init (GogSeriesElementClass *klass)
gobject_klass->set_property = gog_series_element_set_property;
gobject_klass->get_property = gog_series_element_get_property;
gog_klass->editor = gog_series_element_editor;
style_klass->init_style = gog_series_element_init_style;
......@@ -199,13 +211,13 @@ static gboolean
role_series_element_can_add (GogObject const *parent)
{
GogSeriesClass *klass = GOG_SERIES_GET_CLASS (parent);
return ((gog_series_get_valid_element_index(GOG_SERIES (parent), -1, 0) >= 0) &&
(klass->series_element_type > 0));
}
static GogObject *
role_series_element_allocate (GogObject *series)
role_series_element_allocate (GogObject *series)
{
GogSeriesClass *klass = GOG_SERIES_GET_CLASS (series);
GType type = klass->series_element_type;
......@@ -215,8 +227,8 @@ role_series_element_allocate (GogObject *series)
type = GOG_SERIES_ELEMENT_TYPE;
gse = g_object_new (type, NULL);
if (gse != NULL)
GOG_SERIES_ELEMENT (gse)->index =
if (gse != NULL)
GOG_SERIES_ELEMENT (gse)->index =
gog_series_get_valid_element_index (GOG_SERIES (series), -1, 0);
return gse;
}
......@@ -224,8 +236,18 @@ role_series_element_allocate (GogObject *series)
static void
role_series_element_post_add (GogObject *parent, GogObject *child)
{
GogSeries *series = GOG_SERIES (parent);
gog_styled_object_set_style (GOG_STYLED_OBJECT (child),
gog_styled_object_get_style (GOG_STYLED_OBJECT (parent)));
series->overrides = g_list_insert_sorted (series->overrides, child,
(GCompareFunc) element_compare);
}
static void
role_series_element_pre_remove (GogObject *parent, GogObject *child)
{
GogSeries *series = GOG_SERIES (parent);
series->overrides = g_list_remove (series->overrides, child);
}
static void
......@@ -273,7 +295,7 @@ gog_series_get_property (GObject *obj, guint param_id,
switch (param_id) {
case SERIES_HAS_LEGEND :
g_value_set_boolean (value, series->has_legend);
g_value_set_boolean (value, series->has_legend);
break;
default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, param_id, pspec);
break;
......@@ -406,11 +428,12 @@ static void
gog_series_class_init (GogSeriesClass *klass)
{
static GogObjectRole const roles[] = {
{ N_("Style override"), "GogSeriesElement", 0,
{ N_("Point"), "GogSeriesElement", 0,
GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
role_series_element_can_add, NULL,
role_series_element_allocate,
role_series_element_post_add, NULL, NULL },
role_series_element_can_add, NULL,
role_series_element_allocate,
role_series_element_post_add,
role_series_element_pre_remove, NULL },
};
GObjectClass *gobject_klass = (GObjectClass *) klass;
GogObjectClass *gog_klass = (GogObjectClass *) klass;
......@@ -519,7 +542,7 @@ gog_series_dataset_dim_changed (GogDataset *set, int dim_i)
gog_object_request_update (GOG_OBJECT (set));
} else {
GOData *name_src = series->values[-1].data;
char const *name = (name_src != NULL)
char const *name = (name_src != NULL)
? go_data_scalar_get_str (GO_DATA_SCALAR (name_src)) : NULL;
gog_object_set_name (GOG_OBJECT (set), g_strdup (name), NULL);
}
......@@ -609,7 +632,7 @@ gog_series_has_legend (GogSeries const *series)
* gog_series_set_index :
* @series : #GogSeries
* @index :
* @is_manual :
* @is_manual :
*
* if @index >= 0 attempt to assign the new index. Auto
* indicies (@is_manual == FALSE) will not override the current
......@@ -684,14 +707,9 @@ gog_series_set_dim (GogSeries *series, int dim_i, GOData *val, GError **err)
gog_dataset_set_dim (GOG_DATASET (series), dim_i, val, err);
}
static gint element_compare (GogSeriesElement *gse_a, GogSeriesElement *gse_b)
{
return gse_a->index - gse_b->index;
}
/**
* gog_series_num_elements :
* @series : #GogSeries
* @series : #GogSeries
*
* Returns the number of elements in the series
**/
......@@ -702,24 +720,16 @@ gog_series_num_elements (GogSeries const *series)
}
GList *
gog_series_get_elements (GogSeries *series)
gog_series_get_overrides (GogSeries *series)
{
GList *element_list = NULL;
GSList *gse_ptr;
for (gse_ptr = GOG_OBJECT (series)->children;
gse_ptr != NULL;
gse_ptr = gse_ptr->next)
if (IS_GOG_SERIES_ELEMENT (gse_ptr->data))
element_list = g_list_append (element_list, gse_ptr->data);
return g_list_sort (element_list, (GCompareFunc) element_compare);
return series->overrides;
}
int
gog_series_get_valid_element_index (GogSeries *series, int old_index, int desired_index)
gog_series_get_valid_element_index (GogSeries *series, int old_index, int desired_index)
{
int index;
GList *element_list, *element_ptr;
GList *ptr;
g_return_val_if_fail (GOG_SERIES (series) != NULL, -1);
......@@ -727,34 +737,26 @@ gog_series_get_valid_element_index (GogSeries *series, int old_index, int desire
(desired_index < 0))
return old_index;
element_list = gog_series_get_elements (series);
if (desired_index > old_index)
for (element_ptr = element_list;
element_ptr != NULL;
element_ptr = element_ptr->next) {
index = GOG_SERIES_ELEMENT (element_ptr->data)->index;
if (desired_index > old_index)
for (ptr = series->overrides; ptr != NULL; ptr = ptr->next) {
index = GOG_SERIES_ELEMENT (ptr->data)->index;
if (index > desired_index)
break;
if (index == desired_index)
if (index == desired_index)
desired_index++;
}
else
for (element_ptr = g_list_last (element_list);
element_ptr != NULL;
element_ptr = element_ptr->prev) {
index = GOG_SERIES_ELEMENT (element_ptr->data)->index;
else
for (ptr = g_list_last (series->overrides); ptr != NULL; ptr = ptr->prev) {
index = GOG_SERIES_ELEMENT (ptr->data)->index;
if (index < desired_index)
break;
if (index == desired_index)
if (index == desired_index)
desired_index--;
}
g_list_free (element_list);
if ((desired_index >= 0) &&
(desired_index < (int) series->num_elements))
return desired_index;
return old_index;
return old_index;
}
......@@ -48,8 +48,8 @@ void gog_series_set_dim (GogSeries *series, int dim_i,
void gog_series_set_index (GogSeries *series,
int ind, gboolean is_manual);
unsigned gog_series_num_elements (GogSeries const *series);
GList *gog_series_get_elements (GogSeries *series);
unsigned gog_series_num_elements (GogSeries const *series);
GList *gog_series_get_overrides (GogSeries *series);
G_END_DECLS
......
......@@ -485,41 +485,49 @@ gog_view_render (GogView *view, GogViewAllocation const *bbox)
}
/**
* gog_view_point :
* gog_view_info_at_point :
* @view : a #GogView
* @x :
* @y :
* @cur_selection : If @cur_selection is the object @x,@y, and it could create
* a child there, create it
* @obj : If non-NULL store the object @x,@y
* @name : store the name of the most derived object even if it does not yet exist
* caller is responsible for freeing the string (ignored in NULL)
*
* Returns the #GogObject that contains @x,@y. The caller is responsible for
* unrefing the result.
* Returns TRUE if an object is found
**/
GogObject *
gog_view_point (GogView *view, double x, double y)
gboolean
gog_view_info_at_point (GogView *view, double x, double y,
GogObject const *cur_selection,
GogObject **obj, char **name)
{
GSList *ptr;
GogObject *res;
GogViewClass *klass = GOG_VIEW_GET_CLASS (view);
g_return_val_if_fail (klass != NULL, NULL);
g_return_val_if_fail (view->allocation_valid, NULL);
g_return_val_if_fail (view->child_allocations_valid, NULL);
g_return_val_if_fail (klass != NULL, FALSE);
g_return_val_if_fail (view->allocation_valid, FALSE);
g_return_val_if_fail (view->child_allocations_valid, FALSE);
if (x < view->allocation.x ||
x >= (view->allocation.x + view->allocation.w) ||
y < view->allocation.y ||
y >= (view->allocation.y + view->allocation.h))
return NULL;
return FALSE;
for (ptr = view->children; ptr != NULL ; ptr = ptr->next) {
res = gog_view_point (ptr->data, x, y);
if (res != NULL)
return res;
}
for (ptr = view->children; ptr != NULL ; ptr = ptr->next)
if (gog_view_info_at_point (ptr->data, x, y, cur_selection, obj, name))
return TRUE;
if (klass->info_at_point != NULL)
return (klass->info_at_point) (view, x, y, cur_selection, obj, name);
if (obj != NULL)
*obj = view->model;
if (name != NULL)
*name = g_strdup (gog_object_get_name (view->model));
res = (klass->point != NULL) ? (klass->point) (view, x, y) : view->model;
if (res != NULL)
g_object_ref (res);
return res;
return TRUE;
}
/**
......
......@@ -46,11 +46,13 @@ typedef struct {
GObjectClass base;
/* Virtuals */
void (*state_init) (GogView *);
void (*size_request) (GogView *, GogViewRequisition *r);
void (*size_allocate) (GogView *, GogViewAllocation const *a);
void (*render) (GogView *, GogViewAllocation const *bbox);
GogObject *(*point) (GogView *, double x, double y);
void (*state_init) (GogView *);
void (*size_request) (GogView *, GogViewRequisition *r);
void (*size_allocate) (GogView *, GogViewAllocation const *a);
void (*render) (GogView *, GogViewAllocation const *bbox);
gboolean (*info_at_point) (GogView *, double x, double y,
GogObject const *cur_selection,
GogObject **obj, char **name);
} GogViewClass;
#define GOG_VIEW_TYPE (gog_view_get_type ())
......@@ -69,7 +71,9 @@ void gog_view_queue_resize (GogView *v);
void gog_view_size_request (GogView *v, GogViewRequisition *req);
void gog_view_size_allocate (GogView *v, GogViewAllocation const *a);
gboolean gog_view_update_sizes (GogView *v);