goffice r2300 - in trunk: . goffice/graph plugins/plot_barcol plugins/plot_distrib plugins/plot_pie plugins/plot_radar plugins/plot_surface plugins/plot_xy



Author: jbrefort
Date: Wed Dec 31 18:17:14 2008
New Revision: 2300
URL: http://svn.gnome.org/viewvc/goffice?rev=2300&view=rev

Log:
2008-12-31  Jean Brefort  <jean brefort normalesup org>

	* goffice/graph/gog-guru-type-selector.glade: implement the insertion
	of an application specific custom widget.
	* goffice/graph/gog-guru.c: (graph_guru_type_selector_new),
	(gog_guru_add_custom_widget): ditto.
	* goffice/graph/gog-guru.h: ditto.
	* goffice/graph/gog-plot-impl.h: remove series minimum number.
	* goffice/graph/gog-plot.c: (gog_plot_class_init),
	(gog_plot_clear_series): ditto.
	* goffice/graph/gog-plot.h: ditto.
	* plugins/plot_barcol/gog-1.5d.c: (gog_plot1_5d_class_init): ditto.
	* plugins/plot_distrib/gog-boxplot.c: (gog_box_plot_class_init): ditto.
	* plugins/plot_distrib/gog-histogram.c: ditto.
	(gog_histogram_plot_class_init):
	* plugins/plot_distrib/gog-probability-plot.c: ditto.
	(gog_probability_plot_class_init):
	* plugins/plot_pie/gog-pie.c: (gog_pie_plot_class_init),
	(gog_ring_plot_class_init): ditto.
	* plugins/plot_radar/gog-radar.c: (gog_rt_plot_class_init): ditto.
	* plugins/plot_surface/gog-xyz.c: (gog_xyz_plot_class_init): ditto.
	* plugins/plot_xy/gog-xy.c: (gog_2d_plot_class_init): ditto.



Modified:
   trunk/ChangeLog
   trunk/goffice/graph/gog-guru-type-selector.glade
   trunk/goffice/graph/gog-guru.c
   trunk/goffice/graph/gog-guru.h
   trunk/goffice/graph/gog-plot-impl.h
   trunk/goffice/graph/gog-plot.c
   trunk/goffice/graph/gog-plot.h
   trunk/plugins/plot_barcol/gog-1.5d.c
   trunk/plugins/plot_distrib/gog-boxplot.c
   trunk/plugins/plot_distrib/gog-histogram.c
   trunk/plugins/plot_distrib/gog-probability-plot.c
   trunk/plugins/plot_pie/gog-pie.c
   trunk/plugins/plot_radar/gog-radar.c
   trunk/plugins/plot_surface/gog-xyz.c
   trunk/plugins/plot_xy/gog-xy.c

Modified: trunk/goffice/graph/gog-guru-type-selector.glade
==============================================================================
--- trunk/goffice/graph/gog-guru-type-selector.glade	(original)
+++ trunk/goffice/graph/gog-guru-type-selector.glade	Wed Dec 31 18:17:14 2008
@@ -1,374 +1,222 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
 <glade-interface>
