Code

add a way to set a radio toggle in aux toolbar via desktop, by the toggles id
[inkscape.git] / src / desktop.cpp
index f58864955d01641cbc2c4bbf52c27592349caa09..4b4d1fe5bcf8358b803cd97e41a2b8b670b26e16 100644 (file)
@@ -132,7 +132,6 @@ SPDesktop::SPDesktop() :
     window_state(0),
     interaction_disabled_counter( 0 ),
     waiting_cursor( false ),
-    perspectives (NULL),
     guides_active( false ),
     gr_item( 0 ),
     gr_point_type( 0 ),
@@ -310,21 +309,6 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas)
     layer_manager = new Inkscape::LayerManager( this );
 
     grids_visible = true;
-
-    /* Create initial perspective, append it to the list of existing perspectives
-       and make it the current perspective */
-    Box3D::Perspective3D *initial_persp = new Box3D::Perspective3D (
-                                          // VP in x-direction
-                                          Box3D::VanishingPoint( NR::Point(-50.0, 600.0),
-                                                                 NR::Point( -1.0,   0.0), Box3D::VP_FINITE),
-                                          // VP in y-direction
-                                          Box3D::VanishingPoint( NR::Point(500.0,1000.0),
-                                                                 NR::Point(  0.0,   1.0), Box3D::VP_INFINITE),
-                                          // VP in z-direction
-                                          Box3D::VanishingPoint( NR::Point(700.0, 600.0),
-                                                                 NR::Point(sqrt(3.0),1.0), Box3D::VP_FINITE));
-    this->add_perspective (initial_persp);
-    Box3D::Perspective3D::current_perspective = (Box3D::Perspective3D *) perspectives->data;
 }
 
 
@@ -368,11 +352,6 @@ void SPDesktop::destroy()
 
     g_list_free (zooms_past);
     g_list_free (zooms_future);
-
-    for (GSList *p = this->perspectives; p != NULL; p = p->next) {
-        delete ((Box3D::Perspective3D *) p->data);
-    }
-    g_slist_free (perspectives);
 }
 
 SPDesktop::~SPDesktop() {}
@@ -714,45 +693,6 @@ void SPDesktop::set_display_area(NR::Rect const &a, NR::Coord b, bool log)
     set_display_area(a.min()[NR::X], a.min()[NR::Y], a.max()[NR::X], a.max()[NR::Y], b, log);
 }
 
-/**
- * Add a perspective to the desktop if it doesn't exist yet
- */
-void
-SPDesktop::add_perspective (Box3D::Perspective3D * const persp)
-{
-    // check that the perspective is not yet linked to another desktop
-    if (persp->desktop != NULL) {
-        g_assert (persp->desktop == this);
-    }
-
-    // FIXME: Should we handle the case that the perspectives have equal VPs but are not identical?
-    //        If so, we need to take care of relinking the boxes, etc.
-    if (persp == NULL || g_slist_find (this->perspectives, persp)) return;
-    this->perspectives = g_slist_prepend (this->perspectives, persp);
-    persp->desktop = this;
-}
-
-void SPDesktop::remove_perspective (Box3D::Perspective3D * const persp)
-{
-    if (persp == NULL) return;
-    if (!g_slist_find (this->perspectives, persp)) {
-        g_warning ("Could not find perspective in current desktop. Not removed.\n");
-        return;
-    }
-    this->perspectives = g_slist_remove (this->perspectives, persp);
-}
-
-// find an existing perspective whose VPs are equal to those of persp
-Box3D::Perspective3D * SPDesktop::find_perspective (Box3D::Perspective3D * const persp)
-{
-    for (GSList *p = this->perspectives; p != NULL; p = p->next) {
-        if (*((Box3D::Perspective3D *) p->data) == *persp) {
-            return ((Box3D::Perspective3D *) p->data);
-        }
-    }
-    return NULL; // perspective was not found
-}
-
 /**
  * Return viewbox dimensions.
  */
@@ -1179,6 +1119,12 @@ SPDesktop::setToolboxAdjustmentValue (gchar const* id, double val)
     _widget->setToolboxAdjustmentValue (id, val);
 }
 
+void
+SPDesktop::setToolboxSelectOneValue (gchar const* id, gint val)
+{
+    _widget->setToolboxSelectOneValue (id, val);
+}
+
 bool
 SPDesktop::isToolboxButtonActive (gchar const *id)
 {