diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-14 19:42:57 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-14 19:42:57 +0000 |
| commit | efbf9755460d4c4b7a3d9d43dd753afcc8a28865 (patch) | |
| tree | 41a259211da187e29f9983821b4cdfea221b6ad6 /src/widgets | |
| parent | Fix crashes in print preview (diff) | |
| parent | Make cms_key in SPDesktopWidget a regular ustring rather than a pointer (diff) | |
| download | inkscape-efbf9755460d4c4b7a3d9d43dd753afcc8a28865.tar.gz inkscape-efbf9755460d4c4b7a3d9d43dd753afcc8a28865.zip | |
Merge SPCanvasArena caching layer work
(bzr r10451)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/dash-selector.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 25 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.h | 2 | ||||
| -rw-r--r-- | src/widgets/icon.cpp | 1 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 8 |
5 files changed, 19 insertions, 21 deletions
diff --git a/src/widgets/dash-selector.cpp b/src/widgets/dash-selector.cpp index dead653de..3339c64d3 100644 --- a/src/widgets/dash-selector.cpp +++ b/src/widgets/dash-selector.cpp @@ -22,9 +22,9 @@ #include <cstring> #include <string> -#include <libnr/nr-macros.h> #include <gtk/gtk.h> #include <glibmm/i18n.h> +#include <2geom/coord.h> #include "style.h" #include "dialogs/dialog-events.h" @@ -144,7 +144,7 @@ SPDashSelector::set_dash (int ndash, double *dash, double o) if (np == ndash) { int j; for (j = 0; j < ndash; j++) { - if (!NR_DF_TEST_CLOSE (dash[j], pattern[j], delta)) + if (!Geom::are_near(dash[j], pattern[j], delta)) break; } if (j == ndash) { diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 34c3ab75a..970a094a9 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -24,8 +24,9 @@ # include "config.h" #endif -#include <gtkmm/paned.h> #include <gtk/gtk.h> +#include <gtkmm.h> +#include <2geom/rect.h> #include "box3d-context.h" #include "cms-system.h" @@ -543,10 +544,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) Glib::ustring id = Inkscape::CMSSystem::getDisplayId( 0, 0 ); bool enabled = false; - if ( dtw->canvas->cms_key ) { - *(dtw->canvas->cms_key) = id; - enabled = !dtw->canvas->cms_key->empty(); - } + dtw->canvas->cms_key = id; + enabled = !dtw->canvas->cms_key.empty(); cms_adjust_set_sensitive( dtw, enabled ); } #endif // ENABLE_LCMS @@ -807,11 +806,9 @@ void sp_dtw_color_profile_event(EgeColorProfTracker */*tracker*/, SPDesktopWidge gint monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_toplevel(GTK_WIDGET(dtw))->window); Glib::ustring id = Inkscape::CMSSystem::getDisplayId( screenNum, monitor ); bool enabled = false; - if ( dtw->canvas->cms_key ) { - *(dtw->canvas->cms_key) = id; - dtw->requestCanvasUpdate(); - enabled = !dtw->canvas->cms_key->empty(); - } + dtw->canvas->cms_key = id; + dtw->requestCanvasUpdate(); + enabled = !dtw->canvas->cms_key.empty(); cms_adjust_set_sensitive( dtw, enabled ); #endif // ENABLE_LCMS } @@ -1161,7 +1158,7 @@ bool SPDesktopWidget::showInfoDialog( Glib::ustring const &message ) GTK_BUTTONS_OK, "%s", message.c_str()); gtk_window_set_title( GTK_WINDOW(dialog), _("Note:")); // probably want to take this as a parameter. - gint response = gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } return result; @@ -1522,7 +1519,7 @@ sp_desktop_widget_update_hruler (SPDesktopWidget *dtw) * the latter is used for drawing e.g. the grids and guides. Only when the viewbox * coincides with the pixel buffer, everything will line up nicely. */ - NR::IRect viewbox = dtw->canvas->getViewboxIntegers(); + Geom::IntRect viewbox = dtw->canvas->getViewboxIntegers(); double const scale = dtw->desktop->current_zoom(); double s = viewbox.min()[Geom::X] / scale - dtw->ruler_origin[Geom::X]; @@ -1538,7 +1535,7 @@ sp_desktop_widget_update_vruler (SPDesktopWidget *dtw) * the latter is used for drawing e.g. the grids and guides. Only when the viewbox * coincides with the pixel buffer, everything will line up nicely. */ - NR::IRect viewbox = dtw->canvas->getViewboxIntegers(); + Geom::IntRect viewbox = dtw->canvas->getViewboxIntegers(); double const scale = dtw->desktop->current_zoom(); double s = viewbox.min()[Geom::Y] / -scale - dtw->ruler_origin[Geom::Y]; @@ -1887,7 +1884,7 @@ sp_desktop_widget_update_scrollbars (SPDesktopWidget *dtw, double scale) Geom::Rect darea ( Geom::Point(-doc->getWidth(), -doc->getHeight()), Geom::Point(2 * doc->getWidth(), 2 * doc->getHeight()) ); - Geom::OptRect deskarea = Geom::unify(darea, doc->getRoot()->getBboxDesktop()); + Geom::OptRect deskarea = darea | doc->getRoot()->getBboxDesktop(); /* Canvas region we always show unconditionally */ Geom::Rect carea( Geom::Point(deskarea->min()[Geom::X] * scale - 64, deskarea->max()[Geom::Y] * -scale - 64), diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 79994a299..742411fb1 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -14,7 +14,6 @@ #include <gtk/gtk.h> -#include "libnr/nr-point.h" #include "forward.h" #include "sp-object.h" #include "message.h" @@ -23,6 +22,7 @@ #include <stddef.h> #include <sigc++/connection.h> +#include <2geom/point.h> // forward declaration typedef struct _EgeColorProfTracker EgeColorProfTracker; diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 450c5f0d9..95cb23a22 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -23,6 +23,7 @@ #include <gtkmm.h> #include <gdkmm/pixbuf.h> #include <glibmm/fileutils.h> +#include <2geom/transforms.h> #include "path-prefix.h" #include "preferences.h" diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 5d065c3e9..3c1196e96 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -6808,11 +6808,11 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl ) unsigned writing_mode = item->style->writing_mode.value; // below, variable names suggest horizontal move, but we check the writing direction // and move in the corresponding axis - int axis; + Geom::Dim2 axis; if (writing_mode == SP_CSS_WRITING_MODE_LR_TB || writing_mode == SP_CSS_WRITING_MODE_RL_TB) { - axis = NR::X; + axis = Geom::X; } else { - axis = NR::Y; + axis = Geom::Y; } Geom::OptRect bbox @@ -6865,7 +6865,7 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl ) } } Geom::Point XY = SP_TEXT(item)->attributes.firstXY(); - if (axis == NR::X) { + if (axis == Geom::X) { XY = XY + Geom::Point (move, 0); } else { XY = XY + Geom::Point (0, move); |