-
-<widget class="GtkWindow" id="window1">
-  <property name="visible">True</property>
-  <property name="title" translatable="yes">window1</property>
-  <property name="type">GTK_WINDOW_TOPLEVEL</property>
-  <property name="window_position">GTK_WIN_POS_NONE</property>
-  <property name="modal">False</property>
-  <property name="resizable">True</property>
-  <property name="destroy_with_parent">False</property>
-  <property name="decorated">True</property>
-  <property name="skip_taskbar_hint">False</property>
-  <property name="skip_pager_hint">False</property>
-  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
-  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-  <property name="focus_on_map">True</property>
-
-  <child>
-    <widget class="GtkAlignment" id="type_selector">
-      <property name="visible">True</property>
-      <property name="xalign">0.5</property>
-      <property name="yalign">0.5</property>
-      <property name="xscale">1</property>
-      <property name="yscale">1</property>
-      <property name="top_padding">6</property>
-      <property name="bottom_padding">0</property>
-      <property name="left_padding">6</property>
-      <property name="right_padding">6</property>
-
-      <child>
-	<widget class="GtkVBox" id="vbox2">
-	  <property name="visible">True</property>
-	  <property name="homogeneous">False</property>
-	  <property name="spacing">12</property>
-
-	  <child>
-	    <widget class="GtkHBox" id="hbox1">
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">24</property>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox4">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="type_label">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">&lt;b&gt;_Plot type&lt;/b&gt;</property>
-		      <property name="use_underline">True</property>
-		      <property name="use_markup">True</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		      <property name="mnemonic_widget">type_treeview</property>
-		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		      <property name="width_chars">-1</property>
-		      <property name="single_line_mode">False</property>
-		      <property name="angle">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow1">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-		      <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-		      <child>
-			<widget class="GtkTreeView" id="type_treeview">
-			  <property name="width_request">150</property>
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="headers_visible">False</property>
-			  <property name="rules_hint">False</property>
-			  <property name="reorderable">False</property>
-			  <property name="enable_search">True</property>
-			  <property name="fixed_height_mode">False</property>
-			  <property name="hover_selection">False</property>
-			  <property name="hover_expand">False</property>
-			</widget>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">False</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox5">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">12</property>
-
-		  <child>
-		    <widget class="GtkVBox" id="vbox6">
-		      <property name="visible">True</property>
-		      <property name="homogeneous">False</property>
-		      <property name="spacing">6</property>
-
-		      <child>
-			<widget class="GtkLabel" id="subtype_label">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">&lt;b&gt;_Subtype&lt;/b&gt;</property>
-			  <property name="use_underline">True</property>
-			  <property name="use_markup">True</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
-			  <property name="wrap">False</property>
-			  <property name="selectable">False</property>
-			  <property name="xalign">0</property>
-			  <property name="yalign">0.5</property>
-			  <property name="xpad">0</property>
-			  <property name="ypad">0</property>
-			  <property name="mnemonic_widget">type_treeview</property>
-			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-			  <property name="width_chars">-1</property>
-			  <property name="single_line_mode">False</property>
-			  <property name="angle">0</property>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkFrame" id="canvas_container">
-			  <property name="visible">True</property>
-			  <property name="label_xalign">0</property>
-			  <property name="label_yalign">0.5</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-
-			  <child>
-			    <placeholder/>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">True</property>
-			  <property name="fill">True</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkAlignment" id="alignment10">
-			  <property name="visible">True</property>
-			  <property name="xalign">1</property>
-			  <property name="yalign">0</property>
-			  <property name="xscale">0</property>
-			  <property name="yscale">0</property>
-			  <property name="top_padding">6</property>
-			  <property name="bottom_padding">0</property>
-			  <property name="left_padding">0</property>
-			  <property name="right_padding">0</property>
-
-			  <child>
-			    <widget class="GtkButton" id="sample_button">
-			      <property name="visible">True</property>
-			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">False</property>
-
-			      <child>
-				<widget class="GtkAlignment" id="alignment8">
-				  <property name="visible">True</property>
-				  <property name="xalign">0.5</property>
-				  <property name="yalign">0.5</property>
-				  <property name="xscale">0</property>
-				  <property name="yscale">0</property>
-				  <property name="top_padding">0</property>
-				  <property name="bottom_padding">0</property>
-				  <property name="left_padding">0</property>
-				  <property name="right_padding">0</property>
-
-				  <child>
-				    <widget class="GtkHBox" id="hbox3">
-				      <property name="visible">True</property>
-				      <property name="homogeneous">False</property>
-				      <property name="spacing">2</property>
-
-				      <child>
-					<widget class="GtkImage" id="image27">
-					  <property name="visible">True</property>
-					  <property name="stock">gtk-dialog-info</property>
-					  <property name="icon_size">4</property>
-					  <property name="xalign">0.5</property>
-					  <property name="yalign">0.5</property>
-					  <property name="xpad">0</property>
-					  <property name="ypad">0</property>
-					</widget>
-					<packing>
-					  <property name="padding">0</property>
-					  <property name="expand">False</property>
-					  <property name="fill">False</property>
-					</packing>
-				      </child>
-
-				      <child>
-					<widget class="GtkLabel" id="sample_label">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">Show sample</property>
-					  <property name="use_underline">True</property>
-					  <property name="use_markup">False</property>
-					  <property name="justify">GTK_JUSTIFY_LEFT</property>
-					  <property name="wrap">False</property>
-					  <property name="selectable">False</property>
-					  <property name="xalign">0.5</property>
-					  <property name="yalign">0.5</property>
-					  <property name="xpad">0</property>
-					  <property name="ypad">0</property>
-					  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-					  <property name="width_chars">-1</property>
-					  <property name="single_line_mode">False</property>
-					  <property name="angle">0</property>
-					</widget>
-					<packing>
-					  <property name="padding">0</property>
-					  <property name="expand">False</property>
-					  <property name="fill">False</property>
-					</packing>
-				      </child>
-				    </widget>
-				  </child>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
-			</packing>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">True</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">True</property>
-	      <property name="fill">True</property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkHBox" id="hbox3">
-	      <property name="visible">True</property>
-	      <property name="homogeneous">False</property>
-	      <property name="spacing">24</property>
-
-	      <child>
-		<widget class="GtkVBox" id="vbox3">
-		  <property name="visible">True</property>
-		  <property name="homogeneous">False</property>
-		  <property name="spacing">6</property>
-
-		  <child>
-		    <widget class="GtkLabel" id="description_title_label">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">&lt;b&gt;Description&lt;/b&gt;</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">True</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		      <property name="width_chars">-1</property>
-		      <property name="single_line_mode">False</property>
-		      <property name="angle">0</property>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkFrame" id="frame2">
-		      <property name="visible">True</property>
-		      <property name="label_xalign">0</property>
-		      <property name="label_yalign">0.5</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-
-		      <child>
-			<widget class="GtkLabel" id="description_label">
-			  <property name="height_request">60</property>
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes"></property>
-			  <property name="use_underline">False</property>
-			  <property name="use_markup">False</property>
-			  <property name="justify">GTK_JUSTIFY_LEFT</property>
-			  <property name="wrap">True</property>
-			  <property name="selectable">False</property>
-			  <property name="xalign">0</property>
-			  <property name="yalign">0</property>
-			  <property name="xpad">6</property>
-			  <property name="ypad">6</property>
-			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-			  <property name="width_chars">-1</property>
-			  <property name="single_line_mode">False</property>
-			  <property name="angle">0</property>
-			</widget>
-		      </child>
-		    </widget>
-		    <packing>
-		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">True</property>
-		    </packing>
-		  </child>
-		</widget>
-		<packing>
-		  <property name="padding">0</property>
-		  <property name="expand">True</property>
-		  <property name="fill">True</property>
-		</packing>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="padding">0</property>
-	      <property name="expand">False</property>
-	      <property name="fill">False</property>
-	    </packing>
-	  </child>
-	</widget>
-      </child>
-    </widget>
-  </child>
-</widget>
-
+  <widget class="GtkWindow" id="window1">
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">window1</property>
+    <child>
+      <widget class="GtkAlignment" id="type_selector">
+        <property name="visible">True</property>
+        <property name="top_padding">6</property>
+        <property name="left_padding">6</property>
+        <property name="right_padding">6</property>
+        <child>
+          <widget class="GtkVBox" id="vbox2">
+            <property name="visible">True</property>
+            <property name="spacing">12</property>
+            <child>
+              <widget class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="spacing">24</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox4">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="type_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">&lt;b&gt;_Plot type&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">type_treeview</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                        <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
+                        <property name="shadow_type">GTK_SHADOW_IN</property>
+                        <child>
+                          <widget class="GtkTreeView" id="type_treeview">
+                            <property name="width_request">150</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="headers_visible">False</property>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox5">
+                    <property name="visible">True</property>
+                    <property name="spacing">12</property>
+                    <child>
+                      <widget class="GtkVBox" id="rbox">
+                        <property name="visible">True</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkLabel" id="subtype_label">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">&lt;b&gt;_Subtype&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">type_treeview</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkFrame" id="canvas_container">
+                            <property name="visible">True</property>
+                            <property name="label_xalign">0</property>
+                            <property name="shadow_type">GTK_SHADOW_IN</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkAlignment" id="alignment10">
+                            <property name="visible">True</property>
+                            <property name="xalign">1</property>
+                            <property name="yalign">0</property>
+                            <property name="xscale">0</property>
+                            <property name="yscale">0</property>
+                            <property name="top_padding">6</property>
+                            <child>
+                              <widget class="GtkButton" id="sample_button">
+                                <property name="visible">True</property>
+                                <property name="focus_on_click">False</property>
+                                <property name="response_id">0</property>
+                                <child>
+                                  <widget class="GtkAlignment" id="alignment8">
+                                    <property name="visible">True</property>
+                                    <property name="xscale">0</property>
+                                    <property name="yscale">0</property>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox3">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">2</property>
+                                        <child>
+                                          <widget class="GtkImage" id="image27">
+                                            <property name="visible">True</property>
+                                            <property name="stock">gtk-dialog-info</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="sample_label">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Show sample</property>
+                                            <property name="use_underline">True</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                    </child>
+                                  </widget>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox2">
+                <property name="visible">True</property>
+                <property name="spacing">24</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="description_title_label">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Description&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkFrame" id="frame2">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">GTK_SHADOW_IN</property>
+                        <child>
+                          <widget class="GtkLabel" id="description_label">
+                            <property name="height_request">60</property>
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="yalign">0</property>
+                            <property name="xpad">6</property>
+                            <property name="ypad">6</property>
+                            <property name="wrap">True</property>
+                          </widget>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </glade-interface>

