[goffice] removed unused fields in GocItem



commit 8612dc502024323d6355a41f91af162bef33714b
Author: Jean Brefort <jean brefort normalesup org>
Date:   Fri Sep 18 11:59:42 2009 +0200

    removed unused fields in GocItem

 ChangeLog                               |    9 ++++
 docs/reference/goffice-0.8-sections.txt |   72 +++++++++---------------------
 goffice/canvas/goc-group.c              |    1 -
 goffice/canvas/goc-item.c               |   71 ++++++++++++++----------------
 goffice/canvas/goc-item.h               |    5 --
 goffice/gtk/goffice-gtk.c               |    4 +-
 goffice/utils/go-style.c                |    1 +
 7 files changed, 67 insertions(+), 96 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ea9180d..f4982ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-18  Jean Brefort  <jean brefort normalesup org>
+
+	* docs/reference/goffice-0.8-sections.txt: removed duplicates
+	* goffice/canvas/goc-group.c (goc_group_draw_region): remove unuseful call.
+	* goffice/canvas/goc-item.c: update documentation and remove unused code.
+	* goffice/canvas/goc-item.h: remove unused fields.
+	* goffice/gtk/goffice-gtk.c: add missing colons.
+	* goffice/utils/go-style.c: fixed a documentation warning.
+
 2009-09-16  Morten Welinder  <terra gnome org>
 
 	* goffice/canvas/goc-widget.c (goc_widget_init,
diff --git a/docs/reference/goffice-0.8-sections.txt b/docs/reference/goffice-0.8-sections.txt
index b8fdf99..4326b89 100644
--- a/docs/reference/goffice-0.8-sections.txt
+++ b/docs/reference/goffice-0.8-sections.txt
@@ -553,20 +553,34 @@ gog_renderer_get_type
 <FILE>go-gtk</FILE>
 <TITLE>Gtk+</TITLE>
 <SUBSECTION Utilities>
-go_gtk_button_new_with_stock
-go_gtk_dialog_add_button
+go_gtk_editable_enters
+go_gtk_builder_new
+go_gtk_builder_signal_connect
+go_gtk_builder_signal_connect_swapped
+go_gtk_builder_get_widget
+go_gtk_builder_combo_box_init_text
+go_gtk_builder_group_value
+go_pango_measure_string
 go_gtk_dialog_run
-go_gtk_file_sel_dialog
-go_gtk_help_button_init
-go_gtk_nonmodal_dialog
+go_gtk_dialog_add_button
 go_gtk_notice_dialog
 go_gtk_notice_nonmodal_dialog
 go_gtk_query_yes_no
-go_gtk_select_image
-go_gtk_url_is_writeable
+go_gtk_button_new_with_stock
 go_gtk_widget_disable_focus
 go_gtk_window_set_transient
-go_gtk_editable_enters
+go_gtk_help_button_init
+go_gtk_nonmodal_dialog
+go_gtk_file_sel_dialog
+go_gtk_select_image
+go_gui_get_image_save_info
+go_gtk_url_is_writeable
+go_atk_setup_label
+go_dialog_guess_alternative_button_order
+go_widget_set_tooltip_text
+go_tool_item_set_tooltip_text
+go_menu_position_below
+go_gtk_url_show
 </SECTION>
 
 <SECTION>
@@ -747,39 +761,6 @@ gog_axis_map_is_inverted
 ### GUI utilities
 
 <SECTION>
-<FILE>goffice-gtk</FILE>
-<TITLE>Goffice GTK related utilities</TITLE>
-go_gtk_editable_enters
-go_gtk_builder_new
-go_gtk_builder_signal_connect
-go_gtk_builder_signal_connect_swapped
-go_gtk_builder_get_widget
-go_gtk_builder_combo_box_init_text
-go_gtk_builder_group_value
-go_pango_measure_string
-go_gtk_dialog_run
-go_gtk_dialog_add_button
-go_gtk_notice_dialog
-go_gtk_notice_nonmodal_dialog
-go_gtk_query_yes_no
-go_gtk_button_new_with_stock
-go_gtk_widget_disable_focus
-go_gtk_window_set_transient
-go_gtk_help_button_init
-go_gtk_nonmodal_dialog
-go_gtk_file_sel_dialog
-go_gtk_select_image
-go_gui_get_image_save_info
-go_gtk_url_is_writeable
-go_atk_setup_label
-go_dialog_guess_alternative_button_order
-go_widget_set_tooltip_text
-go_tool_item_set_tooltip_text
-go_menu_position_below
-go_gtk_url_show
-</SECTION>
-
-<SECTION>
 <FILE>go-combo-box</FILE>
 <TITLE>GOComboBox</TITLE>
 GOComboBox
@@ -2346,11 +2327,8 @@ GOFilePermissions
 GOFileProbeLevel
 GODotDot
 go_filename_simplify
-go_url_simplify
 go_filename_from_uri
 go_filename_to_uri
-go_url_resolve_relative
-go_url_make_relative
 go_shell_arg_to_uri
 go_basename_from_uri
 go_dirname_from_uri
@@ -2367,10 +2345,6 @@ go_file_get_date_accessed
 go_file_get_date_modified
 go_file_get_date_changed
 go_file_access
-go_url_decode
-go_url_encode
-go_url_show
-go_url_check_extension
 go_get_mime_type
 go_get_mime_type_for_data
 go_mime_type_get_description
@@ -2529,8 +2503,6 @@ goc_item_set
 goc_item_distance
 goc_item_draw
 goc_item_draw_region
-goc_item_get_operator
-goc_item_move
 goc_item_invalidate
 goc_item_show
 goc_item_hide
diff --git a/goffice/canvas/goc-group.c b/goffice/canvas/goc-group.c
index 35fc63a..9100ed5 100644
--- a/goffice/canvas/goc-group.c
+++ b/goffice/canvas/goc-group.c
@@ -128,7 +128,6 @@ goc_group_draw_region (GocItem const *item, cairo_t *cr,
 		}
 		goc_item_get_bounds (item, &x, &y, &x_, &y_);
 		if (x <= x1 && x_ >= x0 && y <= y1 && y_ >= y0) {
-			cairo_set_operator (cr, goc_item_get_operator (item));
 			if (!goc_item_draw_region (item, cr, x0, y0, x1, y1))
 				goc_item_draw (item, cr);
 		}
diff --git a/goffice/canvas/goc-item.c b/goffice/canvas/goc-item.c
index a499f0e..dac107d 100644
--- a/goffice/canvas/goc-item.c
+++ b/goffice/canvas/goc-item.c
@@ -26,6 +26,23 @@
 #include <gsf/gsf-impl-utils.h>
 #include <glib/gi18n-lib.h>
 
+/**
+ * GocItem:
+ * @base: the parent object.
+ * @canvas: the canvas in which the item is displayed.
+ * @parent: the parent item.
+ * @cached_bounds: whether bounds have been cached in @x0, @y0, @x1 and @y1or not.
+ * @visible: whether the item is visible or hidden. A visible item needs to lie
+ * in the visible region of the canvas to be really visible.
+ * @realized: whether the item is realized or not.
+ * @x0: the lowest horizontal bound of the item.
+ * @y0: the lowest vertical bound of the item.
+ * @x1: the highest horizontal bound of the item.
+ * @y1: the highest vertical bound of the item.
+ *
+ * The virtual base object for canvas items.
+ **/
+
 enum {
 	ITEM_PROP_0,
 	ITEM_PROP_CANVAS,
@@ -43,21 +60,22 @@ enum {
  * Should return TRUE when successfull. If FALSE is returned, @draw will be
  * called. There is no need to implement both methods for an item. Large items
  * should implement @draw_region.
- * @move:
- * @update_bounds:
- * @parent_changed:
- * @get_operator:
- * @button_pressed:
- * @button2_pressed:
- * @button_released:
- * @motion:
- * @enter_notify:
- * @leave_notify:
- * @realize:
- * @unrealize:
- * @key_pressed:
- * @key_released:
- * @notify_scrolled:
+ * @update_bounds: updates the bounds stored in #GocItem as fields #x0, #y0,
+ * #x1,and #y1.
+ * @parent_changed: callback for a parent changed event.
+ * @button_pressed: callback for a button press event.
+ * @button2_pressed: callback for a double click event.
+ * @button_released: callback for a button release event.
+ * @motion: callback for a motion event.
+ * @enter_notify: callback for an enter notify event.
+ * @leave_notify: callback for a leave notify event.
+ * @realize: callback for a realizes event.
+ * @unrealize: callback for an unrealize event.
+ * @key_pressed: callback for a key press event.
+ * @key_released: callback for a key release event.
+ * @notify_scrolled: callback for a notify scrolled event. This is useful to
+ * reposition children of the GtkLayout parent of the canvas to their new
+ * position.
  *
  * The base class for all canvas items.
  **/
@@ -286,29 +304,6 @@ goc_item_draw_region (GocItem const *item, cairo_t *cr,
 		klass->draw_region (item, cr, x0, y0, x1, y1): FALSE;
 }
 
-cairo_operator_t
-goc_item_get_operator (GocItem *item)
-{
-	GocItemClass *klass;
-
-	g_return_val_if_fail (GOC_IS_ITEM (item), CAIRO_OPERATOR_OVER);
-	klass = GOC_ITEM_GET_CLASS (item);
-	g_return_val_if_fail (klass != NULL, CAIRO_OPERATOR_OVER);
-
-	return (klass->get_operator)?
-		klass->get_operator (item): CAIRO_OPERATOR_OVER;
-}
-
-void
-goc_item_move (GocItem *item, double x, double y)
-{
-	GocItemClass *klass = GOC_ITEM_GET_CLASS (item);
-	g_return_if_fail (klass != NULL);
-
-	if (klass->move)
-		klass->move (item, x, y);
-}
-
 void
 goc_item_invalidate (GocItem *item)
 {
diff --git a/goffice/canvas/goc-item.h b/goffice/canvas/goc-item.h
index 1e8f63f..50ff973 100644
--- a/goffice/canvas/goc-item.h
+++ b/goffice/canvas/goc-item.h
@@ -32,7 +32,6 @@ struct _GocItem {
 	GocCanvas		*canvas;
 	GocGroup		*parent;
 	gboolean		 cached_bounds;
-	gboolean		 needs_redraw;
 	gboolean		 visible;
 	gboolean		 realized;
 	double			 x0, y0, x1, y1; /* the bounds */
@@ -47,10 +46,8 @@ struct _GocItemClass {
 	void			(*draw) (GocItem const *item, cairo_t *cr);
 	gboolean		(*draw_region) (GocItem const *item, cairo_t *cr,
 						double x0, double y0, double x1, double y1);
-	void			(*move) (GocItem *item, double x, double y);
 	void			(*update_bounds) (GocItem *item);
 	void			(*parent_changed) (GocItem *item);
-	cairo_operator_t	(*get_operator) (GocItem *item);
 	/* events related functions */
 	gboolean		(*button_pressed) (GocItem *item, int button, double x, double y);
 	gboolean		(*button2_pressed) (GocItem *item, int button, double x, double y);
@@ -80,8 +77,6 @@ double		 goc_item_distance	(GocItem *item, double x, double y, GocItem **near_it
 void		 goc_item_draw		(GocItem const *item, cairo_t *cr);
 gboolean	 goc_item_draw_region	(GocItem const *item, cairo_t *cr,
 					 double x0, double y0, double x1, double y1);
-cairo_operator_t goc_item_get_operator  (GocItem *item);
-void		 goc_item_move		(GocItem *item, double x, double y);
 
 void		 goc_item_invalidate	(GocItem *item);
 void		 goc_item_show		(GocItem *item);
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 423ffed..260531c 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -44,7 +44,7 @@
 
 
 /**
- * go_gtk_button_new_with_stock
+ * go_gtk_button_new_with_stock:
  * @text : button label
  * @stock_id : id for stock icon
  *
@@ -1029,7 +1029,7 @@ go_gtk_url_is_writeable (GtkWindow *parent, char const *uri,
 }
 
 /**
- * go_gtk_dialog_run
+ * go_gtk_dialog_run:
  * @dialog : #GtkDialog
  * @parent : #GtkWindow
  *
diff --git a/goffice/utils/go-style.c b/goffice/utils/go-style.c
index b1c6670..8b31f87 100644
--- a/goffice/utils/go-style.c
+++ b/goffice/utils/go-style.c
@@ -1087,6 +1087,7 @@ go_style_assign (GOStyle *dst, GOStyle const *src)
  * go_style_apply_theme :
  * @dst : #GOStyle
  * @src :  #GOStyle
+ * @fields: the fields to which the copy should be limited
  *
  * Merge the attributes from @src onto the elements of @dst that were not user
  * assigned (is_auto)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]