diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-08-01 20:28:56 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-08-01 20:28:56 +0000 |
| commit | 5a15ea1a002fa4638198d50182e6fd5847ee9cf9 (patch) | |
| tree | af73f9301d9392b24bc0cda21c57fa815cae567e /src | |
| parent | Merge from trunk. (diff) | |
| download | inkscape-5a15ea1a002fa4638198d50182e6fd5847ee9cf9.tar.gz inkscape-5a15ea1a002fa4638198d50182e6fd5847ee9cf9.zip | |
Fixed Windows compile bug.
(bzr r12380.1.58)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/emf-win32-inout.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/emf-win32-print.cpp | 71 |
2 files changed, 41 insertions, 40 deletions
diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 627d78b16..2530af0cc 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -777,18 +777,18 @@ myEnhMetaFileProc(HDC /*hDC*/, HANDLETABLE * /*lpHTable*/, ENHMETARECORD const * d->dc[d->level].PixelsInX = pEmr->rclFrame.right - pEmr->rclFrame.left; d->dc[d->level].PixelsInY = pEmr->rclFrame.bottom - pEmr->rclFrame.top; - device_x = pEmr->rclFrame.left/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); - device_y = pEmr->rclFrame.top/100.0*Inkscape::Util::Quantity::Convert(1, "mm", "px"); + device_x = pEmr->rclFrame.left/100.0*Inkscape::Util::Quantity::convert(1, "mm", "px"); + device_y = pEmr->rclFrame.top/100.0*Inkscape::Util::Quantity::convert(1, "mm", "px"); d->MMX = d->dc[d->level].PixelsInX / 100.0; d->MMY = d->dc[d->level].PixelsInY / 100.0; - d->dc[d->level].PixelsOutX = d->MMX * Inkscape::Util::Quantity::Convert(1, "mm", "px"); - d->dc[d->level].PixelsOutY = d->MMY * Inkscape::Util::Quantity::Convert(1, "mm", "px"); + d->dc[d->level].PixelsOutX = d->MMX * Inkscape::Util::Quantity::convert(1, "mm", "px"); + d->dc[d->level].PixelsOutY = d->MMY * Inkscape::Util::Quantity::convert(1, "mm", "px"); // calculate ratio of Inkscape dpi/device dpi if (pEmr->szlMillimeters.cx && pEmr->szlDevice.cx) - device_scale = Inkscape::Util::Quantity::Convert(1, "mm", "px")*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; + device_scale = Inkscape::Util::Quantity::convert(1, "mm", "px")*pEmr->szlMillimeters.cx/pEmr->szlDevice.cx; tmp_outdef << " width=\"" << d->MMX << "mm\"\n" << diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 8784f4ace..dae97fecf 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -36,6 +36,7 @@ #include "helper/geom.h" #include "helper/geom-curves.h" #include "sp-item.h" +#include "util/units.h" #include "style.h" #include "inkscape-version.h" @@ -127,7 +128,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * if (bbox) d = *bbox; } - d *= Geom::Scale(Inkscape::Util::Quantity::Convert(1, "px", "in")); + d *= Geom::Scale(Inkscape::Util::Quantity::convert(1, "px", "in")); float dwInchesX = d.width(); float dwInchesY = d.height(); @@ -194,7 +195,7 @@ unsigned int PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument * snprintf(buff, sizeof(buff)-1, "Screen=%dx%dpx, %dx%dmm", PixelsX, PixelsY, MMX, MMY); GdiComment(hdc, strlen(buff), (BYTE*) buff); - snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * Inkscape::Util::Quantity::Convert(1, "in", "mm"), dwInchesY * Inkscape::Util::Quantity::Convert(1, "in", "mm")); + snprintf(buff, sizeof(buff)-1, "Drawing=%.1lfx%.1lfpx, %.1lfx%.1lfmm", _width, _height, dwInchesX * Inkscape::Util::Quantity::convert(1, "in", "mm"), dwInchesY * Inkscape::Util::Quantity::convert(1, "in", "mm")); GdiComment(hdc, strlen(buff), (BYTE*) buff); } @@ -303,7 +304,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo double scale = sqrt( (p[X]*p[X]) + (p[Y]*p[Y]) ) / sqrt(2); - DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI) ); + DWORD linewidth = MAX( 1, (DWORD) (scale * style->stroke_width.computed * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI) ); if (style->stroke_linecap.computed == 0) { linecap = PS_ENDCAP_FLAT; @@ -340,7 +341,7 @@ void PrintEmfWin32::create_pen(SPStyle const *style, const Geom::Affine &transfo n_dash = style->stroke_dash.n_dash; dash = new DWORD[n_dash]; for (i = 0; i < style->stroke_dash.n_dash; i++) { - dash[i] = (DWORD) (style->stroke_dash.dash[i] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + dash[i] = (DWORD) (style->stroke_dash.dash[i] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); } } } @@ -543,8 +544,8 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -563,10 +564,10 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -585,14 +586,14 @@ bool PrintEmfWin32::print_simple_shape(Geom::PathVector const &pathv, const Geom Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -715,8 +716,8 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p0 = pit->initialPoint(); - p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const x0 = (LONG) round(p0[X]); LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -733,10 +734,10 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo //Geom::Point p0 = cit->initialPoint(); Geom::Point p1 = cit->finalPoint(); - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -753,14 +754,14 @@ unsigned int PrintEmfWin32::print_pathv(Geom::PathVector const &pathv, const Geo Geom::Point p2 = points[2]; Geom::Point p3 = points[3]; - //p0[X] = (p0[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[X] = (p1[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[X] = (p2[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[X] = (p3[X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p1[Y] = (p1[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Y] = (p2[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p3[Y] = (p3[Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + //p0[X] = (p0[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[X] = (p1[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[X] = (p2[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[X] = (p3[X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + //p0[Y] = (p0[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p1[Y] = (p1[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Y] = (p2[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p3[Y] = (p3[Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); //LONG const x0 = (LONG) round(p0[X]); //LONG const y0 = (LONG) round(rc.bottom-p0[Y]); @@ -828,7 +829,7 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons LOGFONTW *lf = (LOGFONTW*)g_malloc(sizeof(LOGFONTW)); g_assert(lf != NULL); - lf->lfHeight = -style->font_size.computed * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI; + lf->lfHeight = -style->font_size.computed * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI; lf->lfWidth = 0; lf->lfEscapement = rot; lf->lfOrientation = rot; @@ -877,8 +878,8 @@ unsigned int PrintEmfWin32::text(Inkscape::Extension::Print * /*mod*/, char cons SetBkMode(hdc, TRANSPARENT); Geom::Point p2 = p * tf; - p2[Geom::X] = (p2[Geom::X] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); - p2[Geom::Y] = (p2[Geom::Y] * Inkscape::Util::Quantity::Convert(1, "px", "in") * dwDPI); + p2[Geom::X] = (p2[Geom::X] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); + p2[Geom::Y] = (p2[Geom::Y] * Inkscape::Util::Quantity::convert(1, "px", "in") * dwDPI); LONG const xpos = (LONG) round(p2[Geom::X]); LONG const ypos = (LONG) round(rc.bottom - p2[Geom::Y]); |