Modified: trunk/goffice/graph/gog-guru.c
==============================================================================
--- trunk/goffice/graph/gog-guru.c	(original)
+++ trunk/goffice/graph/gog-guru.c	Wed Dec 31 18:17:14 2008
@@ -1126,6 +1126,7 @@
 	typesel->current_type = NULL;
 	typesel->sample_graph_item = NULL;
 	typesel->max_priority_so_far = -1;
+	s->type_selector = typesel;
 
 	selector = glade_xml_get_widget (gui, "type_selector");
 
@@ -1323,3 +1324,15 @@
 
 	return state->dialog;
 }
+
+void
+gog_guru_add_custom_widget (GtkWidget *guru, GtkWidget *custom)
+{
+	GraphGuruState *state = g_object_get_data (G_OBJECT (guru), "state");
+	GtkBox *box = GTK_BOX (gtk_widget_get_parent (gtk_widget_get_parent (state->type_selector->canvas)));
+	if (custom) {
+		gtk_box_pack_start (GTK_BOX (box), custom, FALSE, TRUE, 0);
+		g_object_set_data (G_OBJECT (custom), "graph", state->graph);
+		gtk_widget_show_all (custom);
+	}
+}

Modified: trunk/goffice/graph/gog-guru.h
==============================================================================
--- trunk/goffice/graph/gog-guru.h	(original)
+++ trunk/goffice/graph/gog-guru.h	Wed Dec 31 18:17:14 2008
@@ -36,6 +36,8 @@
 
 GtkWidget *gog_guru_get_help_button (GtkWidget *guru);
 
