diff options
| author | Ted Gould <ted@gould.cx> | 2008-10-11 15:16:23 +0000 |
|---|---|---|
| committer | Ted Gould <ted@canonical.com> | 2008-10-11 15:16:23 +0000 |
| commit | 2f5eb047d9e05be5e68549ef6b75070d2faa7d2f (patch) | |
| tree | ca2e94164b6d7aaebfc17196ca46bfc825a7665a /src/dialogs | |
| parent | Merge from trunk. (diff) | |
| download | inkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.tar.gz inkscape-2f5eb047d9e05be5e68549ef6b75070d2faa7d2f.zip | |
Merging from trunk
(bzr r6884)
Diffstat (limited to 'src/dialogs')
| -rw-r--r-- | src/dialogs/clonetiler.cpp | 14 | ||||
| -rw-r--r-- | src/dialogs/export.cpp | 10 | ||||
| -rw-r--r-- | src/dialogs/layers-panel.cpp | 14 | ||||
| -rw-r--r-- | src/dialogs/stroke-style.cpp | 4 | ||||
| -rw-r--r-- | src/dialogs/tiledialog.cpp | 23 | ||||
| -rw-r--r-- | src/dialogs/unclump.cpp | 4 |
6 files changed, 40 insertions, 29 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 1094571f5..c27c2b666 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -896,10 +896,10 @@ clonetiler_trace_pick (NR::Rect box) if (!trace_arena) return 0; - NR::Matrix t(NR::scale(trace_zoom, trace_zoom)); + Geom::Matrix t(Geom::Scale(trace_zoom, trace_zoom)); nr_arena_item_set_transform(trace_root, &t); NRGC gc(NULL); - gc.transform.set_identity(); + gc.transform.setIdentity(); nr_arena_item_invoke_update( trace_root, NULL, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE ); @@ -1248,13 +1248,13 @@ clonetiler_apply( GtkWidget */*widget*/, void * ) bool prefs_bbox = prefs->getBool("tools", "bounding_box", false); SPItem::BBoxType bbox_type = ( prefs_bbox ? SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX ); - boost::optional<NR::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)), + boost::optional<Geom::Rect> r = SP_ITEM(obj)->getBounds(sp_item_i2doc_affine(SP_ITEM(obj)), bbox_type); if (r) { - w = r->dimensions()[NR::X]; - h = r->dimensions()[NR::Y]; - x0 = r->min()[NR::X]; - y0 = r->min()[NR::Y]; + w = r->dimensions()[Geom::X]; + h = r->dimensions()[Geom::Y]; + x0 = r->min()[Geom::X]; + y0 = r->min()[Geom::Y]; center = desktop->dt2doc(SP_ITEM(obj)->getCenter()); sp_repr_set_svg_double(obj_repr, "inkscape:tile-cx", center[Geom::X]); diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index 5e23f0656..816a50754 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -778,7 +778,7 @@ sp_export_selection_modified ( Inkscape::Application */*inkscape*/, if ( SP_ACTIVE_DESKTOP ) { SPDocument *doc; doc = sp_desktop_document (SP_ACTIVE_DESKTOP); - boost::optional<Geom::Rect> bbox = to_2geom(sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)))); + boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc))); if (bbox) { sp_export_set_area (base, bbox->min()[Geom::X], bbox->min()[Geom::Y], @@ -847,7 +847,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) case SELECTION_SELECTION: if ((sp_desktop_selection(SP_ACTIVE_DESKTOP))->isEmpty() == false) { - bbox = to_2geom((sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds()); + bbox = sp_desktop_selection (SP_ACTIVE_DESKTOP)->bounds(); /* Only if there is a selection that we can set do we break, otherwise we fall through to the drawing */ @@ -859,7 +859,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) /** \todo * This returns wrong values if the document has a viewBox. */ - bbox = to_2geom(sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)))); + bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc))); /* If the drawing is valid, then we'll use it and break otherwise we drop through to the page settings */ if (bbox) { @@ -1407,7 +1407,7 @@ sp_export_detect_size(GtkObject * base) { switch (this_test[i]) { case SELECTION_SELECTION: if ((sp_desktop_selection(SP_ACTIVE_DESKTOP))->isEmpty() == false) { - boost::optional<Geom::Rect> bbox = to_2geom((sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds()); + boost::optional<Geom::Rect> bbox = (sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds(); //std::cout << "Selection " << bbox; if ( bbox && sp_export_bbox_equal(*bbox,current_bbox)) { @@ -1418,7 +1418,7 @@ sp_export_detect_size(GtkObject * base) { case SELECTION_DRAWING: { SPDocument *doc = sp_desktop_document (SP_ACTIVE_DESKTOP); - boost::optional<Geom::Rect> bbox = to_2geom(sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)))); + boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc))); // std::cout << "Drawing " << bbox2; if ( bbox && sp_export_bbox_equal(*bbox,current_bbox) ) { diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index c41d8ccb4..a8c55f9de 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -88,6 +88,17 @@ static gboolean layers_panel_activated( GtkObject */*object*/, GdkEvent * /*even return FALSE; } +static gboolean layers_panel_deactivated( GtkObject */*object*/, GdkEvent * /*event*/, gpointer data ) +{ + if ( data ) + { + LayersPanel* panel = reinterpret_cast<LayersPanel*>(data); + panel->setDesktop(NULL); + } + + return FALSE; +} + void LayersPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback ) { @@ -710,6 +721,7 @@ LayersPanel::LayersPanel() : } g_signal_connect( G_OBJECT(INKSCAPE), "activate_desktop", G_CALLBACK( layers_panel_activated ), this ); + g_signal_connect( G_OBJECT(INKSCAPE), "deactivate_desktop", G_CALLBACK( layers_panel_deactivated ), this ); setDesktop( targetDesktop ); show_all_children(); @@ -719,6 +731,8 @@ LayersPanel::LayersPanel() : LayersPanel::~LayersPanel() { + setDesktop(NULL); + _compositeSettings.setSubject(NULL); if ( _model ) diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index fe621e4f1..00e308278 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -592,7 +592,7 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, // Find object's bbox in document Geom::Matrix const i2doc(sp_item_i2doc_affine(SP_ITEM(object))); - boost::optional<NR::Rect> dbox = SP_ITEM(object)->getBounds(i2doc); + boost::optional<Geom::Rect> dbox = SP_ITEM(object)->getBounds(i2doc); if (!dbox) { return NULL; @@ -608,7 +608,7 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, Glib::RefPtr<Gdk::Pixbuf> pixbuf = Glib::wrap(svg_preview_cache.get_preview_from_cache(key)); if (!pixbuf) { - pixbuf = Glib::wrap(render_pixbuf(root, sf, to_2geom(*dbox), psize)); + pixbuf = Glib::wrap(render_pixbuf(root, sf, *dbox, psize)); svg_preview_cache.set_preview_in_cache(key, pixbuf->gobj()); } diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp index 99919d127..1643057e8 100644 --- a/src/dialogs/tiledialog.cpp +++ b/src/dialogs/tiledialog.cpp @@ -48,8 +48,8 @@ sp_compare_x_position(SPItem *first, SPItem *second) using Geom::X; using Geom::Y; - boost::optional<Geom::Rect> a = to_2geom(first->getBounds(sp_item_i2doc_affine(first))); - boost::optional<Geom::Rect> b = to_2geom(second->getBounds(sp_item_i2doc_affine(second))); + boost::optional<Geom::Rect> a = first->getBounds(sp_item_i2doc_affine(first)); + boost::optional<Geom::Rect> b = second->getBounds(sp_item_i2doc_affine(second)); if ( !a || !b ) { // FIXME? @@ -88,8 +88,8 @@ sp_compare_x_position(SPItem *first, SPItem *second) int sp_compare_y_position(SPItem *first, SPItem *second) { - boost::optional<Geom::Rect> a = to_2geom(first->getBounds(sp_item_i2doc_affine(first))); - boost::optional<Geom::Rect> b = to_2geom(second->getBounds(sp_item_i2doc_affine(second))); + boost::optional<Geom::Rect> a = first->getBounds(sp_item_i2doc_affine(first)); + boost::optional<Geom::Rect> b = second->getBounds(sp_item_i2doc_affine(second)); if ( !a || !b ) { // FIXME? @@ -168,7 +168,7 @@ void TileDialog::Grid_Arrange () cnt=0; for (; items != NULL; items = items->next) { SPItem *item = SP_ITEM(items->data); - boost::optional<Geom::Rect> b = to_2geom(item->getBounds(sp_item_i2doc_affine(item))); + boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); if (!b) { continue; } @@ -210,7 +210,7 @@ void TileDialog::Grid_Arrange () const GSList *sizes = sorted; for (; sizes != NULL; sizes = sizes->next) { SPItem *item = SP_ITEM(sizes->data); - boost::optional<Geom::Rect> b = to_2geom(item->getBounds(sp_item_i2doc_affine(item))); + boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); if (b) { width = b->dimensions()[Geom::X]; height = b->dimensions()[Geom::Y]; @@ -267,7 +267,7 @@ void TileDialog::Grid_Arrange () } - boost::optional<Geom::Rect> sel_bbox = to_2geom(selection->bounds()); + boost::optional<Geom::Rect> sel_bbox = selection->bounds(); // Fit to bbox, calculate padding between rows accordingly. if ( sel_bbox && !SpaceManualRadioButton.get_active() ){ #ifdef DEBUG_GRID_ARRANGE @@ -317,7 +317,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h for (; current_row != NULL; current_row = current_row->next) { SPItem *item=SP_ITEM(current_row->data); Inkscape::XML::Node *repr = SP_OBJECT_REPR(item); - boost::optional<Geom::Rect> b = to_2geom(item->getBounds(sp_item_i2doc_affine(item))); + boost::optional<Geom::Rect> b = item->getBounds(sp_item_i2doc_affine(item)); Geom::Point min; if (b) { width = b->dimensions()[Geom::X]; @@ -345,11 +345,8 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h g_slist_free (current_row); } - NRRect b; - selection->bounds(&b); - - sp_document_done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE, - _("Arrange in a grid")); + sp_document_done (sp_desktop_document (desktop), SP_VERB_SELECTION_GRIDTILE, + _("Arrange in a grid")); } diff --git a/src/dialogs/unclump.cpp b/src/dialogs/unclump.cpp index 9e4fce1e7..1329fdb5f 100644 --- a/src/dialogs/unclump.cpp +++ b/src/dialogs/unclump.cpp @@ -35,7 +35,7 @@ unclump_center (SPItem *item) return i->second; } - boost::optional<Geom::Rect> r = to_2geom(item->getBounds(sp_item_i2d_affine(item))); + boost::optional<Geom::Rect> r = item->getBounds(sp_item_i2d_affine(item)); if (r) { Geom::Point const c = r->midpoint(); c_cache[SP_OBJECT_ID(item)] = c; @@ -54,7 +54,7 @@ unclump_wh (SPItem *item) if ( i != wh_cache.end() ) { wh = i->second; } else { - boost::optional<Geom::Rect> r = to_2geom(item->getBounds(sp_item_i2d_affine(item))); + boost::optional<Geom::Rect> r = item->getBounds(sp_item_i2d_affine(item)); if (r) { wh = r->dimensions(); wh_cache[SP_OBJECT_ID(item)] = wh; |
