summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 429ce09)
raw | patch | inline | side by side (parent: 429ce09)
author | joncruz <joncruz@users.sourceforge.net> | |
Fri, 5 Dec 2008 06:21:29 +0000 (06:21 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Fri, 5 Dec 2008 06:21:29 +0000 (06:21 +0000) |
index c1b534b7705addcb019e8ceb45800ffe9f26e9b0..e5cc35debdf258c0f43b1a288180d56410952bda 100644 (file)
#include "util/fixed_point.h"
#include "preferences.h"
+#ifndef INK_UNUSED
+#define INK_UNUSED(x) ((void)(x))
+#endif
+
// IIR filtering method based on:
// L.J. van Vliet, I.T. Young, and P.W. Verbeek, Recursive Gaussian Derivative Filters,
// in: A.K. Jain, S. Venkatesh, B.C. Lovell (eds.),
{
#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads)
+#else
+ INK_UNUSED(num_threads);
#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
#if HAVE_OPENMP
#if HAVE_OPENMP
#pragma omp parallel for num_threads(num_threads) private(history)
+#else
+ INK_UNUSED(num_threads);
#endif // HAVE_OPENMP
for ( int c2 = 0 ; c2 < n2 ; c2++ ) {
index 5c6575ccaed70ce19a6e3f59707509d8002fad5b..0f96c6ed28592c5ff0e1565fda38b88e0b358648 100644 (file)
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
* Checks whether an item has a construction applied as LPE and if so returns the index in
* lpesubtools of this construction
*/
-int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item)
+int lpetool_item_has_construction(SPLPEToolContext */*lc*/, SPItem *item)
{
if (!SP_IS_LPE_ITEM(item)) {
return -1;
static void
set_pos_and_anchor(SPCanvasText *canvas_text, const Geom::Piecewise<Geom::D2<Geom::SBasis> > &pwd2,
- const double t, const double length, bool use_curvature = false)
+ const double t, const double length, bool /*use_curvature*/ = false)
{
using namespace Geom;
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index b6f510201e5e45d6584167af3a7264be22ed68e4..bee7e1b5d6279290b53cb60a58c5237a095a52aa 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
curve->unref();
}
-static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const */*snapprefs*/)
{
g_assert(item != NULL);
g_assert(SP_IS_GENERICELLIPSE(item));
-
+
SPGenericEllipse *ellipse = SP_GENERICELLIPSE(item);
sp_genericellipse_normalize(ellipse);
NR::Matrix const i2d = sp_item_i2d_affine(item);
@@ -278,10 +278,10 @@ static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, I
}
double rx = ellipse->rx.computed;
- double ry = ellipse->ry.computed;
+ double ry = ellipse->ry.computed;
double cx = ellipse->cx.computed;
double cy = ellipse->cy.computed;
-
+
// Snap to the 4 quadrant points of the ellipse, but only if the arc
// spans far enough to include them
double angle = 0;
@@ -290,19 +290,19 @@ static void sp_genericellipse_snappoints(SPItem const *item, SnapPointsIter p, I
*p = NR::Point(cx + cos(angle)*rx, cy + sin(angle)*ry) * i2d;
}
}
-
- // And if we have a slice, also snap to the endpoints and the centre point
+
+ // And if we have a slice, also snap to the endpoints and the centre point
if (slice) {
// Add the centre, if we have a closed slice
if (ellipse->closed) {
*p = NR::Point(cx, cy) * i2d;
}
// Add the start point, if it's not coincident with a quadrant point
- if (fmod(ellipse->start, M_PI_2) != 0.0 ) {
+ if (fmod(ellipse->start, M_PI_2) != 0.0 ) {
*p = NR::Point(cx + cos(ellipse->start)*rx, cy + sin(ellipse->start)*ry) * i2d;
- }
+ }
// Add the end point, if it's not coincident with a quadrant point
- if (fmod(ellipse->end, M_PI_2) != 0.0 ) {
+ if (fmod(ellipse->end, M_PI_2) != 0.0 ) {
*p = NR::Point(cx + cos(ellipse->end)*rx, cy + sin(ellipse->end)*ry) * i2d;
}
}
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 8868b787519e4d31982cf86fd9edb1cbd5fc5510..01f266594729dbee5f9ad93d5ba808a60701d3b8 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
-#define __SP_ITEM_C__
-
/** \file
* Base class for visual SVG elements
*/
this->display = NULL;
this->clip_ref = new SPClipPathReference(this);
- sigc::signal<void, SPObject *, SPObject *> cs1=this->clip_ref->changedSignal();
- sigc::slot2<void,SPObject*, SPObject *> sl1=sigc::bind(sigc::ptr_fun(clip_ref_changed), this);
+ sigc::signal<void, SPObject *, SPObject *> cs1=this->clip_ref->changedSignal();
+ sigc::slot2<void,SPObject*, SPObject *> sl1=sigc::bind(sigc::ptr_fun(clip_ref_changed), this);
_clip_ref_connection = cs1.connect(sl1);
this->mask_ref = new SPMaskReference(this);
- sigc::signal<void, SPObject *, SPObject *> cs2=this->mask_ref->changedSignal();
- sigc::slot2<void,SPObject*, SPObject *> sl2=sigc::bind(sigc::ptr_fun(mask_ref_changed), this);
+ sigc::signal<void, SPObject *, SPObject *> cs2=this->mask_ref->changedSignal();
+ sigc::slot2<void,SPObject*, SPObject *> sl2=sigc::bind(sigc::ptr_fun(mask_ref_changed), this);
_mask_ref_connection = cs2.connect(sl2);
this->avoidRef = new SPAvoidRef(this);
SPItem::isExplicitlyHidden() const
{
return (this->style->display.set
- && this->style->display.value == SP_CSS_DISPLAY_NONE);
+ && this->style->display.value == SP_CSS_DISPLAY_NONE);
}
/**
@@ -663,7 +661,7 @@ sp_item_write(SPObject *const object, Inkscape::XML::Document *xml_doc, Inkscape
SPObject *child;
SPItem *item = SP_ITEM(object);
- // in the case of SP_OBJECT_WRITE_BUILD, the item should always be newly created,
+ // in the case of SP_OBJECT_WRITE_BUILD, the item should always be newly created,
// so we need to add any children from the underlying object to the new repr
if (flags & SP_OBJECT_WRITE_BUILD) {
Inkscape::XML::Node *crepr;
@@ -749,7 +747,7 @@ sp_item_invoke_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transf
/** Calls \a item's subclass' bounding box method; clips it by the bbox of clippath, if any; and
* unions the resulting bbox with \a bbox. If \a clear is true, empties \a bbox first. Passes the
* transform and the flags to the actual bbox methods. Note that many of subclasses (e.g. groups,
- * clones), in turn, call this function in their bbox methods.
+ * clones), in turn, call this function in their bbox methods.
* \retval bbox Note that there is no guarantee that bbox will contain a rectangle when the
* function returns. If this item does not have a boundingbox, this might well be empty.
*/
@@ -792,7 +790,7 @@ sp_item_invoke_bbox_full(SPItem const *item, Geom::OptRect &bbox, Geom::Matrix c
y = SP_FILTER(filter)->y.computed;
if (SP_FILTER(filter)->width._set)
w = SP_FILTER(filter)->width.computed;
- if (SP_FILTER(filter)->height._set)
+ if (SP_FILTER(filter)->height._set)
h = SP_FILTER(filter)->height.computed;
double dx0 = 0;
@@ -800,7 +798,7 @@ sp_item_invoke_bbox_full(SPItem const *item, Geom::OptRect &bbox, Geom::Matrix c
double dy0 = 0;
double dy1 = 0;
if (filter_is_single_gaussian_blur(SP_FILTER(filter))) {
- // if this is a single blur, use 2.4*radius
+ // if this is a single blur, use 2.4*radius
// which may be smaller than the default area;
// see set_filter_area for why it's 2.4
double r = get_single_gaussian_blur_radius (SP_FILTER(filter));
@@ -838,11 +836,11 @@ sp_item_invoke_bbox_full(SPItem const *item, Geom::OptRect &bbox, Geom::Matrix c
}
if (temp_bbox.x0 > temp_bbox.x1 || temp_bbox.y0 > temp_bbox.y1) {
- // Either the bbox hasn't been touched by the SPItemClass' bbox method
+ // Either the bbox hasn't been touched by the SPItemClass' bbox method
// (it still has its initial values, see above: x0 = y0 = NR_HUGE and x1 = y1 = -NR_HUGE)
// or it has explicitely been set to be like this (e.g. in sp_shape_bbox)
-
- // When x0 > x1 or y0 > y1, the bbox is considered to be "nothing", although it has not been
+
+ // When x0 > x1 or y0 > y1, the bbox is considered to be "nothing", although it has not been
// explicitely defined this way for NRRects (as opposed to Geom::OptRect)
// So union bbox with nothing = do nothing, just return
return;
return rect;
}
-static void sp_item_private_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_item_private_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const */*snapprefs*/)
{
- /* This will only be called if the derived class doesn't override this.
- * see for example sp_genericellipse_snappoints in sp-ellipse.cpp
- * We don't know what shape we could be dealing with here, so we'll just
- * return the corners of the bounding box */
+ /* This will only be called if the derived class doesn't override this.
+ * see for example sp_genericellipse_snappoints in sp-ellipse.cpp
+ * We don't know what shape we could be dealing with here, so we'll just
+ * return the corners of the bounding box */
+
+ Geom::OptRect bbox = item->getBounds(sp_item_i2d_affine(item));
- Geom::OptRect bbox = item->getBounds(sp_item_i2d_affine(item));
-
if (bbox) {
Geom::Point p1, p2;
p1 = bbox->min();
@@ -955,12 +953,12 @@ static void sp_item_private_snappoints(SPItem const *item, SnapPointsIter p, Ink
*p = p2;
*p = Geom::Point(p1[Geom::Y], p2[Geom::X]);
}
-
+
}
void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
{
- g_assert (item != NULL);
+ g_assert (item != NULL);
g_assert (SP_IS_ITEM(item));
// Get the snappoints of the item
@@ -971,32 +969,32 @@ void sp_item_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPref
// Get the snappoints at the item's center
if (snapprefs != NULL && snapprefs->getIncludeItemCenter()) {
- *p = item->getCenter();
- }
-
+ *p = item->getCenter();
+ }
+
// Get the snappoints of clipping paths and mask, if any
std::list<SPObject const *> clips_and_masks;
-
+
clips_and_masks.push_back(SP_OBJECT(item->clip_ref->getObject()));
clips_and_masks.push_back(SP_OBJECT(item->mask_ref->getObject()));
-
+
for (std::list<SPObject const *>::const_iterator o = clips_and_masks.begin(); o != clips_and_masks.end(); o++) {
- if (*o) {
- // obj is a group object, the children are the actual clippers
- for (SPObject *child = (*o)->children ; child ; child = child->next) {
- if (SP_IS_ITEM(child)) {
- std::vector<Geom::Point> p_clip_or_mask;
- // Please note the recursive call here!
- sp_item_snappoints(SP_ITEM(child), SnapPointsIter(p_clip_or_mask), snapprefs);
- // Take into account the transformation of the item being clipped or masked
- for (std::vector<Geom::Point>::const_iterator p_orig = p_clip_or_mask.begin(); p_orig != p_clip_or_mask.end(); p_orig++) {
- // All snappoints are in desktop coordinates, but the item's transformation is
- // in document coordinates. Hence the awkward construction below
- *p = (*p_orig) * matrix_to_desktop (matrix_from_desktop (item->transform, item), item);
- }
- }
- }
- }
+ if (*o) {
+ // obj is a group object, the children are the actual clippers
+ for (SPObject *child = (*o)->children ; child ; child = child->next) {
+ if (SP_IS_ITEM(child)) {
+ std::vector<Geom::Point> p_clip_or_mask;
+ // Please note the recursive call here!
+ sp_item_snappoints(SP_ITEM(child), SnapPointsIter(p_clip_or_mask), snapprefs);
+ // Take into account the transformation of the item being clipped or masked
+ for (std::vector<Geom::Point>::const_iterator p_orig = p_clip_or_mask.begin(); p_orig != p_clip_or_mask.end(); p_orig++) {
+ // All snappoints are in desktop coordinates, but the item's transformation is
+ // in document coordinates. Hence the awkward construction below
+ *p = (*p_orig) * matrix_to_desktop (matrix_from_desktop (item->transform, item), item);
+ }
+ }
+ }
+ }
}
}
@@ -1368,7 +1366,7 @@ sp_item_adjust_livepatheffect (SPItem *item, Geom::Matrix const &postmul, bool s
if (new_lpeobj != lpeobj) {
sp_lpe_item_replace_path_effect(lpeitem, lpeobj, new_lpeobj);
}
-
+
if (lpeobj->get_lpe()) {
Inkscape::LivePathEffect::Effect * effect = lpeobj->get_lpe();
effect->transform_multiply(postmul, set);
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
int prefs_bbox = prefs->getInt("/tools/bounding_box", 0);
- SPItem::BBoxType bbox_type = (prefs_bbox ==0)?
+ SPItem::BBoxType bbox_type = (prefs_bbox ==0)?
SPItem::APPROXIMATE_BBOX : SPItem::GEOMETRIC_BBOX;
Geom::OptRect bbox = sp_item_bbox_desktop(item, bbox_type);
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index c568b44be7479f200f7ec54c1f9a5b3f08160c52..6030991e27cd71ef5a89c370ea0f5f132bc75a51 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
-#define __SP_RECT_C__
-
/*
* SVG <rect> implementation
*
/**
* Sets the snappoint p to the unrounded corners of the rectangle
*/
-static void sp_rect_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_rect_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const */*snapprefs*/)
{
/* This method overrides sp_shape_snappoints, which is the default for any shape. The default method
returns all eight points along the path of a rounded rectangle, but not the real corners. Snapping
- the startpoint and endpoint of each rounded corner is not very usefull and really confusing. Instead
+ the startpoint and endpoint of each rounded corner is not very usefull and really confusing. Instead
we could snap either the real corners, or not snap at all. Bulia Byak opted to snap the real corners,
- but it should be noted that this might be confusing in some cases with relatively large radii. With
+ but it should be noted that this might be confusing in some cases with relatively large radii. With
small radii though the user will easily understand which point is snapping. */
-
+
g_assert(item != NULL);
g_assert(SP_IS_RECT(item));
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 9266297bef3772cb622d0612f58fcbb97e5a7df9..8627e179ffbc88dc0fc7d4eb29e2dd98c8429dd6 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
SPStyle *style = SP_OBJECT_STYLE(text);
font_instance *tf = font_factory::Default()->FaceFromStyle(style);
-
+
char name_buf[256];
char *n;
if (tf) {
return ret;
}
-static void sp_text_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_text_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const */*snapprefs*/)
{
// the baseline anchor of the first char
Inkscape::Text::Layout const *layout = te_get_layout((SPItem *) item);