+void	   gog_guru_add_custom_widget (GtkWidget *guru, GtkWidget *custom);
+
 G_END_DECLS
 
 #endif /* GOG_GURU_H */

Modified: trunk/goffice/graph/gog-plot-impl.h
==============================================================================
--- trunk/goffice/graph/gog-plot-impl.h	(original)
+++ trunk/goffice/graph/gog-plot-impl.h	Wed Dec 31 18:17:14 2008
@@ -32,7 +32,7 @@
 G_BEGIN_DECLS
 
 struct _GogPlotDesc {
-	unsigned  num_series_min, num_series_max;
+	unsigned  num_series_max;
 	unsigned  num_axis;
 	GogSeriesDesc series;
 };

Modified: trunk/goffice/graph/gog-plot.c
==============================================================================
--- trunk/goffice/graph/gog-plot.c	(original)
+++ trunk/goffice/graph/gog-plot.c	Wed Dec 31 18:17:14 2008
@@ -80,13 +80,6 @@
 	return g_slist_length (plot->series) < plot->desc.num_series_max;
 }
 
-static gboolean
-role_series_can_remove (GogObject const *child)
-{
-	GogPlot const *plot = GOG_PLOT (child->parent);
-	return g_slist_length (plot->series) > plot->desc.num_series_min;
-}
-
 static GogObject *
 role_series_allocate (GogObject *plot)
 {
@@ -502,7 +495,7 @@
 	static GogObjectRole const roles[] = {
 		{ N_("Series"), "GogSeries",	0,
 		  GOG_POSITION_SPECIAL, GOG_POSITION_SPECIAL, GOG_OBJECT_NAME_BY_ROLE,
-		  role_series_can_add, role_series_can_remove,
+		  role_series_can_add, NULL,
 		  role_series_allocate,
 		  role_series_post_add, role_series_pre_remove, NULL },
 	};
@@ -1055,6 +1048,15 @@
 	g_strfreev (hints);
 }
 
+void gog_plot_clear_series (GogPlot *plot)
+{
+	while (plot->series) {
+		GogObject *gobj = GOG_OBJECT (plot->series->data);
+		gog_object_clear_parent (gobj);
+		g_object_unref (gobj);
+	}
+}
+
 /*****************************************************************************/
 
 #ifdef GOFFICE_WITH_GTK

Modified: trunk/goffice/graph/gog-plot.h
==============================================================================
--- trunk/goffice/graph/gog-plot.h	(original)
+++ trunk/goffice/graph/gog-plot.h	Wed Dec 31 18:17:14 2008
@@ -70,6 +70,7 @@
 void 	   gog_plot_update_3d 		(GogPlot *plot);
 
 void	   gog_plot_guru_helper		(GogPlot *plot);
+void	   gog_plot_clear_series	(GogPlot *plot);
 
 G_END_DECLS
 

Modified: trunk/plugins/plot_barcol/gog-1.5d.c
==============================================================================
--- trunk/plugins/plot_barcol/gog-1.5d.c	(original)
+++ trunk/plugins/plot_barcol/gog-1.5d.c	Wed Dec 31 18:17:14 2008
@@ -359,7 +359,6 @@
 		plot_klass->desc.series.dim = dimensions;
 		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
 	}
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = G_MAXINT;
 	plot_klass->series_type = gog_series1_5d_get_type ();
 	plot_klass->axis_get_bounds   	= gog_plot1_5d_axis_get_bounds;

Modified: trunk/plugins/plot_distrib/gog-boxplot.c
==============================================================================
--- trunk/plugins/plot_distrib/gog-boxplot.c	(original)
+++ trunk/plugins/plot_distrib/gog-boxplot.c	Wed Dec 31 18:17:14 2008
@@ -394,7 +394,6 @@
 		plot_klass->desc.series.dim = dimensions;
 		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
 	}
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = G_MAXINT;
 	plot_klass->series_type = gog_box_plot_series_get_type ();
 	plot_klass->axis_set = GOG_AXIS_SET_XY;

Modified: trunk/plugins/plot_distrib/gog-histogram.c
==============================================================================
--- trunk/plugins/plot_distrib/gog-histogram.c	(original)
+++ trunk/plugins/plot_distrib/gog-histogram.c	Wed Dec 31 18:17:14 2008
@@ -190,7 +190,6 @@
 		plot_klass->desc.series.dim = dimensions;
 		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
 	}
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = 1;
 	plot_klass->series_type = gog_histogram_plot_series_get_type ();
 	plot_klass->axis_set = GOG_AXIS_SET_XY;

Modified: trunk/plugins/plot_distrib/gog-probability-plot.c
==============================================================================
--- trunk/plugins/plot_distrib/gog-probability-plot.c	(original)
+++ trunk/plugins/plot_distrib/gog-probability-plot.c	Wed Dec 31 18:17:14 2008
@@ -264,7 +264,6 @@
 		plot_klass->desc.series.dim = dimensions;
 		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
 	}
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = 1;
 	plot_klass->series_type = gog_probability_plot_series_get_type ();
 	plot_klass->axis_set = GOG_AXIS_SET_XY;

Modified: trunk/plugins/plot_pie/gog-pie.c
==============================================================================
--- trunk/plugins/plot_pie/gog-pie.c	(original)
+++ trunk/plugins/plot_pie/gog-pie.c	Wed Dec 31 18:17:14 2008
@@ -265,7 +265,6 @@
 		plot_klass->desc.series.num_dim = G_N_ELEMENTS (dimensions);
 		plot_klass->desc.series.style_fields = GOG_STYLE_OUTLINE | GOG_STYLE_FILL;
 	}
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = 1;
 	plot_klass->series_type  = gog_pie_series_get_type ();
 }
@@ -374,7 +373,6 @@
 			0, 100., 0.,
 			GSF_PARAM_STATIC | G_PARAM_READWRITE));
 
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = G_MAXINT;
 	plot_klass->desc.series.style_fields = GOG_STYLE_OUTLINE | GOG_STYLE_FILL;
 }

Modified: trunk/plugins/plot_radar/gog-radar.c
==============================================================================
--- trunk/plugins/plot_radar/gog-radar.c	(original)
+++ trunk/plugins/plot_radar/gog-radar.c	Wed Dec 31 18:17:14 2008
@@ -215,7 +215,6 @@
 			GSF_PARAM_STATIC | G_PARAM_READWRITE | GO_PARAM_PERSISTENT));
 
 	/* Fill in GogPlotClass methods */
-	gog_plot_klass->desc.num_series_min = 1;
 	gog_plot_klass->desc.num_series_max = G_MAXINT;
 	gog_plot_klass->series_type = gog_rt_series_get_type();
 

Modified: trunk/plugins/plot_surface/gog-xyz.c
==============================================================================
--- trunk/plugins/plot_surface/gog-xyz.c	(original)
+++ trunk/plugins/plot_surface/gog-xyz.c	Wed Dec 31 18:17:14 2008
@@ -403,7 +403,6 @@
 	}
 
 	/* Fill in GogPlotClass methods */
-	gog_plot_klass->desc.num_series_min = 1;
 	gog_plot_klass->desc.num_series_max = 1;
 	gog_plot_klass->series_type = gog_xyz_series_get_type();
 	gog_plot_klass->axis_get_bounds	= gog_xyz_plot_axis_get_bounds;

Modified: trunk/plugins/plot_xy/gog-xy.c
==============================================================================
--- trunk/plugins/plot_xy/gog-xy.c	(original)
+++ trunk/plugins/plot_xy/gog-xy.c	Wed Dec 31 18:17:14 2008
@@ -233,7 +233,6 @@
 	gog_klass->update	= gog_2d_plot_update;
 	gog_klass->view_type	= gog_xy_view_get_type ();
 
-	plot_klass->desc.num_series_min = 1;
 	plot_klass->desc.num_series_max = G_MAXINT;
 	plot_klass->series_type  	= gog_xy_series_get_type ();
 	plot_klass->axis_set	      	= GOG_AXIS_SET_XY;



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