From 36b0d3d98750412f72b7d069eeec6ef99b0178ea Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 26 May 2023 01:39:54 +0200 Subject: [PATCH] Update cairo patch --- CMakeScripts/blah.diff | 10267 ++++++++++++++++++++++++++++++++++ packaging/cairo.patch | 1334 +++-- src/3rdparty/CMakeLists.txt | 2 +- src/display/cairo-utils.cpp | 4 +- src/display/cairo-utils.h | 2 +- src/display/dither-lock.h | 4 +- 6 files changed, 11059 insertions(+), 554 deletions(-) create mode 100644 CMakeScripts/blah.diff diff --git a/CMakeScripts/blah.diff b/CMakeScripts/blah.diff new file mode 100644 index 0000000000..41853cb6b2 --- /dev/null +++ b/CMakeScripts/blah.diff @@ -0,0 +1,10267 @@ +diff --git a/.clang-tidy b/.clang-tidy +index 161c1302c8..d5f4b039cd 100644 +--- a/.clang-tidy ++++ b/.clang-tidy +@@ -1,5 +1,5 @@ + # SPDX-License-Identifier: GPL-2.0-or-later +-Checks: '-*, modernize-deprecated-headers, modernize-loop-convert, modernize-use-override, modernize-redundant-void-arg, modernize-use-emplace, modernize-use-noexcept, modernize-use-bool-literals, modernize-pass-by-value, modernize-use-equals-delete' ++Checks: '-*, modernize-deprecated-headers, modernize-loop-convert, modernize-use-override, modernize-redundant-void-arg, modernize-use-emplace, modernize-use-noexcept, modernize-use-bool-literals, modernize-pass-by-value, modernize-use-equals-delete, bugprone-*' + #, modernize-use-equals-default (gave false results) + #, readability-*, bugprone-*' + WarningsAsErrors: '' +diff --git a/src/3rdparty/2geom b/src/3rdparty/2geom +--- a/src/3rdparty/2geom ++++ b/src/3rdparty/2geom +@@ -1 +1 @@ +-Subproject commit a54359b4266dafce130727350b7108575b8014dc ++Subproject commit a54359b4266dafce130727350b7108575b8014dc-dirty +diff --git a/src/3rdparty/autotrace/autotrace.h b/src/3rdparty/autotrace/autotrace.h +index dc49be1df6..4e51d94fb4 100644 +--- a/src/3rdparty/autotrace/autotrace.h ++++ b/src/3rdparty/autotrace/autotrace.h +@@ -56,7 +56,7 @@ extern "C" { + AT_MSG_WARNING, + }; + +- typedef struct _at_fitting_opts_type at_fitting_opts_type; ++ typedef struct at_fitting_opts_type at_fitting_opts_type; + typedef struct _at_input_opts_type at_input_opts_type; + typedef struct _at_output_opts_type at_output_opts_type; + typedef struct _at_bitmap at_bitmap; +@@ -109,7 +109,7 @@ extern "C" { + /* Fitting option. + With using at_fitting_opts_doc macro, the description of + each option could be get. e.g. at_fitting_opts_doc(background_color) */ +- struct _at_fitting_opts_type { ++ struct at_fitting_opts_type { + #define at_doc__background_color \ + N_("background-color : the color of the background that " \ + "should be ignored, for example FFFFFF; " \ +diff --git a/src/3rdparty/libcroco b/src/3rdparty/libcroco +--- a/src/3rdparty/libcroco ++++ b/src/3rdparty/libcroco +@@ -1 +1 @@ +-Subproject commit b9e4b47fc7c63abc880bad35d61048294afdea38 ++Subproject commit b9e4b47fc7c63abc880bad35d61048294afdea38-dirty +diff --git a/src/actions/actions-extra-data.cpp b/src/actions/actions-extra-data.cpp +index ffce571da8..a14b30711e 100644 +--- a/src/actions/actions-extra-data.cpp ++++ b/src/actions/actions-extra-data.cpp +@@ -57,7 +57,7 @@ Glib::ustring InkActionExtraData::get_tooltip_for_action(Glib::ustring const &ac + Glib::ustring value; + auto search = data.find(action_name); + if (search != data.end()) { +- if (expanded && strncmp(action_name.c_str(), "win:tool-switch('", 17)) { ++ if (expanded && strncmp(action_name.c_str(), "win:tool-switch('", 17) != 0) { + value = translated ? ("" + Glib::ustring(_(search->second.label.c_str())) + "\n" + + Glib::ustring(_(search->second.tooltip.c_str()))) + : (search->second.label + "\n" + search->second.tooltip); +diff --git a/src/actions/actions-object-align.cpp b/src/actions/actions-object-align.cpp +index 63b7c2493c..0727af49af 100644 +--- a/src/actions/actions-object-align.cpp ++++ b/src/actions/actions-object-align.cpp +@@ -440,7 +440,7 @@ object_distribute_text(const Glib::VariantBase& value, InkscapeApplication *app) + if (base[Geom::Y] < b_min[Geom::Y]) b_min[Geom::Y] = base[Geom::Y]; + if (base[Geom::X] > b_max[Geom::X]) b_max[Geom::X] = base[Geom::X]; + if (base[Geom::Y] > b_max[Geom::Y]) b_max[Geom::Y] = base[Geom::Y]; +- baselines.emplace_back(Baseline(item, base, orientation)); ++ baselines.emplace_back(item, base, orientation); + } + } + } +diff --git a/src/attribute-rel-css.h b/src/attribute-rel-css.h +index b00162aa0b..35c471bfad 100644 +--- a/src/attribute-rel-css.h ++++ b/src/attribute-rel-css.h +@@ -8,7 +8,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __SP_ATTRIBUTE_REL_CSS_H__ +-#define __SP_ATTRIBUTE_REL_CSS_H__ ++#define SP_ATTRIBUTE_REL_CSS_H_ + + /* + * attribute-rel-css.h +diff --git a/src/attribute-rel-svg.h b/src/attribute-rel-svg.h +index 9cd5718517..1d958d641c 100644 +--- a/src/attribute-rel-svg.h ++++ b/src/attribute-rel-svg.h +@@ -8,7 +8,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __SP_ATTRIBUTE_REL_SVG_H__ +-#define __SP_ATTRIBUTE_REL_SVG_H__ ++#define SP_ATTRIBUTE_REL_SVG_H_ + + /* + * attribute-rel-svg.h +diff --git a/src/attribute-sort-util.h b/src/attribute-sort-util.h +index d0dcc55e5a..99ee5082b3 100644 +--- a/src/attribute-sort-util.h ++++ b/src/attribute-sort-util.h +@@ -10,7 +10,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __SP_ATTRIBUTE_SORT_UTIL_H__ +-#define __SP_ATTRIBUTE_SORT_UTIL_H__ ++#define SP_ATTRIBUTE_SORT_UTIL_H_ + + #include "xml/node.h" + +diff --git a/src/attributes.h b/src/attributes.h +index 2b17b09275..8e27f645b8 100644 +--- a/src/attributes.h ++++ b/src/attributes.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_ATTRIBUTES_H__ +-#define __SP_ATTRIBUTES_H__ ++#define SP_ATTRIBUTES_H_ + + /** \file + * Lookup dictionary for attributes/properties. +diff --git a/src/conditions.cpp b/src/conditions.cpp +index e092ddc8fa..5f485e0317 100644 +--- a/src/conditions.cpp ++++ b/src/conditions.cpp +@@ -35,7 +35,7 @@ static bool evaluateRequiredFeatures(SPItem const *item, gchar const *value); + static bool evaluateRequiredExtensions(SPItem const *item, gchar const *value); + + /* define any conditional attributes and their handler functions in this array */ +-static Condition _condition_handlers[] = { ++static Condition condition_handlers[] = { + { "systemLanguage", evaluateSystemLanguage }, + { "requiredFeatures", evaluateRequiredFeatures }, + { "requiredExtensions", evaluateRequiredExtensions }, +@@ -44,9 +44,9 @@ static Condition _condition_handlers[] = { + // function which evaluates if item should be displayed + bool sp_item_evaluate(SPItem const *item) { + bool needDisplay = true; +- for ( unsigned int i = 0 ; needDisplay && (i < sizeof(_condition_handlers) / sizeof(_condition_handlers[0])) ; i++ ) { +- gchar const *value = item->getAttribute(_condition_handlers[i].attribute); +- if ( value && !_condition_handlers[i].evaluator(item, value) ) { ++ for ( unsigned int i = 0 ; needDisplay && (i < sizeof(condition_handlers) / sizeof(condition_handlers[0])) ; i++ ) { ++ gchar const *value = item->getAttribute(condition_handlers[i].attribute); ++ if ( value && !condition_handlers[i].evaluator(item, value) ) { + needDisplay = false; + } + } +diff --git a/src/desktop-events.h b/src/desktop-events.h +index 9361cdeaf5..933b343bc0 100644 +--- a/src/desktop-events.h ++++ b/src/desktop-events.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __DESKTOP_EVENTS_H__ +-#define __DESKTOP_EVENTS_H__ ++#define DESKTOP_EVENTS_H_ + + /* + * Entry points for event distribution +diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp +index 4117308c3e..a61a230aa5 100644 +--- a/src/desktop-style.cpp ++++ b/src/desktop-style.cpp +@@ -295,7 +295,7 @@ sp_desktop_get_color(SPDesktop *desktop, bool is_fill) + "#000"); + + if (desktop->current && property) { // if there is style and the property in it, +- if (strncmp(property, "url", 3)) { // and if it's not url, ++ if (strncmp(property, "url", 3) != 0) { // and if it's not url, + // read it + r = sp_svg_read_color(property, r); + } +@@ -382,7 +382,7 @@ sp_desktop_get_color_tool(SPDesktop *desktop, Glib::ustring const &tool, bool is + gchar const *property = sp_repr_css_property(css, is_fill ? "fill" : "stroke", "#000"); + + if (desktop->current && property) { // if there is style and the property in it, +- if (strncmp(property, "url", 3) && strncmp(property, "none", 4)) { // and if it's not url or none, ++ if (strncmp(property, "url", 3) != 0 && strncmp(property, "none", 4)) { // and if it's not url or none, + // read it + r = sp_svg_read_color(property, r); + if (has_color) +@@ -1456,7 +1456,7 @@ objects_query_fontfeaturesettings (const std::vector &objects, SPStyle + + if (style_res->font_feature_settings.set && // + strcmp(style_res->font_feature_settings.value(), +- style->font_feature_settings.value())) { ++ style->font_feature_settings.value()) != 0) { + different = true; // different fonts + } + +@@ -1599,7 +1599,7 @@ objects_query_fontfamily (const std::vector &objects, SPStyle *style_re + texts ++; + + if (style_res->font_family.set && // +- strcmp(style_res->font_family.value(), style->font_family.value())) { ++ strcmp(style_res->font_family.value(), style->font_family.value()) != 0) { + different = true; // different fonts + } + +diff --git a/src/desktop.cpp b/src/desktop.cpp +index 22f195b647..1b53955952 100644 +--- a/src/desktop.cpp ++++ b/src/desktop.cpp +@@ -75,18 +75,18 @@ + namespace Inkscape { namespace XML { class Node; }} + + // Callback declarations +-static bool _drawing_handler (GdkEvent *event, Inkscape::DrawingItem *item, SPDesktop *desktop); +-static void _reconstruction_start(SPDesktop * desktop); +-static void _reconstruction_finish(SPDesktop * desktop); ++static bool drawing_handler (GdkEvent *event, Inkscape::DrawingItem *item, SPDesktop *desktop); ++static void reconstruction_start(SPDesktop * desktop); ++static void reconstruction_finish(SPDesktop * desktop); + +-static gdouble _pinch_begin_zoom = 1.; ++static gdouble pinch_begin_zoom = 1.; + +-static void _pinch_begin_handler(GtkGesture *gesture, GdkEventSequence *sequence, SPDesktop *desktop) ++static void pinch_begin_handler(GtkGesture *gesture, GdkEventSequence *sequence, SPDesktop *desktop) + { +- _pinch_begin_zoom = desktop->current_zoom(); ++ pinch_begin_zoom = desktop->current_zoom(); + } + +-static void _pinch_scale_changed_handler(GtkGesture *gesture, gdouble delta, SPDesktop *desktop) ++static void pinch_scale_changed_handler(GtkGesture *gesture, gdouble delta, SPDesktop *desktop) + { + GdkEventSequence *sequence = gtk_gesture_get_last_updated_sequence(gesture); + const GdkEvent *event = gtk_gesture_get_last_event(gesture, sequence); +@@ -95,7 +95,7 @@ static void _pinch_scale_changed_handler(GtkGesture *gesture, gdouble delta, SPD + Geom::Point button_world = desktop->getCanvas()->canvas_to_world(button_window); + Geom::Point button_dt(desktop->w2d(button_world)); + +- desktop->zoom_absolute(button_dt, _pinch_begin_zoom * delta); ++ desktop->zoom_absolute(button_dt, pinch_begin_zoom * delta); + } + + SPDesktop::SPDesktop() +@@ -216,7 +216,7 @@ SPDesktop::init (SPNamedView *nv, Inkscape::UI::Widget::Canvas *acanvas, SPDeskt + canvas_catchall->connect_event(sigc::bind(sigc::ptr_fun(sp_desktop_root_handler), this)); + + canvas_drawing = new Inkscape::CanvasItemDrawing(canvas_group_drawing); +- canvas_drawing->connect_drawing_event(sigc::bind(sigc::ptr_fun(_drawing_handler), this)); ++ canvas_drawing->connect_drawing_event(sigc::bind(sigc::ptr_fun(drawing_handler), this)); + canvas->set_drawing(canvas_drawing->get_drawing()); // Canvas needs access. + + Inkscape::DrawingItem *drawing_item = document->getRoot()->invoke_show( +@@ -244,15 +244,15 @@ SPDesktop::init (SPNamedView *nv, Inkscape::UI::Widget::Canvas *acanvas, SPDeskt + // pinch zoom + zoomgesture = gtk_gesture_zoom_new(GTK_WIDGET(canvas->gobj())); + gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (zoomgesture), GTK_PHASE_CAPTURE); +- g_signal_connect(zoomgesture, "begin", G_CALLBACK(_pinch_begin_handler), this); +- g_signal_connect(zoomgesture, "scale-changed", G_CALLBACK(_pinch_scale_changed_handler), this); ++ g_signal_connect(zoomgesture, "begin", G_CALLBACK(pinch_begin_handler), this); ++ g_signal_connect(zoomgesture, "scale-changed", G_CALLBACK(pinch_scale_changed_handler), this); + + /* Set up notification of rebuilding the document, this allows + for saving object related settings in the document. */ + _reconstruction_start_connection = +- document->connectReconstructionStart(sigc::bind(sigc::ptr_fun(_reconstruction_start), this)); ++ document->connectReconstructionStart(sigc::bind(sigc::ptr_fun(reconstruction_start), this)); + _reconstruction_finish_connection = +- document->connectReconstructionFinish(sigc::bind(sigc::ptr_fun(_reconstruction_finish), this)); ++ document->connectReconstructionFinish(sigc::bind(sigc::ptr_fun(reconstruction_finish), this)); + _reconstruction_old_layer_id.clear(); + } + +@@ -1422,7 +1422,7 @@ SPDesktop::onDocumentFilenameSet (gchar const* filename) + * Calls event handler of current event context. + */ + static bool +-_drawing_handler (GdkEvent *event, Inkscape::DrawingItem *drawing_item, SPDesktop *desktop) ++drawing_handler (GdkEvent *event, Inkscape::DrawingItem *drawing_item, SPDesktop *desktop) + { + if (event->type == GDK_KEY_PRESS && Inkscape::UI::Tools::get_latin_keyval(&event->key) == GDK_KEY_space && + desktop->event_context->is_space_panning()) +@@ -1441,7 +1441,7 @@ _drawing_handler (GdkEvent *event, Inkscape::DrawingItem *drawing_item, SPDeskto + } + + /// Called when document is starting to be rebuilt. +-static void _reconstruction_start(SPDesktop * desktop) ++static void reconstruction_start(SPDesktop * desktop) + { + auto layer = desktop->layerManager().currentLayer(); + desktop->_reconstruction_old_layer_id = layer->getId() ? layer->getId() : ""; +@@ -1451,7 +1451,7 @@ static void _reconstruction_start(SPDesktop * desktop) + } + + /// Called when document rebuild is finished. +-static void _reconstruction_finish(SPDesktop * desktop) ++static void reconstruction_finish(SPDesktop * desktop) + { + g_debug("Desktop, finishing reconstruction\n"); + if ( !desktop->_reconstruction_old_layer_id.empty() ) { +diff --git a/src/display/cairo-templates.h b/src/display/cairo-templates.h +index d23343e456..3f390356df 100644 +--- a/src/display/cairo-templates.h ++++ b/src/display/cairo-templates.h +@@ -25,11 +25,13 @@ + static const int OPENMP_THRESHOLD = 2048; + #endif + +-#include + #include + #include +-#include "display/nr-3dutils.h" ++#include ++#include ++ + #include "display/cairo-utils.h" ++#include "display/nr-3dutils.h" + + /** + * Blend two surfaces using the supplied functor. +@@ -109,7 +111,7 @@ void ink_cairo_surface_blend(cairo_surface_t *in1, cairo_surface_t *in2, cairo_s + #endif + for (int i = 0; i < h; ++i) { + guint32 *in1_p = in1_data + i * stride1/4; +- guint8 *in2_p = reinterpret_cast(in2_data) + i * stride2; ++ guint8 *in2_p = reinterpret_cast(in2_data) + static_cast(i * )stride2; + guint32 *out_p = out_data + i * strideout/4; + for (int j = 0; j < w; ++j) { + guint32 in2_px = *in2_p; +@@ -126,7 +128,7 @@ void ink_cairo_surface_blend(cairo_surface_t *in1, cairo_surface_t *in2, cairo_s + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = 0; i < h; ++i) { +- guint8 *in1_p = reinterpret_cast(in1_data) + i * stride1; ++ guint8 *in1_p = reinterpret_cast(in1_data) + static_cast(i * )stride1; + guint32 *in2_p = in2_data + i * stride2/4; + guint32 *out_p = out_data + i * strideout/4; + for (int j = 0; j < w; ++j) { +@@ -156,9 +158,9 @@ void ink_cairo_surface_blend(cairo_surface_t *in1, cairo_surface_t *in2, cairo_s + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = 0; i < h; ++i) { +- guint8 *in1_p = reinterpret_cast(in1_data) + i * stride1; +- guint8 *in2_p = reinterpret_cast(in2_data) + i * stride2; +- guint8 *out_p = reinterpret_cast(out_data) + i * strideout; ++ guint8 *in1_p = reinterpret_cast(in1_data) + static_cast(i * )stride1; ++ guint8 *in2_p = reinterpret_cast(in2_data) + static_cast(i * )stride2; ++ guint8 *out_p = reinterpret_cast(out_data) + static_cast(i * )strideout; + for (int j = 0; j < w; ++j) { + guint32 in1_px = *in1_p; in1_px <<= 24; + guint32 in2_px = *in2_p; in2_px <<= 24; +@@ -259,7 +261,7 @@ void ink_cairo_surface_filter(cairo_surface_t *in, cairo_surface_t *out, Filter + #endif + for (int i = 0; i < h; ++i) { + guint32 *in_p = in_data + i * stridein/4; +- guint8 *out_p = reinterpret_cast(out_data) + i * strideout; ++ guint8 *out_p = reinterpret_cast(out_data) + static_cast(i * )strideout; + for (int j = 0; j < w; ++j) { + guint32 out_px = filter(*in_p); + *out_p = out_px >> 24; +@@ -285,8 +287,8 @@ void ink_cairo_surface_filter(cairo_surface_t *in, cairo_surface_t *out, Filter + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = 0; i < h; ++i) { +- guint8 *in_p = reinterpret_cast(in_data) + i * stridein; +- guint8 *out_p = reinterpret_cast(out_data) + i * strideout; ++ guint8 *in_p = reinterpret_cast(in_data) + static_cast(i * )stridein; ++ guint8 *out_p = reinterpret_cast(out_data) + static_cast(i * )strideout; + for (int j = 0; j < w; ++j) { + guint32 in_px = *in_p; in_px <<= 24; + guint32 out_px = filter(in_px); +@@ -311,7 +313,7 @@ void ink_cairo_surface_filter(cairo_surface_t *in, cairo_surface_t *out, Filter + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = 0; i < h; ++i) { +- guint8 *in_p = reinterpret_cast(in_data) + i * stridein; ++ guint8 *in_p = reinterpret_cast(in_data) + static_cast(i * )stridein; + guint32 *out_p = out_data + i * strideout/4; + for (int j = 0; j < w; ++j) { + out_p[j] = filter(guint32(in_p[j]) << 24); +@@ -356,7 +358,7 @@ void ink_cairo_surface_synthesize(cairo_surface_t *out, cairo_rectangle_t const + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = out_area.y; i < h; ++i) { +- guint32 *out_p = reinterpret_cast(out_data + i * strideout); ++ guint32 *out_p = reinterpret_cast(out_data + static_cast(i * )strideout); + for (int j = out_area.x; j < w; ++j) { + *out_p = synth(j, i); + ++out_p; +@@ -368,7 +370,7 @@ void ink_cairo_surface_synthesize(cairo_surface_t *out, cairo_rectangle_t const + #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) + #endif + for (int i = out_area.y; i < h; ++i) { +- guint8 *out_p = out_data + i * strideout; ++ guint8 *out_p = out_data + static_cast(i * )strideout; + for (int j = out_area.x; j < w; ++j) { + guint32 out_px = synth(j, i); + *out_p = out_px >> 24; +@@ -407,19 +409,19 @@ struct SurfaceSynth { + + guint32 pixelAt(int x, int y) const { + if (_alpha) { +- unsigned char *px = _px + y*_stride + x; ++ unsigned char *px = _px + static_cast(y*)_stride + x; + return *px << 24; + } else { +- unsigned char *px = _px + y*_stride + x*4; ++ unsigned char *px = _px + y*_stride + static_cast(x*)4; + return *reinterpret_cast(px); + } + } + guint32 alphaAt(int x, int y) const { + if (_alpha) { +- unsigned char *px = _px + y*_stride + x; ++ unsigned char *px = _px + static_cast(y*)_stride + x; + return *px; + } else { +- unsigned char *px = _px + y*_stride + x*4; ++ unsigned char *px = _px + y*_stride + static_cast(x*)4; + guint32 p = *reinterpret_cast(px); + return (p & 0xff000000) >> 24; + } +@@ -436,7 +438,7 @@ struct SurfaceSynth { + guint32 xif = round((x - xf) * 255), yif = round((y - yf) * 255); + guint32 p00, p01, p10, p11; + +- unsigned char *pxi = _px + yi*_stride + xi*4; ++ unsigned char *pxi = _px + yi*_stride + static_cast(xi*)4; + guint32 *pxu = reinterpret_cast(pxi); + guint32 *pxl = reinterpret_cast(pxi + _stride); + p00 = *pxu; p10 = *(pxu + 1); +@@ -469,12 +471,12 @@ struct SurfaceSynth { + guint32 xif = round((x - xf) * 255), yif = round((y - yf) * 255); + guint32 p00, p01, p10, p11; + if (_alpha) { +- unsigned char *pxu = _px + yi*_stride + xi; ++ unsigned char *pxu = _px + static_cast(yi*)_stride + xi; + unsigned char *pxl = pxu + _stride; + p00 = *pxu; p10 = *(pxu + 1); + p01 = *pxl; p11 = *(pxl + 1); + } else { +- unsigned char *pxi = _px + yi*_stride + xi*4; ++ unsigned char *pxi = _px + yi*_stride + static_cast(xi*)4; + guint32 *pxu = reinterpret_cast(pxi); + guint32 *pxl = reinterpret_cast(pxi + _stride); + p00 = (*pxu & 0xff000000) >> 24; p10 = (*(pxu + 1) & 0xff000000) >> 24; +diff --git a/src/display/cairo-utils.cpp b/src/display/cairo-utils.cpp +index 21ffb79d7b..8856c93a06 100644 +--- a/src/display/cairo-utils.cpp ++++ b/src/display/cairo-utils.cpp +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1090,7 +1091,7 @@ ink_cairo_surface_copy(cairo_surface_t *s) + cairo_surface_flush(s); + int stride = cairo_image_surface_get_stride(s); + int h = cairo_image_surface_get_height(s); +- memcpy(cairo_image_surface_get_data(ns), cairo_image_surface_get_data(s), stride * h); ++ memcpy(cairo_image_surface_get_data(ns), cairo_image_surface_get_data(s), static_cast(stride * )h); + cairo_surface_mark_dirty(ns); + } else { + // generic implementation +@@ -1203,7 +1204,7 @@ ink_cairo_surface_blit(cairo_surface_t *src, cairo_surface_t *dest) + cairo_surface_flush(src); + int stride = cairo_image_surface_get_stride(src); + int h = cairo_image_surface_get_height(src); +- memcpy(cairo_image_surface_get_data(dest), cairo_image_surface_get_data(src), stride * h); ++ memcpy(cairo_image_surface_get_data(dest), cairo_image_surface_get_data(src), static_cast(stride * )h); + cairo_surface_mark_dirty(dest); + } else { + // generic implementation +@@ -1249,7 +1250,7 @@ static int ink_cairo_surface_average_color_internal(cairo_surface_t *surface, do + /* TODO convert this to OpenMP somehow */ + for (int y = 0; y < height; ++y, data += stride) { + for (int x = 0; x < width; ++x) { +- guint32 px = *reinterpret_cast(data + 4*x); ++ guint32 px = *reinterpret_cast(data + static_cast(4*)x); + EXTRACT_ARGB32(px, a,r,g,b) + rf += r / 255.0; + gf += g / 255.0; +@@ -1827,7 +1828,7 @@ guint32 rgba_from_argb32(guint32 c) + const guchar* pixbuf_to_png(guchar const**rows, guchar* px, int num_rows, int num_cols, int stride, int color_type, int bit_depth) + { + int n_fields = 1 + (color_type&2) + (color_type&4)/4; +- const guchar* new_data = (const guchar*)malloc(((n_fields * bit_depth * num_cols + 7)/8) * num_rows); ++ const guchar* new_data = (const guchar*)malloc(static_cast(((n_fields * bit_depth * num_cols + 7)/8) * )num_rows); + char* ptr = (char*) new_data; + // Used when we write image data smaller than one byte (for instance in + // black and white images where 1px = 1bit). Only possible with greyscale. +@@ -1835,7 +1836,7 @@ const guchar* pixbuf_to_png(guchar const**rows, guchar* px, int num_rows, int nu + for (int row = 0; row < num_rows; ++row) { + rows[row] = (const guchar*)ptr; + for (int col = 0; col < num_cols; ++col) { +- guint32 *pixel = reinterpret_cast(px + row*stride)+col; ++ guint32 *pixel = reinterpret_cast(px + static_cast(row*)stride)+col; + + guint64 pix3 = (*pixel & 0xff000000) >> 24; + guint64 pix2 = (*pixel & 0x00ff0000) >> 16; +diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h +index fb1e3fd43d..af66ed863f 100644 +--- a/src/display/cairo-utils.h ++++ b/src/display/cairo-utils.h +@@ -18,7 +18,7 @@ + #include "style.h" + + struct SPColor; +-typedef struct _GdkPixbuf GdkPixbuf; ++typedef struct GdkPixbuf GdkPixbuf; + + void ink_cairo_pixbuf_cleanup(unsigned char *, void *); + +@@ -167,13 +167,13 @@ std::optional extract_pathvector_from_cairo(cairo_t *ct); + + #define EXTRACT_ARGB32(px,a,r,g,b) \ + guint32 a, r, g, b; \ +- a = ((px) & 0xff000000) >> 24; \ +- r = ((px) & 0x00ff0000) >> 16; \ +- g = ((px) & 0x0000ff00) >> 8; \ +- b = ((px) & 0x000000ff); ++ (a) = ((px) & 0xff000000) >> 24; \ ++ (r) = ((px) & 0x00ff0000) >> 16; \ ++ (g) = ((px) & 0x0000ff00) >> 8; \ ++ (b) = ((px) & 0x000000ff); + + #define ASSEMBLE_ARGB32(px,a,r,g,b) \ +- guint32 px = (a << 24) | (r << 16) | (g << 8) | b; ++ guint32 px = ((a) << 24) | ((r) << 16) | ((g) << 8) | (b); + + inline double srgb_to_linear( const double c ) { + if( c < 0.04045 ) { +diff --git a/src/display/control/canvas-item-ctrl.cpp b/src/display/control/canvas-item-ctrl.cpp +index e0dcd90632..3cb148aca6 100644 +--- a/src/display/control/canvas-item-ctrl.cpp ++++ b/src/display/control/canvas-item-ctrl.cpp +@@ -14,14 +14,14 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "canvas-item-ctrl.h" ++ + #include <2geom/transforms.h> ++#include + +-#include "canvas-item-ctrl.h" ++#include "display/cairo-utils.h" // argb32_from_rgba() + #include "helper/geom.h" +- + #include "preferences.h" // Default size. +-#include "display/cairo-utils.h" // argb32_from_rgba() +- + #include "ui/widget/canvas.h" + + namespace Inkscape { +@@ -303,7 +303,7 @@ void CanvasItemCtrl::_render(CanvasItemBuffer &buf) const + uint32_t backcolor = get_canvas()->get_effective_background(); + uint32_t *p = _cache.get(); + for (int i = 0; i < height; ++i) { +- auto pb = reinterpret_cast(pxb + i * strideb); ++ auto pb = reinterpret_cast(pxb + static_cast(i * )strideb); + for (int j = 0; j < width; ++j) { + uint32_t base = *pb; + uint32_t cc = *p++; +@@ -1089,7 +1089,7 @@ void CanvasItemCtrl::build_cache(int device_scale) const + unsigned char* pxb = work->get_data(); + auto p = _cache.get(); + for (int i = 0; i < device_scale * size; ++i) { +- auto pb = reinterpret_cast(pxb + i * strideb); ++ auto pb = reinterpret_cast(pxb + static_cast(i * )strideb); + for (int j = 0; j < width; ++j) { + + if (triangles) { +@@ -1120,7 +1120,7 @@ void CanvasItemCtrl::build_cache(int device_scale) const + unsigned int rs = _pixbuf->get_rowstride(); + for (int y = 0; y < height/device_scale; y++){ + for (int x = 0; x < width/device_scale; x++) { +- unsigned char *s = px + rs*y + 4*x; ++ unsigned char *s = px + static_cast(rs*)y + static_cast(4*)x; + uint32_t color; + if (s[3] < 0x80) { + color = 0; +@@ -1135,7 +1135,7 @@ void CanvasItemCtrl::build_cache(int device_scale) const + for (int j = 0; j < device_scale; ++j) { + auto p = _cache.get() + + (x * device_scale + i) + // Column +- (y * device_scale + j) * width; // Row ++ static_cast((y * device_scale + j) * )width; // Row + *p = color; + } + } +diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp +index e82c8d0566..1e884ed412 100644 +--- a/src/display/drawing-image.cpp ++++ b/src/display/drawing-image.cpp +@@ -10,13 +10,15 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "drawing-image.h" ++ + #include <2geom/bezier-curve.h> ++#include + +-#include "drawing.h" +-#include "drawing-context.h" +-#include "drawing-image.h" +-#include "cairo-utils.h" + #include "cairo-templates.h" ++#include "cairo-utils.h" ++#include "drawing-context.h" ++#include "drawing.h" + + namespace Inkscape { + +@@ -240,7 +242,7 @@ DrawingItem *DrawingImage::_pickItem(Geom::Point const &p, double delta, unsigne + if ((ix < 0) || (iy < 0) || (ix >= width) || (iy >= height)) + return nullptr; + +- auto pix_ptr = pixels + iy * rowstride + ix * 4; ++ auto pix_ptr = pixels + iy * rowstride + static_cast(ix * )4; + // pick if the image is less than 99% transparent + guint32 alpha = 0; + if (_pixbuf->pixelFormat() == Inkscape::Pixbuf::PF_CAIRO) { +diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp +index 4a9c4789fc..2df3416354 100644 +--- a/src/display/drawing-item.cpp ++++ b/src/display/drawing-item.cpp +@@ -10,26 +10,24 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "display/drawing-item.h" ++ + #include ++#include + ++#include "display/cairo-templates.h" ++#include "display/cairo-utils.h" ++#include "display/control/canvas-item-drawing.h" + #include "display/drawing-context.h" + #include "display/drawing-group.h" +-#include "display/drawing-item.h" + #include "display/drawing-pattern.h" + #include "display/drawing-surface.h" + #include "display/drawing-text.h" + #include "display/drawing.h" +- +-#include "display/cairo-utils.h" +-#include "display/cairo-templates.h" +- +-#include "display/control/canvas-item-drawing.h" +-#include "ui/widget/canvas.h" // Mark area for redrawing. +- + #include "nr-filter.h" +-#include "style.h" +- + #include "object/sp-item.h" ++#include "style.h" ++#include "ui/widget/canvas.h" // Mark area for redrawing. + + static constexpr auto CACHE_SCORE_THRESHOLD = 50000.0; ///< Do not consider objects for caching below this score. + +@@ -609,7 +607,7 @@ void DrawingItem::update(Geom::IntRect const &area, UpdateContext const &ctx, un + cr.score = score; + // if _cacheRect() is empty, a negative score will be returned from _cacheScore(), + // so this will not execute (cache score threshold must be positive) +- cr.cache_size = _cacheRect()->area() * 4; ++ cr.cache_size = static_cast(_cacheRect()->area() * )4; + cr.item = this; + auto it = std::lower_bound(_drawing._candidate_items.begin(), _drawing._candidate_items.end(), cr, + std::greater()); +diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp +index 4e04bfd62f..c2a0e58b6b 100644 +--- a/src/display/nr-filter-gaussian.cpp ++++ b/src/display/nr-filter-gaussian.cpp +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -329,7 +330,7 @@ INK_UNUSED(num_threads); // to suppress unused argument compiler warning + for(unsigned int i=1; i(c1*)PC); + } + // Backward pass + IIRValue v[N+1][PC]; +@@ -344,7 +345,7 @@ INK_UNUSED(num_threads); // to suppress unused argument compiler warning + int c1=n1-1; + while(c1-->0) { + for(unsigned int i=N; i>0; i--) copy_n(v[i-1], PC, v[i]); +- copy_n(tmpdata[tid]+c1*PC, PC, v[0]); ++ copy_n(tmpdata[tid]+static_cast(c1*)PC, PC, v[0]); + for(unsigned int c=0; c + #include ++#include ++#include + #include + #include ++ + #include "display/cairo-templates.h" + #include "display/cairo-utils.h" + #include "display/nr-filter-morphology.h" +@@ -79,8 +81,8 @@ void morphologicalFilter1D(cairo_surface_t * const input, cairo_surface_t * cons + } + + // Process "row" +- unsigned char *in_p = in_data + i * (axis == Geom::X ? stridein : BPP); +- unsigned char *out_p = out_data + i * (axis == Geom::X ? strideout : BPP); ++ unsigned char *in_p = in_data + static_cast(i * (axis == Geom::X ? stridein : BPP)); ++ unsigned char *out_p = out_data + static_cast(i * (axis == Geom::X ? strideout : BPP)); + /* This is the "short but slow" version, which might be easier to follow, the longer but faster version follows. + for (int j = 0; j < w+ri; ++j) { + for(int p = 0; p < BPP; ++p) { // Iterate over channels +diff --git a/src/display/nr-filter-slot.h b/src/display/nr-filter-slot.h +index ecd9f00573..54499bb897 100644 +--- a/src/display/nr-filter-slot.h ++++ b/src/display/nr-filter-slot.h +@@ -20,8 +20,8 @@ + #include "nr-filter-units.h" + + extern "C" { +-typedef struct _cairo cairo_t; +-typedef struct _cairo_surface cairo_surface_t; ++typedef struct cairo cairo_t; ++typedef struct cairo_surface cairo_surface_t; + } + + namespace Inkscape { +diff --git a/src/display/nr-filter-turbulence.cpp b/src/display/nr-filter-turbulence.cpp +index f13b977861..5eeef54540 100644 +--- a/src/display/nr-filter-turbulence.cpp ++++ b/src/display/nr-filter-turbulence.cpp +@@ -18,13 +18,16 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "display/nr-filter-turbulence.h" ++ ++#include ++#include ++ + #include "display/cairo-templates.h" + #include "display/cairo-utils.h" +-#include "display/nr-filter.h" +-#include "display/nr-filter-turbulence.h" + #include "display/nr-filter-units.h" + #include "display/nr-filter-utils.h" +-#include ++#include "display/nr-filter.h" + + namespace Inkscape { + namespace Filters{ +@@ -65,8 +68,8 @@ public: + _latticeSelector[i] = i; + + do { +- _gradient[i][k][0] = static_cast(_random() % (BSize * 2) - BSize) / BSize; +- _gradient[i][k][1] = static_cast(_random() % (BSize * 2) - BSize) / BSize; ++ _gradient[i][k][0] = static_cast(_random() % (static_cast(BSize * )2) - BSize) / BSize; ++ _gradient[i][k][1] = static_cast(_random() % (static_cast(BSize * )2) - BSize) / BSize; + } while (_gradient[i][k][0] == 0 && _gradient[i][k][1] == 0); + + // normalize gradient +diff --git a/src/display/nr-svgfonts.h b/src/display/nr-svgfonts.h +index ffc54f67d1..665fdf8737 100644 +--- a/src/display/nr-svgfonts.h ++++ b/src/display/nr-svgfonts.h +@@ -23,7 +23,7 @@ class SPGlyph; + class SPMissingGlyph; + class SPObject; + +-extern "C" { typedef struct _GdkEventExpose GdkEventExpose; } ++extern "C" { typedef struct GdkEventExpose GdkEventExpose; } + + namespace Gtk { + class Widget; +diff --git a/src/document.cpp b/src/document.cpp +index 7ed267bbbe..3200a9fc38 100644 +--- a/src/document.cpp ++++ b/src/document.cpp +@@ -1100,7 +1100,7 @@ void SPDocument::do_change_filename(gchar const *const filename, bool const reba + Inkscape::XML::rebase_hrefs(this, new_document_base, use_sodipodi_absref); + } + +- if (strncmp(new_document_name, "ink_ext_XXXXXX", 14)) // do not use temporary filenames ++ if (strncmp(new_document_name, "ink_ext_XXXXXX", 14) != 0) // do not use temporary filenames + repr->setAttribute("sodipodi:docname", new_document_name); + } + +@@ -1208,7 +1208,7 @@ SPObject *SPDocument::getObjectByHref(char const *href) const + return getObjectById(id); + } + +-static void _getObjectsByClassRecursive(Glib::ustring const &klass, SPObject *parent, std::vector &objects) ++static void getObjectsByClassRecursive(Glib::ustring const &klass, SPObject *parent, std::vector &objects) + { + if (!parent) return; + +@@ -1230,7 +1230,7 @@ static void _getObjectsByClassRecursive(Glib::ustring const &klass, SPObject *pa + + // Check children + for (auto &child : parent->children) { +- _getObjectsByClassRecursive(klass, &child, objects); ++ getObjectsByClassRecursive(klass, &child, objects); + } + } + +@@ -1238,11 +1238,11 @@ std::vector SPDocument::getObjectsByClass(Glib::ustring const &klass) + { + if (klass.empty()) return {}; + std::vector objects; +- _getObjectsByClassRecursive(klass, root, objects); ++ getObjectsByClassRecursive(klass, root, objects); + return objects; + } + +-static void _getObjectsByElementRecursive(Glib::ustring const &element, ++static void getObjectsByElementRecursive(Glib::ustring const &element, + SPObject *parent, + std::vector &objects, + bool custom) +@@ -1257,7 +1257,7 @@ static void _getObjectsByElementRecursive(Glib::ustring const &element, + + // Check children + for (auto &child : parent->children) { +- _getObjectsByElementRecursive(element, &child, objects, custom); ++ getObjectsByElementRecursive(element, &child, objects, custom); + } + } + +@@ -1265,11 +1265,11 @@ std::vector SPDocument::getObjectsByElement(Glib::ustring const &elem + { + if (element.empty()) return {}; + std::vector objects; +- _getObjectsByElementRecursive(element, root, objects, custom); ++ getObjectsByElementRecursive(element, root, objects, custom); + return objects; + } + +-static void _getObjectsBySelectorRecursive(SPObject *parent, ++static void getObjectsBySelectorRecursive(SPObject *parent, + CRSelEng *sel_eng, CRSimpleSel *simple_sel, + std::vector &objects) + { +@@ -1282,7 +1282,7 @@ static void _getObjectsBySelectorRecursive(SPObject *parent, + + // Check children + for (auto &child : parent->children) { +- _getObjectsBySelectorRecursive(&child, sel_eng, simple_sel, objects); ++ getObjectsBySelectorRecursive(&child, sel_eng, simple_sel, objects); + } + } + } +@@ -1301,7 +1301,7 @@ std::vector SPDocument::getObjectsBySelector(Glib::ustring const &sel + std::vector objects; + for (auto cur = cr_selector; cur; cur = cur->next) { + if (cur->simple_sel) { +- _getObjectsBySelectorRecursive(root, sel_eng, cur->simple_sel, objects); ++ getObjectsBySelectorRecursive(root, sel_eng, cur->simple_sel, objects); + } + } + cr_selector_destroy(cr_selector); +diff --git a/src/ege-color-prof-tracker.cpp b/src/ege-color-prof-tracker.cpp +index b84e2d2494..ed27be7238 100644 +--- a/src/ege-color-prof-tracker.cpp ++++ b/src/ege-color-prof-tracker.cpp +@@ -40,11 +40,11 @@ + + /* Note: this file should be kept compilable as both .cpp and .c */ + +-#include +-#include + #include +- ++#include ++#include + #include ++#include + + #ifdef HAVE_X11 + #include +@@ -102,7 +102,7 @@ typedef struct + } EgeColorProfTrackerPrivate; + + #define EGE_COLOR_PROF_TRACKER_GET_PRIVATE( o ) \ +- reinterpret_cast( ege_color_prof_tracker_get_instance_private (o)) ++ (reinterpret_cast( ege_color_prof_tracker_get_instance_private (o))) + + static void event_after_cb( GtkWidget* widget, GdkEvent* event, gpointer user_data ); + static void target_hierarchy_changed_cb(GtkWidget* widget, GtkWidget* prev_top, gpointer user_data); +@@ -136,7 +136,7 @@ void ege_color_prof_tracker_class_init( EgeColorProfTrackerClass* klass ) + G_SIGNAL_RUN_FIRST, + 0, + nullptr, nullptr, +- sp_marshal_VOID__INT_INT, ++ sp_marshal_VOID_INT_INT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_INT); +@@ -146,7 +146,7 @@ void ege_color_prof_tracker_class_init( EgeColorProfTrackerClass* klass ) + G_SIGNAL_RUN_FIRST, + 0, + nullptr, nullptr, +- sp_marshal_VOID__INT_INT, ++ sp_marshal_VOID_INT_INT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_INT); +@@ -476,7 +476,7 @@ void handle_property_change(GdkScreen* screen, const gchar* name) + if ( atom != None ) { + Atom actualType = None; + int actualFormat = 0; +- unsigned long size = 128 * 1042; ++ unsigned long size = static_cast(128 * )1042; + unsigned long nitems = 0; + unsigned long bytesAfter = 0; + unsigned char* prop = nullptr; +diff --git a/src/enums.h b/src/enums.h +index 3ea78a9950..e3bb76b5ab 100644 +--- a/src/enums.h ++++ b/src/enums.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_ENUMS_H__ +-#define __SP_ENUMS_H__ ++#define SP_ENUMS_H_ + + /* + * Main program enumerated types +diff --git a/src/extension/dependency.h b/src/extension/dependency.h +index e2c2791120..9811bf40fe 100644 +--- a/src/extension/dependency.h ++++ b/src/extension/dependency.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_DEPENDENCY_H__ +-#define INKSCAPE_EXTENSION_DEPENDENCY_H__ ++#define INKSCAPE_EXTENSION_DEPENDENCY_H_ + + #include + #include "xml/repr.h" +diff --git a/src/extension/effect.h b/src/extension/effect.h +index 60dbf0e464..bdeabd420b 100644 +--- a/src/extension/effect.h ++++ b/src/extension/effect.h +@@ -10,7 +10,7 @@ + + + #ifndef INKSCAPE_EXTENSION_EFFECT_H__ +-#define INKSCAPE_EXTENSION_EFFECT_H__ ++#define INKSCAPE_EXTENSION_EFFECT_H_ + + #include + +diff --git a/src/extension/execution-env.h b/src/extension/execution-env.h +index fb54ceb71d..6fb7f45a8c 100644 +--- a/src/extension/execution-env.h ++++ b/src/extension/execution-env.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_EXECUTION_ENV_H__ +-#define INKSCAPE_EXTENSION_EXECUTION_ENV_H__ ++#define INKSCAPE_EXTENSION_EXECUTION_ENV_H_ + + #include + #include +diff --git a/src/extension/implementation/xslt.h b/src/extension/implementation/xslt.h +index 745d7f57aa..32724d7e20 100644 +--- a/src/extension/implementation/xslt.h ++++ b/src/extension/implementation/xslt.h +@@ -11,7 +11,7 @@ + */ + + #ifndef __INKSCAPE_EXTENSION_IMPEMENTATION_XSLT_H__ +-#define __INKSCAPE_EXTENSION_IMPEMENTATION_XSLT_H__ ++#define INKSCAPE_EXTENSION_IMPEMENTATION_XSLT_H_ + + #include "implementation.h" + +diff --git a/src/extension/init.h b/src/extension/init.h +index d4254cb710..2780c48873 100644 +--- a/src/extension/init.h ++++ b/src/extension/init.h +@@ -14,7 +14,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_INIT_H__ +-#define INKSCAPE_EXTENSION_INIT_H__ ++#define INKSCAPE_EXTENSION_INIT_H_ + + namespace Inkscape { + namespace Extension { +diff --git a/src/extension/input.h b/src/extension/input.h +index 3eafbf99fe..3f7993cb74 100644 +--- a/src/extension/input.h ++++ b/src/extension/input.h +@@ -10,7 +10,7 @@ + + + #ifndef INKSCAPE_EXTENSION_INPUT_H__ +-#define INKSCAPE_EXTENSION_INPUT_H__ ++#define INKSCAPE_EXTENSION_INPUT_H_ + + #include + #include +diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp +index b8a35a7a50..a03bc726f1 100644 +--- a/src/extension/internal/cairo-render-context.cpp ++++ b/src/extension/internal/cairo-render-context.cpp +@@ -25,40 +25,33 @@ + #define PANGO_ENABLE_ENGINE + #endif + +-#include "cairo-render-context.h" +- +-#include +-#include + #include <2geom/pathvector.h> +- ++#include ++#include ++#include ++#include + #include + #include + +-#include "display/drawing.h" +-#include "display/curve.h" ++#include "cairo-render-context.h" ++#include "cairo-renderer.h" + #include "display/cairo-utils.h" ++#include "display/curve.h" + #include "display/drawing-paintserver.h" +- +-#include "object/sp-item.h" +-#include "object/sp-item-group.h" ++#include "display/drawing.h" ++#include "extension/system.h" ++#include "io/sys.h" ++#include "object/sp-clippath.h" + #include "object/sp-hatch.h" ++#include "object/sp-item-group.h" ++#include "object/sp-item.h" + #include "object/sp-linear-gradient.h" +-#include "object/sp-radial-gradient.h" ++#include "object/sp-mask.h" + #include "object/sp-mesh-gradient.h" + #include "object/sp-pattern.h" +-#include "object/sp-mask.h" +-#include "object/sp-clippath.h" +- +-#include "util/units.h" +- +-#include "cairo-renderer.h" +-#include "extension/system.h" +- +-#include "io/sys.h" +- ++#include "object/sp-radial-gradient.h" + #include "svg/stringstream.h" +- +-#include ++#include "util/units.h" + + // include support for only the compiled-in surface types + #ifdef CAIRO_HAS_PDF_SURFACE +@@ -726,7 +719,7 @@ CairoRenderContext::popLayer(cairo_operator_t composite) + const float coeff_g = 0.7154 / 255.0; + const float coeff_b = 0.0721 / 255.0; + for (int row = 0 ; row < height; row++) { +- unsigned char *row_data = pixels + (row * stride); ++ unsigned char *row_data = pixels + (static_cast(row * )stride); + for (int i = 0 ; i < width; i++) { + guint32 *pixel = reinterpret_cast(row_data) + i; + float lum_alpha = (((*pixel & 0x00ff0000) >> 16) * coeff_r + +diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h +index d17e978eed..0f6f1d2d32 100644 +--- a/src/extension/internal/cairo-render-context.h ++++ b/src/extension/internal/cairo-render-context.h +@@ -28,8 +28,8 @@ + class SPClipPath; + class SPMask; + +-typedef struct _PangoFont PangoFont; +-typedef struct _PangoLayout PangoLayout; ++typedef struct PangoFont PangoFont; ++typedef struct PangoLayout PangoLayout; + + namespace Inkscape { + class Pixbuf; +diff --git a/src/extension/internal/cdr-input.h b/src/extension/internal/cdr-input.h +index 546151fac0..bbac7e7866 100644 +--- a/src/extension/internal/cdr-input.h ++++ b/src/extension/internal/cdr-input.h +@@ -12,7 +12,7 @@ + */ + + #ifndef __EXTENSION_INTERNAL_CDROUTPUT_H__ +-#define __EXTENSION_INTERNAL_CDROUTPUT_H__ ++#define EXTENSION_INTERNAL_CDROUTPUT_H_ + + #ifdef HAVE_CONFIG_H + # include "config.h" // only include where actually required! +diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp +index 71a586977b..532dd5f303 100644 +--- a/src/extension/internal/emf-inout.cpp ++++ b/src/extension/internal/emf-inout.cpp +@@ -2248,7 +2248,7 @@ std::cout << "BEFORE DRAW" + + PU_EMRSETBKCOLOR pEmr = (PU_EMRSETBKCOLOR) lpEMFR; + tbkColor = pEmr->crColor; +- if(memcmp(&tbkColor, &(d->dc[d->level].bkColor), sizeof(U_COLORREF))){ ++ if(memcmp(&tbkColor, &(d->dc[d->level].bkColor), sizeof(U_COLORREF)) != 0){ + d->dc[d->level].dirty |= DIRTY_TEXT; + if(d->dc[d->level].fill_mode == DRAW_PATTERN){ d->dc[d->level].dirty |= DIRTY_FILL; } + if(d->dc[d->level].stroke_mode == DRAW_PATTERN){ d->dc[d->level].dirty |= DIRTY_STROKE; } +diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp +index f793feec36..44b5f49b1c 100644 +--- a/src/extension/internal/emf-print.cpp ++++ b/src/extension/internal/emf-print.cpp +@@ -2085,7 +2085,7 @@ unsigned int PrintEmf::text(Inkscape::Extension::Print * /*mod*/, char const *te + float rgb[3]; + style->fill.value.color.get_rgb_floatv(rgb); + // only change the text color when it needs to be changed +- if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float))) { ++ if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float)) != 0) { + memcpy(htextcolor_rgb, rgb, 3 * sizeof(float)); + rec = U_EMRSETTEXTCOLOR_set(U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2])); + if (!rec || emf_append((PU_ENHMETARECORD)rec, et, U_REC_FREE)) { +diff --git a/src/extension/internal/filter/bevels.h b/src/extension/internal/filter/bevels.h +index a8382ba4e5..975ee5e406 100644 +--- a/src/extension/internal/filter/bevels.h ++++ b/src/extension/internal/filter/bevels.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BEVELS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BEVELS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BEVELS_H_ + /* Change the 'BEVELS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/blurs.h b/src/extension/internal/filter/blurs.h +index 85f99fdacf..8a6b2b5db7 100644 +--- a/src/extension/internal/filter/blurs.h ++++ b/src/extension/internal/filter/blurs.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BLURS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BLURS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BLURS_H_ + /* Change the 'BLURS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/bumps.h b/src/extension/internal/filter/bumps.h +index 4db33d6e0f..5701bf143f 100644 +--- a/src/extension/internal/filter/bumps.h ++++ b/src/extension/internal/filter/bumps.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BUMPS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BUMPS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_BUMPS_H_ + /* Change the 'BUMPS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/color.h b/src/extension/internal/filter/color.h +index 9f4f872704..6e0dc290cc 100644 +--- a/src/extension/internal/filter/color.h ++++ b/src/extension/internal/filter/color.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_COLOR_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_COLOR_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_COLOR_H_ + /* Change the 'COLOR' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/distort.h b/src/extension/internal/filter/distort.h +index c27dba5a56..e694ffd5ad 100644 +--- a/src/extension/internal/filter/distort.h ++++ b/src/extension/internal/filter/distort.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_DISTORT_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_DISTORT_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_DISTORT_H_ + /* Change the 'DISTORT' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/filter-file.cpp b/src/extension/internal/filter/filter-file.cpp +index e72598dd44..e38de7ad04 100644 +--- a/src/extension/internal/filter/filter-file.cpp ++++ b/src/extension/internal/filter/filter-file.cpp +@@ -41,7 +41,7 @@ filters_load_file (Glib::ustring filename, gchar * menuname) + } + + Inkscape::XML::Node * root = doc->root(); +- if (strcmp(root->name(), "svg:svg")) { ++ if (strcmp(root->name(), "svg:svg") != 0) { + Inkscape::GC::release(doc); + g_warning("File (%s) is not SVG. Ignored.", filename.c_str()); + return; +diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp +index 5bd7365837..7afe853d96 100644 +--- a/src/extension/internal/filter/filter.cpp ++++ b/src/extension/internal/filter/filter.cpp +@@ -150,7 +150,7 @@ void Filter::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::Vie + sp_repr_css_set_property(css, "filter", url.c_str()); + sp_repr_css_set(node, css, "style"); + } else { +- if (strncmp(filter, "url(#", strlen("url(#")) || filter[strlen(filter) - 1] != ')') { ++ if (strncmp(filter, "url(#", strlen("url(#")) != 0 || filter[strlen(filter) - 1] != ')') { + // This is not url(#id) -- we can't handle it + continue; + } +diff --git a/src/extension/internal/filter/image.h b/src/extension/internal/filter/image.h +index 8820122262..acd3e8aa8e 100644 +--- a/src/extension/internal/filter/image.h ++++ b/src/extension/internal/filter/image.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_IMAGE_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_IMAGE_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_IMAGE_H_ + /* Change the 'IMAGE' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/morphology.h b/src/extension/internal/filter/morphology.h +index 31fcc9e5f8..ad01fad81d 100644 +--- a/src/extension/internal/filter/morphology.h ++++ b/src/extension/internal/filter/morphology.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_MORPHOLOGY_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_MORPHOLOGY_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_MORPHOLOGY_H_ + /* Change the 'MORPHOLOGY' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/overlays.h b/src/extension/internal/filter/overlays.h +index b93c070040..c1f9dede06 100644 +--- a/src/extension/internal/filter/overlays.h ++++ b/src/extension/internal/filter/overlays.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_OVERLAYS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_OVERLAYS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_OVERLAYS_H_ + /* Change the 'OVERLAYS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/paint.h b/src/extension/internal/filter/paint.h +index 920b275afe..23e866078a 100644 +--- a/src/extension/internal/filter/paint.h ++++ b/src/extension/internal/filter/paint.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PAINT_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PAINT_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PAINT_H_ + /* Change the 'PAINT' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/protrusions.h b/src/extension/internal/filter/protrusions.h +index ccf54b4763..6f53e82bcf 100644 +--- a/src/extension/internal/filter/protrusions.h ++++ b/src/extension/internal/filter/protrusions.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_PROTRUSIONS_H_ + /* Change the 'PROTRUSIONS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/shadows.h b/src/extension/internal/filter/shadows.h +index 34813a33e2..9cb348fdcf 100644 +--- a/src/extension/internal/filter/shadows.h ++++ b/src/extension/internal/filter/shadows.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_SHADOWS_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_SHADOWS_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_SHADOWS_H_ + /* Change the 'SHADOWS' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/textures.h b/src/extension/internal/filter/textures.h +index 66066aeb9c..8ea69f531a 100644 +--- a/src/extension/internal/filter/textures.h ++++ b/src/extension/internal/filter/textures.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TEXTURES_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TEXTURES_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TEXTURES_H_ + /* Change the 'TEXTURES' above to be your file name */ + + /* +diff --git a/src/extension/internal/filter/transparency.h b/src/extension/internal/filter/transparency.h +index 39cd240bb4..5bb8f944d2 100644 +--- a/src/extension/internal/filter/transparency.h ++++ b/src/extension/internal/filter/transparency.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TRANSPARENCY_H__ +-#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TRANSPARENCY_H__ ++#define SEEN_INKSCAPE_EXTENSION_INTERNAL_FILTER_TRANSPARENCY_H_ + /* Change the 'TRANSPARENCY' above to be your file name */ + + /* +diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h +index edb190610d..0d91545516 100644 +--- a/src/extension/internal/latex-pstricks.h ++++ b/src/extension/internal/latex-pstricks.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __INKSCAPE_EXTENSION_INTERNAL_PRINT_LATEX_H__ +-#define __INKSCAPE_EXTENSION_INTERNAL_PRINT_LATEX_H__ ++#define INKSCAPE_EXTENSION_INTERNAL_PRINT_LATEX_H_ + + /* + * LaTeX Printing +diff --git a/src/extension/internal/metafile-print.cpp b/src/extension/internal/metafile-print.cpp +index 41775daeac..da45a59451 100644 +--- a/src/extension/internal/metafile-print.cpp ++++ b/src/extension/internal/metafile-print.cpp +@@ -181,7 +181,7 @@ U_COLORREF PrintMetafile::weight_opacity(U_COLORREF c1) + /* t between 0 and 1, values outside that range use the nearest limit */ + U_COLORREF PrintMetafile::weight_colors(U_COLORREF c1, U_COLORREF c2, double t) + { +-#define clrweight(a,b,t) ((1-t)*((double) a) + (t)*((double) b)) ++#define clrweight(a,b,t) ((1-(t))*((double) (a)) + (t)*((double) (b))) + U_COLORREF result; + t = ( t > 1.0 ? 1.0 : ( t < 0.0 ? 0.0 : t)); + // clang-format off +diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp +index 52ba20cf70..210d0af884 100644 +--- a/src/extension/internal/odf.cpp ++++ b/src/extension/internal/odf.cpp +@@ -992,10 +992,10 @@ void OdfOutput::preprocess(ZipFile &zf, SPDocument *doc, Inkscape::XML::Node *no + if (nodeName == "metadata" || nodeName == "svg:metadata") + { + Inkscape::XML::Node *mchild = node->firstChild() ; +- if (!mchild || strcmp(mchild->name(), "rdf:RDF")) ++ if (!mchild || strcmp(mchild->name(), "rdf:RDF") != 0) + return; + Inkscape::XML::Node *rchild = mchild->firstChild() ; +- if (!rchild || strcmp(rchild->name(), "cc:Work")) ++ if (!rchild || strcmp(rchild->name(), "cc:Work") != 0) + return; + for (Inkscape::XML::Node *cchild = rchild->firstChild() ; + cchild ; cchild = cchild->next()) +diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp +index 25daae3acb..4b57cd0afb 100644 +--- a/src/extension/internal/pdfinput/pdf-input.cpp ++++ b/src/extension/internal/pdfinput/pdf-input.cpp +@@ -35,6 +35,7 @@ + #include + #endif + ++#include + #include + #include + #include +@@ -401,8 +402,8 @@ static void copy_cairo_surface_to_pixbuf (cairo_surface_t *surface, + cairo_height = gdk_pixbuf_get_height (pixbuf); + for (y = 0; y < cairo_height; y++) + { +- src = reinterpret_cast(cairo_data + y * cairo_rowstride); +- dst = pixbuf_data + y * pixbuf_rowstride; ++ src = reinterpret_cast(cairo_data + static_cast(y * )cairo_rowstride); ++ dst = pixbuf_data + static_cast(y * )pixbuf_rowstride; + for (x = 0; x < cairo_width; x++) + { + dst[0] = (*src >> 16) & 0xff; +@@ -515,7 +516,7 @@ void PdfImportDialog::_setPreviewPage(int page) { + if (_thumb_data) { + gfree(_thumb_data); + } +- _thumb_data = reinterpret_cast(gmalloc(_thumb_rowstride * _thumb_height)); ++ _thumb_data = reinterpret_cast(gmalloc(static_cast(_thumb_rowstride * )_thumb_height)); + if (_cairo_surface) { + cairo_surface_destroy(_cairo_surface); + } +@@ -561,7 +562,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + + // Initialize the globalParams variable for poppler + if (!globalParams) { +- globalParams = _POPPLER_NEW_GLOBAL_PARAMS(); ++ globalParams = POPPLER_NEW_GLOBAL_PARAMS(); + } + + +@@ -571,7 +572,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { + + // poppler does not use glib g_open. So on win32 we must use unicode call. code was copied from + // glib gstdio.c +- pdf_doc = _POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password ++ pdf_doc = POPPLER_MAKE_SHARED_PDFDOC(uri); // TODO: Could ask for password + + if (!pdf_doc->isOk()) { + int error = pdf_doc->getErrorCode(); +@@ -757,7 +758,7 @@ PdfInput::add_builder_page(std::shared_ptrpdf_doc, SvgBuilder *builder, + } + + // Apply crop settings +- _POPPLER_CONST PDFRectangle *clipToBox = nullptr; ++ POPPLER_CONST PDFRectangle *clipToBox = nullptr; + + switch (prefs->getAttributeInt("cropTo", -1)) { + case 0: // Media box +diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h +index e6d6c55700..3233fc23c7 100644 +--- a/src/extension/internal/pdfinput/pdf-input.h ++++ b/src/extension/internal/pdfinput/pdf-input.h +@@ -25,8 +25,8 @@ + #include "svg-builder.h" + + #ifdef HAVE_POPPLER_CAIRO +-struct _PopplerDocument; +-typedef struct _PopplerDocument PopplerDocument; ++struct PopplerDocument; ++typedef struct PopplerDocument PopplerDocument; + #endif + + struct _GdkEventExpose; +diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp +index a923d4aec8..b250144f68 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.cpp ++++ b/src/extension/internal/pdfinput/pdf-parser.cpp +@@ -263,7 +263,7 @@ GfxPatch blankPatch() + //------------------------------------------------------------------------ + + PdfParser::PdfParser(std::shared_ptr pdf_doc, Inkscape::Extension::Internal::SvgBuilder *builderA, Page *page, +- _POPPLER_CONST PDFRectangle *cropBox) ++ POPPLER_CONST PDFRectangle *cropBox) + : _pdf_doc(pdf_doc) + , xref(pdf_doc->getXRef()) + , builder(builderA) +@@ -315,7 +315,7 @@ PdfParser::PdfParser(std::shared_ptr pdf_doc, Inkscape::Extension::Inter + } + + PdfParser::PdfParser(XRef *xrefA, Inkscape::Extension::Internal::SvgBuilder *builderA, Dict *resDict, +- _POPPLER_CONST PDFRectangle *box) ++ POPPLER_CONST PDFRectangle *box) + : xref(xrefA) + , builder(builderA) + , subPage(true) +@@ -370,16 +370,16 @@ void PdfParser::parse(Object *obj, GBool topLevel) { + _POPPLER_CALL_ARGS(obj2, obj->arrayGet, i); + if (!obj2.isStream()) { + error(errInternal, -1, "Weird page contents"); +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + return; + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } + } else if (!obj->isStream()) { + error(errInternal, -1, "Weird page contents"); + return; + } +- parser = new _POPPLER_NEW_PARSER(xref, obj); ++ parser = new POPPLER_NEW_PARSER(xref, obj); + go(topLevel); + delete parser; + parser = nullptr; +@@ -392,7 +392,7 @@ void PdfParser::go(GBool /*topLevel*/) + + // scan a sequence of objects + int numArgs = 0; +- _POPPLER_CALL(obj, parser->getObj); ++ POPPLER_CALL(obj, parser->getObj); + while (!obj.isEOF()) { + + // got a command - execute it +@@ -430,13 +430,13 @@ void PdfParser::go(GBool /*topLevel*/) + printf("\n"); + fflush(stdout); + } +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + } + + // grab the next object +- _POPPLER_CALL(obj, parser->getObj); ++ POPPLER_CALL(obj, parser->getObj); + } +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + + // args at end with no command + if (numArgs > 0) { +@@ -626,8 +626,8 @@ void PdfParser::opSetDash(Object args[], int /*numArgs*/) + dash = (double *)gmallocn(length, sizeof(double)); + for (int i = 0; i < length; ++i) { + Object obj; +- dash[i] = _POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum(); +- _POPPLER_FREE(obj); ++ dash[i] = POPPLER_CALL_ARGS_DEREF(obj, a->get, i).getNum(); ++ POPPLER_FREE(obj); + } + } + #if POPPLER_CHECK_VERSION(22, 9, 0) +@@ -687,7 +687,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } + if (!obj1.isDict()) { + error(errSyntaxError, getPos(), "ExtGState '{0:s}' is wrong type"), args[0].getName(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + return; + } + if (printCommands) { +@@ -697,7 +697,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } + + // transparency support: blend mode, fill/stroke opacity +- if (!_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "BM").isNull()) { ++ if (!POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "BM").isNull()) { + GfxBlendMode mode = gfxBlendNormal; + if (state->parseBlendMode(&obj2, &mode)) { + state->setBlendMode(mode); +@@ -705,39 +705,39 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + error(errSyntaxError, getPos(), "Invalid blend mode in ExtGState"); + } + } +- _POPPLER_FREE(obj2); +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "ca").isNum()) { ++ POPPLER_FREE(obj2); ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "ca").isNum()) { + state->setFillOpacity(obj2.getNum()); + } +- _POPPLER_FREE(obj2); +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "CA").isNum()) { ++ POPPLER_FREE(obj2); ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "CA").isNum()) { + state->setStrokeOpacity(obj2.getNum()); + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + + // fill/stroke overprint + GBool haveFillOP = gFalse; +- if ((haveFillOP = _POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "op").isBool())) { ++ if ((haveFillOP = POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "op").isBool())) { + state->setFillOverprint(obj2.getBool()); + } +- _POPPLER_FREE(obj2); +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "OP").isBool()) { ++ POPPLER_FREE(obj2); ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "OP").isBool()) { + state->setStrokeOverprint(obj2.getBool()); + if (!haveFillOP) { + state->setFillOverprint(obj2.getBool()); + } + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + + // stroke adjust +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "SA").isBool()) { ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "SA").isBool()) { + state->setStrokeAdjust(obj2.getBool()); + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + + // transfer function +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "TR2").isNull()) { +- _POPPLER_FREE(obj2); ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "TR2").isNull()) { ++ POPPLER_FREE(obj2); + _POPPLER_CALL_ARGS(obj2, obj1.dictLookup, "TR"); + } + if (obj2.isName(const_cast("Default")) || +@@ -749,7 +749,7 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + for (int i = 0; i < 4; ++i) { + _POPPLER_CALL_ARGS(obj3, obj2.arrayGet, i); + funcs[i] = Function::parse(&obj3); +- _POPPLER_FREE(obj3); ++ POPPLER_FREE(obj3); + if (!funcs[i]) { + pos = i; + break; +@@ -766,21 +766,21 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } else if (!obj2.isNull()) { + error(errSyntaxError, getPos(), "Invalid transfer function in ExtGState"); + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + + // soft mask +- if (!_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "SMask").isNull()) { ++ if (!POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "SMask").isNull()) { + if (obj2.isName(const_cast("None"))) { + // Do nothing. + } else if (obj2.isDict()) { +- if (_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "S").isName("Alpha")) { ++ if (POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "S").isName("Alpha")) { + alpha = gTrue; + } else { // "Luminosity" + alpha = gFalse; + } +- _POPPLER_FREE(obj3); ++ POPPLER_FREE(obj3); + funcs[0] = nullptr; +- if (!_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "TR").isNull()) { ++ if (!POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "TR").isNull()) { + funcs[0] = Function::parse(&obj3); + if (funcs[0]->getInputSize() != 1 || + funcs[0]->getOutputSize() != 1) { +@@ -789,8 +789,8 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + funcs[0] = nullptr; + } + } +- _POPPLER_FREE(obj3); +- if ((haveBackdropColor = _POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "BC").isArray())) { ++ POPPLER_FREE(obj3); ++ if ((haveBackdropColor = POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "BC").isArray())) { + for (int & i : backdropColor.c) { + i = 0; + } +@@ -799,27 +799,27 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + if (obj4.isNum()) { + backdropColor.c[i] = dblToCol(obj4.getNum()); + } +- _POPPLER_FREE(obj4); ++ POPPLER_FREE(obj4); + } + } +- _POPPLER_FREE(obj3); +- if (_POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "G").isStream()) { +- if (_POPPLER_CALL_ARGS_DEREF(obj4, obj3.streamGetDict()->lookup, "Group").isDict()) { ++ POPPLER_FREE(obj3); ++ if (POPPLER_CALL_ARGS_DEREF(obj3, obj2.dictLookup, "G").isStream()) { ++ if (POPPLER_CALL_ARGS_DEREF(obj4, obj3.streamGetDict()->lookup, "Group").isDict()) { + GfxColorSpace *blendingColorSpace = nullptr; + GBool isolated = gFalse; + GBool knockout = gFalse; +- if (!_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "CS").isNull()) { ++ if (!POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "CS").isNull()) { + blendingColorSpace = GfxColorSpace::parse(nullptr, &obj5, nullptr, state); + } +- _POPPLER_FREE(obj5); +- if (_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "I").isBool()) { ++ POPPLER_FREE(obj5); ++ if (POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "I").isBool()) { + isolated = obj5.getBool(); + } +- _POPPLER_FREE(obj5); +- if (_POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "K").isBool()) { ++ POPPLER_FREE(obj5); ++ if (POPPLER_CALL_ARGS_DEREF(obj5, obj4.dictLookup, "K").isBool()) { + knockout = obj5.getBool(); + } +- _POPPLER_FREE(obj5); ++ POPPLER_FREE(obj5); + if (!haveBackdropColor) { + if (blendingColorSpace) { + blendingColorSpace->getDefaultColor(&backdropColor); +@@ -838,18 +838,18 @@ void PdfParser::opSetExtGState(Object args[], int /*numArgs*/) + } else { + error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); + } +- _POPPLER_FREE(obj4); ++ POPPLER_FREE(obj4); + } else { + error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState - missing group"); + } +- _POPPLER_FREE(obj3); ++ POPPLER_FREE(obj3); + } else if (!obj2.isNull()) { + error(errSyntaxError, getPos(), "Invalid soft mask in ExtGState"); + } + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } + + void PdfParser::doSoftMask(Object *str, GBool alpha, +@@ -874,21 +874,21 @@ void PdfParser::doSoftMask(Object *str, GBool alpha, + if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) { + error(errSyntaxError, getPos(), "Unknown form type"); + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // get bounding box + _POPPLER_CALL_ARGS(obj1, dict->lookup, "BBox"); + if (!obj1.isArray()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + error(errSyntaxError, getPos(), "Bad form bounding box"); + return; + } + for (i = 0; i < 4; ++i) { + _POPPLER_CALL_ARGS(obj2, obj1.arrayGet, i); + bbox[i] = obj2.getNum(); +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // get matrix + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Matrix"); +@@ -896,14 +896,14 @@ void PdfParser::doSoftMask(Object *str, GBool alpha, + for (i = 0; i < 6; ++i) { + _POPPLER_CALL_ARGS(obj2, obj1.arrayGet, i); + m[i] = obj2.getNum(); +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } + } else { + m[0] = 1; m[1] = 0; + m[2] = 0; m[3] = 1; + m[4] = 0; m[5] = 0; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // get resources + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Resources"); +@@ -919,7 +919,7 @@ void PdfParser::doSoftMask(Object *str, GBool alpha, + if (blendingColorSpace) { + delete blendingColorSpace; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } + + void PdfParser::opSetRenderingIntent(Object /*args*/[], int /*numArgs*/) +@@ -963,7 +963,7 @@ GfxColorSpace *PdfParser::lookupColorSpaceCopy(Object &arg) + colorSpacesCache[name].reset(colorSpace->copy()); + } + } +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + return colorSpace; + } + +@@ -1828,7 +1828,7 @@ void PdfParser::doPatchMeshShFill(GfxPatchMeshShading *shading) { + } + } + +-void PdfParser::fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth) { ++void PdfParser::fillPatch(POPPLER_CONST GfxPatch *patch, int nComps, int depth) { + GfxPatch patch00 = blankPatch(); + GfxPatch patch01 = blankPatch(); + GfxPatch patch10 = blankPatch(); +@@ -2230,7 +2230,7 @@ void PdfParser::opShowSpaceText(Object args[], int /*numArgs*/) + } else { + error(errSyntaxError, getPos(), "Element of show/space array must be number or string"); + } +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + } + } + +@@ -2242,7 +2242,7 @@ void PdfParser::doShowText(GooString *s) { + int wMode; + double riseX, riseY; + CharCode code; +- Unicode _POPPLER_CONST_82 *u = nullptr; ++ Unicode POPPLER_CONST_82 *u = nullptr; + double dx, dy, tdx, tdy; + double originX, originY, tOriginX, tOriginY; + Object charProc; +@@ -2319,14 +2319,14 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/) + } + if (!obj1.isStream()) { + error(errSyntaxError, getPos(), "XObject '{0:s}' is wrong type", name); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + return; + } + _POPPLER_CALL_ARGS(obj2, obj1.streamGetDict()->lookup, "Subtype"); + if (obj2.isName(const_cast("Image"))) { + _POPPLER_CALL_ARGS(refObj, res->lookupXObjectNF, name); + doImage(&refObj, obj1.getStream(), gFalse); +- _POPPLER_FREE(refObj); ++ POPPLER_FREE(refObj); + } else if (obj2.isName(const_cast("Form"))) { + doForm(&obj1); + } else if (obj2.isName(const_cast("PS"))) { +@@ -2338,8 +2338,8 @@ void PdfParser::opXObject(Object args[], int /*numArgs*/) + } else { + error(errSyntaxError, getPos(), "XObject subtype is missing or wrong type"); + } +- _POPPLER_FREE(obj2); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj2); ++ POPPLER_FREE(obj1); + } + + void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) +@@ -2368,7 +2368,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + // get size + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Width"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "W"); + } + if (obj1.isInt()){ +@@ -2380,10 +2380,10 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + else { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Height"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "H"); + } + if (obj1.isInt()) { +@@ -2395,25 +2395,25 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + else { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // image interpolation + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Interpolate"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "I"); + } + if (obj1.isBool()) + interpolate = obj1.getBool(); + else + interpolate = gFalse; +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + maskInterpolate = gFalse; + + // image or mask? + _POPPLER_CALL_ARGS(obj1, dict->lookup, "ImageMask"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "IM"); + } + mask = gFalse; +@@ -2423,13 +2423,13 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + else if (!obj1.isNull()) { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // bit depth + if (bits == 0) { + _POPPLER_CALL_ARGS(obj1, dict->lookup, "BitsPerComponent"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "BPC"); + } + if (obj1.isInt()) { +@@ -2439,7 +2439,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + } else { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } + + // display a mask +@@ -2451,7 +2451,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + invert = gFalse; + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Decode"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "D"); + } + if (obj1.isArray()) { +@@ -2459,11 +2459,11 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + if (obj2.isInt() && obj2.getInt() == 1) { + invert = gTrue; + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } else if (!obj1.isNull()) { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // draw it + builder->addImageMask(state, str, width, height, invert, interpolate); +@@ -2473,7 +2473,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + GfxColorSpace *colorSpace; + _POPPLER_CALL_ARGS(obj1, dict->lookup, "ColorSpace"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "CS"); + } + if (!obj1.isNull()) { +@@ -2487,17 +2487,17 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + } else { + colorSpace = nullptr; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + if (!colorSpace) { + goto err1; + } + _POPPLER_CALL_ARGS(obj1, dict->lookup, "Decode"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, dict->lookup, "D"); + } + GfxImageColorMap *colorMap = new GfxImageColorMap(bits, &obj1, colorSpace); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + if (!colorMap->isOk()) { + delete colorMap; + goto err1; +@@ -2523,61 +2523,61 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + maskDict = smaskObj.streamGetDict(); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Width"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "W"); + } + if (!obj1.isInt()) { + goto err2; + } + maskWidth = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Height"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "H"); + } + if (!obj1.isInt()) { + goto err2; + } + maskHeight = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "BitsPerComponent"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "BPC"); + } + if (!obj1.isInt()) { + goto err2; + } + int maskBits = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Interpolate"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "I"); + } + if (obj1.isBool()) + maskInterpolate = obj1.getBool(); + else + maskInterpolate = gFalse; +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "ColorSpace"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "CS"); + } + GfxColorSpace *maskColorSpace = lookupColorSpaceCopy(obj1); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + if (!maskColorSpace || maskColorSpace->getMode() != csDeviceGray) { + goto err1; + } + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Decode"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "D"); + } + maskColorMap = new GfxImageColorMap(maskBits, &obj1, maskColorSpace); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + if (!maskColorMap->isOk()) { + delete maskColorMap; + goto err1; +@@ -2590,7 +2590,7 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + for (i = 0; i < maskObj.arrayGetLength() && i < 2*gfxColorMaxComps; ++i) { + _POPPLER_CALL_ARGS(obj1, maskObj.arrayGet, i); + maskColors[i] = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } + haveColorKeyMask = gTrue; + } else if (maskObj.isStream()) { +@@ -2602,47 +2602,47 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + maskDict = maskObj.streamGetDict(); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Width"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "W"); + } + if (!obj1.isInt()) { + goto err2; + } + maskWidth = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Height"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "H"); + } + if (!obj1.isInt()) { + goto err2; + } + maskHeight = obj1.getInt(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "ImageMask"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "IM"); + } + if (!obj1.isBool() || !obj1.getBool()) { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Interpolate"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "I"); + } + if (obj1.isBool()) + maskInterpolate = obj1.getBool(); + else + maskInterpolate = gFalse; +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + maskInvert = gFalse; + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "Decode"); + if (obj1.isNull()) { +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + _POPPLER_CALL_ARGS(obj1, maskDict->lookup, "D"); + } + if (obj1.isArray()) { +@@ -2650,11 +2650,11 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + if (obj2.isInt() && obj2.getInt() == 1) { + maskInvert = gTrue; + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } else if (!obj1.isNull()) { + goto err2; + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + haveExplicitMask = gTrue; + } + +@@ -2672,14 +2672,14 @@ void PdfParser::doImage(Object * /*ref*/, Stream *str, GBool inlineImg) + } + delete colorMap; + +- _POPPLER_FREE(maskObj); +- _POPPLER_FREE(smaskObj); ++ POPPLER_FREE(maskObj); ++ POPPLER_FREE(smaskObj); + } + + return; + + err2: +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + err1: + error(errSyntaxError, getPos(), "Bad image parameters"); + } +@@ -2708,21 +2708,21 @@ void PdfParser::doForm(Object *str) { + if (!(obj1.isNull() || (obj1.isInt() && obj1.getInt() == 1))) { + error(errSyntaxError, getPos(), "Unknown form type"); + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // get bounding box + _POPPLER_CALL_ARGS(bboxObj, dict->lookup, "BBox"); + if (!bboxObj.isArray()) { +- _POPPLER_FREE(bboxObj); ++ POPPLER_FREE(bboxObj); + error(errSyntaxError, getPos(), "Bad form bounding box"); + return; + } + for (i = 0; i < 4; ++i) { + _POPPLER_CALL_ARGS(obj1, bboxObj.arrayGet, i); + bbox[i] = obj1.getNum(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } +- _POPPLER_FREE(bboxObj); ++ POPPLER_FREE(bboxObj); + + // get matrix + _POPPLER_CALL_ARGS(matrixObj, dict->lookup, "Matrix"); +@@ -2730,14 +2730,14 @@ void PdfParser::doForm(Object *str) { + for (i = 0; i < 6; ++i) { + _POPPLER_CALL_ARGS(obj1, matrixObj.arrayGet, i); + m[i] = obj1.getNum(); +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + } + } else { + m[0] = 1; m[1] = 0; + m[2] = 0; m[3] = 1; + m[4] = 0; m[5] = 0; + } +- _POPPLER_FREE(matrixObj); ++ POPPLER_FREE(matrixObj); + + // get resources + _POPPLER_CALL_ARGS(resObj, dict->lookup, "Resources"); +@@ -2746,25 +2746,25 @@ void PdfParser::doForm(Object *str) { + // check for a transparency group + transpGroup = isolated = knockout = gFalse; + blendingColorSpace = nullptr; +- if (_POPPLER_CALL_ARGS_DEREF(obj1, dict->lookup, "Group").isDict()) { +- if (_POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "S").isName("Transparency")) { ++ if (POPPLER_CALL_ARGS_DEREF(obj1, dict->lookup, "Group").isDict()) { ++ if (POPPLER_CALL_ARGS_DEREF(obj2, obj1.dictLookup, "S").isName("Transparency")) { + transpGroup = gTrue; +- if (!_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "CS").isNull()) { ++ if (!POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "CS").isNull()) { + blendingColorSpace = GfxColorSpace::parse(nullptr, &obj3, nullptr, state); + } +- _POPPLER_FREE(obj3); +- if (_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "I").isBool()) { ++ POPPLER_FREE(obj3); ++ if (POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "I").isBool()) { + isolated = obj3.getBool(); + } +- _POPPLER_FREE(obj3); +- if (_POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "K").isBool()) { ++ POPPLER_FREE(obj3); ++ if (POPPLER_CALL_ARGS_DEREF(obj3, obj1.dictLookup, "K").isBool()) { + knockout = obj3.getBool(); + } +- _POPPLER_FREE(obj3); ++ POPPLER_FREE(obj3); + } +- _POPPLER_FREE(obj2); ++ POPPLER_FREE(obj2); + } +- _POPPLER_FREE(obj1); ++ POPPLER_FREE(obj1); + + // draw it + ++formDepth; +@@ -2775,7 +2775,7 @@ void PdfParser::doForm(Object *str) { + if (blendingColorSpace) { + delete blendingColorSpace; + } +- _POPPLER_FREE(resObj); ++ POPPLER_FREE(resObj); + } + + void PdfParser::doForm1(Object *str, Dict *resDict, double *matrix, double *bbox, GBool transpGroup, GBool softMask, +@@ -2884,31 +2884,31 @@ Stream *PdfParser::buildImageStream() { + #else + dict.initDict(xref); + #endif +- _POPPLER_CALL(obj, parser->getObj); ++ POPPLER_CALL(obj, parser->getObj); + while (!obj.isCmd(const_cast("ID")) && !obj.isEOF()) { + if (!obj.isName()) { + error(errSyntaxError, getPos(), "Inline image dictionary key must be a name object"); +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + } else { + Object obj2; +- _POPPLER_CALL(obj2, parser->getObj); ++ POPPLER_CALL(obj2, parser->getObj); + if (obj2.isEOF() || obj2.isError()) { +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + break; + } +- _POPPLER_DICTADD(dict, obj.getName(), obj2); +- _POPPLER_FREE(obj); +- _POPPLER_FREE(obj2); ++ POPPLER_DICTADD(dict, obj.getName(), obj2); ++ POPPLER_FREE(obj); ++ POPPLER_FREE(obj2); + } +- _POPPLER_CALL(obj, parser->getObj); ++ POPPLER_CALL(obj, parser->getObj); + } + if (obj.isEOF()) { + error(errSyntaxError, getPos(), "End of file in inline image"); +- _POPPLER_FREE(obj); +- _POPPLER_FREE(dict); ++ POPPLER_FREE(obj); ++ POPPLER_FREE(dict); + return nullptr; + } +- _POPPLER_FREE(obj); ++ POPPLER_FREE(obj); + + // make stream + #if defined(POPPLER_NEW_OBJECT_API) +diff --git a/src/extension/internal/pdfinput/pdf-parser.h b/src/extension/internal/pdfinput/pdf-parser.h +index 12d5318e65..af8f44feb6 100644 +--- a/src/extension/internal/pdfinput/pdf-parser.h ++++ b/src/extension/internal/pdfinput/pdf-parser.h +@@ -123,9 +123,9 @@ class PdfParser { + public: + + // Constructor for regular output. +- PdfParser(std::shared_ptr pdf_doc, SvgBuilder *builderA, Page *page, _POPPLER_CONST PDFRectangle *cropBox); ++ PdfParser(std::shared_ptr pdf_doc, SvgBuilder *builderA, Page *page, POPPLER_CONST PDFRectangle *cropBox); + // Constructor for a sub-page object. +- PdfParser(XRef *xrefA, SvgBuilder *builderA, Dict *resDict, _POPPLER_CONST PDFRectangle *box); ++ PdfParser(XRef *xrefA, SvgBuilder *builderA, Dict *resDict, POPPLER_CONST PDFRectangle *box); + + virtual ~PdfParser(); + +@@ -258,7 +258,7 @@ private: + void gouraudFillTriangle(double x0, double y0, GfxColor *color0, double x1, double y1, GfxColor *color1, double x2, + double y2, GfxColor *color2, int nComps, int depth); + void doPatchMeshShFill(GfxPatchMeshShading *shading); +- void fillPatch(_POPPLER_CONST GfxPatch *patch, int nComps, int depth); ++ void fillPatch(POPPLER_CONST GfxPatch *patch, int nComps, int depth); + void doEndPath(); + + // path clipping operators +diff --git a/src/extension/internal/pdfinput/pdf-utils.cpp b/src/extension/internal/pdfinput/pdf-utils.cpp +index 8576467be9..60cad7d4b3 100644 +--- a/src/extension/internal/pdfinput/pdf-utils.cpp ++++ b/src/extension/internal/pdfinput/pdf-utils.cpp +@@ -105,7 +105,7 @@ ClipHistoryEntry::ClipHistoryEntry(ClipHistoryEntry *other, bool cleared) + saved = nullptr; + } + +-Geom::Rect getRect(_POPPLER_CONST PDFRectangle *box) ++Geom::Rect getRect(POPPLER_CONST PDFRectangle *box) + { + return Geom::Rect(box->x1, box->y1, box->x2, box->y2); + } +diff --git a/src/extension/internal/pdfinput/pdf-utils.h b/src/extension/internal/pdfinput/pdf-utils.h +index 4d333c0d75..96bfbac714 100644 +--- a/src/extension/internal/pdfinput/pdf-utils.h ++++ b/src/extension/internal/pdfinput/pdf-utils.h +@@ -48,6 +48,6 @@ private: + ClipHistoryEntry(ClipHistoryEntry *other, bool cleared = false); + }; + +-Geom::Rect getRect(_POPPLER_CONST PDFRectangle *box); ++Geom::Rect getRect(POPPLER_CONST PDFRectangle *box); + + #endif /* PDF_UTILS_H */ +diff --git a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp +index 7f9183b1b5..8bc238d0b1 100644 +--- a/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp ++++ b/src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp +@@ -69,6 +69,7 @@ + //======================================================================== + + #include ++#include + + FT_Error ft_new_face_from_file(FT_Library library, const char *filename_utf8, FT_Long face_index, FT_Face *aface); + +@@ -237,7 +238,7 @@ struct FreeTypeFontResource + }; + + // cairo callback for when cairo_font_face_t is destroyed +-static void _ft_done_face(void *closure) ++static void ft_done_face(void *closure) + { + FreeTypeFontResource *resource = (FreeTypeFontResource *)closure; + +@@ -277,9 +278,9 @@ static std::optional createFreeTypeFontFace(FT_Library lib, co + + font_face.cairo_font_face = + cairo_ft_font_face_create_for_ft_face(resource->face, FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); +- if (cairo_font_face_set_user_data(font_face.cairo_font_face, &ft_cairo_key, resource, _ft_done_face)) { ++ if (cairo_font_face_set_user_data(font_face.cairo_font_face, &ft_cairo_key, resource, ft_done_face)) { + cairo_font_face_destroy(font_face.cairo_font_face); +- _ft_done_face(resource); ++ ft_done_face(resource); + return {}; + } + +@@ -554,12 +555,12 @@ err2: + + static const cairo_user_data_key_t type3_font_key = {0}; + +-typedef struct _type3_font_info ++typedef struct type3_font_info + { + #if POPPLER_CHECK_VERSION(22, 4, 0) +- _type3_font_info(const std::shared_ptr &fontA, PDFDoc *docA, CairoFontEngine *fontEngineA, bool printingA, ++ type3_font_info(std::shared_ptr fontA, PDFDoc *docA, CairoFontEngine *fontEngineA, bool printingA, + XRef *xrefA) +- : font(fontA) ++ : font(std::move(fontA)) + , doc(docA) + , fontEngine(fontEngineA) + , printing(printingA) +@@ -585,13 +586,13 @@ typedef struct _type3_font_info + XRef *xref; + } type3_font_info_t; + +-static void _free_type3_font_info(void *closure) ++static void free_type3_font_info(void *closure) + { + type3_font_info_t *info = (type3_font_info_t *)closure; + delete info; + } + +-static cairo_status_t _init_type3_glyph(cairo_scaled_font_t *scaled_font, cairo_t *cr, cairo_font_extents_t *extents) ++static cairo_status_t init_type3_glyph(cairo_scaled_font_t *scaled_font, cairo_t *cr, cairo_font_extents_t *extents) + { + type3_font_info_t *info; + +@@ -607,7 +608,7 @@ static cairo_status_t _init_type3_glyph(cairo_scaled_font_t *scaled_font, cairo_ + return CAIRO_STATUS_SUCCESS; + } + +-static cairo_status_t _render_type3_glyph(cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, ++static cairo_status_t render_type3_glyph(cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, + cairo_text_extents_t *metrics, bool color) + { + // We have stripped out the type3 glyph support here, because it calls back +@@ -623,10 +624,10 @@ static cairo_status_t _render_type3_color_glyph(cairo_scaled_font_t *scaled_font + } + #endif + +-static cairo_status_t _render_type3_noncolor_glyph(cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, ++static cairo_status_t render_type3_noncolor_glyph(cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, + cairo_text_extents_t *metrics) + { +- return _render_type3_glyph(scaled_font, glyph, cr, metrics, false); ++ return render_type3_glyph(scaled_font, glyph, cr, metrics, false); + } + + #if POPPLER_CHECK_VERSION(22, 4, 0) +@@ -647,17 +648,17 @@ CairoType3Font *CairoType3Font::create(GfxFont *gfxFont, PDFDoc *doc, CairoFontE + Dict *charProcs = gfx8bit->getCharProcs(); + Ref ref = *gfxFont->getID(); + cairo_font_face_t *font_face = cairo_user_font_face_create(); +- cairo_user_font_face_set_init_func(font_face, _init_type3_glyph); ++ cairo_user_font_face_set_init_func(font_face, init_type3_glyph); + #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 17, 6) + // When both callbacks are set, Cairo will call the color glyph + // callback first. If that returns NOT_IMPLEMENTED, Cairo will + // then call the non-color glyph callback. + cairo_user_font_face_set_render_color_glyph_func(font_face, _render_type3_color_glyph); + #endif +- cairo_user_font_face_set_render_glyph_func(font_face, _render_type3_noncolor_glyph); ++ cairo_user_font_face_set_render_glyph_func(font_face, render_type3_noncolor_glyph); + type3_font_info_t *info = new type3_font_info_t(gfxFont, doc, fontEngine, printing, xref); + +- cairo_font_face_set_user_data(font_face, &type3_font_key, (void *)info, _free_type3_font_info); ++ cairo_font_face_set_user_data(font_face, &type3_font_key, (void *)info, free_type3_font_info); + + char **enc = gfx8bit->getEncoding(); + codeToGID.resize(256); +diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h +index dc9e47e45b..15d2bbb2b2 100644 +--- a/src/extension/internal/pdfinput/poppler-transition-api.h ++++ b/src/extension/internal/pdfinput/poppler-transition-api.h +@@ -15,37 +15,37 @@ + #include + + #if POPPLER_CHECK_VERSION(22, 4, 0) +-#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get()) ++#define POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)(font_ptr).get()) + #else + #define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr) + #endif + + #if POPPLER_CHECK_VERSION(22, 3, 0) +-#define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared(std::make_unique(uri)) ++#define POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared(std::make_unique(uri)) + #else + #define _POPPLER_MAKE_SHARED_PDFDOC(uri) std::make_shared(new GooString(uri), nullptr, nullptr, nullptr) + #endif + + #if POPPLER_CHECK_VERSION(0, 83, 0) +-#define _POPPLER_CONST_83 const ++#define POPPLER_CONST_83 const + #else + #define _POPPLER_CONST_83 + #endif + + #if POPPLER_CHECK_VERSION(0, 82, 0) +-#define _POPPLER_CONST_82 const ++#define POPPLER_CONST_82 const + #else + #define _POPPLER_CONST_82 + #endif + + #if POPPLER_CHECK_VERSION(0, 76, 0) +-#define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse) ++#define POPPLER_NEW_PARSER(xref, obj) Parser(xref, obj, gFalse) + #else + #define _POPPLER_NEW_PARSER(xref, obj) Parser(xref, new Lexer(xref, obj), gFalse) + #endif + + #if POPPLER_CHECK_VERSION(0, 83, 0) +-#define _POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr(new GlobalParams(args)) ++#define POPPLER_NEW_GLOBAL_PARAMS(args...) std::unique_ptr(new GlobalParams(args)) + #else + #define _POPPLER_NEW_GLOBAL_PARAMS(args...) new GlobalParams(args) + #endif +@@ -62,13 +62,13 @@ typedef bool GBool; + #endif + + #if POPPLER_CHECK_VERSION(0,70,0) +-#define _POPPLER_CONST const ++#define POPPLER_CONST const + #else + #define _POPPLER_CONST + #endif + + #if POPPLER_CHECK_VERSION(0,69,0) +-#define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(key, std::move(obj)) ++#define POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(key, std::move(obj)) + #elif POPPLER_CHECK_VERSION(0,58,0) + #define _POPPLER_DICTADD(dict, key, obj) (dict).dictAdd(copyString(key), std::move(obj)) + #else +@@ -77,10 +77,10 @@ typedef bool GBool; + + #if POPPLER_CHECK_VERSION(0,58,0) + #define POPPLER_NEW_OBJECT_API +-#define _POPPLER_FREE(obj) +-#define _POPPLER_CALL(ret, func) (ret = func()) +-#define _POPPLER_CALL_ARGS(ret, func, ...) (ret = func(__VA_ARGS__)) +-#define _POPPLER_CALL_ARGS_DEREF _POPPLER_CALL_ARGS ++#define POPPLER_FREE(obj) ++#define POPPLER_CALL(ret, func) ((ret) = func()) ++#define POPPLER_CALL_ARGS(ret, func, ...) (ret = func(__VA_ARGS__)) ++#define POPPLER_CALL_ARGS_DEREF _POPPLER_CALL_ARGS + #else + #define _POPPLER_FREE(obj) (obj).free() + #define _POPPLER_CALL(ret, func) (*func(&ret)) +diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp +index 71b8332188..8b0a306e95 100644 +--- a/src/extension/internal/pdfinput/poppler-utils.cpp ++++ b/src/extension/internal/pdfinput/poppler-utils.cpp +@@ -506,7 +506,7 @@ std::string FontData::getSpecification() const + // scanFonts from FontInfo.cc + //------------------------------------------------------------------------ + +-void _getFontsRecursive(std::shared_ptr pdf_doc, Dict *resources, const FontList &fontsList, ++void getFontsRecursive(std::shared_ptr pdf_doc, Dict *resources, const FontList &fontsList, + std::set &visitedObjects, int page) + { + auto xref = pdf_doc->getXRef(); +@@ -556,7 +556,7 @@ void _getFontsRecursive(std::shared_ptr pdf_doc, Dict *resources, const + continue; + + if (resObj.isDict() && resObj.getDict() != resources) { +- _getFontsRecursive(pdf_doc, resObj.getDict(), fontsList, visitedObjects, page); ++ getFontsRecursive(pdf_doc, resObj.getDict(), fontsList, visitedObjects, page); + } + } + } +@@ -571,7 +571,7 @@ FontList getPdfFonts(std::shared_ptr pdf_doc) + for (auto page_num = 1; page_num <= count; page_num++) { + auto page = pdf_doc->getCatalog()->getPage(page_num); + auto resources = page->getResourceDict(); +- _getFontsRecursive(pdf_doc, resources, fontsList, visitedObjects, page_num); ++ getFontsRecursive(pdf_doc, resources, fontsList, visitedObjects, page_num); + } + return fontsList; + } +diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp +index 8d69d0bf06..1f531a18f0 100644 +--- a/src/extension/internal/pdfinput/svg-builder.cpp ++++ b/src/extension/internal/pdfinput/svg-builder.cpp +@@ -16,6 +16,7 @@ + # include "config.h" // only include where actually required! + #endif + ++#include + #include + + #ifdef HAVE_POPPLER +@@ -422,10 +423,10 @@ static void svgSetTransform(Inkscape::XML::Node *node, Geom::Affine matrix) { + /** + * \brief Generates a SVG path string from poppler's data structure + */ +-static gchar *svgInterpretPath(_POPPLER_CONST_83 GfxPath *path) { ++static gchar *svgInterpretPath(POPPLER_CONST_83 GfxPath *path) { + Inkscape::SVG::PathString pathString; + for (int i = 0 ; i < path->getNumSubpaths() ; ++i ) { +- _POPPLER_CONST_83 GfxSubpath *subpath = path->getSubpath(i); ++ POPPLER_CONST_83 GfxSubpath *subpath = path->getSubpath(i); + if (subpath->getNumPoints() > 0) { + pathString.moveTo(subpath->getX(0), subpath->getY(0)); + int j = 1; +@@ -1012,7 +1013,7 @@ gchar *SvgBuilder::_createTilingPattern(GfxTilingPattern *tiling_pattern, + gchar *SvgBuilder::_createGradient(GfxShading *shading, const Geom::Affine pat_matrix, bool for_shading) + { + Inkscape::XML::Node *gradient; +- _POPPLER_CONST Function *func; ++ POPPLER_CONST Function *func; + int num_funcs; + bool extend0, extend1; + +@@ -1116,7 +1117,7 @@ static bool svgGetShadingColor(GfxShading *shading, double offset, GfxColor *res + + #define INT_EPSILON 8 + bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading, +- _POPPLER_CONST Function *func) { ++ POPPLER_CONST Function *func) { + int type = func->getType(); + auto space = shading->getColorSpace(); + if ( type == 0 || type == 2 ) { // Sampled or exponential function +@@ -1128,7 +1129,7 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh + _addStopToGradient(gradient, 1.0, &stop2, space, 1.0); + } + } else if ( type == 3 ) { // Stitching +- auto stitchingFunc = static_cast<_POPPLER_CONST StitchingFunction*>(func); ++ auto stitchingFunc = static_cast(func); + const double *bounds = stitchingFunc->getBounds(); + const double *encode = stitchingFunc->getEncode(); + int num_funcs = stitchingFunc->getNumFuncs(); +@@ -1141,10 +1142,10 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh + svgGetShadingColor(shading, bounds[i + 1], &color); + // Add stops + if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn +- double expE = (static_cast<_POPPLER_CONST ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE(); ++ double expE = (static_cast(stitchingFunc->getFunc(i)))->getE(); + if (expE > 1.0) { + expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1 +- if (encode[2*i] == 0) { // normal sequence ++ if (encode[static_cast(2*)i] == 0) { // normal sequence + _addStopToGradient(gradient, bounds[i + 1] - expE, &prev_color, space, 1.0); + } else { // reflected sequence + _addStopToGradient(gradient, bounds[i] + expE, &color, space, 1.0); +@@ -1798,7 +1799,7 @@ Inkscape::XML::Node *SvgBuilder::_createImage(Stream *str, int width, int height + for ( int x = 0 ; x < width ; x++ ) { + // Check each color component against the mask + for ( int i = 0; i < color_map->getNumPixelComps() ; i++) { +- if ( row[i] < mask_colors[2*i] * 255 || ++ if ( row[i] < mask_colors[static_cast(2*)i] * 255 || + row[i] > mask_colors[2*i + 1] * 255 ) { + *dest = *dest | 0xff000000; + break; +diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h +index 51160bf55a..67ae1d4b4d 100644 +--- a/src/extension/internal/pdfinput/svg-builder.h ++++ b/src/extension/internal/pdfinput/svg-builder.h +@@ -180,7 +180,7 @@ private: + void _addStopToGradient(Inkscape::XML::Node *gradient, double offset, GfxColor *color, GfxColorSpace *space, + double opacity); + bool _addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading, +- _POPPLER_CONST Function *func); ++ POPPLER_CONST Function *func); + gchar *_createTilingPattern(GfxTilingPattern *tiling_pattern, GfxState *state, + bool is_stroke=false); + // Image/mask creation +diff --git a/src/extension/internal/svg.h b/src/extension/internal/svg.h +index ec76bf0dbd..46cf7a3ddf 100644 +--- a/src/extension/internal/svg.h ++++ b/src/extension/internal/svg.h +@@ -14,7 +14,7 @@ + */ + + #ifndef __SVG_H__ +-#define __SVG_H__ ++#define SVG_H_ + + #include "../implementation/implementation.h" + +diff --git a/src/extension/internal/text_reassemble.c b/src/extension/internal/text_reassemble.c +index 543106f3e0..b8dcd7eab3 100644 +--- a/src/extension/internal/text_reassemble.c ++++ b/src/extension/internal/text_reassemble.c +@@ -1678,7 +1678,7 @@ int trinfo_load_bk(TR_INFO *tri, int usebk, TRCOLORREF bkcolor){ + */ + int trinfo_check_bk(TR_INFO *tri, int usebk, TRCOLORREF bkcolor){ + int status = 0; +- if( (tri->usebk != usebk) || memcmp(&tri->bkcolor,&bkcolor,sizeof(TRCOLORREF))){ status = -1; } ++ if( (tri->usebk != usebk) || memcmp(&tri->bkcolor,&bkcolor,sizeof(TRCOLORREF)) != 0){ status = -1; } + return(status); + } + +@@ -2228,7 +2228,7 @@ void TR_layout_2_svg(TR_INFO *tri){ + case TXTDECOR_WAVY: strcat(obuf," wavy" ); break; + default: break; + } +- if((tsp->decoration & TXTDECOR_CLRSET) && memcmp(&(tsp->decColor),&(tsp->color),sizeof(TRCOLORREF))){ ++ if((tsp->decoration & TXTDECOR_CLRSET) && memcmp(&(tsp->decColor),&(tsp->color),sizeof(TRCOLORREF)) != 0){ + /* CSS 3, CSS 2 implementations may choke on it. If the specified color matches text color omit, for better CSS 2 compatitiblity. */ + sprintf(cbuf," #%2.2X%2.2X%2.2X",tsp->decColor.Red,tsp->decColor.Green,tsp->decColor.Blue); + strcat(obuf,cbuf); +diff --git a/src/extension/internal/text_reassemble.h b/src/extension/internal/text_reassemble.h +index 25b556abb9..56137382ef 100644 +--- a/src/extension/internal/text_reassemble.h ++++ b/src/extension/internal/text_reassemble.h +@@ -22,7 +22,7 @@ Copyright: 2014 David Mathog and California Institute of Technology (Caltech) + */ + + #ifndef _TEXT_REASSEMBLE_ +-#define _TEXT_REASSEMBLE_ ++#define TEXT_REASSEMBLE_ + + #ifdef __cplusplus + extern "C" { +@@ -41,8 +41,8 @@ extern "C" { + #include FT_GLYPH_H + + /** \cond */ +-#define TEREMIN(A,B) (A < B ? A : B) +-#define TEREMAX(A,B) (A > B ? A : B) ++#define TEREMIN(A,B) ((A) < (B) ? (A) : (B)) ++#define TEREMAX(A,B) ((A) > (B) ? (A) : (B)) + + #ifndef M_PI + # define M_PI 3.14159265358979323846 /* pi */ +diff --git a/src/extension/internal/vsd-input.h b/src/extension/internal/vsd-input.h +index f30c905f67..781ea5e59e 100644 +--- a/src/extension/internal/vsd-input.h ++++ b/src/extension/internal/vsd-input.h +@@ -12,7 +12,7 @@ + */ + + #ifndef __EXTENSION_INTERNAL_VSDOUTPUT_H__ +-#define __EXTENSION_INTERNAL_VSDOUTPUT_H__ ++#define EXTENSION_INTERNAL_VSDOUTPUT_H_ + + #ifdef HAVE_CONFIG_H + # include "config.h" // only include where actually required! +diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp +index 048295dae6..25ebd24716 100644 +--- a/src/extension/internal/wmf-inout.cpp ++++ b/src/extension/internal/wmf-inout.cpp +@@ -1834,7 +1834,7 @@ std::cout << "BEFORE DRAW" + { + dbg_str << "\n"; + nSize = U_WMRSETBKCOLOR_get(contents, &tbkColor); +- if(memcmp(&tbkColor, &(d->dc[d->level].bkColor), sizeof(U_COLORREF))){ ++ if(memcmp(&tbkColor, &(d->dc[d->level].bkColor), sizeof(U_COLORREF)) != 0){ + d->dc[d->level].dirty |= DIRTY_TEXT; + if(d->dc[d->level].fill_mode == DRAW_PATTERN){ d->dc[d->level].dirty |= DIRTY_FILL; } + tbkMode = d->dc[d->level].bkMode; +diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp +index e5cbe95b04..4a98497033 100644 +--- a/src/extension/internal/wmf-print.cpp ++++ b/src/extension/internal/wmf-print.cpp +@@ -1479,7 +1479,7 @@ unsigned int PrintWmf::text(Inkscape::Extension::Print * /*mod*/, char const *te + float rgb[3]; + style->fill.value.color.get_rgb_floatv(rgb); + // only change the text color when it needs to be changed +- if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float))) { ++ if (memcmp(htextcolor_rgb, rgb, 3 * sizeof(float)) != 0) { + memcpy(htextcolor_rgb, rgb, 3 * sizeof(float)); + rec = U_WMRSETTEXTCOLOR_set(U_RGB(255 * rgb[0], 255 * rgb[1], 255 * rgb[2])); + if (!rec || wmf_append((U_METARECORD *)rec, wt, U_REC_FREE)) { +diff --git a/src/extension/internal/wpg-input.h b/src/extension/internal/wpg-input.h +index 67e4d9185e..b5c2635bde 100644 +--- a/src/extension/internal/wpg-input.h ++++ b/src/extension/internal/wpg-input.h +@@ -12,7 +12,7 @@ + */ + + #ifndef __EXTENSION_INTERNAL_WPGOUTPUT_H__ +-#define __EXTENSION_INTERNAL_WPGOUTPUT_H__ ++#define EXTENSION_INTERNAL_WPGOUTPUT_H_ + + #ifdef HAVE_CONFIG_H + # include "config.h" // only include where actually required! +diff --git a/src/extension/output.h b/src/extension/output.h +index 28109f14cf..1250042586 100644 +--- a/src/extension/output.h ++++ b/src/extension/output.h +@@ -12,7 +12,7 @@ + + + #ifndef INKSCAPE_EXTENSION_OUTPUT_H__ +-#define INKSCAPE_EXTENSION_OUTPUT_H__ ++#define INKSCAPE_EXTENSION_OUTPUT_H_ + + #include "extension.h" + class SPDocument; +diff --git a/src/extension/patheffect.h b/src/extension/patheffect.h +index b2dd7a029c..3d3ec7ddb8 100644 +--- a/src/extension/patheffect.h ++++ b/src/extension/patheffect.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_PATHEFFECT_H__ +-#define INKSCAPE_EXTENSION_PATHEFFECT_H__ ++#define INKSCAPE_EXTENSION_PATHEFFECT_H_ + + #include "document.h" + #include "extension.h" +diff --git a/src/extension/prefdialog/parameter-color.h b/src/extension/prefdialog/parameter-color.h +index 9a59d6d660..7a3cf5e54f 100644 +--- a/src/extension/prefdialog/parameter-color.h ++++ b/src/extension/prefdialog/parameter-color.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SEEN_INK_EXTENSION_PARAMCOLOR_H__ +-#define SEEN_INK_EXTENSION_PARAMCOLOR_H__ ++#define SEEN_INK_EXTENSION_PARAMCOLOR_H_ + /* + * Copyright (C) 2005-2007 Authors: + * Ted Gould +diff --git a/src/extension/prefdialog/parameter.h b/src/extension/prefdialog/parameter.h +index 206560af8b..aafb94d562 100644 +--- a/src/extension/prefdialog/parameter.h ++++ b/src/extension/prefdialog/parameter.h +@@ -12,7 +12,7 @@ + */ + + #ifndef SEEN_INK_EXTENSION_PARAM_H__ +-#define SEEN_INK_EXTENSION_PARAM_H__ ++#define SEEN_INK_EXTENSION_PARAM_H_ + + #include "widget.h" + +diff --git a/src/extension/prefdialog/prefdialog.h b/src/extension/prefdialog/prefdialog.h +index 897d33602c..6a1bf376cd 100644 +--- a/src/extension/prefdialog/prefdialog.h ++++ b/src/extension/prefdialog/prefdialog.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_DIALOG_H__ +-#define INKSCAPE_EXTENSION_DIALOG_H__ ++#define INKSCAPE_EXTENSION_DIALOG_H_ + + #include + #include +diff --git a/src/extension/print.h b/src/extension/print.h +index c4bc267bdd..6f5718c10d 100644 +--- a/src/extension/print.h ++++ b/src/extension/print.h +@@ -10,7 +10,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_PRINT_H__ +-#define INKSCAPE_EXTENSION_PRINT_H__ ++#define INKSCAPE_EXTENSION_PRINT_H_ + + #include <2geom/affine.h> + #include <2geom/generic-rect.h> +diff --git a/src/extension/system.cpp b/src/extension/system.cpp +index 0610825a1a..49f3085bff 100644 +--- a/src/extension/system.cpp ++++ b/src/extension/system.cpp +@@ -329,7 +329,7 @@ build_from_reprdoc(Inkscape::XML::Document *doc, Implementation::Implementation + + Inkscape::XML::Node *repr = doc->root(); + +- if (strcmp(repr->name(), INKSCAPE_EXTENSION_NS "inkscape-extension")) { ++ if (strcmp(repr->name(), INKSCAPE_EXTENSION_NS "inkscape-extension") != 0) { + g_warning("Extension definition started with <%s> instead of <" INKSCAPE_EXTENSION_NS "inkscape-extension>. Extension will not be created. See http://wiki.inkscape.org/wiki/index.php/Extensions for reference.\n", repr->name()); + return false; + } +diff --git a/src/extension/system.h b/src/extension/system.h +index 937cdde800..a6648e3b01 100644 +--- a/src/extension/system.h ++++ b/src/extension/system.h +@@ -14,7 +14,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_SYSTEM_H__ +-#define INKSCAPE_EXTENSION_SYSTEM_H__ ++#define INKSCAPE_EXTENSION_SYSTEM_H_ + + #include + +diff --git a/src/extension/template.h b/src/extension/template.h +index b50b73a1bd..089d5f3bb1 100644 +--- a/src/extension/template.h ++++ b/src/extension/template.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_TEMPLATE_H__ +-#define INKSCAPE_EXTENSION_TEMPLATE_H__ ++#define INKSCAPE_EXTENSION_TEMPLATE_H_ + + #include + #include +diff --git a/src/extension/timer.h b/src/extension/timer.h +index ce9c495571..2ea7f37e7c 100644 +--- a/src/extension/timer.h ++++ b/src/extension/timer.h +@@ -12,7 +12,7 @@ + */ + + #ifndef INKSCAPE_EXTENSION_TIMER_H__ +-#define INKSCAPE_EXTENSION_TIMER_H__ ++#define INKSCAPE_EXTENSION_TIMER_H_ + + #include + #include +diff --git a/src/file-update.cpp b/src/file-update.cpp +index 6cbd1814b4..1e350a5460 100644 +--- a/src/file-update.cpp ++++ b/src/file-update.cpp +@@ -227,7 +227,7 @@ void sp_file_fix_osb(SPObject *o) + * first empty lines and style attrs on other empty lines. + * + * */ +-void _fix_pre_v1_empty_lines(SPObject *o) ++void fix_pre_v1_empty_lines(SPObject *o) + { + std::vector cl = o->childList(false); + bool begin = true; +@@ -257,7 +257,7 @@ void _fix_pre_v1_empty_lines(SPObject *o) + + void sp_file_fix_empty_lines(SPDocument *doc) + { +- sp_file_text_run_recursive(_fix_pre_v1_empty_lines, doc->getRoot()); ++ sp_file_text_run_recursive(fix_pre_v1_empty_lines, doc->getRoot()); + sp_file_text_run_recursive(fix_update, doc->getRoot()); + } + +diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp +index 9b3bfffef7..377e0b0dba 100644 +--- a/src/filter-chemistry.cpp ++++ b/src/filter-chemistry.cpp +@@ -270,7 +270,7 @@ new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdo + g_assert(b != nullptr); + } + // Blend primitive +- if(strcmp(blendmode, "normal")) { ++ if(strcmp(blendmode, "normal") != 0) { + Inkscape::XML::Node *b_repr; + b_repr = xml_doc->createElement("svg:feBlend"); + b_repr->setAttribute("inkscape:collect", "always"); +diff --git a/src/filter-enums.h b/src/filter-enums.h +index 613634615a..4c484fe064 100644 +--- a/src/filter-enums.h ++++ b/src/filter-enums.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_FILTER_ENUMS_H__ +-#define __SP_FILTER_ENUMS_H__ ++#define SP_FILTER_ENUMS_H_ + + /* + * Conversion data for filter and filter primitive enumerations +diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp +index 4288a74c2a..176a77a390 100644 +--- a/src/gradient-drag.cpp ++++ b/src/gradient-drag.cpp +@@ -246,11 +246,11 @@ bool GrDrag::styleSet( const SPCSSAttr *css, bool switch_style) + sp_repr_css_set_property (stop, "stop-color", css->attribute("color")); + } + +- if (css->attribute("stroke") && strcmp(css->attribute("stroke"), "none")) { ++ if (css->attribute("stroke") && strcmp(css->attribute("stroke"), "none") != 0) { + sp_repr_css_set_property (stop, "stop-color", css->attribute("stroke")); + } + +- if (css->attribute("fill") && strcmp(css->attribute("fill"), "none")) { ++ if (css->attribute("fill") && strcmp(css->attribute("fill"), "none") != 0) { + sp_repr_css_set_property (stop, "stop-color", css->attribute("fill")); + } + +@@ -2766,7 +2766,7 @@ void GrDrag::selected_move_screen(double x, double y) + */ + bool GrDrag::key_press_handler(GdkEvent *event) + { +- if (MOD__CTRL(event)) { ++ if (MOD_CTRL(event)) { + return false; + } + +@@ -2807,11 +2807,11 @@ bool GrDrag::key_press_handler(GdkEvent *event) + + gint mul = 1 + Inkscape::UI::Tools::gobble_key_events(keyval, 0); // with any mask + +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + mul *= 10; + } + +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + selected_move_screen(mul * x_dir, mul * y_dir); + } else { + auto *prefs = Inkscape::Preferences::get(); +diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp +index 30111cb8d9..737f0fa7be 100644 +--- a/src/helper/geom.cpp ++++ b/src/helper/geom.cpp +@@ -781,7 +781,7 @@ recursive_bezier4(const double x1, const double y1, + double m_distance_tolerance_square = 0.5 / m_approximation_scale; + m_distance_tolerance_square *= m_distance_tolerance_square; + enum curve_recursion_limit_e { curve_recursion_limit = 32 }; +-#define calc_sq_distance(A,B,C,D) ((A-C)*(A-C) + (B-D)*(B-D)) ++#define calc_sq_distance(A,B,C,D) (((A)-(C))*((A)-(C)) + ((B)-(D))*((B)-(D))) + + if(level > curve_recursion_limit) + { +diff --git a/src/include/macros.h b/src/include/macros.h +index aa1719d2f9..cd9c4fea78 100644 +--- a/src/include/macros.h ++++ b/src/include/macros.h +@@ -31,12 +31,12 @@ + #define INK_GDK_MODIFIER_MASK (GDK_SHIFT_MASK | INK_GDK_PRIMARY_MASK | GDK_MOD1_MASK) + + // keyboard modifiers in an event +-#define MOD__SHIFT(event) ((event)->key.state & GDK_SHIFT_MASK) +-#define MOD__CTRL(event) ((event)->key.state & INK_GDK_PRIMARY_MASK) +-#define MOD__ALT(event) ((event)->key.state & GDK_MOD1_MASK) +-#define MOD__SHIFT_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == GDK_SHIFT_MASK) +-#define MOD__CTRL_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == INK_GDK_PRIMARY_MASK) +-#define MOD__ALT_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == GDK_MOD1_MASK) ++#define MOD_SHIFT(event) ((event)->key.state & GDK_SHIFT_MASK) ++#define MOD_CTRL(event) ((event)->key.state & INK_GDK_PRIMARY_MASK) ++#define MOD_ALT(event) ((event)->key.state & GDK_MOD1_MASK) ++#define MOD_SHIFT_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == GDK_SHIFT_MASK) ++#define MOD_CTRL_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == INK_GDK_PRIMARY_MASK) ++#define MOD_ALT_ONLY(event) (((event)->key.state & INK_GDK_MODIFIER_MASK) == GDK_MOD1_MASK) + + #endif // SEEN_MACROS_H + +diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp +index f9e266e05b..14d9b73f38 100644 +--- a/src/inkscape-application.cpp ++++ b/src/inkscape-application.cpp +@@ -575,11 +575,11 @@ InkscapeApplication::dump() + } + } + +-static InkscapeApplication *_instance = nullptr; ++static InkscapeApplication *instance = nullptr; + + InkscapeApplication *InkscapeApplication::instance() + { +- return _instance; ++ return instance; + } + + void +@@ -607,11 +607,11 @@ InkscapeApplication::_start_main_option_section(const Glib::ustring& section_nam + + InkscapeApplication::InkscapeApplication() + { +- if (_instance) { ++ if (instance) { + std::cerr << "Multiple instances of InkscapeApplication" << std::endl; + std::terminate(); + } +- _instance = this; ++ instance = this; + + using T = Gio::Application; + +@@ -815,7 +815,7 @@ InkscapeApplication::InkscapeApplication() + + InkscapeApplication::~InkscapeApplication() + { +- _instance = nullptr; ++ instance = nullptr; + Inkscape::Util::StaticsBin::get().destroy(); + } + +diff --git a/src/inkscape-window.cpp b/src/inkscape-window.cpp +index 2f8110543a..290a153704 100644 +--- a/src/inkscape-window.cpp ++++ b/src/inkscape-window.cpp +@@ -64,7 +64,7 @@ using Inkscape::UI::Dialog::DialogManager; + using Inkscape::UI::Dialog::DialogContainer; + using Inkscape::UI::Dialog::DialogWindow; + +-static gboolean _resize_children(Gtk::Window *win) ++static gboolean resize_children(Gtk::Window *win) + { + Inkscape::UI::resize_widget_children(win); + return false; +@@ -155,7 +155,7 @@ InkscapeWindow::InkscapeWindow(SPDocument* document) + DialogManager::singleton().restore_dialogs_state(_desktop->getContainer(), include_short_lived); + + // This pokes the window to request the right size for the dialogs once loaded. +- g_idle_add(GSourceFunc(&_resize_children), this); ++ g_idle_add(GSourceFunc(&resize_children), this); + + // ================= Shift Icons ================= + // Note: The menu is defined at the app level but shifting icons requires actual widgets and +diff --git a/src/inkscape.cpp b/src/inkscape.cpp +index b60a4e83dc..142ce0a294 100644 +--- a/src/inkscape.cpp ++++ b/src/inkscape.cpp +@@ -66,7 +66,7 @@ + #include + + // Inkscape::Application static members +-Inkscape::Application * Inkscape::Application::_S_inst = nullptr; ++Inkscape::Application * Inkscape::Application::S_inst = nullptr; + bool Inkscape::Application::_crashIsHappening = false; + + #define DESKTOP_IS_ACTIVE(d) (INKSCAPE._desktops != nullptr && !INKSCAPE._desktops->empty() && ((d) == INKSCAPE._desktops->front())) +@@ -124,13 +124,13 @@ void inkscape_unref(Inkscape::Application & in) + { + in.refCount--; + +- if (&in == Inkscape::Application::_S_inst) { ++ if (&in == Inkscape::Application::S_inst) { + if (in.refCount <= 0) { +- delete Inkscape::Application::_S_inst; ++ delete Inkscape::Application::S_inst; + } + } else { + g_error("Attempt to unref an Application (=%p) not the current instance (=%p) (maybe it's already been destroyed?)", +- &in, Inkscape::Application::_S_inst); ++ &in, Inkscape::Application::S_inst); + } + } + +@@ -165,7 +165,7 @@ Application::create(bool use_gui) + bool + Application::exists() + { +- return Application::_S_inst != nullptr; ++ return Application::S_inst != nullptr; + } + + /** +@@ -178,7 +178,7 @@ Application::instance() + if (!exists()) { + g_error("Inkscape::Application does not yet exist."); + } +- return *Application::_S_inst; ++ return *Application::S_inst; + } + + /* \brief Constructor for the application. +@@ -223,7 +223,7 @@ Application::Application(bool use_gui) : + + // \TODO: this belongs to Application::init but if it isn't here + // then the Filters and Extensions menus don't work. +- _S_inst = this; ++ S_inst = this; + + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + InkErrorHandler* handler = new InkErrorHandler(use_gui); +@@ -321,7 +321,7 @@ Application::~Application() + + Inkscape::Preferences::unload(); + +- _S_inst = nullptr; // this will probably break things ++ S_inst = nullptr; // this will probably break things + + refCount = 0; + // gtk_main_quit (); +diff --git a/src/inkscape.h b/src/inkscape.h +index 1129f51e42..f1eaafcea8 100644 +--- a/src/inkscape.h ++++ b/src/inkscape.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __INKSCAPE_H__ +-#define __INKSCAPE_H__ ++#define INKSCAPE_H_ + + /* + * Interface to main application +@@ -163,7 +163,7 @@ public: + } + + private: +- static Inkscape::Application * _S_inst; ++ static Inkscape::Application * S_inst; + + Application(bool use_gui); + ~Application(); +diff --git a/src/io/resource.cpp b/src/io/resource.cpp +index aa8af77a8f..a656ae2273 100644 +--- a/src/io/resource.cpp ++++ b/src/io/resource.cpp +@@ -194,7 +194,7 @@ std::string get_filename_string(Type type, char const *filename, bool localized, + + // TRANSLATORS: 'en' is an ISO 639-1 language code. + // Replace with language code for your language, i.e. the name of your .po file +- localized = localized && strcmp(_("en"), "en"); ++ localized = localized && strcmp(_("en"), "en") != 0; + + if (localized) { + std::string localized_filename = filename; +diff --git a/src/io/stream/stringstream.h b/src/io/stream/stringstream.h +index 3afb9a8705..149fe58d2c 100644 +--- a/src/io/stream/stringstream.h ++++ b/src/io/stream/stringstream.h +@@ -8,7 +8,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __INKSCAPE_IO_STRINGSTREAM_H__ +-#define __INKSCAPE_IO_STRINGSTREAM_H__ ++#define INKSCAPE_IO_STRINGSTREAM_H_ + + #include + +diff --git a/src/libnrtype/Layout-TNG-OutIter.cpp b/src/libnrtype/Layout-TNG-OutIter.cpp +index 3e9b611bc8..2b9210f43c 100644 +--- a/src/libnrtype/Layout-TNG-OutIter.cpp ++++ b/src/libnrtype/Layout-TNG-OutIter.cpp +@@ -740,7 +740,7 @@ void Layout::simulateLayoutUsingKerning(iterator const &from, iterator const &to + original_item = item_getter; \ + _char_index--; \ + } \ +- while (item_getter == original_item) { \ ++ while ((item_getter) == original_item) { \ + if (_char_index == 0) { \ + _glyph_index = _parent_layout->_characters[_char_index].in_glyph; \ + return true; \ +@@ -764,7 +764,7 @@ void Layout::simulateLayoutUsingKerning(iterator const &from, iterator const &to + _glyph_index = _parent_layout->_glyphs.size(); \ + return false; \ + } \ +- if (item_getter != original_item) break; \ ++ if ((item_getter) != original_item) break; \ + } \ + _glyph_index = _parent_layout->_characters[_char_index].in_glyph; \ + return true; \ +diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h +index 70c5890795..9b5c87446c 100644 +--- a/src/libnrtype/Layout-TNG.h ++++ b/src/libnrtype/Layout-TNG.h +@@ -10,7 +10,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __LAYOUT_TNG_H__ +-#define __LAYOUT_TNG_H__ ++#define LAYOUT_TNG_H_ + + //#define DEBUG_TEXTLAYOUT_DUMPASTEXT + +diff --git a/src/live_effects/lpe-sketch.cpp b/src/live_effects/lpe-sketch.cpp +index bcd87b3f3f..a22902d2d3 100644 +--- a/src/live_effects/lpe-sketch.cpp ++++ b/src/live_effects/lpe-sketch.cpp +@@ -324,7 +324,7 @@ LPESketch::doEffect_pwd2 (Geom::Piecewise > const & pwd2_ + } + if (closed && s1>piece_total_length + s0_initial){ + done = true; +- if (closed && s1>2*piece_total_length){ ++ if ( s1>2*piece_total_length){ + s1 = 2*piece_total_length - strokeoverlap*(1-strokeoverlap_rdm)*strokelength-0.0001; + } + } +diff --git a/src/live_effects/spiro.cpp b/src/live_effects/spiro.cpp +index 4c129bafd2..8c34967caa 100644 +--- a/src/live_effects/spiro.cpp ++++ b/src/live_effects/spiro.cpp +@@ -13,6 +13,7 @@ + #include "spiro.h" + + #include ++#include + #include + #include + +@@ -755,9 +756,9 @@ spiro_iter(spiro_seg *s, bandmat *m, int *perm, double *v, const int n) + } + if (cyclic) { + memcpy(m + nmat, m, sizeof(bandmat) * nmat); +- memcpy(m + 2 * nmat, m, sizeof(bandmat) * nmat); ++ memcpy(m + static_cast(2 * )nmat, m, sizeof(bandmat) * nmat); + memcpy(v + nmat, v, sizeof(double) * nmat); +- memcpy(v + 2 * nmat, v, sizeof(double) * nmat); ++ memcpy(v + static_cast(2 * )nmat, v, sizeof(double) * nmat); + n_invert = 3 * nmat; + j = nmat; + } else { +diff --git a/src/manipulation/copy-resource.h b/src/manipulation/copy-resource.h +index 08348be368..907417b1cb 100644 +--- a/src/manipulation/copy-resource.h ++++ b/src/manipulation/copy-resource.h +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + + #ifndef _SEEN_COPY_RESOURCE_H_ +-#define _SEEN_COPY_RESOURCE_H_ ++#define SEEN_COPY_RESOURCE_H_ + + class SPDocument; + class SPObject; +diff --git a/src/object/algorithms/graphlayout.cpp b/src/object/algorithms/graphlayout.cpp +index c42ca22fb6..adc0f2534f 100644 +--- a/src/object/algorithms/graphlayout.cpp ++++ b/src/object/algorithms/graphlayout.cpp +@@ -161,7 +161,7 @@ void graphlayout(std::vector const & items) { + es.emplace_back(rect_index_first, rect_index_second); + + if (conn->style->marker_end.set) { +- if (directed && strcmp(conn->style->marker_end.value(), "none")) { ++ if (directed && strcmp(conn->style->marker_end.value(), "none") != 0) { + constraints.push_back(new SeparationConstraint(YDIM, rect_index_first, rect_index_second, + ideal_connector_length * directed_edge_height_modifier)); + } +diff --git a/src/object/box3d.cpp b/src/object/box3d.cpp +index 1efc8bba6e..6e7a782066 100644 +--- a/src/object/box3d.cpp ++++ b/src/object/box3d.cpp +@@ -140,14 +140,14 @@ void SPBox3D::set(SPAttr key, const gchar* value) { + box->position_set(); + break; + case SPAttr::INKSCAPE_BOX3D_CORNER0: +- if (value && strcmp(value, "0 : 0 : 0 : 0")) { ++ if (value && strcmp(value, "0 : 0 : 0 : 0") != 0) { + box->orig_corner0 = Proj::Pt3(value); + box->save_corner0 = box->orig_corner0; + box->position_set(); + } + break; + case SPAttr::INKSCAPE_BOX3D_CORNER7: +- if (value && strcmp(value, "0 : 0 : 0 : 0")) { ++ if (value && strcmp(value, "0 : 0 : 0 : 0") != 0) { + box->orig_corner7 = Proj::Pt3(value); + box->save_corner7 = box->orig_corner7; + box->position_set(); +diff --git a/src/object/color-profile.cpp b/src/object/color-profile.cpp +index f02c2f95ae..092f87be6b 100644 +--- a/src/object/color-profile.cpp ++++ b/src/object/color-profile.cpp +@@ -108,7 +108,7 @@ namespace Inkscape { + class ColorProfileImpl { + public: + static cmsHPROFILE _sRGBProf; +- static cmsHPROFILE _NullProf; ++ static cmsHPROFILE NullProf; + + ColorProfileImpl(); + +@@ -160,13 +160,13 @@ cmsHPROFILE ColorProfileImpl::getSRGBProfile() { + return ColorProfileImpl::_sRGBProf; + } + +-cmsHPROFILE ColorProfileImpl::_NullProf = nullptr; ++cmsHPROFILE ColorProfileImpl::NullProf = nullptr; + + cmsHPROFILE ColorProfileImpl::getNULLProfile() { +- if ( !_NullProf ) { +- _NullProf = cmsCreateNULLProfile(); ++ if ( !NullProf ) { ++ NullProf = cmsCreateNULLProfile(); + } +- return _NullProf; ++ return NullProf; + } + + ColorProfile::FilePlusHome::FilePlusHome(Glib::ustring filename, bool isInHome) : filename(std::move(filename)), isInHome(isInHome) { +diff --git a/src/object/sp-anchor.cpp b/src/object/sp-anchor.cpp +index a1d5474a30..76e43f94a9 100644 +--- a/src/object/sp-anchor.cpp ++++ b/src/object/sp-anchor.cpp +@@ -112,7 +112,7 @@ void SPAnchor::updatePageAnchor() { + } + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPAnchor::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { +diff --git a/src/object/sp-dimensions.cpp b/src/object/sp-dimensions.cpp +index b5d8c47001..ab2e16836c 100644 +--- a/src/object/sp-dimensions.cpp ++++ b/src/object/sp-dimensions.cpp +@@ -28,7 +28,7 @@ + void SPDimensions::calcDimsFromParentViewport(const SPItemCtx *ictx, bool assign_to_set, // + SPDimensions const *use) + { +-#define ASSIGN(field) { if (assign_to_set) { field._set = true; } } ++#define ASSIGN(field) { if (assign_to_set) { (field)._set = true; } } + + auto const *effectivewidth = &this->width; + auto const *effectiveheight = &this->height; +diff --git a/src/object/sp-dimensions.h b/src/object/sp-dimensions.h +index 337b6d1533..f60a077b75 100644 +--- a/src/object/sp-dimensions.h ++++ b/src/object/sp-dimensions.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef SP_DIMENSIONS_H__ +-#define SP_DIMENSIONS_H__ ++#define SP_DIMENSIONS_H_ + + /* + * dimensions helper class, common code used by root, image and others +diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp +index 7f97d581ad..af05138afd 100644 +--- a/src/object/sp-ellipse.cpp ++++ b/src/object/sp-ellipse.cpp +@@ -183,7 +183,7 @@ void SPGenericEllipse::set(SPAttr key, gchar const *value) + + case SPAttr::SODIPODI_OPEN: + // This is for reading in old files. +- if ((!value) || strcmp(value,"true")) { ++ if ((!value) || strcmp(value,"true") != 0) { + // We rely on this to reset arc_type when changing an arc to + // an ellipse/circle, so it is drawn as a closed path. + // A clone will not even change it's this->type +diff --git a/src/object/sp-filter.cpp b/src/object/sp-filter.cpp +index cb065884ba..82facf20bd 100644 +--- a/src/object/sp-filter.cpp ++++ b/src/object/sp-filter.cpp +@@ -148,7 +148,7 @@ void SPFilter::set(SPAttr key, char const *value) + requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SPAttr::AUTO_REGION: +- auto_region = !value || std::strcmp(value, "false"); ++ auto_region = !value || std::strcmp(value, "false") != 0; + requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SPAttr::FILTERRES: +diff --git a/src/object/sp-font-face.cpp b/src/object/sp-font-face.cpp +index 5685a7362a..12318d6632 100644 +--- a/src/object/sp-font-face.cpp ++++ b/src/object/sp-font-face.cpp +@@ -729,7 +729,7 @@ void SPFontFace::update(SPCtx *ctx, guint flags) { + SPObject::update(ctx, flags); + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPFontFace::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { +diff --git a/src/object/sp-font.cpp b/src/object/sp-font.cpp +index a1cd5b7b14..77c37fb6a7 100644 +--- a/src/object/sp-font.cpp ++++ b/src/object/sp-font.cpp +@@ -161,7 +161,7 @@ void SPFont::update(SPCtx *ctx, guint flags) { + SPObject::update(ctx, flags); + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPFont::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { +diff --git a/src/object/sp-glyph-kerning.cpp b/src/object/sp-glyph-kerning.cpp +index f92477368c..62bb5472f8 100644 +--- a/src/object/sp-glyph-kerning.cpp ++++ b/src/object/sp-glyph-kerning.cpp +@@ -155,7 +155,7 @@ void SPGlyphKerning::update(SPCtx *ctx, guint flags) + SPObject::update(ctx, flags); + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPGlyphKerning::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) + { +diff --git a/src/object/sp-glyph.cpp b/src/object/sp-glyph.cpp +index e8fecdfac9..e08ec76aac 100644 +--- a/src/object/sp-glyph.cpp ++++ b/src/object/sp-glyph.cpp +@@ -237,7 +237,7 @@ void SPGlyph::update(SPCtx *ctx, guint flags) + SPObject::update(ctx, flags); + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPGlyph::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) + { +diff --git a/src/object/sp-gradient.cpp b/src/object/sp-gradient.cpp +index 1a81abda07..429877747b 100644 +--- a/src/object/sp-gradient.cpp ++++ b/src/object/sp-gradient.cpp +@@ -495,7 +495,7 @@ void SPGradient::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *re + this->has_stops = TRUE; + if ( this->getStopCount() > 1 ) { + gchar const * attr = this->getAttribute("inkscape:swatch"); +- if ( attr && strcmp(attr, "gradient") ) { ++ if ( attr && strcmp(attr, "gradient") != 0 ) { + this->setAttribute( "inkscape:swatch", "gradient" ); + } + } +@@ -540,7 +540,7 @@ void SPGradient::remove_child(Inkscape::XML::Node *child) + if ( this->getStopCount() <= 1 ) { + gchar const * attr = this->getAttribute("inkscape:swatch"); + +- if ( attr && strcmp(attr, "solid") ) { ++ if ( attr && strcmp(attr, "solid") != 0 ) { + this->setAttribute( "inkscape:swatch", "solid" ); + } + } +diff --git a/src/object/sp-image.cpp b/src/object/sp-image.cpp +index 12cdb4836a..1c4d3fbce4 100644 +--- a/src/object/sp-image.cpp ++++ b/src/object/sp-image.cpp +@@ -18,21 +18,22 @@ + # include "config.h" // only include where actually required! + #endif + +-#include +-#include +-#include +-#include +-#include + #include <2geom/rect.h> + #include <2geom/transforms.h> +-#include ++#include ++#include ++#include + #include ++#include ++#include ++#include ++#include + +-#include "snap-candidate.h" +-#include "snap-preferences.h" +-#include "display/drawing-image.h" + #include "display/cairo-utils.h" + #include "display/curve.h" ++#include "display/drawing-image.h" ++#include "snap-candidate.h" ++#include "snap-preferences.h" + // Added for preserveAspectRatio support -- EAF + #include "attributes.h" + #include "print.h" +@@ -785,7 +786,7 @@ void sp_embed_image(Inkscape::XML::Node *image_node, Inkscape::Pixbuf *pb) + + // Save base64 encoded data in image node + // this formula taken from Glib docs +- gsize needed_size = len * 4 / 3 + len * 4 / (3 * 72) + 7; ++ gsize needed_size = len * 4 / 3 + len * 4 / (static_cast(3 * )72) + 7; + needed_size += 5 + 8 + data_mimetype.size(); // 5 bytes for data: + 8 for ;base64, + + gchar *buffer = (gchar *) g_malloc(needed_size); +@@ -838,7 +839,7 @@ void sp_embed_svg(Inkscape::XML::Node *image_node, std::string const &fn) + + // Save base64 encoded data in image node + // this formula taken from Glib docs +- gsize needed_size = len * 4 / 3 + len * 4 / (3 * 72) + 7; ++ gsize needed_size = len * 4 / 3 + len * 4 / (static_cast(3 * )72) + 7; + needed_size += 5 + 8 + data_mimetype.size(); // 5 bytes for data: + 8 for ;base64, + + gchar *buffer = (gchar *) g_malloc(needed_size); +diff --git a/src/object/sp-item-group.cpp b/src/object/sp-item-group.cpp +index 187804544b..1d69d89e88 100644 +--- a/src/object/sp-item-group.cpp ++++ b/src/object/sp-item-group.cpp +@@ -396,7 +396,7 @@ void SPGroup::snappoints(std::vector &p, Inkscape: + * + * @post item and its representation are updated + */ +-static void _ungroup_compensate_source_transform(SPItem *item, SPItem const *const expected_source, ++static void ungroup_compensate_source_transform(SPItem *item, SPItem const *const expected_source, + Geom::Affine const &source_transform) + { + if (!item || item->cloned) { +@@ -467,7 +467,7 @@ void sp_item_group_ungroup_handle_clones(SPItem *parent, Geom::Affine const g) + auto hrefListCopy = parent->hrefList; + + for (auto *cobj : hrefListCopy) { +- _ungroup_compensate_source_transform(cast(cobj), parent, g); ++ ungroup_compensate_source_transform(cast(cobj), parent, g); + } + } + +@@ -599,7 +599,7 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children) + bool breakparent = false; + for (auto &child2 : group->children) { + if (cast(&child2) == linked) { +- _ungroup_compensate_source_transform(citem, cast(linked), g); ++ ungroup_compensate_source_transform(citem, cast(linked), g); + breakparent = true; + break; + } +@@ -759,7 +759,7 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children) + SPObject *sp_item_group_get_child_by_name(SPGroup *group, SPObject *ref, const gchar *name) + { + SPObject *child = (ref) ? ref->getNext() : group->firstChild(); +- while ( child && strcmp(child->getRepr()->name(), name) ) { ++ while ( child && strcmp(child->getRepr()->name(), name) != 0 ) { + child = child->getNext(); + } + return child; +diff --git a/src/object/sp-mesh-array.cpp b/src/object/sp-mesh-array.cpp +index 33f2a40386..9cd6f4a4c3 100644 +--- a/src/object/sp-mesh-array.cpp ++++ b/src/object/sp-mesh-array.cpp +@@ -38,6 +38,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include + #include + #include + +@@ -1663,11 +1664,11 @@ void SPMeshNodeArray::bicubic( SPMeshNodeArray* smooth, SPMeshType type ) { + d[i].resize( smooth->patch_columns() + 1 ); + for( unsigned j = 0; j < d[i].size(); ++j ) { + float rgb_color[3]; +- this->nodes[ i*3 ][ j*3 ]->color.get_rgb_floatv(rgb_color); ++ this->nodes[ static_cast(i*)3 ][ static_cast(j*)3 ]->color.get_rgb_floatv(rgb_color); + d[i][j].g[0][0] = rgb_color[ 0 ]; + d[i][j].g[1][0] = rgb_color[ 1 ]; + d[i][j].g[2][0] = rgb_color[ 2 ]; +- d[i][j].p = this->nodes[ i*3 ][ j*3 ]->p; ++ d[i][j].p = this->nodes[ static_cast(i*)3 ][ static_cast(j*)3 ]->p; + } + } + +@@ -1815,7 +1816,7 @@ void SPMeshNodeArray::bicubic( SPMeshNodeArray* smooth, SPMeshType type ) { + for( unsigned k = 0; k < 9; ++k ) { + for( unsigned l = 0; l < 9; ++l ) { + // Every third node is a corner node +- smooth->nodes[ (i*8+k)*3 ][(j*8+l)*3 ]->color.set( r[0][k][l], r[1][k][l], r[2][k][l] ); ++ smooth->nodes[ static_cast((i*8+k)*)3 ][static_cast((j*8+l)*)3 ]->color.set( r[0][k][l], r[1][k][l], r[2][k][l] ); + } + } + } +@@ -2874,7 +2875,7 @@ void SPMeshNodeArray::split_row( unsigned int row, double coord ) { + SPMeshNode* new_node = new SPMeshNode; + new_row.push_back( new_node ); + } +- nodes.insert( nodes.begin()+3*(row+1), new_row ); ++ nodes.insert( nodes.begin()+static_cast<__gnu_cxx::__normal_iterator *, class std::vector > >::difference_type>(3*(row+1)), new_row ); + } + + guint i = 3 * row; // Convert from patch row to node row +diff --git a/src/object/sp-missing-glyph.cpp b/src/object/sp-missing-glyph.cpp +index ff32a5f732..e82f69cd9d 100644 +--- a/src/object/sp-missing-glyph.cpp ++++ b/src/object/sp-missing-glyph.cpp +@@ -97,7 +97,7 @@ void SPMissingGlyph::set(SPAttr key, const gchar* value) { + } + } + +-#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), rs->attribute(key)); ++#define COPY_ATTR(rd,rs,key) (rd)->setAttribute((key), (rs)->attribute(key)); + + Inkscape::XML::Node* SPMissingGlyph::write(Inkscape::XML::Document* xml_doc, Inkscape::XML::Node* repr, guint flags) { + if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { +diff --git a/src/object/sp-tag-use.h b/src/object/sp-tag-use.h +index 5a5cb993df..f3eb4ff8c0 100644 +--- a/src/object/sp-tag-use.h ++++ b/src/object/sp-tag-use.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_TAG_USE_H__ +-#define __SP_TAG_USE_H__ ++#define SP_TAG_USE_H_ + + /* + * SVG implementation +diff --git a/src/object/uri-references.cpp b/src/object/uri-references.cpp +index c7a1d34ab5..7c22181bf7 100644 +--- a/src/object/uri-references.cpp ++++ b/src/object/uri-references.cpp +@@ -171,7 +171,7 @@ void URIReference::attach(const URI &uri) + if (!strncmp(fragment, "xpointer(id(", 12)) { + id = g_strdup(fragment + 12); + size_t const len = strlen(id); +- if (len < 3 || strcmp(id + len - 2, "))")) { ++ if (len < 3 || strcmp(id + len - 2, "))") != 0) { + g_free(id); + throw MalformedURIException(); + } +diff --git a/src/object/uri.cpp b/src/object/uri.cpp +index 05539a69e2..c72a18a505 100644 +--- a/src/object/uri.cpp ++++ b/src/object/uri.cpp +@@ -11,14 +11,14 @@ + + #include "uri.h" + ++#include + #include +- + #include + #include + #include + #include +-#include + #include ++#include + + #include "bad-uri-exception.h" + +@@ -412,7 +412,7 @@ static int uri_unescape_utf8_codepoint(const char *s, char *out) + out[n] = 0; + + for (int i = 1; i < n; ++i) { +- value = uri_unescape_triplet(s + (i * 3)); ++ value = uri_unescape_triplet(s + (static_cast(i * )3)); + + if ((value >> 6) != /* 0b10 */ 0x2) { + return 0; +diff --git a/src/object/viewbox.h b/src/object/viewbox.h +index bf516a5aa4..bf73abaa4b 100644 +--- a/src/object/viewbox.h ++++ b/src/object/viewbox.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_VIEWBOX_H__ +-#define __SP_VIEWBOX_H__ ++#define SP_VIEWBOX_H_ + + /* + * viewBox helper class, common code used by root, symbol, marker, pattern, image, view +diff --git a/src/oklab.cpp b/src/oklab.cpp +index 80f994e02b..a6d47d49f1 100644 +--- a/src/oklab.cpp ++++ b/src/oklab.cpp +@@ -12,11 +12,12 @@ + + #include "oklab.h" + +-#include +- + #include <2geom/angle.h> + #include <2geom/math-utils.h> + #include <2geom/polynomial.h> ++#include ++#include ++ + #include "color.h" + + namespace Oklab { +@@ -361,7 +362,7 @@ double max_chroma(double l, double h) + */ + unsigned const COLOR_SCALE_INTERVALS = 32; // Must be a power of 2 and less than 1024. + +-uint8_t const *render_hue_scale(double s, double l, std::array *map) ++uint8_t const *render_hue_scale(double s, double l, std::array(4 * )1024> *map) + { + auto const data = map->data(); + auto pos = data; +@@ -392,7 +393,7 @@ uint8_t const *render_hue_scale(double s, double l, std::array *map) ++uint8_t const *render_saturation_scale(double h, double l, std::array(4 * )1024> *map) + { + auto const data = map->data(); + auto pos = data; +@@ -420,7 +421,7 @@ uint8_t const *render_saturation_scale(double h, double l, std::array *map) ++uint8_t const *render_lightness_scale(double h, double s, std::array(4 * )1024> *map) + { + auto const data = map->data(); + auto pos = data; +diff --git a/src/oklab.h b/src/oklab.h +index 65c0bd1458..004d707547 100644 +--- a/src/oklab.h ++++ b/src/oklab.h +@@ -14,6 +14,7 @@ + #define SEEN_OKLAB_H + + #include ++#include + + #include "hsluv.h" + +@@ -130,9 +131,9 @@ double max_chroma(double l, double h); + * @param[out] map Working store and RGB output showing the range of one of the color coordinates. + * @return A pointer to the raw data of the map. + */ +-uint8_t const *render_hue_scale(double s, double l, std::array *map); +-uint8_t const *render_saturation_scale(double h, double l, std::array *map); +-uint8_t const *render_lightness_scale(double h, double s, std::array *map); ++uint8_t const *render_hue_scale(double s, double l, std::array(4 * )1024> *map); ++uint8_t const *render_saturation_scale(double h, double l, std::array(4 * )1024> *map); ++uint8_t const *render_lightness_scale(double h, double s, std::array(4 * )1024> *map); + + } // namespace Oklab + +diff --git a/src/path-prefix.cpp b/src/path-prefix.cpp +index e3be5846fd..a0c2e2c06a 100644 +--- a/src/path-prefix.cpp ++++ b/src/path-prefix.cpp +@@ -44,7 +44,7 @@ + * On Windows, the result should be identical to + * g_win32_get_package_installation_directory_of_module(nullptr) + */ +-static std::string _get_bundle_prefix_dir() ++static std::string get_bundle_prefix_dir() + { + char const *program_dir = get_program_dir(); + auto prefix = Glib::path_get_dirname(program_dir); +@@ -81,7 +81,7 @@ char const *get_inkscape_datadir() + static std::string datadir = Glib::getenv("INKSCAPE_DATADIR"); + + if (datadir.empty()) { +- datadir = Glib::build_filename(_get_bundle_prefix_dir(), "share"); ++ datadir = Glib::build_filename(get_bundle_prefix_dir(), "share"); + + if (!Glib::file_test(Glib::build_filename(datadir, "inkscape"), Glib::FILE_TEST_IS_DIR)) { + datadir = INKSCAPE_DATADIR; +diff --git a/src/path/splinefit/splinefit.c b/src/path/splinefit/splinefit.c +index 9e3039a7cc..a0e36942d3 100644 +--- a/src/path/splinefit/splinefit.c ++++ b/src/path/splinefit/splinefit.c +@@ -96,7 +96,7 @@ For order2 splines we've got + S(ti^2)*b + S(ti)*(x1-x0-b) = S(xi)-n*x0 + [ S(ti^2)-S(ti) ]*b = S(xi)-S(ti)*(x1-x0) - n*x0 + */ +-static int _ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to, ++static int ApproximateSplineFromPoints(SplinePoint *from, SplinePoint *to, + FitPoint *mid, int cnt, BasePoint *nextcp, BasePoint *prevcp, + int order2) { + bigreal tt, ttn; +@@ -387,7 +387,7 @@ return( SplineMake3(from,to)); + if ( (spline = IsLinearApprox(from,to,mid,cnt,order2))!=NULL ) + return( spline ); + +- ret = _ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,order2); ++ ret = ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,order2); + + if ( ret&1 ) { + from->nextcp = nextcp; +@@ -412,7 +412,7 @@ static bigreal ClosestSplineSolve(Spline1D *sp,bigreal sought,bigreal close_to_t + int i; + bigreal t, best, test; + +- _CubicSolve(sp,sought,ts); ++ CubicSolve(sp,sought,ts); + best = 9e20; t= close_to_t; + for ( i=0; i<3; ++i ) if ( ts[i]>-.0001 && ts[i]<1.0001 ) { + if ( (test=ts[i]-close_to_t)<0 ) test = -test; +@@ -889,7 +889,7 @@ return( SplineMake3(from,to)); + quad.e = 80*bunit.y*(42*bunit.y*m-25*f*(bunit.y-bunit.x*f)); + } + extended solutions[4] = {-999999,-999999,-999999,-999999}; +- _QuarticSolve(&quad,solutions); ++ QuarticSolve(&quad,solutions); + extended abSolutions[10][2]; /* there are at most 4+4+1+1=10 solutions of pairs of a and b (quartic=0,derivative=0,b=0.01,a=0.01) */ + numberOfSolutions = 0; + extended a,b; +@@ -926,7 +926,7 @@ return( SplineMake3(from,to)); + } + for( int i = 0; i < 4; i++ ) /* overwriting (reusing) */ + solutions[i] = -999999; +- _QuarticSolve(&quad,solutions); ++ QuarticSolve(&quad,solutions); + for( int i = 0; i < 4; i++ ){ + a = solutions[i]; + if ( a >= 0 && a < aMax ) { +@@ -1212,7 +1212,7 @@ return( SplineMake3(from,to)); + if ( k<0 ) { + BasePoint nextcp, prevcp; + bigreal temp1, temp2; +- int ret = _ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,false); ++ int ret = ApproximateSplineFromPoints(from,to,mid,cnt,&nextcp,&prevcp,false); + /* sometimes least squares gives us the right answer */ + if ( !(ret&1) || !(ret&2)) + continue; +@@ -1334,7 +1334,7 @@ return( spline ); + #undef TRY_CNT + #undef DECIMATION + +-SplinePoint *_ApproximateSplineSetFromGen(SplinePoint *from, SplinePoint *to, ++SplinePoint *ApproximateSplineSetFromGen(SplinePoint *from, SplinePoint *to, + bigreal start_t, bigreal end_t, + bigreal toler, int toler_is_sumsq, + GenPointsP genp, void *tok, +@@ -1384,11 +1384,11 @@ SplinePoint *_ApproximateSplineSetFromGen(SplinePoint *from, SplinePoint *to, + SplineFree(from->next); + from->next = NULL; + to->prev = NULL; +- mid = _ApproximateSplineSetFromGen(from, NULL, start_t, mid_t, toler, ++ mid = ApproximateSplineSetFromGen(from, NULL, start_t, mid_t, toler, + toler_is_sumsq, genp, tok, order2, + depth+1); + if ( mid ) { +- r = _ApproximateSplineSetFromGen(mid, to, mid_t, end_t, toler, ++ r = ApproximateSplineSetFromGen(mid, to, mid_t, end_t, toler, + toler_is_sumsq, genp, tok, + order2, depth+1); + if ( r ) +@@ -1422,6 +1422,6 @@ SplinePoint *ApproximateSplineSetFromGen(SplinePoint *from, SplinePoint *to, + bigreal toler, int toler_is_sumsq, + GenPointsP genp, void *tok, + int order2) { +- return _ApproximateSplineSetFromGen(from, to, start_t, end_t, toler, ++ return ApproximateSplineSetFromGen(from, to, start_t, end_t, toler, + toler_is_sumsq, genp, tok, order2, 0); + } +diff --git a/src/path/splinefit/splinefont.c b/src/path/splinefit/splinefont.c +index 468162892a..21267b43fd 100644 +--- a/src/path/splinefit/splinefont.c ++++ b/src/path/splinefit/splinefont.c +@@ -719,7 +719,7 @@ return( -1 ); + /* I use -999999 as an error flag, since we're really only interested in */ + /* solns near 0 and 1 that should be ok. -1 is perhaps a little too close */ + /* Sigh. When solutions are near 0, the rounding errors are appalling. */ +-int _CubicSolve(const Spline1D *sp,bigreal sought, extended ts[3]) { ++int CubicSolve(const Spline1D *sp,bigreal sought, extended ts[3]) { + extended d, xN, yN, delta2, temp, delta, h, t2, t3, theta; + extended sa=sp->a, sb=sp->b, sc=sp->c, sd=sp->d-sought; + int i=0; +@@ -797,7 +797,7 @@ return(false); /* All roots imaginary */ + return( ts[0]!=-999999 ); + } + +-int _QuarticSolve(Quartic *q,extended ts[4]) { ++int QuarticSolve(Quartic *q,extended ts[4]) { + extended extrema[5]; + Spline1D sp; + int ecnt = 0, i, zcnt; +@@ -809,21 +809,21 @@ int _QuarticSolve(Quartic *q,extended ts[4]) { + sp.c = q->d; + sp.d = q->e; + ts[3] = -999999; +-return( _CubicSolve(&sp,0,ts)); ++return( CubicSolve(&sp,0,ts)); + } else if ( q->e==0 ) { /* we can factor out a zero root */ + sp.a = q->a; + sp.b = q->b; + sp.c = q->c; + sp.d = q->d; + ts[0] = 0; +-return( _CubicSolve(&sp,0,ts+1)+1); ++return( CubicSolve(&sp,0,ts+1)+1); + } + + sp.a = 4*q->a; + sp.b = 3*q->b; + sp.c = 2*q->c; + sp.d = q->d; +- if ( _CubicSolve(&sp,0,extrema)) { ++ if ( CubicSolve(&sp,0,extrema)) { + ecnt = 1; + if ( extrema[1]!=-999999 ) { + ecnt = 2; +@@ -1089,7 +1089,7 @@ static enum pointtype SplinePointDowngrade(int current, int geom) { + + // Assumes flag combinations are already verified. Only returns false + // when called with check_compat +-int _SplinePointCategorize(SplinePoint *sp, int flags) { ++int SplinePointCategorize(SplinePoint *sp, int flags) { + enum pointtype geom, dg, cur; + + if ( flags & pconvert_flag_none ) +@@ -1127,7 +1127,7 @@ int _SplinePointCategorize(SplinePoint *sp, int flags) { + } + + void SplinePointCategorize(SplinePoint *sp) { +- _SplinePointCategorize(sp, pconvert_flag_all|pconvert_flag_by_geom); ++ SplinePointCategorize(sp, pconvert_flag_all|pconvert_flag_by_geom); + } + + static void SplinePointReCategorize(SplinePoint *sp,int oldpt) { +diff --git a/src/path/splinefit/splinefont.h b/src/path/splinefit/splinefont.h +index 83db934cec..a029bbd011 100644 +--- a/src/path/splinefit/splinefont.h ++++ b/src/path/splinefit/splinefont.h +@@ -1,7 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + + #ifndef _SEEN_SPLINEFONT_H_ +-#define _SEEN_SPLINEFONT_H_ ++#define SEEN_SPLINEFONT_H_ + + #include + +@@ -134,8 +134,8 @@ bigreal BPDot(BasePoint v1, BasePoint v2); + bigreal BPCross(BasePoint v1, BasePoint v2); + BasePoint BPRev(BasePoint v); + +-int _CubicSolve(const Spline1D *sp,bigreal sought, extended ts[3]); +-int _QuarticSolve(Quartic *q,extended ts[4]); ++int CubicSolve(const Spline1D *sp,bigreal sought, extended ts[3]); ++int QuarticSolve(Quartic *q,extended ts[4]); + int IntersectLines(BasePoint *inter, + BasePoint *line1_1, BasePoint *line1_2, + BasePoint *line2_1, BasePoint *line2_2); +diff --git a/src/preferences.cpp b/src/preferences.cpp +index 87bbac8fc9..da48e8fdd0 100644 +--- a/src/preferences.cpp ++++ b/src/preferences.cpp +@@ -216,7 +216,7 @@ static Inkscape::XML::Document *loadImpl( std::string const& prefsFilename, Glib + } + + // 5. Basic sanity check: does the root element have a correct name? +- if (strcmp(prefs_read->root()->name(), "inkscape")) { ++ if (strcmp(prefs_read->root()->name(), "inkscape") != 0) { + gchar *msg = g_strdup_printf(_("The file %s is not a valid Inkscape preferences file."), + Glib::filename_to_utf8(prefsFilename).c_str()); + errMsg = msg; +@@ -514,10 +514,10 @@ void Preferences::remove(Glib::ustring const &pref_path) + /** + * Class that holds additional information for registered Observers. + */ +-class Preferences::_ObserverData ++class Preferences::ObserverData + { + public: +- _ObserverData(Inkscape::XML::Node *node, bool isAttr) : _node(node), _is_attr(isAttr) {} ++ ObserverData(Inkscape::XML::Node *node, bool isAttr) : _node(node), _is_attr(isAttr) {} + + Inkscape::XML::Node *_node; ///< Node at which the wrapping PrefNodeObserver is registered + bool _is_attr; ///< Whether this Observer watches a single attribute +@@ -540,7 +540,7 @@ void Preferences::PrefNodeObserver::notifyAttributeChanged(XML::Node &node, GQua + // filter out attributes we don't watch + gchar const *attr_name = g_quark_to_string(name); + if ( _filter.empty() || (_filter == attr_name) ) { +- _ObserverData *d = Preferences::_get_pref_observer_data(_observer); ++ ObserverData *d = Preferences::_get_pref_observer_data(_observer); + Glib::ustring notify_path = _observer.observed_path; + + if (!d->_is_attr) { +@@ -604,7 +604,7 @@ void Preferences::addObserver(Observer &o) + node = _findObserverNode(o.observed_path, node_key, attr_key, true); + if (node) { + // set additional data +- o._data.reset(new _ObserverData(node, !attr_key.empty())); ++ o._data.reset(new ObserverData(node, !attr_key.empty())); + + _observer_map[&o].reset(new PrefNodeObserver(o, attr_key)); + +@@ -624,7 +624,7 @@ void Preferences::removeObserver(Observer &o) + auto it = _observer_map.find(&o); + if (it != _observer_map.end()) { + Inkscape::XML::Node *node = o._data->_node; +- _ObserverData *priv_data = o._data.get(); ++ ObserverData *priv_data = o._data.get(); + + if (priv_data->_is_attr) { + node->removeObserver(*it->second); +diff --git a/src/preferences.h b/src/preferences.h +index 13bff80c00..c9a2703b3e 100644 +--- a/src/preferences.h ++++ b/src/preferences.h +@@ -60,7 +60,7 @@ public: + * derive (e.g. GConf, flat XML file...) + */ + class Preferences { +- class _ObserverData; ++ class ObserverData; + + public: + // ############################# +@@ -112,7 +112,7 @@ public: + + Glib::ustring const observed_path; ///< Path which the observer watches + private: +- std::unique_ptr<_ObserverData> _data; ///< additional data used by the implementation while the observer is active ++ std::unique_ptr _data; ///< additional data used by the implementation while the observer is active + }; + + /** +@@ -661,13 +661,13 @@ private: + /// Wrapper class for XML node observers + class PrefNodeObserver; + +- typedef std::map> _ObsMap; ++ typedef std::map> ObsMap; + /// Map that keeps track of wrappers assigned to PrefObservers +- _ObsMap _observer_map; ++ ObsMap _observer_map; + + // privilege escalation methods for PrefNodeObserver + static Entry const _create_pref_value(Glib::ustring const &, void const *ptr); +- static _ObserverData *_get_pref_observer_data(Observer &o) { return o._data.get(); } ++ static ObserverData *_get_pref_observer_data(Observer &o) { return o._data.get(); } + + static Preferences *_instance; + +diff --git a/src/snap-enums.h b/src/snap-enums.h +index b304c1efd4..c2b9caacea 100644 +--- a/src/snap-enums.h ++++ b/src/snap-enums.h +@@ -151,7 +151,7 @@ enum class SimpleSnap { + Nodes, // nodes, paths + Alignment, // alignment and distribution snaps + Rest, // all the rest +- _MaxEnumValue ++ MaxEnumValue + }; + + } +diff --git a/src/snap-preferences.cpp b/src/snap-preferences.cpp +index 1863b800f3..3cd8402151 100644 +--- a/src/snap-preferences.cpp ++++ b/src/snap-preferences.cpp +@@ -38,13 +38,13 @@ Inkscape::SnapPreferences::SnapPreferences() : + + bool Inkscape::SnapPreferences::get_simple_snap(Inkscape::SimpleSnap option) const { + auto index = static_cast(option); +- assert(index < size_t(Inkscape::SimpleSnap::_MaxEnumValue)); ++ assert(index < size_t(Inkscape::SimpleSnap::MaxEnumValue)); + return _simple_snapping[index]; + } + + void Inkscape::SnapPreferences::set_simple_snap(Inkscape::SimpleSnap option, bool enable) { + auto index = static_cast(option); +- assert(index < size_t(Inkscape::SimpleSnap::_MaxEnumValue)); ++ assert(index < size_t(Inkscape::SimpleSnap::MaxEnumValue)); + _simple_snapping[index] = enable; + } + +diff --git a/src/snap-preferences.h b/src/snap-preferences.h +index 655e76c724..239ced7319 100644 +--- a/src/snap-preferences.h ++++ b/src/snap-preferences.h +@@ -96,7 +96,7 @@ private: + //(snapping to grids and guides is not affected by this) + bool _strict_snapping; + +- bool _simple_snapping[static_cast(Inkscape::SimpleSnap::_MaxEnumValue)]; ++ bool _simple_snapping[static_cast(Inkscape::SimpleSnap::MaxEnumValue)]; + + double _grid_tolerance; + double _guide_tolerance; +diff --git a/src/style-internal.cpp b/src/style-internal.cpp +index 9da7c76b8f..d6ed3ae5e2 100644 +--- a/src/style-internal.cpp ++++ b/src/style-internal.cpp +@@ -1373,7 +1373,7 @@ SPIShapes::read( gchar const *str) { + void + SPIShapes::clear() { + +- SPIBase::clear(); ++ SPIString::clear(); + + hrefs_clear(); + } +diff --git a/src/style-internal.h b/src/style-internal.h +index 73119dba57..95d7b93b8d 100644 +--- a/src/style-internal.h ++++ b/src/style-internal.h +@@ -546,7 +546,7 @@ public: + /// special handling. For OpenType fonts the values 'common-ligatures', 'contextual', + /// 'no-discretionary-ligatures', and 'no-historical-ligatures' are not useful but we still must be + /// able to parse them. +-using _SPCSSFontVariantLigatures_int = typename std::underlying_type::type; ++using SPCSSFontVariantLigatures_int = typename std::underlying_type::type; + class SPILigatures : public SPIEnum<_SPCSSFontVariantLigatures_int> + { + +@@ -565,7 +565,7 @@ public: + + /// SPIEnum w/ extra bits. The 'font-variants-numeric' property is a complete mess that needs + /// special handling. Multiple key words can be specified, some exclusive of others. +-using _SPCSSFontVariantNumeric_int = typename std::underlying_type::type; ++using SPCSSFontVariantNumeric_int = typename std::underlying_type::type; + class SPINumeric : public SPIEnum<_SPCSSFontVariantNumeric_int> + { + +@@ -584,7 +584,7 @@ public: + + /// SPIEnum w/ extra bits. The 'font-variants-east-asian' property is a complete mess that needs + /// special handling. Multiple key words can be specified, some exclusive of others. +-using _SPCSSFontVariantEastAsian_int = typename std::underlying_type::type; ++using SPCSSFontVariantEastAsian_int = typename std::underlying_type::type; + class SPIEastAsian : public SPIEnum<_SPCSSFontVariantEastAsian_int> + { + +@@ -611,7 +611,7 @@ public: + : SPIBase(inherits) + {} + +- SPIString(const SPIString &rhs) { *this = rhs; } ++ SPIString(const SPIString &rhs) : SPIBase(rhs) { *this = rhs; } + + ~SPIString() override { + g_free(_value); +@@ -833,7 +833,7 @@ public: + this->clear(); + } + +- SPIPaintOrder(const SPIPaintOrder &rhs) { *this = rhs; } ++ SPIPaintOrder(const SPIPaintOrder &rhs) : SPIBase(rhs) { *this = rhs; } + + ~SPIPaintOrder() override { + g_free( value ); +diff --git a/src/style.cpp b/src/style.cpp +index cdc7bdf803..92ba7bb0d4 100644 +--- a/src/style.cpp ++++ b/src/style.cpp +@@ -78,7 +78,7 @@ static CRSelEng *sp_repr_sel_eng(); + class SPStylePropHelper { + SPStylePropHelper() { + #define REGISTER_PROPERTY(id, member, name) \ +- g_assert(decltype(SPStyle::member)::static_id() == id); \ ++ g_assert(decltype(SPStyle::member)::static_id() == (id)); \ + _register(reinterpret_cast(&SPStyle::member), id) /* name unused */ + + // SVG 2: Attributes promoted to properties +@@ -248,7 +248,7 @@ private: + std::vector m_vector; + }; + +-auto &_prop_helper = SPStylePropHelper::instance(); ++auto &prop_helper = SPStylePropHelper::instance(); + + // C++11 allows one constructor to call another... might be useful. The original C code + // had separate calls to create SPStyle, one with only SPDocument and the other with only +@@ -466,7 +466,7 @@ SPStyle::SPStyle(SPDocument *document_in, SPObject *object_in) : + + + // This might be too resource hungary... but for now it possible to loop over properties +- _properties = _prop_helper.get_vector(this); ++ _properties = prop_helper.get_vector(this); + } + + SPStyle::~SPStyle() { +@@ -500,7 +500,7 @@ const std::vector SPStyle::properties() { return this->_properties; } + + void + SPStyle::clear(SPAttr id) { +- SPIBase *p = _prop_helper.get(this, id); ++ SPIBase *p = prop_helper.get(this, id); + if (p) { + p->clear(); + } else { +@@ -697,7 +697,7 @@ SPStyle::readIfUnset(SPAttr id, gchar const *val, SPStyleSrc const &source ) { + return; + } + +- auto p = _prop_helper.get(this, id); ++ auto p = prop_helper.get(this, id); + if (p) { + p->readIfUnset(val, source); + } else { +@@ -723,7 +723,7 @@ bool SPStyle::isSet(SPAttr id) + return color_interpolation.set; + } + +- auto p = _prop_helper.get(this, id); ++ auto p = prop_helper.get(this, id); + if (p) { + return p->set; + } else { +@@ -1094,7 +1094,7 @@ SPStyle::getFontFeatureString() { + feature_string += "ruby, "; + + char const *val = font_feature_settings.value(); +- if (val[0] && strcmp(val, "normal")) { ++ if (val[0] && strcmp(val, "normal") != 0) { + // We do no sanity checking... + feature_string += val; + feature_string += ", "; +diff --git a/src/svg/svg-affine-parser.cpp b/src/svg/svg-affine-parser.cpp +index 14bfd729c2..ba5d14ceed 100644 +--- a/src/svg/svg-affine-parser.cpp ++++ b/src/svg/svg-affine-parser.cpp +@@ -26,7 +26,7 @@ + + + #line 29 "svg-affine-parser.cpp" +-static const char _svg_transform_actions[] = { ++static const char svg_transform_actions[] = { + 0, 1, 0, 1, 8, 1, 11, 1, + 12, 1, 14, 1, 15, 1, 16, 2, + 0, 8, 2, 1, 7, 2, 2, 7, +@@ -41,7 +41,7 @@ static const char _svg_transform_actions[] = { + 7, 3, 12, 6, 7 + }; + +-static const short _svg_transform_key_offsets[] = { ++static const short svg_transform_key_offsets[] = { + 0, 0, 1, 2, 3, 4, 5, 10, + 19, 22, 24, 36, 46, 49, 51, 63, + 73, 76, 78, 90, 100, 103, 105, 117, +@@ -87,7 +87,7 @@ static const short _svg_transform_key_offsets[] = { + 1926, 1935, 1944, 1953, 1962, 1971, 1980 + }; + +-static const char _svg_transform_trans_keys[] = { ++static const char svg_transform_trans_keys[] = { + 97, 116, 114, 105, 120, 13, 32, 40, + 9, 10, 13, 32, 43, 45, 46, 9, + 10, 48, 57, 46, 48, 57, 48, 57, +@@ -339,7 +339,7 @@ static const char _svg_transform_trans_keys[] = { + 114, 115, 116, 9, 10, 0 + }; + +-static const char _svg_transform_single_lengths[] = { ++static const char svg_transform_single_lengths[] = { + 0, 1, 1, 1, 1, 1, 3, 5, + 1, 0, 6, 4, 1, 0, 6, 4, + 1, 0, 6, 4, 1, 0, 6, 4, +@@ -385,7 +385,7 @@ static const char _svg_transform_single_lengths[] = { + 7, 7, 7, 7, 7, 7, 7 + }; + +-static const char _svg_transform_range_lengths[] = { ++static const char svg_transform_range_lengths[] = { + 0, 0, 0, 0, 0, 0, 1, 2, + 1, 1, 3, 3, 1, 1, 3, 3, + 1, 1, 3, 3, 1, 1, 3, 3, +@@ -431,7 +431,7 @@ static const char _svg_transform_range_lengths[] = { + 1, 1, 1, 1, 1, 1, 1 + }; + +-static const short _svg_transform_index_offsets[] = { ++static const short svg_transform_index_offsets[] = { + 0, 0, 2, 4, 6, 8, 10, 15, + 23, 26, 28, 38, 46, 49, 51, 61, + 69, 72, 74, 84, 92, 95, 97, 107, +@@ -477,7 +477,7 @@ static const short _svg_transform_index_offsets[] = { + 1766, 1775, 1784, 1793, 1802, 1811, 1820 + }; + +-static const short _svg_transform_indicies[] = { ++static const short svg_transform_indicies[] = { + 1, 0, 2, 0, 3, 0, 4, 0, + 5, 0, 5, 5, 6, 5, 0, 6, + 6, 7, 7, 8, 6, 9, 0, 10, +@@ -709,7 +709,7 @@ static const short _svg_transform_indicies[] = { + 534, 535, 536, 531, 530, 0 + }; + +-static const short _svg_transform_trans_targs[] = { ++static const short svg_transform_trans_targs[] = { + 334, 2, 3, 4, 5, 6, 7, 8, + 9, 227, 9, 227, 10, 11, 12, 223, + 13, 224, 11, 12, 223, 13, 222, 13, +@@ -780,7 +780,7 @@ static const short _svg_transform_trans_targs[] = { + 114 + }; + +-static const char _svg_transform_trans_actions[] = { ++static const char svg_transform_trans_actions[] = { + 13, 0, 0, 0, 0, 0, 0, 3, + 3, 3, 0, 0, 0, 1, 15, 1, + 15, 0, 0, 3, 0, 3, 3, 0, +@@ -851,7 +851,7 @@ static const char _svg_transform_trans_actions[] = { + 30 + }; + +-static const char _svg_transform_to_state_actions[] = { ++static const char svg_transform_to_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +@@ -897,7 +897,7 @@ static const char _svg_transform_to_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0 + }; + +-static const char _svg_transform_from_state_actions[] = { ++static const char svg_transform_from_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, +@@ -943,7 +943,7 @@ static const char _svg_transform_from_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0 + }; + +-static const short _svg_transform_eof_trans[] = { ++static const short svg_transform_eof_trans[] = { + 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +@@ -1040,7 +1040,7 @@ bool sp_svg_transform_read(gchar const *str, Geom::Affine *transform) + if ( cs == 0 ) + goto _out; + _resume: +- _acts = _svg_transform_actions + _svg_transform_from_state_actions[cs]; ++ _acts = svg_transform_actions + svg_transform_from_state_actions[cs]; + _nacts = (unsigned int) *_acts++; + while ( _nacts-- > 0 ) { + switch ( *_acts++ ) { +@@ -1052,10 +1052,10 @@ _resume: + } + } + +- _keys = _svg_transform_trans_keys + _svg_transform_key_offsets[cs]; +- _trans = _svg_transform_index_offsets[cs]; ++ _keys = svg_transform_trans_keys + svg_transform_key_offsets[cs]; ++ _trans = svg_transform_index_offsets[cs]; + +- _klen = _svg_transform_single_lengths[cs]; ++ _klen = svg_transform_single_lengths[cs]; + if ( _klen > 0 ) { + const char *_lower = _keys; + const char *_mid; +@@ -1078,7 +1078,7 @@ _resume: + _trans += _klen; + } + +- _klen = _svg_transform_range_lengths[cs]; ++ _klen = svg_transform_range_lengths[cs]; + if ( _klen > 0 ) { + const char *_lower = _keys; + const char *_mid; +@@ -1101,14 +1101,14 @@ _resume: + } + + _match: +- _trans = _svg_transform_indicies[_trans]; ++ _trans = svg_transform_indicies[_trans]; + _eof_trans: +- cs = _svg_transform_trans_targs[_trans]; ++ cs = svg_transform_trans_targs[_trans]; + +- if ( _svg_transform_trans_actions[_trans] == 0 ) ++ if ( svg_transform_trans_actions[_trans] == 0 ) + goto _again; + +- _acts = _svg_transform_actions + _svg_transform_trans_actions[_trans]; ++ _acts = svg_transform_actions + svg_transform_trans_actions[_trans]; + _nacts = (unsigned int) *_acts++; + while ( _nacts-- > 0 ) + { +@@ -1197,7 +1197,7 @@ _eof_trans: + } + + _again: +- _acts = _svg_transform_actions + _svg_transform_to_state_actions[cs]; ++ _acts = svg_transform_actions + svg_transform_to_state_actions[cs]; + _nacts = (unsigned int) *_acts++; + while ( _nacts-- > 0 ) { + switch ( *_acts++ ) { +@@ -1220,8 +1220,8 @@ _again: + _test_eof: {} + if ( p == eof ) + { +- if ( _svg_transform_eof_trans[cs] > 0 ) { +- _trans = _svg_transform_eof_trans[cs] - 1; ++ if ( svg_transform_eof_trans[cs] > 0 ) { ++ _trans = svg_transform_eof_trans[cs] - 1; + goto _eof_trans; + } + } +diff --git a/src/svg/svg-box.cpp b/src/svg/svg-box.cpp +index bf434e4bbd..10ef32acb5 100644 +--- a/src/svg/svg-box.cpp ++++ b/src/svg/svg-box.cpp +@@ -20,7 +20,7 @@ + + // Match a side to it's fallback index, + // top->bottom, top->right, right->left +-#define FALLBACK(i) ((i - 2 >= 0) ? (i - 2) : 0) ++#define FALLBACK(i) (((i) - 2 >= 0) ? ((i) - 2) : 0) + + /** + * An svg box is a type of css/html type which contains up to 4 svg lengths. +diff --git a/src/text-editing.cpp b/src/text-editing.cpp +index 375e4ef182..a032b64574 100644 +--- a/src/text-editing.cpp ++++ b/src/text-editing.cpp +@@ -733,7 +733,7 @@ static SPObject* delete_line_break(SPObject *root, SPObject *item, bool *next_is + for ( const auto & attr :dest_node_attrs->attributeList()) { + gchar const *key = g_quark_to_string(attr.key); + gchar const *this_attr = this_node_attrs_inherited->attribute(key); +- if ((this_attr == nullptr || strcmp(attr.value, this_attr)) && this_node_attrs->attribute(key) == nullptr) ++ if ((this_attr == nullptr || strcmp(attr.value, this_attr) != 0) && this_node_attrs->attribute(key) == nullptr) + this_node_attrs->setAttribute(key, this_attr); + } + sp_repr_css_attr_unref(this_node_attrs_inherited); +@@ -1480,12 +1480,12 @@ static bool css_attrs_are_equal(SPCSSAttr const *first, SPCSSAttr const *second) + { + for ( const auto & attr : first->attributeList()) { + gchar const *other_attr = second->attribute(g_quark_to_string(attr.key)); +- if (other_attr == nullptr || strcmp(attr.value, other_attr)) ++ if (other_attr == nullptr || strcmp(attr.value, other_attr) != 0) + return false; + } + for (const auto & attr : second->attributeList()) { + gchar const *other_attr = first->attribute(g_quark_to_string(attr.key)); +- if (other_attr == nullptr || strcmp(attr.value, other_attr)) ++ if (other_attr == nullptr || strcmp(attr.value, other_attr) != 0) + return false; + } + return true; +diff --git a/src/trace/autotrace/inkscape-autotrace.cpp b/src/trace/autotrace/inkscape-autotrace.cpp +index 9a8f6ebce0..59d28334aa 100644 +--- a/src/trace/autotrace/inkscape-autotrace.cpp ++++ b/src/trace/autotrace/inkscape-autotrace.cpp +@@ -11,11 +11,13 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + * + */ +-#include ++#include "inkscape-autotrace.h" ++ + #include <2geom/path-sink.h> ++#include + #include ++#include + +-#include "inkscape-autotrace.h" + #include "async/progress.h" + + extern "C" { +@@ -49,11 +51,11 @@ Glib::RefPtr to_rgb8_packed(Glib::RefPtr const &pixbuf + } + + int imgsize = width * height; +- auto out = new unsigned char[3 * imgsize]; ++ auto out = new unsigned char[static_cast(3 * )imgsize]; + auto q = out; + + for (int y = 0; y < height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < width; x++) { + unsigned char alpha = nchannels == 3 ? 255 : p[3]; + unsigned char white = 255 - alpha; +diff --git a/src/trace/autotrace/inkscape-autotrace.h b/src/trace/autotrace/inkscape-autotrace.h +index a117592373..cef2c2b6d3 100644 +--- a/src/trace/autotrace/inkscape-autotrace.h ++++ b/src/trace/autotrace/inkscape-autotrace.h +@@ -17,7 +17,7 @@ + #define INKSCAPE_TRACE_AUTOTRACE_H + + #include "trace/trace.h" +-using at_fitting_opts_type = struct _at_fitting_opts_type; ++using at_fitting_opts_type = struct at_fitting_opts_type; + + namespace Inkscape { + namespace Trace { +diff --git a/src/trace/imagemap-gdk.cpp b/src/trace/imagemap-gdk.cpp +index 9d47b3bf82..b0ad051f58 100644 +--- a/src/trace/imagemap-gdk.cpp ++++ b/src/trace/imagemap-gdk.cpp +@@ -7,9 +7,11 @@ + * Copyright (C) 2018 Authors + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ +-#include + #include "imagemap-gdk.h" + ++#include ++#include ++ + namespace Inkscape { + namespace Trace { + +@@ -24,7 +26,7 @@ GrayMap gdkPixbufToGrayMap(Glib::RefPtr const &buf) + auto map = GrayMap(width, height); + + for (int y = 0; y < height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < width; x++) { + int alpha = nchannels == 3 ? 255 : p[3]; + int white = 3 * (255 - alpha); +@@ -47,7 +49,7 @@ Glib::RefPtr grayMapToGdkPixbuf(GrayMap const &map) + auto data = buf->get_pixels(); + + for (int y = 0; y < map.height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < map.width; x++) { + unsigned long pix = map.getPixel(x, y) / 3; + p[0] = p[1] = p[2] = pix & 0xff; +@@ -69,7 +71,7 @@ RgbMap gdkPixbufToRgbMap(Glib::RefPtr const &buf) + auto map = RgbMap(width, height); + + for (int y = 0; y < height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < width; x++) { + int alpha = nchannels == 3 ? 255 : p[3]; + int white = 255 - alpha; +@@ -93,7 +95,7 @@ Glib::RefPtr indexedMapToGdkPixbuf(IndexedMap const &map) + int nchannels = buf->get_n_channels(); + + for (int y = 0; y < map.height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < map.width; x++) { + auto rgb = map.getPixelValue(x, y); + p[0] = rgb.r & 0xff; +diff --git a/src/trace/imagemap.h b/src/trace/imagemap.h +index 542e64178c..b7b29657bd 100644 +--- a/src/trace/imagemap.h ++++ b/src/trace/imagemap.h +@@ -10,8 +10,9 @@ + #ifndef INKSCAPE_TRACE_IMAGEMAP_H + #define INKSCAPE_TRACE_IMAGEMAP_H + +-#include + #include ++#include ++#include + + namespace Inkscape { + namespace Trace { +@@ -43,7 +44,7 @@ struct GrayMap + : MapBase + { + static unsigned long constexpr BLACK = 0; +- static unsigned long constexpr WHITE = 255 * 3; ++ static unsigned long constexpr WHITE = static_cast(255 * )3; + + GrayMap(int width, int height); + +diff --git a/src/trace/pool.h b/src/trace/pool.h +index 742050a681..9158741e58 100644 +--- a/src/trace/pool.h ++++ b/src/trace/pool.h +@@ -53,9 +53,10 @@ + #ifndef INKSCAPE_TRACE_POOL_H + #define INKSCAPE_TRACE_POOL_H + ++#include ++#include + #include + #include +-#include + + template + class Pool +@@ -102,7 +103,7 @@ private: + { + int i = cblock++; + int blocksize = 1 << (6 + (i / 2)); +- block[i] = (void *)std::malloc(blocksize * size); ++ block[i] = (void *)std::malloc(static_cast(blocksize * )size); + if (!block[i]) throw std::bad_alloc(); + char *p = (char *)block[i]; + for (int k = 0; k < blocksize - 1; k++) { +diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp +index a958821e7a..9113fe5a78 100644 +--- a/src/trace/siox.cpp ++++ b/src/trace/siox.cpp +@@ -6,14 +6,16 @@ + + Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ ++#include "siox.h" ++ ++#include ++#include + #include + #include +-#include +-#include ++#include + #include +-#include ++#include + +-#include "siox.h" + #include "async/progress.h" + + namespace Inkscape { +@@ -39,7 +41,7 @@ SioxImage::SioxImage(Glib::RefPtr const &buf) + + // Copy pixel data. + for (int y = 0; y < height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < width; x++) { + uint32_t r = p[0]; + uint32_t g = p[1]; +@@ -63,7 +65,7 @@ Glib::RefPtr SioxImage::getGdkPixbuf() const + auto data = buf->get_pixels(); + + for (int y = 0; y < height; y++) { +- auto p = data + rowstride * y; ++ auto p = data + static_cast(rowstride * )y; + for (int x = 0; x < width; x++) { + uint32_t rgb = pixdata[offset(x, y)]; + p[0] = (rgb >> 16) & 0xff; // r +diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp +index ed39825c7a..3c7e15eff7 100644 +--- a/src/trace/trace.cpp ++++ b/src/trace/trace.cpp +@@ -13,41 +13,37 @@ + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ +-#include +-#include ++#include "trace.h" ++ ++#include <2geom/transforms.h> + #include + #include +-#include <2geom/transforms.h> ++#include + #include ++#include ++#include + +-#include "trace.h" +-#include "siox.h" +- ++#include "async/async.h" ++#include "async/background-progress.h" ++#include "async/progress-splitter.h" + #include "desktop.h" +-#include "document.h" ++#include "display/cairo-utils.h" ++#include "display/drawing-context.h" ++#include "display/drawing.h" + #include "document-undo.h" ++#include "document.h" + #include "helper/geom.h" + #include "inkscape.h" + #include "message-stack.h" +-#include "selection.h" +-#include "svg/svg.h" +- +-#include "async/async.h" +-#include "async/progress-splitter.h" +-#include "async/background-progress.h" +- +-#include "display/cairo-utils.h" +-#include "display/drawing.h" +-#include "display/drawing-context.h" +- +-#include "object/sp-item.h" + #include "object/sp-image.h" ++#include "object/sp-item.h" + #include "object/weakptr.h" +- ++#include "selection.h" ++#include "siox.h" ++#include "svg/svg.h" + #include "ui/icon-names.h" +- +-#include "xml/repr.h" + #include "xml/attribute-record.h" ++#include "xml/repr.h" + + namespace Inkscape { + namespace Trace { +@@ -221,7 +217,7 @@ Glib::RefPtr sioxProcessImage(Glib::RefPtr pixbuf, Cai + assert(iheight == siox_mask->get_height()); + for (int y = 0; y < iheight; y++) { + for (int x = 0; x < iwidth; x++) { +- auto p = siox_mask->get_data() + y * siox_mask->get_stride() + 4 * x; ++ auto p = siox_mask->get_data() + y * siox_mask->get_stride() + static_cast(4 * )x; + float a = p[3] / 255.0f; + float cm = Siox::CERTAIN_BACKGROUND_CONFIDENCE + (Siox::UNKNOWN_REGION_CONFIDENCE - Siox::CERTAIN_BACKGROUND_CONFIDENCE) * a; + sioximage.setConfidence(x, y, cm); +diff --git a/src/ui/dialog/clonetiler.h b/src/ui/dialog/clonetiler.h +index f6ef6e0751..d85a5f220d 100644 +--- a/src/ui/dialog/clonetiler.h ++++ b/src/ui/dialog/clonetiler.h +@@ -9,7 +9,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef __SP_CLONE_TILER_H__ +-#define __SP_CLONE_TILER_H__ ++#define SP_CLONE_TILER_H_ + + #include "ui/dialog/dialog-base.h" + #include "ui/widget/color-picker.h" +diff --git a/src/ui/dialog/command-palette.cpp b/src/ui/dialog/command-palette.cpp +index bf82ba7ef3..72524f46ed 100644 +--- a/src/ui/dialog/command-palette.cpp ++++ b/src/ui/dialog/command-palette.cpp +@@ -87,34 +87,34 @@ CommandPalette::CommandPalette() + } + + // Setup Base UI Components +- _builder->get_widget("CPBase", _CPBase); +- _builder->get_widget("CPHeader", _CPHeader); +- _builder->get_widget("CPListBase", _CPListBase); ++ _builder->get_widget("CPBase", CPBase); ++ _builder->get_widget("CPHeader", CPHeader); ++ _builder->get_widget("CPListBase", CPListBase); + +- _builder->get_widget("CPSearchBar", _CPSearchBar); +- _builder->get_widget("CPFilter", _CPFilter); ++ _builder->get_widget("CPSearchBar", CPSearchBar); ++ _builder->get_widget("CPFilter", CPFilter); + +- _builder->get_widget("CPSuggestions", _CPSuggestions); +- _builder->get_widget("CPHistory", _CPHistory); ++ _builder->get_widget("CPSuggestions", CPSuggestions); ++ _builder->get_widget("CPHistory", CPHistory); + +- _builder->get_widget("CPSuggestionsScroll", _CPSuggestionsScroll); +- _builder->get_widget("CPHistoryScroll", _CPHistoryScroll); ++ _builder->get_widget("CPSuggestionsScroll", CPSuggestionsScroll); ++ _builder->get_widget("CPHistoryScroll", CPHistoryScroll); + +- _CPBase->add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | ++ CPBase->add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | + Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::KEY_PRESS_MASK); + + // TODO: Customise on user language RTL, LTR or better user preference +- _CPBase->set_halign(Gtk::ALIGN_CENTER); +- _CPBase->set_valign(Gtk::ALIGN_START); ++ CPBase->set_halign(Gtk::ALIGN_CENTER); ++ CPBase->set_valign(Gtk::ALIGN_START); + + auto esc_func = sigc::mem_fun(*this, &CommandPalette::on_key_press_cpfilter_escape); +- _CPFilter->signal_key_press_event().connect(esc_func, false); +- _CPSuggestions->signal_key_release_event().connect(esc_func, false); +- _CPHistory->signal_key_press_event().connect(esc_func, false); ++ CPFilter->signal_key_press_event().connect(esc_func, false); ++ CPSuggestions->signal_key_release_event().connect(esc_func, false); ++ CPHistory->signal_key_press_event().connect(esc_func, false); + set_mode(CPMode::SEARCH); + +- _CPSuggestions->set_activate_on_single_click(); +- _CPSuggestions->set_selection_mode(Gtk::SELECTION_SINGLE); ++ CPSuggestions->set_activate_on_single_click(); ++ CPSuggestions->set_selection_mode(Gtk::SELECTION_SINGLE); + + // Setup operations [actions, extensions] + { +@@ -175,7 +175,7 @@ CommandPalette::CommandPalette() + } + } + // for `enter to execute` feature +- _CPSuggestions->signal_row_activated().connect(sigc::mem_fun(*this, &CommandPalette::on_row_activated)); ++ CPSuggestions->signal_row_activated().connect(sigc::mem_fun(*this, &CommandPalette::on_row_activated)); + } + + void CommandPalette::open() +@@ -187,18 +187,18 @@ void CommandPalette::open() + load_win_doc_actions(); + _win_doc_actions_loaded = true; + } +- _CPBase->show_all(); +- _CPFilter->grab_focus(); ++ CPBase->show_all(); ++ CPFilter->grab_focus(); + _is_open = true; + } + + void CommandPalette::close() + { +- _CPBase->hide(); ++ CPBase->hide(); + + // Reset filtering - show all suggestions +- _CPFilter->set_text(""); +- _CPSuggestions->invalidate_filter(); ++ CPFilter->set_text(""); ++ CPSuggestions->invalidate_filter(); + + set_mode(CPMode::SEARCH); + +@@ -281,9 +281,9 @@ void CommandPalette::append_recent_file_operation(const Glib::ustring &path, boo + } + // Add to suggestions + if (is_suggestion) { +- _CPSuggestions->append(*CPOperation); ++ CPSuggestions->append(*CPOperation); + } else { +- _CPHistory->append(*CPOperation); ++ CPHistory->append(*CPOperation); + } + } + } +@@ -383,9 +383,9 @@ bool CommandPalette::generate_action_operation(const ActionPtrName &action_ptr_n + + // Add to suggestions + if (is_suggestion) { +- _CPSuggestions->append(*CPOperation); ++ CPSuggestions->append(*CPOperation); + } else { +- _CPHistory->append(*CPOperation); ++ CPHistory->append(*CPOperation); + } + + return true; +@@ -393,14 +393,14 @@ bool CommandPalette::generate_action_operation(const ActionPtrName &action_ptr_n + + void CommandPalette::on_search() + { +- _CPSuggestions->unset_sort_func(); +- _CPSuggestions->set_sort_func(sigc::mem_fun(*this, &CommandPalette::on_sort)); +- _search_text = _CPFilter->get_text(); +- _CPSuggestions->invalidate_filter(); // Remove old filter constraint and apply new one +- if (auto top_row = _CPSuggestions->get_row_at_y(0); top_row) { +- _CPSuggestions->select_row(*top_row); // select top row +- } +- _CPSuggestionsScroll->get_vadjustment()->set_value(0); ++ CPSuggestions->unset_sort_func(); ++ CPSuggestions->set_sort_func(sigc::mem_fun(*this, &CommandPalette::on_sort)); ++ _search_text = CPFilter->get_text(); ++ CPSuggestions->invalidate_filter(); // Remove old filter constraint and apply new one ++ if (auto top_row = CPSuggestions->get_row_at_y(0); top_row) { ++ CPSuggestions->select_row(*top_row); // select top row ++ } ++ CPSuggestionsScroll->get_vadjustment()->set_value(0); + } + + bool CommandPalette::on_filter_full_action_name(Gtk::ListBoxRow *child) +@@ -446,18 +446,18 @@ bool CommandPalette::on_key_press_cpfilter_search_mode(GdkEventKey *evt) + { + auto key = evt->keyval; + if (key == GDK_KEY_Return or key == GDK_KEY_Linefeed) { +- if (auto selected_row = _CPSuggestions->get_selected_row(); selected_row) { ++ if (auto selected_row = CPSuggestions->get_selected_row(); selected_row) { + selected_row->activate(); + } + return true; + } else if (key == GDK_KEY_Up) { +- if (!_CPHistory->get_children().empty()) { ++ if (!CPHistory->get_children().empty()) { + set_mode(CPMode::HISTORY); + return true; + } + } else if (key == GDK_KEY_Down) { +- if (!_CPSuggestions->get_children().empty()) { +- _CPSuggestions->unselect_all(); ++ if (!CPSuggestions->get_children().empty()) { ++ CPSuggestions->unselect_all(); + } + } + return false; +@@ -480,7 +480,7 @@ bool CommandPalette::on_key_press_cpfilter_input_mode(GdkEventKey *evt, const Ac + case GDK_KEY_Return: + [[fallthrough]]; + case GDK_KEY_Linefeed: +- execute_action(action_ptr_name, _CPFilter->get_text()); ++ execute_action(action_ptr_name, CPFilter->get_text()); + close(); + return true; + } +@@ -489,13 +489,13 @@ bool CommandPalette::on_key_press_cpfilter_input_mode(GdkEventKey *evt, const Ac + + void CommandPalette::hide_suggestions() + { +- _CPBase->set_size_request(-1, 10); +- _CPListBase->hide(); ++ CPBase->set_size_request(-1, 10); ++ CPListBase->hide(); + } + void CommandPalette::show_suggestions() + { +- _CPBase->set_size_request(-1, _max_height_requestable); +- _CPListBase->show_all(); ++ CPBase->set_size_request(-1, _max_height_requestable); ++ CPListBase->show_all(); + } + + void CommandPalette::on_action_fullname_clicked(const Glib::ustring &action_fullname) +@@ -522,7 +522,7 @@ void CommandPalette::on_history_selection_changed(Gtk::ListBoxRow *lb) + { + // set the search box text to current selection + if (const auto name_label = get_name_desc(lb).first; name_label) { +- _CPFilter->set_text(name_label->get_text()); ++ CPFilter->set_text(name_label->get_text()); + } + } + +@@ -533,7 +533,7 @@ bool CommandPalette::operate_recent_file(Glib::ustring const &uri, bool const im + bool write_to_history = true; + + // if the last element in CPHistory is already this, don't update history file +- if (not _CPHistory->get_children().empty()) { ++ if (not CPHistory->get_children().empty()) { + if (const auto last_operation = _history_xml.get_last_operation(); last_operation.has_value()) { + if (uri == last_operation->data) { + bool last_operation_was_import = last_operation->history_type == HistoryType::IMPORT_FILE; +@@ -609,7 +609,7 @@ bool CommandPalette::ask_action_parameter(const ActionPtrName &action_ptr_name) + if (action_param_type != TypeOfVariant::NONE) { + set_mode(CPMode::INPUT); + +- _cpfilter_key_press_connection = _CPFilter->signal_key_press_event().connect( ++ _cpfilter_key_press_connection = CPFilter->signal_key_press_event().connect( + sigc::bind(sigc::mem_fun(*this, &CommandPalette::on_key_press_cpfilter_input_mode), + action_ptr_name), + false); +@@ -643,11 +643,11 @@ bool CommandPalette::ask_action_parameter(const ActionPtrName &action_ptr_name) + + // Indicate user about what to enter FIXME Dialog generation + if (action_hint.length()) { +- _CPFilter->set_placeholder_text(action_hint); +- _CPFilter->set_tooltip_text(action_hint); ++ CPFilter->set_placeholder_text(action_hint); ++ CPFilter->set_tooltip_text(action_hint); + } else { +- _CPFilter->set_placeholder_text("Enter a " + type_string + "..."); +- _CPFilter->set_tooltip_text("Enter a " + type_string + "..."); ++ CPFilter->set_placeholder_text("Enter a " + type_string + "..."); ++ CPFilter->set_tooltip_text("Enter a " + type_string + "..."); + } + + +@@ -1122,32 +1122,32 @@ void CommandPalette::set_mode(CPMode mode) + return; + } + +- _CPFilter->set_text(""); +- _CPFilter->set_icon_from_icon_name("edit-find-symbolic"); +- _CPFilter->set_placeholder_text("Search operation..."); +- _CPFilter->set_tooltip_text("Search operation..."); ++ CPFilter->set_text(""); ++ CPFilter->set_icon_from_icon_name("edit-find-symbolic"); ++ CPFilter->set_placeholder_text("Search operation..."); ++ CPFilter->set_tooltip_text("Search operation..."); + show_suggestions(); + + // Show Suggestions instead of history +- _CPHistoryScroll->set_no_show_all(); +- _CPHistoryScroll->hide(); ++ CPHistoryScroll->set_no_show_all(); ++ CPHistoryScroll->hide(); + +- _CPSuggestionsScroll->set_no_show_all(false); +- _CPSuggestionsScroll->show_all(); ++ CPSuggestionsScroll->set_no_show_all(false); ++ CPSuggestionsScroll->show_all(); + +- _CPSuggestions->unset_filter_func(); +- _CPSuggestions->set_filter_func(sigc::mem_fun(*this, &CommandPalette::on_filter_general)); ++ CPSuggestions->unset_filter_func(); ++ CPSuggestions->set_filter_func(sigc::mem_fun(*this, &CommandPalette::on_filter_general)); + + _cpfilter_search_connection.disconnect(); // to be sure + _cpfilter_key_press_connection.disconnect(); + + _cpfilter_search_connection = +- _CPFilter->signal_search_changed().connect(sigc::mem_fun(*this, &CommandPalette::on_search)); +- _cpfilter_key_press_connection = _CPFilter->signal_key_press_event().connect( ++ CPFilter->signal_search_changed().connect(sigc::mem_fun(*this, &CommandPalette::on_search)); ++ _cpfilter_key_press_connection = CPFilter->signal_key_press_event().connect( + sigc::mem_fun(*this, &CommandPalette::on_key_press_cpfilter_search_mode), false); + + _search_text = ""; +- _CPSuggestions->invalidate_filter(); ++ CPSuggestions->invalidate_filter(); + break; + + case CPMode::INPUT: +@@ -1158,12 +1158,12 @@ void CommandPalette::set_mode(CPMode mode) + _cpfilter_key_press_connection.disconnect(); + + hide_suggestions(); +- _CPFilter->set_text(""); +- _CPFilter->grab_focus(); ++ CPFilter->set_text(""); ++ CPFilter->grab_focus(); + +- _CPFilter->set_icon_from_icon_name("input-keyboard"); +- _CPFilter->set_placeholder_text("Enter action argument"); +- _CPFilter->set_tooltip_text("Enter action argument"); ++ CPFilter->set_icon_from_icon_name("input-keyboard"); ++ CPFilter->set_placeholder_text("Enter action argument"); ++ CPFilter->set_tooltip_text("Enter action argument"); + + break; + +@@ -1173,7 +1173,7 @@ void CommandPalette::set_mode(CPMode mode) + } + + hide_suggestions(); +- _CPFilter->set_icon_from_icon_name("gtk-search"); ++ CPFilter->set_icon_from_icon_name("gtk-search"); + _cpfilter_search_connection.disconnect(); + _cpfilter_key_press_connection.disconnect(); + +@@ -1184,39 +1184,39 @@ void CommandPalette::set_mode(CPMode mode) + return; + } + +- if (_CPHistory->get_children().empty()) { ++ if (CPHistory->get_children().empty()) { + return; + } + + // Show history instead of suggestions +- _CPSuggestionsScroll->set_no_show_all(); +- _CPHistoryScroll->set_no_show_all(false); ++ CPSuggestionsScroll->set_no_show_all(); ++ CPHistoryScroll->set_no_show_all(false); + +- _CPSuggestionsScroll->hide(); +- _CPHistoryScroll->show_all(); ++ CPSuggestionsScroll->hide(); ++ CPHistoryScroll->show_all(); + +- _CPFilter->set_icon_from_icon_name("format-justify-fill"); +- _CPFilter->set_icon_tooltip_text(N_("History mode")); ++ CPFilter->set_icon_from_icon_name("format-justify-fill"); ++ CPFilter->set_icon_tooltip_text(N_("History mode")); + _cpfilter_search_connection.disconnect(); + _cpfilter_key_press_connection.disconnect(); + +- _cpfilter_key_press_connection = _CPFilter->signal_key_press_event().connect( ++ _cpfilter_key_press_connection = CPFilter->signal_key_press_event().connect( + sigc::mem_fun(*this, &CommandPalette::on_key_press_cpfilter_history_mode), false); + +- _CPHistory->signal_row_selected().connect( ++ CPHistory->signal_row_selected().connect( + sigc::mem_fun(*this, &CommandPalette::on_history_selection_changed)); +- _CPHistory->signal_row_activated().connect(sigc::mem_fun(*this, &CommandPalette::on_row_activated)); ++ CPHistory->signal_row_activated().connect(sigc::mem_fun(*this, &CommandPalette::on_row_activated)); + + { + // select last row +- const auto last_row = _CPHistory->get_row_at_index(_CPHistory->get_children().size() - 1); +- _CPHistory->select_row(*last_row); ++ const auto last_row = CPHistory->get_row_at_index(CPHistory->get_children().size() - 1); ++ CPHistory->select_row(*last_row); + last_row->grab_focus(); + } + + { + // FIXME: scroll to bottom +- const auto adjustment = _CPHistoryScroll->get_vadjustment(); ++ const auto adjustment = CPHistoryScroll->get_vadjustment(); + adjustment->set_value(adjustment->get_upper()); + } + +@@ -1433,7 +1433,7 @@ void CommandPalette::load_win_doc_actions() + + Gtk::Box *CommandPalette::get_base_widget() + { +- return _CPBase; ++ return CPBase; + } + + // CPHistoryXML --------------------------------------------------------------- +diff --git a/src/ui/dialog/command-palette.h b/src/ui/dialog/command-palette.h +index 4b848fa1e0..082e78a494 100644 +--- a/src/ui/dialog/command-palette.h ++++ b/src/ui/dialog/command-palette.h +@@ -208,18 +208,18 @@ private: // variables + // Widgets + Glib::RefPtr _builder; + +- Gtk::Box *_CPBase; +- Gtk::Box *_CPHeader; +- Gtk::Box *_CPListBase; ++ Gtk::Box *CPBase; ++ Gtk::Box *CPHeader; ++ Gtk::Box *CPListBase; + +- Gtk::SearchBar *_CPSearchBar; +- Gtk::SearchEntry *_CPFilter; ++ Gtk::SearchBar *CPSearchBar; ++ Gtk::SearchEntry *CPFilter; + +- Gtk::ListBox *_CPSuggestions; +- Gtk::ListBox *_CPHistory; ++ Gtk::ListBox *CPSuggestions; ++ Gtk::ListBox *CPHistory; + +- Gtk::ScrolledWindow *_CPSuggestionsScroll; +- Gtk::ScrolledWindow *_CPHistoryScroll; ++ Gtk::ScrolledWindow *CPSuggestionsScroll; ++ Gtk::ScrolledWindow *CPHistoryScroll; + + // Data + const int _max_height_requestable = 360; +diff --git a/src/ui/dialog/dialog-container.cpp b/src/ui/dialog/dialog-container.cpp +index be5e587cbd..4a76220d7e 100644 +--- a/src/ui/dialog/dialog-container.cpp ++++ b/src/ui/dialog/dialog-container.cpp +@@ -91,7 +91,7 @@ DialogContainer::DialogContainer(InkscapeWindow* inkscape_window) + sigc::bind(sigc::mem_fun(*this, &DialogContainer::append_drop), columns))); + + // Setup drop targets. +- target_entries.emplace_back(Gtk::TargetEntry("GTK_NOTEBOOK_TAB")); ++ target_entries.emplace_back("GTK_NOTEBOOK_TAB"); + columns->set_target_entries(target_entries); + + add(*columns); +diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp +index 640fd7f9ed..fdafd70b0f 100644 +--- a/src/ui/dialog/document-properties.cpp ++++ b/src/ui/dialog/document-properties.cpp +@@ -476,7 +476,7 @@ void DocumentProperties::build_guides() + + /// Populates the available color profiles combo box + void DocumentProperties::populate_available_profiles(){ +- _AvailableProfilesListStore->clear(); // Clear any existing items in the combo box ++ AvailableProfilesListStore->clear(); // Clear any existing items in the combo box + + // Iterate through the list of profiles and add the name to the combo box. + bool home = true; // initial value doesn't matter, it's just to avoid a compiler warning +@@ -487,18 +487,18 @@ void DocumentProperties::populate_available_profiles(){ + // add a separator between profiles from the user's home directory and system profiles + if (!first && profile.isInHome != home) + { +- row = *(_AvailableProfilesListStore->append()); +- row[_AvailableProfilesListColumns.fileColumn] = ""; +- row[_AvailableProfilesListColumns.nameColumn] = ""; +- row[_AvailableProfilesListColumns.separatorColumn] = true; ++ row = *(AvailableProfilesListStore->append()); ++ row[AvailableProfilesListColumns.fileColumn] = ""; ++ row[AvailableProfilesListColumns.nameColumn] = ""; ++ row[AvailableProfilesListColumns.separatorColumn] = true; + } + home = profile.isInHome; + first = false; + +- row = *(_AvailableProfilesListStore->append()); +- row[_AvailableProfilesListColumns.fileColumn] = profile.filename; +- row[_AvailableProfilesListColumns.nameColumn] = profile.name; +- row[_AvailableProfilesListColumns.separatorColumn] = false; ++ row = *(AvailableProfilesListStore->append()); ++ row[AvailableProfilesListColumns.fileColumn] = profile.filename; ++ row[AvailableProfilesListColumns.nameColumn] = profile.name; ++ row[AvailableProfilesListColumns.separatorColumn] = false; + } + } + +@@ -509,13 +509,13 @@ void DocumentProperties::linkSelectedProfile() + //store this profile in the SVG document (create element in the XML) + if (auto document = getDocument()){ + // Find the index of the currently-selected row in the color profiles combobox +- Gtk::TreeModel::iterator iter = _AvailableProfilesList.get_active(); ++ Gtk::TreeModel::iterator iter = AvailableProfilesList.get_active(); + if (!iter) + return; + + // Read the filename and description from the list of available profiles +- Glib::ustring file = (*iter)[_AvailableProfilesListColumns.fileColumn]; +- Glib::ustring name = (*iter)[_AvailableProfilesListColumns.nameColumn]; ++ Glib::ustring file = (*iter)[AvailableProfilesListColumns.fileColumn]; ++ Glib::ustring name = (*iter)[AvailableProfilesListColumns.nameColumn]; + + std::vector current = document->getResourceList( "iccprofile" ); + for (auto obj : current) { +@@ -572,7 +572,7 @@ struct static_caster { To * operator () (From * value) const { return static_cas + + void DocumentProperties::populate_linked_profiles_box() + { +- _LinkedProfilesListStore->clear(); ++ LinkedProfilesListStore->clear(); + if (auto document = getDocument()) { + std::vector current = document->getResourceList( "iccprofile" ); + if (! current.empty()) { +@@ -586,8 +586,8 @@ void DocumentProperties::populate_linked_profiles_box() + static_caster()); + + for (auto &profile: _current) { +- Gtk::TreeModel::Row row = *(_LinkedProfilesListStore->append()); +- row[_LinkedProfilesListColumns.nameColumn] = profile->name; ++ Gtk::TreeModel::Row row = *(LinkedProfilesListStore->append()); ++ row[LinkedProfilesListColumns.nameColumn] = profile->name; + // row[_LinkedProfilesListColumns.previewColumn] = "Color Preview"; + } + } +@@ -596,55 +596,55 @@ void DocumentProperties::populate_linked_profiles_box() + void DocumentProperties::external_scripts_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _ExternalScriptsContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ ExternalScriptsContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + + void DocumentProperties::embedded_scripts_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _EmbeddedScriptsContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ EmbeddedScriptsContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + + void DocumentProperties::linked_profiles_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _EmbProfContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ EmbProfContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + + void DocumentProperties::cms_create_popup_menu(Gtk::Widget& parent, sigc::slot rem) + { + Gtk::MenuItem* mi = Gtk::manage(new Gtk::MenuItem(_("_Remove"), true)); +- _EmbProfContextMenu.append(*mi); ++ EmbProfContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); +- _EmbProfContextMenu.accelerate(parent); ++ EmbProfContextMenu.accelerate(parent); + } + + + void DocumentProperties::external_create_popup_menu(Gtk::Widget& parent, sigc::slot rem) + { + Gtk::MenuItem* mi = Gtk::manage(new Gtk::MenuItem(_("_Remove"), true)); +- _ExternalScriptsContextMenu.append(*mi); ++ ExternalScriptsContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); +- _ExternalScriptsContextMenu.accelerate(parent); ++ ExternalScriptsContextMenu.accelerate(parent); + } + + void DocumentProperties::embedded_create_popup_menu(Gtk::Widget& parent, sigc::slot rem) + { + Gtk::MenuItem* mi = Gtk::manage(new Gtk::MenuItem(_("_Remove"), true)); +- _EmbeddedScriptsContextMenu.append(*mi); ++ EmbeddedScriptsContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); +- _EmbeddedScriptsContextMenu.accelerate(parent); ++ EmbeddedScriptsContextMenu.accelerate(parent); + } + + void DocumentProperties::onColorProfileSelectRow() + { +- Glib::RefPtr sel = _LinkedProfilesList.get_selection(); ++ Glib::RefPtr sel = LinkedProfilesList.get_selection(); + if (sel) { + _unlink_btn.set_sensitive(sel->count_selected_rows () > 0); + } +@@ -653,11 +653,11 @@ void DocumentProperties::onColorProfileSelectRow() + + void DocumentProperties::removeSelectedProfile(){ + Glib::ustring name; +- if(_LinkedProfilesList.get_selection()) { +- Gtk::TreeModel::iterator i = _LinkedProfilesList.get_selection()->get_selected(); ++ if(LinkedProfilesList.get_selection()) { ++ Gtk::TreeModel::iterator i = LinkedProfilesList.get_selection()->get_selected(); + + if(i){ +- name = (*i)[_LinkedProfilesListColumns.nameColumn]; ++ name = (*i)[LinkedProfilesListColumns.nameColumn]; + } else { + return; + } +@@ -678,9 +678,9 @@ void DocumentProperties::removeSelectedProfile(){ + onColorProfileSelectRow(); + } + +-bool DocumentProperties::_AvailableProfilesList_separator(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter) ++bool DocumentProperties::AvailableProfilesList_separator(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter) + { +- bool separator = (*iter)[_AvailableProfilesListColumns.separatorColumn]; ++ bool separator = (*iter)[AvailableProfilesListColumns.separatorColumn]; + return separator; + } + +@@ -704,9 +704,9 @@ void DocumentProperties::build_cms() + + row++; + +- _LinkedProfilesListScroller.set_hexpand(); +- _LinkedProfilesListScroller.set_valign(Gtk::ALIGN_CENTER); +- _page_cms->table().attach(_LinkedProfilesListScroller, 0, row, 3, 1); ++ LinkedProfilesListScroller.set_hexpand(); ++ LinkedProfilesListScroller.set_valign(Gtk::ALIGN_CENTER); ++ _page_cms->table().attach(LinkedProfilesListScroller, 0, row, 3, 1); + + row++; + +@@ -726,44 +726,44 @@ void DocumentProperties::build_cms() + + row++; + +- _AvailableProfilesList.set_hexpand(); +- _AvailableProfilesList.set_valign(Gtk::ALIGN_CENTER); +- _page_cms->table().attach(_AvailableProfilesList, 0, row, 1, 1); ++ AvailableProfilesList.set_hexpand(); ++ AvailableProfilesList.set_valign(Gtk::ALIGN_CENTER); ++ _page_cms->table().attach(AvailableProfilesList, 0, row, 1, 1); + + _unlink_btn.set_halign(Gtk::ALIGN_CENTER); + _unlink_btn.set_valign(Gtk::ALIGN_CENTER); + _page_cms->table().attach(_unlink_btn, 2, row, 1, 1); + + // Set up the Available Profiles combo box +- _AvailableProfilesListStore = Gtk::ListStore::create(_AvailableProfilesListColumns); +- _AvailableProfilesList.set_model(_AvailableProfilesListStore); +- _AvailableProfilesList.pack_start(_AvailableProfilesListColumns.nameColumn); +- _AvailableProfilesList.set_row_separator_func(sigc::mem_fun(*this, &DocumentProperties::_AvailableProfilesList_separator)); +- _AvailableProfilesList.signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::linkSelectedProfile) ); ++ AvailableProfilesListStore = Gtk::ListStore::create(AvailableProfilesListColumns); ++ AvailableProfilesList.set_model(AvailableProfilesListStore); ++ AvailableProfilesList.pack_start(AvailableProfilesListColumns.nameColumn); ++ AvailableProfilesList.set_row_separator_func(sigc::mem_fun(*this, &DocumentProperties::AvailableProfilesList_separator)); ++ AvailableProfilesList.signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::linkSelectedProfile) ); + + populate_available_profiles(); + + //# Set up the Linked Profiles combo box +- _LinkedProfilesListStore = Gtk::ListStore::create(_LinkedProfilesListColumns); +- _LinkedProfilesList.set_model(_LinkedProfilesListStore); +- _LinkedProfilesList.append_column(_("Profile Name"), _LinkedProfilesListColumns.nameColumn); ++ LinkedProfilesListStore = Gtk::ListStore::create(LinkedProfilesListColumns); ++ LinkedProfilesList.set_model(LinkedProfilesListStore); ++ LinkedProfilesList.append_column(_("Profile Name"), LinkedProfilesListColumns.nameColumn); + // _LinkedProfilesList.append_column(_("Color Preview"), _LinkedProfilesListColumns.previewColumn); +- _LinkedProfilesList.set_headers_visible(false); ++ LinkedProfilesList.set_headers_visible(false); + // TODO restore? _LinkedProfilesList.set_fixed_height_mode(true); + + populate_linked_profiles_box(); + +- _LinkedProfilesListScroller.add(_LinkedProfilesList); +- _LinkedProfilesListScroller.set_shadow_type(Gtk::SHADOW_IN); +- _LinkedProfilesListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); +- _LinkedProfilesListScroller.set_size_request(-1, 90); ++ LinkedProfilesListScroller.add(LinkedProfilesList); ++ LinkedProfilesListScroller.set_shadow_type(Gtk::SHADOW_IN); ++ LinkedProfilesListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); ++ LinkedProfilesListScroller.set_size_request(-1, 90); + + _unlink_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile)); + +- _LinkedProfilesList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onColorProfileSelectRow) ); ++ LinkedProfilesList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onColorProfileSelectRow) ); + +- _LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release)); +- cms_create_popup_menu(_LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile)); ++ LinkedProfilesList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::linked_profiles_list_button_release)); ++ cms_create_popup_menu(LinkedProfilesList, sigc::mem_fun(*this, &DocumentProperties::removeSelectedProfile)); + + if (auto document = getDocument()) { + std::vector current = document->getResourceList( "defs" ); +@@ -804,9 +804,9 @@ void DocumentProperties::build_scripting() + + row++; + +- _ExternalScriptsListScroller.set_hexpand(); +- _ExternalScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); +- _page_external_scripts->table().attach(_ExternalScriptsListScroller, 0, row, 3, 1); ++ ExternalScriptsListScroller.set_hexpand(); ++ ExternalScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); ++ _page_external_scripts->table().attach(ExternalScriptsListScroller, 0, row, 3, 1); + + row++; + +@@ -835,10 +835,10 @@ void DocumentProperties::build_scripting() + _page_external_scripts->table().attach(_external_remove_btn, 2, row, 1, 1); + + //# Set up the External Scripts box +- _ExternalScriptsListStore = Gtk::ListStore::create(_ExternalScriptsListColumns); +- _ExternalScriptsList.set_model(_ExternalScriptsListStore); +- _ExternalScriptsList.append_column(_("Filename"), _ExternalScriptsListColumns.filenameColumn); +- _ExternalScriptsList.set_headers_visible(true); ++ ExternalScriptsListStore = Gtk::ListStore::create(ExternalScriptsListColumns); ++ ExternalScriptsList.set_model(ExternalScriptsListStore); ++ ExternalScriptsList.append_column(_("Filename"), ExternalScriptsListColumns.filenameColumn); ++ ExternalScriptsList.set_headers_visible(true); + // TODO restore? _ExternalScriptsList.set_fixed_height_mode(true); + + +@@ -866,9 +866,9 @@ void DocumentProperties::build_scripting() + + row++; + +- _EmbeddedScriptsListScroller.set_hexpand(); +- _EmbeddedScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); +- _page_embedded_scripts->table().attach(_EmbeddedScriptsListScroller, 0, row, 3, 1); ++ EmbeddedScriptsListScroller.set_hexpand(); ++ EmbeddedScriptsListScroller.set_valign(Gtk::ALIGN_CENTER); ++ _page_embedded_scripts->table().attach(EmbeddedScriptsListScroller, 0, row, 3, 1); + + row++; + +@@ -887,10 +887,10 @@ void DocumentProperties::build_scripting() + row++; + + //# Set up the Embedded Scripts box +- _EmbeddedScriptsListStore = Gtk::ListStore::create(_EmbeddedScriptsListColumns); +- _EmbeddedScriptsList.set_model(_EmbeddedScriptsListStore); +- _EmbeddedScriptsList.append_column(_("Script ID"), _EmbeddedScriptsListColumns.idColumn); +- _EmbeddedScriptsList.set_headers_visible(true); ++ EmbeddedScriptsListStore = Gtk::ListStore::create(EmbeddedScriptsListColumns); ++ EmbeddedScriptsList.set_model(EmbeddedScriptsListStore); ++ EmbeddedScriptsList.append_column(_("Script ID"), EmbeddedScriptsListColumns.idColumn); ++ EmbeddedScriptsList.set_headers_visible(true); + // TODO restore? _EmbeddedScriptsList.set_fixed_height_mode(true); + + //# Set up the Embedded Scripts content box +@@ -904,46 +904,46 @@ void DocumentProperties::build_scripting() + + row++; + +- _EmbeddedContentScroller.set_hexpand(); +- _EmbeddedContentScroller.set_valign(Gtk::ALIGN_CENTER); +- _page_embedded_scripts->table().attach(_EmbeddedContentScroller, 0, row, 3, 1); ++ EmbeddedContentScroller.set_hexpand(); ++ EmbeddedContentScroller.set_valign(Gtk::ALIGN_CENTER); ++ _page_embedded_scripts->table().attach(EmbeddedContentScroller, 0, row, 3, 1); + +- _EmbeddedContentScroller.add(_EmbeddedContent); +- _EmbeddedContentScroller.set_shadow_type(Gtk::SHADOW_IN); +- _EmbeddedContentScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); +- _EmbeddedContentScroller.set_size_request(-1, 140); ++ EmbeddedContentScroller.add(EmbeddedContent); ++ EmbeddedContentScroller.set_shadow_type(Gtk::SHADOW_IN); ++ EmbeddedContentScroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); ++ EmbeddedContentScroller.set_size_request(-1, 140); + +- _EmbeddedScriptsList.signal_cursor_changed().connect(sigc::mem_fun(*this, &DocumentProperties::changeEmbeddedScript)); +- _EmbeddedScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onEmbeddedScriptSelectRow) ); ++ EmbeddedScriptsList.signal_cursor_changed().connect(sigc::mem_fun(*this, &DocumentProperties::changeEmbeddedScript)); ++ EmbeddedScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onEmbeddedScriptSelectRow) ); + +- _ExternalScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onExternalScriptSelectRow) ); ++ ExternalScriptsList.get_selection()->signal_changed().connect( sigc::mem_fun(*this, &DocumentProperties::onExternalScriptSelectRow) ); + +- _EmbeddedContent.get_buffer()->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::editEmbeddedScript)); ++ EmbeddedContent.get_buffer()->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::editEmbeddedScript)); + + populate_script_lists(); + +- _ExternalScriptsListScroller.add(_ExternalScriptsList); +- _ExternalScriptsListScroller.set_shadow_type(Gtk::SHADOW_IN); +- _ExternalScriptsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); +- _ExternalScriptsListScroller.set_size_request(-1, 90); ++ ExternalScriptsListScroller.add(ExternalScriptsList); ++ ExternalScriptsListScroller.set_shadow_type(Gtk::SHADOW_IN); ++ ExternalScriptsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); ++ ExternalScriptsListScroller.set_size_request(-1, 90); + + _external_add_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::addExternalScript)); + +- _EmbeddedScriptsListScroller.add(_EmbeddedScriptsList); +- _EmbeddedScriptsListScroller.set_shadow_type(Gtk::SHADOW_IN); +- _EmbeddedScriptsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); +- _EmbeddedScriptsListScroller.set_size_request(-1, 90); ++ EmbeddedScriptsListScroller.add(EmbeddedScriptsList); ++ EmbeddedScriptsListScroller.set_shadow_type(Gtk::SHADOW_IN); ++ EmbeddedScriptsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); ++ EmbeddedScriptsListScroller.set_size_request(-1, 90); + + _embed_new_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::addEmbeddedScript)); + + _external_remove_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeExternalScript)); + _embed_remove_btn.signal_clicked().connect(sigc::mem_fun(*this, &DocumentProperties::removeEmbeddedScript)); + +- _ExternalScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::external_scripts_list_button_release)); +- external_create_popup_menu(_ExternalScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeExternalScript)); ++ ExternalScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::external_scripts_list_button_release)); ++ external_create_popup_menu(ExternalScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeExternalScript)); + +- _EmbeddedScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::embedded_scripts_list_button_release)); +- embedded_create_popup_menu(_EmbeddedScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeEmbeddedScript)); ++ EmbeddedScriptsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &DocumentProperties::embedded_scripts_list_button_release)); ++ embedded_create_popup_menu(EmbeddedScriptsList, sigc::mem_fun(*this, &DocumentProperties::removeEmbeddedScript)); + + //TODO: review this observers code: + if (auto document = getDocument()) { +@@ -1110,11 +1110,11 @@ void DocumentProperties::addEmbeddedScript(){ + + void DocumentProperties::removeExternalScript(){ + Glib::ustring name; +- if(_ExternalScriptsList.get_selection()) { +- Gtk::TreeModel::iterator i = _ExternalScriptsList.get_selection()->get_selected(); ++ if(ExternalScriptsList.get_selection()) { ++ Gtk::TreeModel::iterator i = ExternalScriptsList.get_selection()->get_selected(); + + if(i){ +- name = (*i)[_ExternalScriptsListColumns.filenameColumn]; ++ name = (*i)[ExternalScriptsListColumns.filenameColumn]; + } else { + return; + } +@@ -1146,11 +1146,11 @@ void DocumentProperties::removeExternalScript(){ + + void DocumentProperties::removeEmbeddedScript(){ + Glib::ustring id; +- if(_EmbeddedScriptsList.get_selection()) { +- Gtk::TreeModel::iterator i = _EmbeddedScriptsList.get_selection()->get_selected(); ++ if(EmbeddedScriptsList.get_selection()) { ++ Gtk::TreeModel::iterator i = EmbeddedScriptsList.get_selection()->get_selected(); + + if(i){ +- id = (*i)[_EmbeddedScriptsListColumns.idColumn]; ++ id = (*i)[EmbeddedScriptsListColumns.idColumn]; + } else { + return; + } +@@ -1173,7 +1173,7 @@ void DocumentProperties::removeEmbeddedScript(){ + + void DocumentProperties::onExternalScriptSelectRow() + { +- Glib::RefPtr sel = _ExternalScriptsList.get_selection(); ++ Glib::RefPtr sel = ExternalScriptsList.get_selection(); + if (sel) { + _external_remove_btn.set_sensitive(sel->count_selected_rows () > 0); + } +@@ -1181,7 +1181,7 @@ void DocumentProperties::onExternalScriptSelectRow() + + void DocumentProperties::onEmbeddedScriptSelectRow() + { +- Glib::RefPtr sel = _EmbeddedScriptsList.get_selection(); ++ Glib::RefPtr sel = EmbeddedScriptsList.get_selection(); + if (sel) { + _embed_remove_btn.set_sensitive(sel->count_selected_rows () > 0); + } +@@ -1189,11 +1189,11 @@ void DocumentProperties::onEmbeddedScriptSelectRow() + + void DocumentProperties::changeEmbeddedScript(){ + Glib::ustring id; +- if(_EmbeddedScriptsList.get_selection()) { +- Gtk::TreeModel::iterator i = _EmbeddedScriptsList.get_selection()->get_selected(); ++ if(EmbeddedScriptsList.get_selection()) { ++ Gtk::TreeModel::iterator i = EmbeddedScriptsList.get_selection()->get_selected(); + + if(i){ +- id = (*i)[_EmbeddedScriptsListColumns.idColumn]; ++ id = (*i)[EmbeddedScriptsListColumns.idColumn]; + } else { + return; + } +@@ -1220,23 +1220,23 @@ void DocumentProperties::changeEmbeddedScript(){ + const gchar* content = child->getRepr()->content(); + if (content){ + voidscript=false; +- _EmbeddedContent.get_buffer()->set_text(content); ++ EmbeddedContent.get_buffer()->set_text(content); + } + } + } + } + + if (voidscript) +- _EmbeddedContent.get_buffer()->set_text(""); ++ EmbeddedContent.get_buffer()->set_text(""); + } + + void DocumentProperties::editEmbeddedScript(){ + Glib::ustring id; +- if(_EmbeddedScriptsList.get_selection()) { +- Gtk::TreeModel::iterator i = _EmbeddedScriptsList.get_selection()->get_selected(); ++ if(EmbeddedScriptsList.get_selection()) { ++ Gtk::TreeModel::iterator i = EmbeddedScriptsList.get_selection()->get_selected(); + + if(i){ +- id = (*i)[_EmbeddedScriptsListColumns.idColumn]; ++ id = (*i)[EmbeddedScriptsListColumns.idColumn]; + } else { + return; + } +@@ -1256,7 +1256,7 @@ void DocumentProperties::editEmbeddedScript(){ + for (auto &child: vec) { + child->deleteObject(); + } +- obj->appendChildRepr(document->getReprDoc()->createTextNode(_EmbeddedContent.get_buffer()->get_text().c_str())); ++ obj->appendChildRepr(document->getReprDoc()->createTextNode(EmbeddedContent.get_buffer()->get_text().c_str())); + + //TODO repr->set_content(_EmbeddedContent.get_buffer()->get_text()); + +@@ -1268,8 +1268,8 @@ void DocumentProperties::editEmbeddedScript(){ + } + + void DocumentProperties::populate_script_lists(){ +- _ExternalScriptsListStore->clear(); +- _EmbeddedScriptsListStore->clear(); ++ ExternalScriptsListStore->clear(); ++ EmbeddedScriptsListStore->clear(); + auto document = getDocument(); + if (!document) + return; +@@ -1285,13 +1285,13 @@ void DocumentProperties::populate_script_lists(){ + g_assert(script != nullptr); + if (script->xlinkhref) + { +- Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append()); +- row[_ExternalScriptsListColumns.filenameColumn] = script->xlinkhref; ++ Gtk::TreeModel::Row row = *(ExternalScriptsListStore->append()); ++ row[ExternalScriptsListColumns.filenameColumn] = script->xlinkhref; + } + else // Embedded scripts + { +- Gtk::TreeModel::Row row = *(_EmbeddedScriptsListStore->append()); +- row[_EmbeddedScriptsListColumns.idColumn] = obj->getId(); ++ Gtk::TreeModel::Row row = *(EmbeddedScriptsListStore->append()); ++ row[EmbeddedScriptsListColumns.idColumn] = obj->getId(); + } + } + } +diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h +index 0240652b3d..1be2475d6c 100644 +--- a/src/ui/dialog/document-properties.h ++++ b/src/ui/dialog/document-properties.h +@@ -146,10 +146,10 @@ protected: + Gtk::TreeModelColumn nameColumn; + Gtk::TreeModelColumn separatorColumn; + }; +- AvailableProfilesColumns _AvailableProfilesListColumns; +- Glib::RefPtr _AvailableProfilesListStore; +- Gtk::ComboBox _AvailableProfilesList; +- bool _AvailableProfilesList_separator(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter); ++ AvailableProfilesColumns AvailableProfilesListColumns; ++ Glib::RefPtr AvailableProfilesListStore; ++ Gtk::ComboBox AvailableProfilesList; ++ bool AvailableProfilesList_separator(const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter); + class LinkedProfilesColumns : public Gtk::TreeModel::ColumnRecord + { + public: +@@ -158,11 +158,11 @@ protected: + Gtk::TreeModelColumn nameColumn; + Gtk::TreeModelColumn previewColumn; + }; +- LinkedProfilesColumns _LinkedProfilesListColumns; +- Glib::RefPtr _LinkedProfilesListStore; +- Gtk::TreeView _LinkedProfilesList; +- Gtk::ScrolledWindow _LinkedProfilesListScroller; +- Gtk::Menu _EmbProfContextMenu; ++ LinkedProfilesColumns LinkedProfilesListColumns; ++ Glib::RefPtr LinkedProfilesListStore; ++ Gtk::TreeView LinkedProfilesList; ++ Gtk::ScrolledWindow LinkedProfilesListScroller; ++ Gtk::Menu EmbProfContextMenu; + + //--------------------------------------------------------------- + Gtk::Button _external_add_btn; +@@ -178,7 +178,7 @@ protected: + { add(filenameColumn); } + Gtk::TreeModelColumn filenameColumn; + }; +- ExternalScriptsColumns _ExternalScriptsListColumns; ++ ExternalScriptsColumns ExternalScriptsListColumns; + class EmbeddedScriptsColumns : public Gtk::TreeModel::ColumnRecord + { + public: +@@ -186,18 +186,18 @@ protected: + { add(idColumn); } + Gtk::TreeModelColumn idColumn; + }; +- EmbeddedScriptsColumns _EmbeddedScriptsListColumns; +- Glib::RefPtr _ExternalScriptsListStore; +- Glib::RefPtr _EmbeddedScriptsListStore; +- Gtk::TreeView _ExternalScriptsList; +- Gtk::TreeView _EmbeddedScriptsList; +- Gtk::ScrolledWindow _ExternalScriptsListScroller; +- Gtk::ScrolledWindow _EmbeddedScriptsListScroller; +- Gtk::Menu _ExternalScriptsContextMenu; +- Gtk::Menu _EmbeddedScriptsContextMenu; ++ EmbeddedScriptsColumns EmbeddedScriptsListColumns; ++ Glib::RefPtr ExternalScriptsListStore; ++ Glib::RefPtr EmbeddedScriptsListStore; ++ Gtk::TreeView ExternalScriptsList; ++ Gtk::TreeView EmbeddedScriptsList; ++ Gtk::ScrolledWindow ExternalScriptsListScroller; ++ Gtk::ScrolledWindow EmbeddedScriptsListScroller; ++ Gtk::Menu ExternalScriptsContextMenu; ++ Gtk::Menu EmbeddedScriptsContextMenu; + Gtk::Entry _script_entry; +- Gtk::TextView _EmbeddedContent; +- Gtk::ScrolledWindow _EmbeddedContentScroller; ++ Gtk::TextView EmbeddedContent; ++ Gtk::ScrolledWindow EmbeddedContentScroller; + //--------------------------------------------------------------- + + Gtk::Notebook _grids_notebook; +diff --git a/src/ui/dialog/filedialog.h b/src/ui/dialog/filedialog.h +index 49cbcd8dca..82e5a66826 100644 +--- a/src/ui/dialog/filedialog.h ++++ b/src/ui/dialog/filedialog.h +@@ -15,7 +15,7 @@ + */ + + #ifndef __FILE_DIALOG_H__ +-#define __FILE_DIALOG_H__ ++#define FILE_DIALOG_H_ + + #include + #include +diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h +index 9f3d08508a..eae34fdafd 100644 +--- a/src/ui/dialog/filedialogimpl-gtkmm.h ++++ b/src/ui/dialog/filedialogimpl-gtkmm.h +@@ -16,7 +16,7 @@ + */ + + #ifndef __FILE_DIALOGIMPL_H__ +-#define __FILE_DIALOGIMPL_H__ ++#define FILE_DIALOGIMPL_H_ + + //Gtk includes + #include +diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp +index d62937cce3..2292c40f2e 100644 +--- a/src/ui/dialog/icon-preview.cpp ++++ b/src/ui/dialog/icon-preview.cpp +@@ -15,28 +15,25 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "icon-preview.h" ++ ++#include + #include +-#include + #include +- ++#include + #include + #include + #include + + #include "desktop.h" +-#include "document.h" +-#include "inkscape.h" +-#include "page-manager.h" +- + #include "display/cairo-utils.h" +-#include "display/drawing.h" + #include "display/drawing-context.h" +- ++#include "display/drawing.h" ++#include "document.h" ++#include "inkscape.h" + #include "object/sp-namedview.h" + #include "object/sp-root.h" +- +-#include "icon-preview.h" +- ++#include "page-manager.h" + #include "ui/widget/frame.h" + + extern "C" { +@@ -160,8 +157,8 @@ IconPreviewPanel::IconPreviewPanel() + int avail = 0; + for ( int i = numEntries - 1; i >= 0; --i ) { + int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, sizes[i]); +- pixMem[i] = new guchar[sizes[i] * stride]; +- memset( pixMem[i], 0x00, sizes[i] * stride ); ++ pixMem[i] = new guchar[static_cast(sizes[i] * )stride]; ++ memset( pixMem[i], 0x00, static_cast(sizes[i] * )stride ); + + auto pb = Gdk::Pixbuf::create_from_data(pixMem[i], Gdk::COLORSPACE_RGB, true, 8, sizes[i], sizes[i], stride); + images[i] = Gtk::make_managed(pb); +@@ -402,20 +399,20 @@ void overlayPixels(guchar *px, int width, int height, int stride, + int bytesPerPixel = 4; + int spacing = 4; + for ( int y = 0; y < height; y += spacing ) { +- guchar *ptr = px + y * stride; ++ guchar *ptr = px + static_cast(y * )stride; + for ( int x = 0; x < width; x += spacing ) { + *(ptr++) = r; + *(ptr++) = g; + *(ptr++) = b; + *(ptr++) = 0xff; + +- ptr += bytesPerPixel * (spacing - 1); ++ ptr += static_cast(bytesPerPixel * (spacing - 1)); + } + } + + if ( width > 1 && height > 1 ) { + // point at the last pixel +- guchar *ptr = px + ((height-1) * stride) + ((width - 1) * bytesPerPixel); ++ guchar *ptr = px + ((height-1) * stride) + (static_cast((width - 1) * )bytesPerPixel); + + if ( width > 2 ) { + px[4] = r; +@@ -542,7 +539,7 @@ sp_icon_doc_icon( SPDocument *doc, Inkscape::Drawing &drawing, + + /* Set up pixblock */ + px = g_new(guchar, stride * psize); +- memset(px, 0x00, stride * psize); ++ memset(px, 0x00, static_cast(stride * )psize); + + /* Render */ + cairo_surface_t *s = cairo_image_surface_create_for_data(px, +@@ -594,11 +591,11 @@ void IconPreviewPanel::renderPreview( SPObject* obj ) + guchar *px = sp_icon_doc_icon(doc, *drawing, id, sizes[i], unused); + // g_message( " size %d %s", sizes[i], (px ? "worked" : "failed") ); + if ( px ) { +- memcpy( pixMem[i], px, sizes[i] * stride ); ++ memcpy( pixMem[i], px, static_cast(sizes[i] * )stride ); + g_free( px ); + px = nullptr; + } else { +- memset( pixMem[i], 0, sizes[i] * stride ); ++ memset( pixMem[i], 0, static_cast(sizes[i] * )stride ); + } + images[i]->set(images[i]->get_pixbuf()); + // images[i]->queue_draw(); +diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp +index 3734fe3507..3658e1cd10 100644 +--- a/src/ui/dialog/inkscape-preferences.cpp ++++ b/src/ui/dialog/inkscape-preferences.cpp +@@ -872,7 +872,7 @@ void InkscapePreferences::AddNewObjectsStyle(DialogPage &p, Glib::ustring const + p.add_line( true, "", *button, "", + _("Remember the style of the (first) selected object as this tool's style")); + } +-#define get_tool_action(toolname) ("win.tool-switch('" + toolname + "')") ++#define get_tool_action(toolname) ("win.tool-switch('" + (toolname) + "')") + Glib::ustring get_tool_action_name(Glib::ustring toolname) + { + auto *iapp = InkscapeApplication::instance(); +diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp +index 150aada2c6..148a325fd9 100644 +--- a/src/ui/dialog/livepatheffect-add.cpp ++++ b/src/ui/dialog/livepatheffect-add.cpp +@@ -139,23 +139,23 @@ LivePathEffectAdd::LivePathEffectAdd() + g_warning("Glade file loading failed for path effect dialog"); + return; + } +- _builder->get_widget("LPEDialogSelector", _LPEDialogSelector); +- _builder->get_widget("LPESelectorFlowBox", _LPESelectorFlowBox); +- _builder->get_widget("LPESelectorEffectInfoPop", _LPESelectorEffectInfoPop); +- _builder->get_widget("LPEFilter", _LPEFilter); +- _builder->get_widget("LPEInfo", _LPEInfo); +- _builder->get_widget("LPEExperimental", _LPEExperimental); +- _builder->get_widget("LPEScrolled", _LPEScrolled); +- _builder->get_widget("LPESelectorEffectEventFavShow", _LPESelectorEffectEventFavShow); +- _builder->get_widget("LPESelectorEffectInfoEventBox", _LPESelectorEffectInfoEventBox); +- _builder->get_widget("LPESelectorEffectRadioPackLess", _LPESelectorEffectRadioPackLess); +- _builder->get_widget("LPESelectorEffectRadioPackMore", _LPESelectorEffectRadioPackMore); +- _builder->get_widget("LPESelectorEffectRadioList", _LPESelectorEffectRadioList); +- +- _LPEFilter->signal_search_changed().connect(sigc::mem_fun(*this, &LivePathEffectAdd::on_search)); +- _LPEDialogSelector->add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | ++ _builder->get_widget("LPEDialogSelector", LPEDialogSelector); ++ _builder->get_widget("LPESelectorFlowBox", LPESelectorFlowBox); ++ _builder->get_widget("LPESelectorEffectInfoPop", LPESelectorEffectInfoPop); ++ _builder->get_widget("LPEFilter", LPEFilter); ++ _builder->get_widget("LPEInfo", LPEInfo); ++ _builder->get_widget("LPEExperimental", LPEExperimental); ++ _builder->get_widget("LPEScrolled", LPEScrolled); ++ _builder->get_widget("LPESelectorEffectEventFavShow", LPESelectorEffectEventFavShow); ++ _builder->get_widget("LPESelectorEffectInfoEventBox", LPESelectorEffectInfoEventBox); ++ _builder->get_widget("LPESelectorEffectRadioPackLess", LPESelectorEffectRadioPackLess); ++ _builder->get_widget("LPESelectorEffectRadioPackMore", LPESelectorEffectRadioPackMore); ++ _builder->get_widget("LPESelectorEffectRadioList", LPESelectorEffectRadioList); ++ ++ LPEFilter->signal_search_changed().connect(sigc::mem_fun(*this, &LivePathEffectAdd::on_search)); ++ LPEDialogSelector->add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | + Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK | Gdk::KEY_PRESS_MASK); +- _LPESelectorFlowBox->signal_set_focus_child().connect(sigc::mem_fun(*this, &LivePathEffectAdd::on_focus)); ++ LPESelectorFlowBox->signal_set_focus_child().connect(sigc::mem_fun(*this, &LivePathEffectAdd::on_focus)); + + gladefile = get_filename_string(Inkscape::IO::Resource::UIS, "dialog-livepatheffect-effect.glade"); + for (int i = 0; i < static_cast(converter._length); ++i) { +@@ -246,60 +246,60 @@ LivePathEffectAdd::LivePathEffectAdd() + sigc::mem_fun(*this, &LivePathEffectAdd::mouseover), GTK_WIDGET(LPESelectorEffect->gobj()))); + LPESelectorEffect->signal_leave_notify_event().connect(sigc::bind( + sigc::mem_fun(*this, &LivePathEffectAdd::mouseout), GTK_WIDGET(LPESelectorEffect->gobj()))); +- _LPESelectorFlowBox->insert(*LPESelectorEffect, i); ++ LPESelectorFlowBox->insert(*LPESelectorEffect, i); + LPESelectorEffect->get_parent()->signal_key_press_event().connect( + sigc::bind, const LivePathEffect::EnumEffectData *>( + sigc::mem_fun(*this, &LivePathEffectAdd::on_press_enter), builder_effect, &converter.data(i))); + LPESelectorEffect->get_parent()->get_style_context()->add_class( + ("LPEIndex" + Glib::ustring::format(i)).c_str()); + } +- _LPESelectorFlowBox->set_activate_on_single_click(false); +- _visiblelpe = _LPESelectorFlowBox->get_children().size(); +- _LPEInfo->set_visible(false); +- _LPESelectorEffectRadioPackLess->signal_clicked().connect( ++ LPESelectorFlowBox->set_activate_on_single_click(false); ++ _visiblelpe = LPESelectorFlowBox->get_children().size(); ++ LPEInfo->set_visible(false); ++ LPESelectorEffectRadioPackLess->signal_clicked().connect( + sigc::bind(sigc::mem_fun(*this, &LivePathEffectAdd::viewChanged), 0)); +- _LPESelectorEffectRadioPackMore->signal_clicked().connect( ++ LPESelectorEffectRadioPackMore->signal_clicked().connect( + sigc::bind(sigc::mem_fun(*this, &LivePathEffectAdd::viewChanged), 1)); +- _LPESelectorEffectRadioList->signal_clicked().connect( ++ LPESelectorEffectRadioList->signal_clicked().connect( + sigc::bind(sigc::mem_fun(*this, &LivePathEffectAdd::viewChanged), 2)); +- _LPESelectorEffectEventFavShow->signal_enter_notify_event().connect(sigc::bind( +- sigc::mem_fun(*this, &LivePathEffectAdd::mouseover), GTK_WIDGET(_LPESelectorEffectEventFavShow->gobj()))); +- _LPESelectorEffectEventFavShow->signal_leave_notify_event().connect(sigc::bind( +- sigc::mem_fun(*this, &LivePathEffectAdd::mouseout), GTK_WIDGET(_LPESelectorEffectEventFavShow->gobj()))); +- _LPESelectorEffectEventFavShow->signal_button_press_event().connect( ++ LPESelectorEffectEventFavShow->signal_enter_notify_event().connect(sigc::bind( ++ sigc::mem_fun(*this, &LivePathEffectAdd::mouseover), GTK_WIDGET(LPESelectorEffectEventFavShow->gobj()))); ++ LPESelectorEffectEventFavShow->signal_leave_notify_event().connect(sigc::bind( ++ sigc::mem_fun(*this, &LivePathEffectAdd::mouseout), GTK_WIDGET(LPESelectorEffectEventFavShow->gobj()))); ++ LPESelectorEffectEventFavShow->signal_button_press_event().connect( + sigc::mem_fun(*this, &LivePathEffectAdd::show_fav_toggler)); +- _LPESelectorEffectInfoEventBox->signal_leave_notify_event().connect( ++ LPESelectorEffectInfoEventBox->signal_leave_notify_event().connect( + sigc::mem_fun(*this, &LivePathEffectAdd::hide_pop_description)); +- _LPESelectorEffectInfoEventBox->signal_enter_notify_event().connect(sigc::bind( +- sigc::mem_fun(*this, &LivePathEffectAdd::mouseover), GTK_WIDGET(_LPESelectorEffectInfoEventBox->gobj()))); +- _LPESelectorEffectInfoEventBox->signal_leave_notify_event().connect(sigc::bind( +- sigc::mem_fun(*this, &LivePathEffectAdd::mouseout), GTK_WIDGET(_LPESelectorEffectInfoEventBox->gobj()))); +- _LPEExperimental->property_active().signal_changed().connect( ++ LPESelectorEffectInfoEventBox->signal_enter_notify_event().connect(sigc::bind( ++ sigc::mem_fun(*this, &LivePathEffectAdd::mouseover), GTK_WIDGET(LPESelectorEffectInfoEventBox->gobj()))); ++ LPESelectorEffectInfoEventBox->signal_leave_notify_event().connect(sigc::bind( ++ sigc::mem_fun(*this, &LivePathEffectAdd::mouseout), GTK_WIDGET(LPESelectorEffectInfoEventBox->gobj()))); ++ LPEExperimental->property_active().signal_changed().connect( + sigc::mem_fun(*this, &LivePathEffectAdd::reload_effect_list)); + Gtk::Window *window = SP_ACTIVE_DESKTOP->getToplevel(); + int width; + int height; + window->get_size(width, height); +- _LPEDialogSelector->resize(std::min(width - 300, 1440), std::min(height - 300, 900)); +- _LPESelectorFlowBox->set_focus_vadjustment(_LPEScrolled->get_vadjustment()); +- _LPEDialogSelector->show_all_children(); ++ LPEDialogSelector->resize(std::min(width - 300, 1440), std::min(height - 300, 900)); ++ LPESelectorFlowBox->set_focus_vadjustment(LPEScrolled->get_vadjustment()); ++ LPEDialogSelector->show_all_children(); + _lasteffect = nullptr; + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gint mode = prefs->getInt("/dialogs/livepatheffect/dialogmode", 0); + switch (mode) { + case 0: +- _LPESelectorEffectRadioPackLess->set_active(); ++ LPESelectorEffectRadioPackLess->set_active(); + viewChanged(0); + break; + case 1: +- _LPESelectorEffectRadioPackMore->set_active(); ++ LPESelectorEffectRadioPackMore->set_active(); + viewChanged(1); + break; + default: +- _LPESelectorEffectRadioList->set_active(); ++ LPESelectorEffectRadioList->set_active(); + viewChanged(2); + } +- Gtk::Widget *widg = dynamic_cast(_LPEDialogSelector); ++ Gtk::Widget *widg = dynamic_cast(LPEDialogSelector); + INKSCAPE.themecontext->getChangeThemeSignal().connect(sigc::bind(sigc::ptr_fun(sp_add_top_window_classes), widg)); + sp_add_top_window_classes(widg); + } +@@ -312,32 +312,32 @@ void LivePathEffectAdd::viewChanged(gint mode) + { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + bool changed = false; +- if (mode == 2 && !_LPEDialogSelector->get_style_context()->has_class("LPEList")) { +- _LPEDialogSelector->get_style_context()->add_class("LPEList"); +- _LPEDialogSelector->get_style_context()->remove_class("LPEPackLess"); +- _LPEDialogSelector->get_style_context()->remove_class("LPEPackMore"); +- _LPESelectorFlowBox->set_max_children_per_line(1); ++ if (mode == 2 && !LPEDialogSelector->get_style_context()->has_class("LPEList")) { ++ LPEDialogSelector->get_style_context()->add_class("LPEList"); ++ LPEDialogSelector->get_style_context()->remove_class("LPEPackLess"); ++ LPEDialogSelector->get_style_context()->remove_class("LPEPackMore"); ++ LPESelectorFlowBox->set_max_children_per_line(1); + changed = true; +- } else if (mode == 1 && !_LPEDialogSelector->get_style_context()->has_class("LPEPackMore")) { +- _LPEDialogSelector->get_style_context()->remove_class("LPEList"); +- _LPEDialogSelector->get_style_context()->remove_class("LPEPackLess"); +- _LPEDialogSelector->get_style_context()->add_class("LPEPackMore"); +- _LPESelectorFlowBox->set_max_children_per_line(30); ++ } else if (mode == 1 && !LPEDialogSelector->get_style_context()->has_class("LPEPackMore")) { ++ LPEDialogSelector->get_style_context()->remove_class("LPEList"); ++ LPEDialogSelector->get_style_context()->remove_class("LPEPackLess"); ++ LPEDialogSelector->get_style_context()->add_class("LPEPackMore"); ++ LPESelectorFlowBox->set_max_children_per_line(30); + changed = true; +- } else if (mode == 0 && !_LPEDialogSelector->get_style_context()->has_class("LPEPackLess")) { +- _LPEDialogSelector->get_style_context()->remove_class("LPEList"); +- _LPEDialogSelector->get_style_context()->add_class("LPEPackLess"); +- _LPEDialogSelector->get_style_context()->remove_class("LPEPackMore"); +- _LPESelectorFlowBox->set_max_children_per_line(30); ++ } else if (mode == 0 && !LPEDialogSelector->get_style_context()->has_class("LPEPackLess")) { ++ LPEDialogSelector->get_style_context()->remove_class("LPEList"); ++ LPEDialogSelector->get_style_context()->add_class("LPEPackLess"); ++ LPEDialogSelector->get_style_context()->remove_class("LPEPackMore"); ++ LPESelectorFlowBox->set_max_children_per_line(30); + changed = true; + } + prefs->setInt("/dialogs/livepatheffect/dialogmode", mode); + if (changed) { +- _LPESelectorFlowBox->unset_sort_func(); +- _LPESelectorFlowBox->set_sort_func(sigc::mem_fun(*this, &LivePathEffectAdd::on_sort)); +- std::vector selected = _LPESelectorFlowBox->get_selected_children(); ++ LPESelectorFlowBox->unset_sort_func(); ++ LPESelectorFlowBox->set_sort_func(sigc::mem_fun(*this, &LivePathEffectAdd::on_sort)); ++ std::vector selected = LPESelectorFlowBox->get_selected_children(); + if (selected.size() == 1) { +- _LPESelectorFlowBox->get_selected_children()[0]->grab_focus(); ++ LPESelectorFlowBox->get_selected_children()[0]->grab_focus(); + } + } + } +@@ -348,7 +348,7 @@ void LivePathEffectAdd::on_focus(Gtk::Widget *widget) + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gint mode = prefs->getInt("/dialogs/livepatheffect/dialogmode", 0); + if (child && mode != 2) { +- for (auto i : _LPESelectorFlowBox->get_children()) { ++ for (auto i : LPESelectorFlowBox->get_children()) { + Gtk::FlowBoxChild *leitem = dynamic_cast(i); + Gtk::EventBox *eventbox = dynamic_cast(leitem->get_child()); + if (eventbox) { +@@ -379,7 +379,7 @@ void LivePathEffectAdd::on_focus(Gtk::Widget *widget) + } + + child->show_all_children(); +- _LPESelectorFlowBox->select_child(*child); ++ LPESelectorFlowBox->select_child(*child); + } + } + +@@ -387,7 +387,7 @@ bool LivePathEffectAdd::pop_description(GdkEventCrossing *evt, Glib::RefPtrget_widget("LPESelectorEffectInfo", LPESelectorEffectInfo); +- _LPESelectorEffectInfoPop->set_relative_to(*LPESelectorEffectInfo); ++ LPESelectorEffectInfoPop->set_relative_to(*LPESelectorEffectInfo); + + Gtk::Label *LPEName; + builder_effect->get_widget("LPEName", LPEName); +@@ -408,14 +408,14 @@ bool LivePathEffectAdd::pop_description(GdkEventCrossing *evt, Glib::RefPtrget_widget("LPESelectorEffectInfoDescription", LPESelectorEffectInfoDescription); + LPESelectorEffectInfoDescription->set_text(LPEDescription->get_text()); + +- _LPESelectorEffectInfoPop->show(); ++ LPESelectorEffectInfoPop->show(); + + return true; + } + + bool LivePathEffectAdd::hide_pop_description(GdkEventCrossing *evt) + { +- _LPESelectorEffectInfoPop->hide(); ++ LPESelectorEffectInfoPop->hide(); + return true; + } + +@@ -471,7 +471,7 @@ bool LivePathEffectAdd::fav_toggler(GdkEventButton *evt, Glib::RefPtr(_LPESelectorEffectEventFavShow->get_child()); ++ Gtk::Image *favimage = dynamic_cast(LPESelectorEffectEventFavShow->get_child()); + if (favimage) { + if (_showfavs) { + favimage->set_from_icon_name("draw-star", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR)); +@@ -490,14 +490,14 @@ bool LivePathEffectAdd::apply(GdkEventButton *evt, Glib::RefPtr bu + Gtk::EventBox *LPESelectorEffect; + builder_effect->get_widget("LPESelectorEffect", LPESelectorEffect); + Gtk::FlowBoxChild *flowboxchild = dynamic_cast(LPESelectorEffect->get_parent()); +- _LPESelectorFlowBox->select_child(*flowboxchild); ++ LPESelectorFlowBox->select_child(*flowboxchild); + if (flowboxchild && flowboxchild->get_style_context()->has_class("lpedisabled")) { + return true; + } + _applied = true; + _lasteffect = flowboxchild; +- _LPEDialogSelector->response(Gtk::RESPONSE_APPLY); +- _LPEDialogSelector->hide(); ++ LPEDialogSelector->response(Gtk::RESPONSE_APPLY); ++ LPEDialogSelector->hide(); + return true; + } + +@@ -514,8 +514,8 @@ bool LivePathEffectAdd::on_press_enter(GdkEventKey *key, Glib::RefPtrresponse(Gtk::RESPONSE_APPLY); +- _LPEDialogSelector->hide(); ++ LPEDialogSelector->response(Gtk::RESPONSE_APPLY); ++ LPEDialogSelector->hide(); + return true; + } + return false; +@@ -583,24 +583,24 @@ bool LivePathEffectAdd::on_filter(Gtk::FlowBoxChild *child) + } + Gtk::ToggleButton *experimental = dynamic_cast(contents[3]); + if (experimental) { +- if (experimental->get_active() && !_LPEExperimental->get_active()) { ++ if (experimental->get_active() && !LPEExperimental->get_active()) { + return false; + } + } + Gtk::Label *lpedesc = dynamic_cast(contents[2]); + if (lpedesc) { +- size_t s = lpedesc->get_text().uppercase().find(_LPEFilter->get_text().uppercase(), 0); ++ size_t s = lpedesc->get_text().uppercase().find(LPEFilter->get_text().uppercase(), 0); + if (s != -1) { + _visiblelpe++; + return true; + } + } +- if (_LPEFilter->get_text().length() < 1) { ++ if (LPEFilter->get_text().length() < 1) { + _visiblelpe++; + return true; + } + if (lpename) { +- size_t s = lpename->get_text().uppercase().find(_LPEFilter->get_text().uppercase(), 0); ++ size_t s = lpename->get_text().uppercase().find(LPEFilter->get_text().uppercase(), 0); + if (s != -1) { + _visiblelpe++; + return true; +@@ -620,46 +620,46 @@ void LivePathEffectAdd::reload_effect_list() + } */ + _visiblelpe = 0; + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); +- prefs->setBool("/dialogs/livepatheffect/showexperimental", _LPEExperimental->get_active()); +- _LPESelectorFlowBox->invalidate_filter(); ++ prefs->setBool("/dialogs/livepatheffect/showexperimental", LPEExperimental->get_active()); ++ LPESelectorFlowBox->invalidate_filter(); + if (_showfavs) { + if (_visiblelpe == 0) { +- _LPEInfo->set_text(_("You don't have any favorites yet. Click on the favorites star again to see all LPEs.")); +- _LPEInfo->set_visible(true); +- _LPEInfo->get_style_context()->add_class("lpeinfowarn"); ++ LPEInfo->set_text(_("You don't have any favorites yet. Click on the favorites star again to see all LPEs.")); ++ LPEInfo->set_visible(true); ++ LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } else { +- _LPEInfo->set_text(_("These are your favorite effects")); +- _LPEInfo->set_visible(true); +- _LPEInfo->get_style_context()->add_class("lpeinfowarn"); ++ LPEInfo->set_text(_("These are your favorite effects")); ++ LPEInfo->set_visible(true); ++ LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } + } else { +- _LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); +- _LPEInfo->set_visible(false); +- _LPEInfo->get_style_context()->remove_class("lpeinfowarn"); ++ LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); ++ LPEInfo->set_visible(false); ++ LPEInfo->get_style_context()->remove_class("lpeinfowarn"); + } + } + + void LivePathEffectAdd::on_search() + { + _visiblelpe = 0; +- _LPESelectorFlowBox->invalidate_filter(); ++ LPESelectorFlowBox->invalidate_filter(); + if (_showfavs) { + if (_visiblelpe == 0) { +- _LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); +- _LPEInfo->set_visible(true); +- _LPEInfo->get_style_context()->add_class("lpeinfowarn"); ++ LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); ++ LPEInfo->set_visible(true); ++ LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } else { +- _LPEInfo->set_visible(true); +- _LPEInfo->get_style_context()->add_class("lpeinfowarn"); ++ LPEInfo->set_visible(true); ++ LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } + } else { + if (_visiblelpe == 0) { +- _LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); +- _LPEInfo->set_visible(true); +- _LPEInfo->get_style_context()->add_class("lpeinfowarn"); ++ LPEInfo->set_text(_("Nothing found! Please try again with different search terms.")); ++ LPEInfo->set_visible(true); ++ LPEInfo->get_style_context()->add_class("lpeinfowarn"); + } else { +- _LPEInfo->set_visible(false); +- _LPEInfo->get_style_context()->remove_class("lpeinfowarn"); ++ LPEInfo->set_visible(false); ++ LPEInfo->get_style_context()->remove_class("lpeinfowarn"); + } + } + } +@@ -925,7 +925,7 @@ int LivePathEffectAdd::on_sort(Gtk::FlowBoxChild *child1, Gtk::FlowBoxChild *chi + } + + +-void LivePathEffectAdd::onClose() { _LPEDialogSelector->hide(); } ++void LivePathEffectAdd::onClose() { LPEDialogSelector->hide(); } + + void LivePathEffectAdd::onKeyEvent(GdkEventKey *evt) + { +@@ -958,30 +958,30 @@ void LivePathEffectAdd::show(SPDesktop *desktop) + } else if (shape) { + dial._item_type = "shape"; + } else { +- dial._LPEDialogSelector->hide(); ++ dial.LPEDialogSelector->hide(); + return; + } + } + } + dial._applied = false; +- dial._LPESelectorFlowBox->unset_sort_func(); +- dial._LPESelectorFlowBox->unset_filter_func(); +- dial._LPESelectorFlowBox->set_filter_func(sigc::mem_fun(dial, &LivePathEffectAdd::on_filter)); +- dial._LPESelectorFlowBox->set_sort_func(sigc::mem_fun(dial, &LivePathEffectAdd::on_sort)); +- Glib::RefPtr vadjust = dial._LPEScrolled->get_vadjustment(); ++ dial.LPESelectorFlowBox->unset_sort_func(); ++ dial.LPESelectorFlowBox->unset_filter_func(); ++ dial.LPESelectorFlowBox->set_filter_func(sigc::mem_fun(dial, &LivePathEffectAdd::on_filter)); ++ dial.LPESelectorFlowBox->set_sort_func(sigc::mem_fun(dial, &LivePathEffectAdd::on_sort)); ++ Glib::RefPtr vadjust = dial.LPEScrolled->get_vadjustment(); + vadjust->set_value(vadjust->get_lower()); + Gtk::Window *window = desktop->getToplevel(); +- dial._LPEDialogSelector->set_transient_for(*window); +- dial._LPEDialogSelector->show(); +- int searchlen = dial._LPEFilter->get_text().length(); ++ dial.LPEDialogSelector->set_transient_for(*window); ++ dial.LPEDialogSelector->show(); ++ int searchlen = dial.LPEFilter->get_text().length(); + if (searchlen > 0) { +- dial._LPEFilter->select_region (0, searchlen); +- dial._LPESelectorFlowBox->unselect_all(); ++ dial.LPEFilter->select_region (0, searchlen); ++ dial.LPESelectorFlowBox->unselect_all(); + } else if (dial._lasteffect) { + dial._lasteffect->grab_focus(); + } +- dial._LPEDialogSelector->run(); +- dial._LPEDialogSelector->hide(); ++ dial.LPEDialogSelector->run(); ++ dial.LPEDialogSelector->hide(); + } + + } // namespace Dialog +diff --git a/src/ui/dialog/livepatheffect-add.h b/src/ui/dialog/livepatheffect-add.h +index bd8dca4c06..62f92b0f78 100644 +--- a/src/ui/dialog/livepatheffect-add.h ++++ b/src/ui/dialog/livepatheffect-add.h +@@ -96,20 +96,20 @@ class LivePathEffectAdd { + private: + Gtk::Button _add_button; + Gtk::Button _close_button; +- Gtk::Dialog *_LPEDialogSelector; ++ Gtk::Dialog *LPEDialogSelector; + Glib::RefPtr _builder; +- Gtk::FlowBox *_LPESelectorFlowBox; +- Gtk::Popover *_LPESelectorEffectInfoPop; +- Gtk::EventBox *_LPESelectorEffectEventFavShow; +- Gtk::EventBox *_LPESelectorEffectInfoEventBox; +- Gtk::RadioButton *_LPESelectorEffectRadioList; +- Gtk::RadioButton *_LPESelectorEffectRadioPackLess; +- Gtk::RadioButton *_LPESelectorEffectRadioPackMore; +- Gtk::Switch *_LPEExperimental; +- Gtk::SearchEntry *_LPEFilter; +- Gtk::ScrolledWindow *_LPEScrolled; +- Gtk::Label *_LPEInfo; +- Gtk::Box *_LPESelector; ++ Gtk::FlowBox *LPESelectorFlowBox; ++ Gtk::Popover *LPESelectorEffectInfoPop; ++ Gtk::EventBox *LPESelectorEffectEventFavShow; ++ Gtk::EventBox *LPESelectorEffectInfoEventBox; ++ Gtk::RadioButton *LPESelectorEffectRadioList; ++ Gtk::RadioButton *LPESelectorEffectRadioPackLess; ++ Gtk::RadioButton *LPESelectorEffectRadioPackMore; ++ Gtk::Switch *LPEExperimental; ++ Gtk::SearchEntry *LPEFilter; ++ Gtk::ScrolledWindow *LPEScrolled; ++ Gtk::Label *LPEInfo; ++ Gtk::Box *LPESelector; + guint _visiblelpe; + Glib::ustring _item_type; + bool _has_clip; +diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp +index a35f3c09d5..9b1f796ceb 100644 +--- a/src/ui/dialog/livepatheffect-editor.cpp ++++ b/src/ui/dialog/livepatheffect-editor.cpp +@@ -169,11 +169,11 @@ LivePathEffectEditor::LivePathEffectEditor() + : DialogBase("/dialogs/livepatheffect", "LivePathEffect"), + _builder(create_builder("dialog-livepatheffect.glade")), + LPEListBox(get_widget(_builder, "LPEListBox")), +- _LPEContainer(get_widget(_builder, "LPEContainer")), +- _LPEAddContainer(get_widget(_builder, "LPEAddContainer")), +- _LPEParentBox(get_widget(_builder, "LPEParentBox")), +- _LPECurrentItem(get_widget(_builder, "LPECurrentItem")), +- _LPESelectionInfo(get_widget(_builder, "LPESelectionInfo")), ++ LPEContainer(get_widget(_builder, "LPEContainer")), ++ LPEAddContainer(get_widget(_builder, "LPEAddContainer")), ++ LPEParentBox(get_widget(_builder, "LPEParentBox")), ++ LPECurrentItem(get_widget(_builder, "LPECurrentItem")), ++ LPESelectionInfo(get_widget(_builder, "LPESelectionInfo")), + converter(Inkscape::LivePathEffect::LPETypeConverter) + { + Gtk::EventBox &LPEGallery = get_widget(_builder, "LPEGallery"); +@@ -184,16 +184,16 @@ LivePathEffectEditor::LivePathEffectEditor() + LPEGallery.signal_button_release_event().connect(sigc::mem_fun(*this, &LivePathEffectEditor::openGallery)); + LPEGallery.show(); + } +- _LPEContainer.signal_map().connect(sigc::mem_fun(*this, &LivePathEffectEditor::map_handler) ); +- _LPEContainer.signal_button_press_event().connect([=](GdkEventButton* const evt){dnd = false; /*hack to fix dnd freze expander*/ return false; }, false); ++ LPEContainer.signal_map().connect(sigc::mem_fun(*this, &LivePathEffectEditor::map_handler) ); ++ LPEContainer.signal_button_press_event().connect([=](GdkEventButton* const evt){dnd = false; /*hack to fix dnd freze expander*/ return false; }, false); + setMenu(); +- add(_LPEContainer); ++ add(LPEContainer); + selection_info(); + _lpes_popup.get_entry().set_placeholder_text(_("Add Live Path Effect")); + _lpes_popup.on_match_selected().connect([=](int id){ onAdd((LivePathEffect::EffectType)id); }); + _lpes_popup.on_button_press().connect([=](){ setMenu(); }); + _lpes_popup.on_focus().connect([=](){ setMenu(); return true; }); +- _LPEAddContainer.pack_start(_lpes_popup); ++ LPEAddContainer.pack_start(_lpes_popup); + show_all(); + } + +@@ -488,11 +488,11 @@ LivePathEffectEditor::selection_info() + { + auto selection = getSelection(); + SPItem * selected = nullptr; +- _LPESelectionInfo.hide(); ++ LPESelectionInfo.hide(); + if (selection && (selected = selection->singleItem()) ) { + if (is(selected) || is(selected)) { +- _LPESelectionInfo.set_text(_("Texts does not support live path effects")); +- _LPESelectionInfo.show(); ++ LPESelectionInfo.set_text(_("Texts does not support live path effects")); ++ LPESelectionInfo.show(); + Glib::ustring labeltext = _("Convert text to paths"); + Gtk::Button *selectbutton = Gtk::manage(new Gtk::Button()); + Gtk::Box *boxc = Gtk::manage(new Gtk::Box()); +@@ -508,7 +508,7 @@ LivePathEffectEditor::selection_info() + selectbutton->signal_clicked().connect([=](){ + selection->toCurves(); + }); +- _LPEParentBox.add(*selectbutton); ++ LPEParentBox.add(*selectbutton); + Glib::ustring labeltext2 = _("Clone"); + Gtk::Button *selectbutton2 = Gtk::manage(new Gtk::Button()); + Gtk::Box *boxc2 = Gtk::manage(new Gtk::Box()); +@@ -524,11 +524,11 @@ LivePathEffectEditor::selection_info() + selectbutton2->signal_clicked().connect([=](){ + selection->clone();; + }); +- _LPEParentBox.add(*selectbutton2); +- _LPEParentBox.show_all(); ++ LPEParentBox.add(*selectbutton2); ++ LPEParentBox.show_all(); + } else if (!is(selected) && !is(selected)) { +- _LPESelectionInfo.set_text(_("Select a path, shape, clone or group")); +- _LPESelectionInfo.show(); ++ LPESelectionInfo.set_text(_("Select a path, shape, clone or group")); ++ LPESelectionInfo.show(); + } else { + if (selected->getId()) { + Glib::ustring labeltext = selected->label() ? selected->label() : selected->getId(); +@@ -540,9 +540,9 @@ LivePathEffectEditor::selection_info() + Gtk::Image *type = Gtk::manage(new Gtk::Image(sp_get_shape_icon(shape_type, Gdk::RGBA(highlight),20, 1))); + boxc->pack_start(*type, false, false); + boxc->pack_start(*lbl, false, false); +- _LPECurrentItem.add(*boxc); +- _LPECurrentItem.get_children()[0]->set_halign(Gtk::ALIGN_CENTER); +- _LPESelectionInfo.hide(); ++ LPECurrentItem.add(*boxc); ++ LPECurrentItem.get_children()[0]->set_halign(Gtk::ALIGN_CENTER); ++ LPESelectionInfo.hide(); + } + std::vector > newrootsatellites; + for (auto root : selected->rootsatellites) { +@@ -574,21 +574,21 @@ LivePathEffectEditor::selection_info() + selectbutton->signal_clicked().connect([=](){ + selection->set(lpeitem); + }); +- _LPEParentBox.add(*selectbutton); ++ LPEParentBox.add(*selectbutton); + } + } + } + selected->rootsatellites = newrootsatellites; +- _LPEParentBox.show_all(); +- _LPEParentBox.drag_dest_unset(); +- _LPECurrentItem.show_all(); ++ LPEParentBox.show_all(); ++ LPEParentBox.drag_dest_unset(); ++ LPECurrentItem.show_all(); + } + } else if (!selection || selection->isEmpty()) { +- _LPESelectionInfo.set_text(_("Select a path, shape, clone or group")); +- _LPESelectionInfo.show(); ++ LPESelectionInfo.set_text(_("Select a path, shape, clone or group")); ++ LPESelectionInfo.show(); + } else if (selection->size() > 1) { +- _LPESelectionInfo.set_text(_("Select only one path, shape, clone or group")); +- _LPESelectionInfo.show(); ++ LPESelectionInfo.set_text(_("Select only one path, shape, clone or group")); ++ LPESelectionInfo.show(); + } + } + +@@ -605,14 +605,14 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel) + if (lpeitem) { + lpeitem->update_satellites(); + current_lpeitem = lpeitem; +- _LPEAddContainer.set_sensitive(true); ++ LPEAddContainer.set_sensitive(true); + effect_list_reload(lpeitem); + return; + } + } + } + current_lpeitem = nullptr; +- _LPEAddContainer.set_sensitive(use != nullptr); ++ LPEAddContainer.set_sensitive(use != nullptr); + clear_lpe_list(); + selection_info(); + } +@@ -699,23 +699,23 @@ void + LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem) + { + clear_lpe_list(); +- _LPEExpanders.clear(); ++ LPEExpanders.clear(); + auto gladefile = get_filename_string(Inkscape::IO::Resource::UIS, "dialog-livepatheffect-item.glade"); + gint counter = -1; + Gtk::Expander *LPEExpanderCurrent = nullptr; + effectlist = lpeitem->getEffectList(); + gint total = effectlist.size(); + if (total > 1) { +- _LPECurrentItem.drag_dest_unset(); ++ LPECurrentItem.drag_dest_unset(); + _lpes_popup.drag_dest_unset(); + _lpes_popup.get_entry().drag_dest_unset(); +- _LPEAddContainer.drag_dest_unset(); +- _LPEContainer.drag_dest_set(entries, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_MOVE); +- _LPEContainer.signal_drag_data_received().connect([=](const Glib::RefPtr& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) ++ LPEAddContainer.drag_dest_unset(); ++ LPEContainer.drag_dest_set(entries, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_MOVE); ++ LPEContainer.signal_drag_data_received().connect([=](const Glib::RefPtr& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time) + { + if (dnd) { + unsigned int pos_target, pos_source; +- Gtk::Widget *target = &_LPEContainer; ++ Gtk::Widget *target = &LPEContainer; + pos_source = atoi(reinterpret_cast(selection_data.get_data())); + pos_target = LPEListBox.get_children().size()-1; + if (y < 90) { +@@ -746,9 +746,9 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem) + dnd = false; + } + }); +- _LPEContainer.signal_drag_motion().connect([=](const Glib::RefPtr& context, int x, int y, guint time) ++ LPEContainer.signal_drag_motion().connect([=](const Glib::RefPtr& context, int x, int y, guint time) + { +- Glib::RefPtr stylec = _LPEContainer.get_style_context(); ++ Glib::RefPtr stylec = LPEContainer.get_style_context(); + if (y < 90) { + stylec->add_class("before"); + stylec->remove_class("after"); +@@ -840,7 +840,7 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem) + } else { + visimage->set_from_icon_name("object-hidden-symbolic", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR)); + } +- _LPEExpanders.emplace_back(LPEExpander, (*it)); ++ LPEExpanders.emplace_back(LPEExpander, (*it)); + LPEListBox.add(*LPEEffect); + + Glib::ustring name = "drag_"; +@@ -1032,7 +1032,7 @@ LivePathEffectEditor::effect_list_reload(SPLPEItem *lpeitem) + LPEMoveDownExtrem->hide(); + } + if (LPEExpanderCurrent) { +- _LPESelectionInfo.hide(); ++ LPESelectionInfo.hide(); + LPEExpanderCurrent->set_expanded(true); + Gtk::Window *current_window = dynamic_cast(LPEExpanderCurrent->get_toplevel()); + if (current_window) { +@@ -1063,7 +1063,7 @@ void LivePathEffectEditor::expanded_notify(Gtk::Expander *expander) { + }; + updating = true; + if (expander->get_expanded()) { +- for (auto &w : _LPEExpanders){ ++ for (auto &w : LPEExpanders){ + if (w.first == expander) { + w.first->set_expanded(true); + w.first->get_parent()->get_parent()->get_parent()->set_name("currentlpe"); +@@ -1104,7 +1104,7 @@ void + LivePathEffectEditor::removeEffect(Gtk::Expander * expander) { + bool reload = current_lperef.first != expander; + auto current_lperef_tmp = current_lperef; +- for (auto &w : _LPEExpanders){ ++ for (auto &w : LPEExpanders){ + if (w.first == expander) { + current_lpeitem->setCurrentPathEffect(w.second); + current_lpeitem = current_lpeitem->removeCurrentPathEffect(false); +@@ -1144,11 +1144,11 @@ LivePathEffectEditor::clear_lpe_list() + for (auto &w : LPEListBox.get_children()) { + LPEListBox.remove(*w); + } +- for (auto &w : _LPEParentBox.get_children()) { +- _LPEParentBox.remove(*w); ++ for (auto &w : LPEParentBox.get_children()) { ++ LPEParentBox.remove(*w); + } +- for (auto &w : _LPECurrentItem.get_children()) { +- _LPECurrentItem.remove(*w); ++ for (auto &w : LPECurrentItem.get_children()) { ++ LPECurrentItem.remove(*w); + } + } + +diff --git a/src/ui/dialog/livepatheffect-editor.h b/src/ui/dialog/livepatheffect-editor.h +index 274d0ced0a..d9dbe80440 100644 +--- a/src/ui/dialog/livepatheffect-editor.h ++++ b/src/ui/dialog/livepatheffect-editor.h +@@ -35,7 +35,7 @@ public: + LivePathEffectEditor operator=(LivePathEffectEditor const &d) = delete; + static LivePathEffectEditor &getInstance() { return *new LivePathEffectEditor(); } + void move_list(gint origin, gint dest); +- std::vector > > _LPEExpanders; ++ std::vector > > LPEExpanders; + void showParams(std::pair > expanderdata, bool changed); + bool updating = false; + SPLPEItem *current_lpeitem = nullptr; +@@ -78,14 +78,14 @@ private: + void clearMenu(); + void setMenu(); + bool lpeFlatten(std::shared_ptr lperef); +- Gtk::Box& _LPEContainer; +- Gtk::Box& _LPEAddContainer; +- Gtk::Label&_LPESelectionInfo; +- Gtk::ListBox&_LPEParentBox; +- Gtk::Box&_LPECurrentItem; ++ Gtk::Box& LPEContainer; ++ Gtk::Box& LPEAddContainer; ++ Gtk::Label&LPESelectionInfo; ++ Gtk::ListBox&LPEParentBox; ++ Gtk::Box&LPECurrentItem; + PathEffectList effectlist; +- Glib::RefPtr _LPEList; +- Glib::RefPtr _LPEListFilter; ++ Glib::RefPtr LPEList; ++ Glib::RefPtr LPEListFilter; + const LivePathEffect::EnumEffectDataConverter &converter; + Gtk::Widget *effectwidget = nullptr; + Gtk::Widget *popupwidg = nullptr; +diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp +index 049653c257..ab72b1713f 100644 +--- a/src/ui/dialog/svg-fonts-dialog.cpp ++++ b/src/ui/dialog/svg-fonts-dialog.cpp +@@ -304,21 +304,21 @@ void SvgFontsDialog::on_kerning_value_changed(){ + void SvgFontsDialog::glyphs_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _GlyphsContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ GlyphsContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + + void SvgFontsDialog::kerning_pairs_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _KerningPairsContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ KerningPairsContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + + void SvgFontsDialog::fonts_list_button_release(GdkEventButton* event) + { + if((event->type == GDK_BUTTON_RELEASE) && (event->button == 3)) { +- _FontsContextMenu.popup_at_pointer(reinterpret_cast(event)); ++ FontsContextMenu.popup_at_pointer(reinterpret_cast(event)); + } + } + +@@ -505,47 +505,47 @@ void SvgFontsDialog::create_glyphs_popup_menu(Gtk::Widget& parent, sigc::slotsignal_activate().connect([=](){ + edit_glyph(get_selected_glyph()); + }); +- _GlyphsContextMenu.append(*mi); ++ GlyphsContextMenu.append(*mi); + + mi = Gtk::make_managed(); + mi->show(); +- _GlyphsContextMenu.append(*mi); ++ GlyphsContextMenu.append(*mi); + + mi = Gtk::make_managed(_("_Sort glyphs"), true); + mi->show(); + mi->signal_activate().connect([=](){ + sort_glyphs(get_selected_spfont()); + }); +- _GlyphsContextMenu.append(*mi); ++ GlyphsContextMenu.append(*mi); + + mi = Gtk::make_managed(); + mi->show(); +- _GlyphsContextMenu.append(*mi); ++ GlyphsContextMenu.append(*mi); + + mi = Gtk::make_managed(_("_Remove"), true); +- _GlyphsContextMenu.append(*mi); ++ GlyphsContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); + +- _GlyphsContextMenu.accelerate(parent); ++ GlyphsContextMenu.accelerate(parent); + } + + void SvgFontsDialog::create_kerning_pairs_popup_menu(Gtk::Widget& parent, sigc::slot rem) + { + auto mi = Gtk::manage(new Gtk::MenuItem(_("_Remove"), true)); +- _KerningPairsContextMenu.append(*mi); ++ KerningPairsContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); +- _KerningPairsContextMenu.accelerate(parent); ++ KerningPairsContextMenu.accelerate(parent); + } + + void SvgFontsDialog::create_fonts_popup_menu(Gtk::Widget& parent, sigc::slot rem) + { + auto mi = Gtk::manage(new Gtk::MenuItem(_("_Remove"), true)); +- _FontsContextMenu.append(*mi); ++ FontsContextMenu.append(*mi); + mi->signal_activate().connect(rem); + mi->show(); +- _FontsContextMenu.accelerate(parent); ++ FontsContextMenu.accelerate(parent); + } + + void SvgFontsDialog::update_sensitiveness(){ +@@ -610,7 +610,7 @@ void SvgFontsDialog::update_fonts(bool document_replaced) + } + if (!fonts.empty()) { + // select a font, this dialog is disabled without a font +- auto selection = _FontsList.get_selection(); ++ auto selection = FontsList.get_selection(); + if (selection) { + selection->select(_model->get_iter("0")); + selected_font = true; +@@ -711,15 +711,15 @@ void SvgFontsDialog::on_font_selection_changed(){ + + SPGlyphKerning* SvgFontsDialog::get_selected_kerning_pair() + { +- Gtk::TreeModel::iterator i = _KerningPairsList.get_selection()->get_selected(); ++ Gtk::TreeModel::iterator i = KerningPairsList.get_selection()->get_selected(); + if(i) +- return (*i)[_KerningPairsListColumns.spnode]; ++ return (*i)[KerningPairsListColumns.spnode]; + return nullptr; + } + + SvgFont* SvgFontsDialog::get_selected_svgfont() + { +- Gtk::TreeModel::iterator i = _FontsList.get_selection()->get_selected(); ++ Gtk::TreeModel::iterator i = FontsList.get_selection()->get_selected(); + if(i) + return (*i)[_columns.svgfont]; + return nullptr; +@@ -727,15 +727,15 @@ SvgFont* SvgFontsDialog::get_selected_svgfont() + + SPFont* SvgFontsDialog::get_selected_spfont() + { +- Gtk::TreeModel::iterator i = _FontsList.get_selection()->get_selected(); ++ Gtk::TreeModel::iterator i = FontsList.get_selection()->get_selected(); + if(i) + return (*i)[_columns.spfont]; + return nullptr; + } + + Gtk::TreeModel::iterator SvgFontsDialog::get_selected_glyph_iter() { +- if (_GlyphsListScroller.get_visible()) { +- if (auto selection = _GlyphsList.get_selection()) { ++ if (GlyphsListScroller.get_visible()) { ++ if (auto selection = GlyphsList.get_selection()) { + Gtk::TreeModel::iterator it = selection->get_selected(); + return it; + } +@@ -743,7 +743,7 @@ Gtk::TreeModel::iterator SvgFontsDialog::get_selected_glyph_iter() { + else { + std::vector selected = _glyphs_grid.get_selected_items(); + if (selected.size() == 1) { +- Gtk::ListStore::iterator it = _GlyphsListStore->get_iter(selected.front()); ++ Gtk::ListStore::iterator it = GlyphsListStore->get_iter(selected.front()); + return it; + } + } +@@ -753,7 +753,7 @@ Gtk::TreeModel::iterator SvgFontsDialog::get_selected_glyph_iter() { + SPGlyph* SvgFontsDialog::get_selected_glyph() + { + if (auto it = get_selected_glyph_iter()) { +- return (*it)[_GlyphsListColumns.glyph_node]; ++ return (*it)[GlyphsListColumns.glyph_node]; + } + return nullptr; + } +@@ -761,12 +761,12 @@ SPGlyph* SvgFontsDialog::get_selected_glyph() + void SvgFontsDialog::set_selected_glyph(SPGlyph* glyph) { + if (!glyph) return; + +- _GlyphsListStore->foreach_iter([=](const Gtk::TreeModel::iterator& it) { +- if (it->get_value(_GlyphsListColumns.glyph_node) == glyph) { +- if (auto selection = _GlyphsList.get_selection()) { ++ GlyphsListStore->foreach_iter([=](const Gtk::TreeModel::iterator& it) { ++ if (it->get_value(GlyphsListColumns.glyph_node) == glyph) { ++ if (auto selection = GlyphsList.get_selection()) { + selection->select(it); + } +- auto selected_item = _GlyphsListStore->get_path(it); ++ auto selected_item = GlyphsListStore->get_path(it); + _glyphs_grid.select_path(selected_item); + return true; // stop + } +@@ -850,7 +850,7 @@ const int MARGIN_SPACE = 4; + Gtk::Box* SvgFontsDialog::global_settings_tab(){ + + _fonts_scroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); +- _fonts_scroller.add(_FontsList); ++ _fonts_scroller.add(FontsList); + _fonts_scroller.set_hexpand(); + _fonts_scroller.show(); + _header_box.set_column_spacing(MARGIN_SPACE); +@@ -939,27 +939,27 @@ Gtk::Box* SvgFontsDialog::global_settings_tab(){ + + void SvgFontsDialog::set_glyph_row(const Gtk::TreeRow& row, SPGlyph& glyph) { + auto unicode_name = create_unicode_name(glyph.unicode, 3); +- row[_GlyphsListColumns.glyph_node] = &glyph; +- row[_GlyphsListColumns.glyph_name] = glyph.glyph_name; +- row[_GlyphsListColumns.unicode] = glyph.unicode; +- row[_GlyphsListColumns.UplusCode] = unicode_name; +- row[_GlyphsListColumns.advance] = glyph.horiz_adv_x; +- row[_GlyphsListColumns.name_markup] = "" + Glib::Markup::escape_text(get_glyph_synthetic_name(glyph)) + ""; ++ row[GlyphsListColumns.glyph_node] = &glyph; ++ row[GlyphsListColumns.glyph_name] = glyph.glyph_name; ++ row[GlyphsListColumns.unicode] = glyph.unicode; ++ row[GlyphsListColumns.UplusCode] = unicode_name; ++ row[GlyphsListColumns.advance] = glyph.horiz_adv_x; ++ row[GlyphsListColumns.name_markup] = "" + Glib::Markup::escape_text(get_glyph_synthetic_name(glyph)) + ""; + } + + void + SvgFontsDialog::populate_glyphs_box() + { +- if (!_GlyphsListStore) return; ++ if (!GlyphsListStore) return; + +- _GlyphsListStore->freeze_notify(); ++ GlyphsListStore->freeze_notify(); + + // try to keep selected glyph + Gtk::TreeModel::Path selected_item; + if (auto selected = get_selected_glyph_iter()) { +- selected_item = _GlyphsListStore->get_path(selected); ++ selected_item = GlyphsListStore->get_path(selected); + } +- _GlyphsListStore->clear(); ++ GlyphsListStore->clear(); + + SPFont* spfont = get_selected_spfont(); + _glyphs_observer.set(spfont); +@@ -968,38 +968,38 @@ SvgFontsDialog::populate_glyphs_box() + for (auto& node: spfont->children) { + if (is(&node)) { + auto& glyph = static_cast(node); +- Gtk::TreeModel::Row row = *_GlyphsListStore->append(); ++ Gtk::TreeModel::Row row = *GlyphsListStore->append(); + set_glyph_row(row, glyph); + } + } + + if (!selected_item.empty()) { +- if (auto selection = _GlyphsList.get_selection()) { ++ if (auto selection = GlyphsList.get_selection()) { + selection->select(selected_item); +- _GlyphsList.scroll_to_row(selected_item); ++ GlyphsList.scroll_to_row(selected_item); + } + _glyphs_grid.select_path(selected_item); + } + } + +- _GlyphsListStore->thaw_notify(); ++ GlyphsListStore->thaw_notify(); + } + + void + SvgFontsDialog::populate_kerning_pairs_box() + { +- if (!_KerningPairsListStore) return; ++ if (!KerningPairsListStore) return; + +- _KerningPairsListStore->clear(); ++ KerningPairsListStore->clear(); + + if (SPFont* spfont = get_selected_spfont()) { + for (auto& node: spfont->children) { + if (is(&node)){ +- Gtk::TreeModel::Row row = *(_KerningPairsListStore->append()); +- row[_KerningPairsListColumns.first_glyph] = (static_cast(&node))->u1->attribute_string().c_str(); +- row[_KerningPairsListColumns.second_glyph] = (static_cast(&node))->u2->attribute_string().c_str(); +- row[_KerningPairsListColumns.kerning_value] = (static_cast(&node))->k; +- row[_KerningPairsListColumns.spnode] = static_cast(&node); ++ Gtk::TreeModel::Row row = *(KerningPairsListStore->append()); ++ row[KerningPairsListColumns.first_glyph] = (static_cast(&node))->u1->attribute_string().c_str(); ++ row[KerningPairsListColumns.second_glyph] = (static_cast(&node))->u2->attribute_string().c_str(); ++ row[KerningPairsListColumns.kerning_value] = (static_cast(&node))->k; ++ row[KerningPairsListColumns.spnode] = static_cast(&node); + } + } + } +@@ -1009,8 +1009,8 @@ SvgFontsDialog::populate_kerning_pairs_box() + void SvgFontsDialog::update_glyph(SPGlyph* glyph) { + if (_update.pending() || !glyph) return; + +- _GlyphsListStore->foreach_iter([&](const Gtk::TreeModel::iterator& it) { +- if (it->get_value(_GlyphsListColumns.glyph_node) == glyph) { ++ GlyphsListStore->foreach_iter([&](const Gtk::TreeModel::iterator& it) { ++ if (it->get_value(GlyphsListColumns.glyph_node) == glyph) { + const Gtk::TreeRow& row = *it; + set_glyph_row(row, *glyph); + return true; // stop +@@ -1049,12 +1049,12 @@ void SvgFontsDialog::add_glyph(){ + auto font = get_selected_spfont(); + if (!font) return; + +- auto glyphs = _GlyphsListStore->children(); ++ auto glyphs = GlyphsListStore->children(); + // initialize "unicode" field; if there are glyphs look for the last one and take next unicode + gunichar unicode = ' '; + if (!glyphs.empty()) { + const auto& last = glyphs[glyphs.size() - 1]; +- if (SPGlyph* last_glyph = last[_GlyphsListColumns.glyph_node]) { ++ if (SPGlyph* last_glyph = last[GlyphsListColumns.glyph_node]) { + const Glib::ustring& code = last_glyph->unicode; + if (!code.empty()) { + auto value = code[0]; +@@ -1344,18 +1344,18 @@ void SvgFontsDialog::edit_glyph(SPGlyph* glyph) { + void SvgFontsDialog::set_glyphs_view_mode(bool list) { + if (list) { + _glyphs_icon_scroller.hide(); +- _GlyphsListScroller.show(); ++ GlyphsListScroller.show(); + } + else { +- _GlyphsListScroller.hide(); ++ GlyphsListScroller.hide(); + _glyphs_icon_scroller.show(); + } + } + + Gtk::Box* SvgFontsDialog::glyphs_tab() { +- _GlyphsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::glyphs_list_button_release)); ++ GlyphsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::glyphs_list_button_release)); + _glyphs_grid.signal_button_release_event().connect_notify([=](GdkEventButton* event){ glyphs_list_button_release(event); }); +- create_glyphs_popup_menu(_GlyphsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_glyph)); ++ create_glyphs_popup_menu(GlyphsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_glyph)); + + auto missing_glyph = Gtk::make_managed(); + missing_glyph->set_label(_("Missing glyph")); +@@ -1377,31 +1377,31 @@ Gtk::Box* SvgFontsDialog::glyphs_tab() { + glyphs_vbox.set_border_width(4); + glyphs_vbox.set_spacing(4); + +- _GlyphsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); +- _GlyphsListScroller.add(_GlyphsList); +- fix_inner_scroll(&_GlyphsListScroller); +- _GlyphsList.set_model(_GlyphsListStore); +- _GlyphsList.set_enable_search(false); ++ GlyphsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); ++ GlyphsListScroller.add(GlyphsList); ++ fix_inner_scroll(&GlyphsListScroller); ++ GlyphsList.set_model(GlyphsListStore); ++ GlyphsList.set_enable_search(false); + + _glyph_renderer = Gtk::manage(new SvgGlyphRenderer()); + const int size = 20; // arbitrarily chosen to keep glyphs small but still legible + _glyph_renderer->set_font_size(size * 9 / 10); + _glyph_renderer->set_cell_size(size * 3 / 2, size); +- _glyph_renderer->set_tree(&_GlyphsList); ++ _glyph_renderer->set_tree(&GlyphsList); + _glyph_renderer->signal_clicked().connect([=](const GdkEvent*, const Glib::ustring& unicodes) { + // set preview: show clicked glyph only + _preview_entry.set_text(unicodes); + }); +- auto col_index = _GlyphsList.append_column(_("Glyph"), *_glyph_renderer) - 1; +- if (auto column = _GlyphsList.get_column(col_index)) { +- column->add_attribute(_glyph_renderer->property_glyph(), _GlyphsListColumns.unicode); +- } +- _GlyphsList.append_column_editable(_("Name"), _GlyphsListColumns.glyph_name); +- _GlyphsList.append_column_editable(_("Characters"), _GlyphsListColumns.unicode); +- _GlyphsList.append_column(_("Unicode"), _GlyphsListColumns.UplusCode); +- _GlyphsList.append_column_numeric_editable(_("Advance"), _GlyphsListColumns.advance, "%.2f"); +- _GlyphsList.show(); +- _GlyphsList.signal_row_activated().connect([=](const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*) { ++ auto col_index = GlyphsList.append_column(_("Glyph"), *_glyph_renderer) - 1; ++ if (auto column = GlyphsList.get_column(col_index)) { ++ column->add_attribute(_glyph_renderer->property_glyph(), GlyphsListColumns.unicode); ++ } ++ GlyphsList.append_column_editable(_("Name"), GlyphsListColumns.glyph_name); ++ GlyphsList.append_column_editable(_("Characters"), GlyphsListColumns.unicode); ++ GlyphsList.append_column(_("Unicode"), GlyphsListColumns.UplusCode); ++ GlyphsList.append_column_numeric_editable(_("Advance"), GlyphsListColumns.advance, "%.2f"); ++ GlyphsList.show(); ++ GlyphsList.signal_row_activated().connect([=](const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*) { + edit_glyph(get_selected_glyph()); + }); + +@@ -1442,7 +1442,7 @@ Gtk::Box* SvgFontsDialog::glyphs_tab() { + _glyphs_icon_scroller.add(_glyphs_grid); + _glyphs_icon_scroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + _glyphs_grid.set_name("GlyphsGrid"); +- _glyphs_grid.set_model(_GlyphsListStore); ++ _glyphs_grid.set_model(GlyphsListStore); + _glyphs_grid.set_item_width(cell_width); + _glyphs_grid.set_selection_mode(Gtk::SELECTION_SINGLE); + _glyphs_grid.show_all_children(); +@@ -1451,9 +1451,9 @@ Gtk::Box* SvgFontsDialog::glyphs_tab() { + _glyphs_grid.set_row_spacing(0); + _glyphs_grid.set_column_spacing(0); + _glyphs_grid.set_columns(-1); +- _glyphs_grid.set_markup_column(_GlyphsListColumns.name_markup); ++ _glyphs_grid.set_markup_column(GlyphsListColumns.name_markup); + _glyphs_grid.pack_start(*_glyph_cell_renderer); +- _glyphs_grid.add_attribute(*_glyph_cell_renderer, "glyph", _GlyphsListColumns.unicode); ++ _glyphs_grid.add_attribute(*_glyph_cell_renderer, "glyph", GlyphsListColumns.unicode); + _glyphs_grid.show(); + _glyphs_grid.signal_item_activated().connect([=](const Gtk::TreeModel::Path& path) { + edit_glyph(get_selected_glyph()); +@@ -1463,17 +1463,17 @@ Gtk::Box* SvgFontsDialog::glyphs_tab() { + _glyphs_grid.signal_selection_changed().connect([=]() { + if (_glyphs_icon_scroller.get_visible()) { + if (auto selected = get_selected_glyph_iter()) { +- if (auto selection = _GlyphsList.get_selection()) { ++ if (auto selection = GlyphsList.get_selection()) { + selection->select(selected); + } + } + } + }); +- if (auto selection = _GlyphsList.get_selection()) { ++ if (auto selection = GlyphsList.get_selection()) { + selection->signal_changed().connect([=]() { +- if (_GlyphsListScroller.get_visible()) { ++ if (GlyphsListScroller.get_visible()) { + if (auto selected = get_selected_glyph_iter()) { +- auto selected_item = _GlyphsListStore->get_path(selected); ++ auto selected_item = GlyphsListStore->get_path(selected); + _glyphs_grid.select_path(selected_item); + } + } +@@ -1500,26 +1500,26 @@ Gtk::Box* SvgFontsDialog::glyphs_tab() { + hbox->pack_end(*list, false, false); + + glyphs_vbox.pack_start(*hb, false, false); +- glyphs_vbox.pack_start(_GlyphsListScroller, true, true); ++ glyphs_vbox.pack_start(GlyphsListScroller, true, true); + glyphs_vbox.pack_start(_glyphs_icon_scroller, true, true); + glyphs_vbox.pack_start(*hbox, false,false); + +- _GlyphsListScroller.set_no_show_all(); ++ GlyphsListScroller.set_no_show_all(); + _glyphs_icon_scroller.set_no_show_all(); + (_show_glyph_list ? list : grid)->set_active(); + set_glyphs_view_mode(_show_glyph_list); + +- for (auto&& col : _GlyphsList.get_columns()) { ++ for (auto&& col : GlyphsList.get_columns()) { + col->set_resizable(); + } + +- static_cast(_GlyphsList.get_column_cell_renderer(ColName))->signal_edited().connect( ++ static_cast(GlyphsList.get_column_cell_renderer(ColName))->signal_edited().connect( + sigc::mem_fun(*this, &SvgFontsDialog::glyph_name_edit)); + +- static_cast(_GlyphsList.get_column_cell_renderer(ColString))->signal_edited().connect( ++ static_cast(GlyphsList.get_column_cell_renderer(ColString))->signal_edited().connect( + sigc::mem_fun(*this, &SvgFontsDialog::glyph_unicode_edit)); + +- static_cast(_GlyphsList.get_column_cell_renderer(ColAdvance))->signal_edited().connect( ++ static_cast(GlyphsList.get_column_cell_renderer(ColAdvance))->signal_edited().connect( + sigc::mem_fun(*this, &SvgFontsDialog::glyph_advance_edit)); + + _glyphs_observer.signal_changed().connect([=]() { update_glyphs(); }); +@@ -1562,9 +1562,9 @@ void SvgFontsDialog::add_kerning_pair(){ + kerning_pair = cast(getDocument()->getObjectByRepr(repr)); + + // select newly added pair +- if (auto selection = _KerningPairsList.get_selection()) { +- _KerningPairsListStore->foreach_iter([=](const Gtk::TreeModel::iterator& it) { +- if (it->get_value(_KerningPairsListColumns.spnode) == kerning_pair) { ++ if (auto selection = KerningPairsList.get_selection()) { ++ KerningPairsListStore->foreach_iter([=](const Gtk::TreeModel::iterator& it) { ++ if (it->get_value(KerningPairsListColumns.spnode) == kerning_pair) { + selection->select(it); + return true; // stop + } +@@ -1576,8 +1576,8 @@ void SvgFontsDialog::add_kerning_pair(){ + } + + Gtk::Box* SvgFontsDialog::kerning_tab(){ +- _KerningPairsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::kerning_pairs_list_button_release)); +- create_kerning_pairs_popup_menu(_KerningPairsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_kerning_pair)); ++ KerningPairsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::kerning_pairs_list_button_release)); ++ create_kerning_pairs_popup_menu(KerningPairsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_kerning_pair)); + + //Kerning Setup: + kerning_vbox.set_border_width(4); +@@ -1590,17 +1590,17 @@ Gtk::Box* SvgFontsDialog::kerning_tab(){ + kerning_selector->pack_start(add_kernpair_button, false, false, MARGIN_SPACE / 2); + add_kernpair_button.set_label(_("Add pair")); + add_kernpair_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::add_kerning_pair)); +- _KerningPairsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_pair_selection_changed)); ++ KerningPairsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_pair_selection_changed)); + kerning_slider->signal_value_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_value_changed)); + + kerning_vbox.pack_start(*kerning_selector, false,false); + +- kerning_vbox.pack_start(_KerningPairsListScroller, true,true); +- _KerningPairsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); +- _KerningPairsListScroller.add(_KerningPairsList); +- _KerningPairsList.set_model(_KerningPairsListStore); +- _KerningPairsList.append_column(_("First glyph"), _KerningPairsListColumns.first_glyph); +- _KerningPairsList.append_column(_("Second glyph"), _KerningPairsListColumns.second_glyph); ++ kerning_vbox.pack_start(KerningPairsListScroller, true,true); ++ KerningPairsListScroller.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS); ++ KerningPairsListScroller.add(KerningPairsList); ++ KerningPairsList.set_model(KerningPairsListStore); ++ KerningPairsList.append_column(_("First glyph"), KerningPairsListColumns.first_glyph); ++ KerningPairsList.append_column(_("Second glyph"), KerningPairsListColumns.second_glyph); + // _KerningPairsList.append_column_numeric_editable(_("Kerning Value"), _KerningPairsListColumns.kerning_value, "%f"); + + kerning_vbox.pack_start((Gtk::Widget&) kerning_preview, false,false); +@@ -1703,19 +1703,19 @@ SvgFontsDialog::SvgFontsDialog() + kerning_slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL)); + + // kerning pairs store +- _KerningPairsListStore = Gtk::ListStore::create(_KerningPairsListColumns); ++ KerningPairsListStore = Gtk::ListStore::create(KerningPairsListColumns); + + // list of glyphs in a current font; this store is reused if there are multiple fonts +- _GlyphsListStore = Gtk::ListStore::create(_GlyphsListColumns); ++ GlyphsListStore = Gtk::ListStore::create(GlyphsListColumns); + + // List of SVGFonts declared in a document: + _model = Gtk::ListStore::create(_columns); +- _FontsList.set_model(_model); +- _FontsList.set_enable_search(false); +- _FontsList.append_column_editable(_("_Fonts"), _columns.label); +- _FontsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_font_selection_changed)); ++ FontsList.set_model(_model); ++ FontsList.set_enable_search(false); ++ FontsList.append_column_editable(_("_Fonts"), _columns.label); ++ FontsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_font_selection_changed)); + // connect to the cell renderer's edit signal; there's also model's row_changed, but it is less specific +- if (auto renderer = dynamic_cast(_FontsList.get_column_cell_renderer(0))) { ++ if (auto renderer = dynamic_cast(FontsList.get_column_cell_renderer(0))) { + // commit font names when user edits them + renderer->signal_edited().connect([=](const Glib::ustring& path, const Glib::ustring& new_name) { + if (auto it = _model->get_iter(path)) { +@@ -1762,8 +1762,8 @@ SvgFontsDialog::SvgFontsDialog() + preview_entry_hbox->set_margin_start(MARGIN_SPACE); + preview_entry_hbox->set_margin_end(MARGIN_SPACE); + +- _FontsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::fonts_list_button_release)); +- create_fonts_popup_menu(_FontsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_font)); ++ FontsList.signal_button_release_event().connect_notify(sigc::mem_fun(*this, &SvgFontsDialog::fonts_list_button_release)); ++ create_fonts_popup_menu(FontsList, sigc::mem_fun(*this, &SvgFontsDialog::remove_selected_font)); + + show_all(); + } +diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h +index 40950293f5..04a577bf99 100644 +--- a/src/ui/dialog/svg-fonts-dialog.h ++++ b/src/ui/dialog/svg-fonts-dialog.h +@@ -275,7 +275,7 @@ private: + }; + Glib::RefPtr _model; + Columns _columns; +- Gtk::TreeView _FontsList; ++ Gtk::TreeView FontsList; + Gtk::ScrolledWindow _fonts_scroller; + + class GlyphsColumns : public Gtk::TreeModel::ColumnRecord +@@ -298,10 +298,10 @@ private: + Gtk::TreeModelColumn name_markup; + }; + enum GlyphColumnIndex { ColGlyph, ColName, ColString, ColUplusCode, ColAdvance }; +- GlyphsColumns _GlyphsListColumns; +- Glib::RefPtr _GlyphsListStore; +- Gtk::TreeView _GlyphsList; +- Gtk::ScrolledWindow _GlyphsListScroller; ++ GlyphsColumns GlyphsListColumns; ++ Glib::RefPtr GlyphsListStore; ++ Gtk::TreeView GlyphsList; ++ Gtk::ScrolledWindow GlyphsListScroller; + Gtk::ScrolledWindow _glyphs_icon_scroller; + Gtk::IconView _glyphs_grid; + SvgGlyphRenderer* _glyph_renderer = nullptr; +@@ -323,10 +323,10 @@ private: + Gtk::TreeModelColumn spnode; + }; + +- KerningPairColumns _KerningPairsListColumns; +- Glib::RefPtr _KerningPairsListStore; +- Gtk::TreeView _KerningPairsList; +- Gtk::ScrolledWindow _KerningPairsListScroller; ++ KerningPairColumns KerningPairsListColumns; ++ Glib::RefPtr KerningPairsListStore; ++ Gtk::TreeView KerningPairsList; ++ Gtk::ScrolledWindow KerningPairsListScroller; + Gtk::Button add_kernpair_button; + + Gtk::Grid _header_box; +@@ -338,9 +338,9 @@ private: + bool _show_glyph_list = true; + void set_glyphs_view_mode(bool list); + +- Gtk::Menu _FontsContextMenu; +- Gtk::Menu _GlyphsContextMenu; +- Gtk::Menu _KerningPairsContextMenu; ++ Gtk::Menu FontsContextMenu; ++ Gtk::Menu GlyphsContextMenu; ++ Gtk::Menu KerningPairsContextMenu; + + SvgFontDrawingArea _font_da, kerning_preview; + GlyphComboBox first_glyph, second_glyph; +diff --git a/src/ui/dialog/svg-preview.h b/src/ui/dialog/svg-preview.h +index 0df897f6dd..8eccbfd4e5 100644 +--- a/src/ui/dialog/svg-preview.h ++++ b/src/ui/dialog/svg-preview.h +@@ -16,7 +16,7 @@ + */ + + #ifndef __SVG_PREVIEW_H__ +-#define __SVG_PREVIEW_H__ ++#define SVG_PREVIEW_H_ + + //Gtk includes + #include +diff --git a/src/ui/selected-color.cpp b/src/ui/selected-color.cpp +index 81cc4d296b..2f35c4b760 100644 +--- a/src/ui/selected-color.cpp ++++ b/src/ui/selected-color.cpp +@@ -21,7 +21,7 @@ + namespace Inkscape { + namespace UI { + +-double const SelectedColor::_EPSILON = 1e-4; ++double const SelectedColor::EPSILON = 1e-4; + + SelectedColor::SelectedColor() + : _color(0) +@@ -87,8 +87,8 @@ void SelectedColor::setColorAlpha(SPColor const &color, gfloat alpha, bool emit_ + ); + #endif + +- if ( _virgin || !color.isClose( _color, _EPSILON ) || +- (fabs((_alpha) - (alpha)) >= _EPSILON )) { ++ if ( _virgin || !color.isClose( _color, EPSILON ) || ++ (fabs((_alpha) - (alpha)) >= EPSILON )) { + + _virgin = false; + +diff --git a/src/ui/selected-color.h b/src/ui/selected-color.h +index 6010b76045..48923ea042 100644 +--- a/src/ui/selected-color.h ++++ b/src/ui/selected-color.h +@@ -73,7 +73,7 @@ private: + + bool _updating; + +- static double const _EPSILON; ++ static double const EPSILON; + }; + + class ColorSelectorFactory { +diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp +index b816e23d6c..b54ba8ea97 100644 +--- a/src/ui/tool/path-manipulator.cpp ++++ b/src/ui/tool/path-manipulator.cpp +@@ -742,13 +742,13 @@ unsigned PathManipulator::_deleteStretch(NodeList::iterator start, NodeList::ite + Geom::CubicBezier bc(*cur, *cur->front(), *cur.next()->back(), *cur.next()); + for (unsigned s = 0; s < samples_per_segment; ++s) { + auto t = t_step * s; +- input.emplace_back(InputPoint(bc.pointAt(t), t)); ++ input.emplace_back(bc.pointAt(t), t); + } + ++seg; + } + // Fill last point + // last point + its slope +- input.emplace_back(InputPoint(end->position(), Geom::Point(), end->back()->position(), 1.0)); ++ input.emplace_back(end->position(), Geom::Point(), end->back()->position(), 1.0); + + // get slope for the first point + input.front() = InputPoint(start.prev()->position(), start.prev()->front()->position(), Geom::Point(), 0.0); +diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp +index f13c0fb443..da1db3314f 100644 +--- a/src/ui/tools/arc-tool.cpp ++++ b/src/ui/tools/arc-tool.cpp +@@ -227,7 +227,7 @@ bool ArcTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("arc-rx"); + handled = true; + } +@@ -260,7 +260,7 @@ bool ArcTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- handled = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ handled = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/arc-tool.h b/src/ui/tools/arc-tool.h +index 312f9435b2..095bd2c26d 100644 +--- a/src/ui/tools/arc-tool.h ++++ b/src/ui/tools/arc-tool.h +@@ -30,7 +30,7 @@ namespace Inkscape { + class Selection; + } + +-#define SP_ARC_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) ++#define SP_ARC_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) + #define SP_IS_ARC_CONTEXT(obj) (dynamic_cast(obj) != NULL) + + namespace Inkscape { +diff --git a/src/ui/tools/box3d-tool.cpp b/src/ui/tools/box3d-tool.cpp +index a9d972c5f5..8362b8046c 100644 +--- a/src/ui/tools/box3d-tool.cpp ++++ b/src/ui/tools/box3d-tool.cpp +@@ -322,49 +322,49 @@ bool Box3dTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_Down: + // prevent the zoom field from activation +- if (!MOD__CTRL_ONLY(event)) ++ if (!MOD_CTRL_ONLY(event)) + ret = TRUE; + break; + + case GDK_KEY_bracketright: +- document->getCurrentPersp3D()->rotate_VP (Proj::X, 180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::X, 180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_bracketleft: +- document->getCurrentPersp3D()->rotate_VP (Proj::X, -180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::X, -180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_parenright: +- document->getCurrentPersp3D()->rotate_VP (Proj::Y, 180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::Y, 180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_parenleft: +- document->getCurrentPersp3D()->rotate_VP (Proj::Y, -180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::Y, -180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_braceright: +- document->getCurrentPersp3D()->rotate_VP (Proj::Z, 180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::Z, 180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_braceleft: +- document->getCurrentPersp3D()->rotate_VP (Proj::Z, -180 / snaps * y_dir, MOD__ALT(event)); ++ document->getCurrentPersp3D()->rotate_VP (Proj::Z, -180 / snaps * y_dir, MOD_ALT(event)); + DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + ret = true; + break; + + case GDK_KEY_g: + case GDK_KEY_G: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + _desktop->getSelection()->toGuides(); + ret = true; + } +@@ -372,7 +372,7 @@ bool Box3dTool::root_handler(GdkEvent* event) { + + case GDK_KEY_p: + case GDK_KEY_P: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + if (document->getCurrentPersp3D()) { + document->getCurrentPersp3D()->print_debugging_info(); + } +@@ -382,11 +382,11 @@ bool Box3dTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("box3d-angle-x"); + ret = TRUE; + } +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + Persp3D::toggle_VPs(selection->perspList(), Proj::X); + this->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically? + ret = true; +@@ -395,7 +395,7 @@ bool Box3dTool::root_handler(GdkEvent* event) { + + case GDK_KEY_y: + case GDK_KEY_Y: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + Persp3D::toggle_VPs(selection->perspList(), Proj::Y); + this->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically? + ret = true; +@@ -404,7 +404,7 @@ bool Box3dTool::root_handler(GdkEvent* event) { + + case GDK_KEY_z: + case GDK_KEY_Z: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + Persp3D::toggle_VPs(selection->perspList(), Proj::Z); + this->_vpdrag->updateLines(); // FIXME: Shouldn't this be done automatically? + ret = true; +@@ -435,7 +435,7 @@ bool Box3dTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/box3d-tool.h b/src/ui/tools/box3d-tool.h +index a75c2dbfda..d1583a4b6c 100644 +--- a/src/ui/tools/box3d-tool.h ++++ b/src/ui/tools/box3d-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_BOX3D_CONTEXT_H__ +-#define __SP_BOX3D_CONTEXT_H__ ++#define SP_BOX3D_CONTEXT_H_ + + /* + * 3D box drawing context +diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp +index ed23158493..ccf948e2cc 100644 +--- a/src/ui/tools/calligraphic-tool.cpp ++++ b/src/ui/tools/calligraphic-tool.cpp +@@ -764,7 +764,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + switch (get_latin_keyval (&event->key)) { + case GDK_KEY_Up: + case GDK_KEY_KP_Up: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->angle += 5.0; + if (this->angle > 90.0) + this->angle = 90.0; +@@ -774,7 +774,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Down: + case GDK_KEY_KP_Down: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->angle -= 5.0; + if (this->angle < -90.0) + this->angle = -90.0; +@@ -784,7 +784,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Right: + case GDK_KEY_KP_Right: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width = Quantity::convert(this->width, "px", unit) + 0.01; + if (this->width > 1.0) + this->width = 1.0; +@@ -794,7 +794,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Left: + case GDK_KEY_KP_Left: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width = Quantity::convert(this->width, "px", unit) - 0.01; + if (this->width < 0.00001) + this->width = 0.00001; +@@ -816,7 +816,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("calligraphy-width"); + ret = TRUE; + } +@@ -830,7 +830,7 @@ bool CalligraphicTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_z: + case GDK_KEY_Z: +- if (MOD__CTRL_ONLY(event) && this->is_drawing) { ++ if (MOD_CTRL_ONLY(event) && this->is_drawing) { + // if drawing, cancel, otherwise pass it up for undo + this->cancel(); + ret = TRUE; +@@ -1057,11 +1057,11 @@ void CalligraphicTool::fit_and_split(bool release) { + if (! release) { + currentcurve.reset(); + currentcurve.moveto(b1[0]); +- for (Geom::Point *bp1 = b1; bp1 < b1 + BEZIER_SIZE * nb1; bp1 += BEZIER_SIZE) { ++ for (Geom::Point *bp1 = b1; bp1 < b1 + static_cast(BEZIER_SIZE * )nb1; bp1 += BEZIER_SIZE) { + currentcurve.curveto(bp1[1], bp1[2], bp1[3]); + } + currentcurve.lineto(b2[BEZIER_SIZE*(nb2-1) + 3]); +- for (Geom::Point *bp2 = b2 + BEZIER_SIZE * ( nb2 - 1 ); bp2 >= b2; bp2 -= BEZIER_SIZE) { ++ for (Geom::Point *bp2 = b2 + static_cast(BEZIER_SIZE * ( nb2 - 1 )); bp2 >= b2; bp2 -= BEZIER_SIZE) { + currentcurve.curveto(bp2[2], bp2[1], bp2[0]); + } + // FIXME: dc->segments is always NULL at this point?? +@@ -1073,10 +1073,10 @@ void CalligraphicTool::fit_and_split(bool release) { + } + + /* Current calligraphic */ +- for (Geom::Point *bp1 = b1; bp1 < b1 + BEZIER_SIZE * nb1; bp1 += BEZIER_SIZE) { ++ for (Geom::Point *bp1 = b1; bp1 < b1 + static_cast(BEZIER_SIZE * )nb1; bp1 += BEZIER_SIZE) { + cal1.curveto(bp1[1], bp1[2], bp1[3]); + } +- for (Geom::Point *bp2 = b2; bp2 < b2 + BEZIER_SIZE * nb2; bp2 += BEZIER_SIZE) { ++ for (Geom::Point *bp2 = b2; bp2 < b2 + static_cast(BEZIER_SIZE * )nb2; bp2 += BEZIER_SIZE) { + cal2.curveto(bp2[1], bp2[2], bp2[3]); + } + } else { +diff --git a/src/ui/tools/calligraphic-tool.h b/src/ui/tools/calligraphic-tool.h +index 75b2a4a929..9d5245c97c 100644 +--- a/src/ui/tools/calligraphic-tool.h ++++ b/src/ui/tools/calligraphic-tool.h +@@ -34,7 +34,7 @@ class Path; + #define DDC_MAX_PRESSURE 1.0 + #define DDC_DEFAULT_PRESSURE 1.0 + +-#define DDC_MIN_TILT -1.0 ++#define DDC_MIN_TILT (-1.0) + #define DDC_MAX_TILT 1.0 + #define DDC_DEFAULT_TILT 0.0 + +diff --git a/src/ui/tools/connector-tool.h b/src/ui/tools/connector-tool.h +index f2271aa27e..1c0b72aee9 100644 +--- a/src/ui/tools/connector-tool.h ++++ b/src/ui/tools/connector-tool.h +@@ -43,7 +43,7 @@ namespace Inkscape { + } + } + +-#define SP_CONNECTOR_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) ++#define SP_CONNECTOR_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) + //#define SP_IS_CONNECTOR_CONTEXT(obj) (dynamic_cast((const ToolBase*)obj) != NULL) + + enum { +diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp +index a909df76cf..e441013578 100644 +--- a/src/ui/tools/dropper-tool.cpp ++++ b/src/ui/tools/dropper-tool.cpp +@@ -329,7 +329,7 @@ bool DropperTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_Down: + // prevent the zoom field from activation +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + ret = TRUE; + } + break; +diff --git a/src/ui/tools/dropper-tool.h b/src/ui/tools/dropper-tool.h +index 5222ca3712..d69a9a5ddb 100644 +--- a/src/ui/tools/dropper-tool.h ++++ b/src/ui/tools/dropper-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_DROPPER_CONTEXT_H__ +-#define __SP_DROPPER_CONTEXT_H__ ++#define SP_DROPPER_CONTEXT_H_ + + /* + * Tool for picking colors from drawing +@@ -21,8 +21,8 @@ + + struct SPCanvasItem; + +-#define SP_DROPPER_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_DROPPER_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_DROPPER_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_DROPPER_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + enum { + SP_DROPPER_PICK_VISIBLE, +diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp +index e111533185..f89ff2d4c9 100644 +--- a/src/ui/tools/eraser-tool.cpp ++++ b/src/ui/tools/eraser-tool.cpp +@@ -28,37 +28,28 @@ + + #include "eraser-tool.h" + +-#include ++#include <2geom/bezier-utils.h> ++#include <2geom/pathvector.h> ++#include + #include +-#include +- +-#include + #include + #include +- +-#include <2geom/bezier-utils.h> +-#include <2geom/pathvector.h> ++#include ++#include ++#include + + #include "context-fns.h" + #include "desktop-events.h" + #include "desktop-style.h" + #include "desktop.h" ++#include "display/control/canvas-item-bpath.h" ++#include "display/curve.h" + #include "document-undo.h" + #include "document.h" ++#include "include/macros.h" + #include "layer-manager.h" + #include "message-context.h" + #include "message-stack.h" +-#include "path-chemistry.h" +-#include "preferences.h" +-#include "rubberband.h" +-#include "selection-chemistry.h" +-#include "selection.h" +- +-#include "display/curve.h" +-#include "display/control/canvas-item-bpath.h" +- +-#include "include/macros.h" +- + #include "object/sp-clippath.h" + #include "object/sp-image.h" + #include "object/sp-item-group.h" +@@ -68,10 +59,13 @@ + #include "object/sp-shape.h" + #include "object/sp-text.h" + #include "object/sp-use.h" +- +-#include "ui/icon-names.h" +- ++#include "path-chemistry.h" ++#include "preferences.h" ++#include "rubberband.h" ++#include "selection-chemistry.h" ++#include "selection.h" + #include "svg/svg.h" ++#include "ui/icon-names.h" + + + using Inkscape::DocumentUndo; +@@ -1278,7 +1272,7 @@ void EraserTool::_completeBezier(double tolerance_sq, bool releasing) + + unsigned const bezier_size = 4; + unsigned const max_beziers = 8; +- size_t const bezier_max_length = bezier_size * max_beziers; ++ size_t const bezier_max_length = static_cast(bezier_size * )max_beziers; + + Geom::Point b1[bezier_max_length]; + gint const nb1 = Geom::bezier_fit_cubic_r(b1, point1, npoints, tolerance_sq, max_beziers); +@@ -1303,13 +1297,13 @@ void EraserTool::_completeBezier(double tolerance_sq, bool releasing) + currentcurve.reset(); + currentcurve.moveto(b1[0]); + +- for (Geom::Point *bp1 = b1; bp1 < b1 + bezier_size * nb1; bp1 += bezier_size) { ++ for (Geom::Point *bp1 = b1; bp1 < b1 + static_cast(bezier_size * )nb1; bp1 += bezier_size) { + currentcurve.curveto(bp1[1], bp1[2], bp1[3]); + } + + currentcurve.lineto(b2[bezier_size * (nb2 - 1) + 3]); + +- for (Geom::Point *bp2 = b2 + bezier_size * (nb2 - 1); bp2 >= b2; bp2 -= bezier_size) { ++ for (Geom::Point *bp2 = b2 + static_cast(bezier_size * (nb2 - 1)); bp2 >= b2; bp2 -= bezier_size) { + currentcurve.curveto(bp2[2], bp2[1], bp2[0]); + } + +@@ -1323,11 +1317,11 @@ void EraserTool::_completeBezier(double tolerance_sq, bool releasing) + } + + /* Current eraser */ +- for (Geom::Point *bp1 = b1; bp1 < b1 + bezier_size * nb1; bp1 += bezier_size) { ++ for (Geom::Point *bp1 = b1; bp1 < b1 + static_cast(bezier_size * )nb1; bp1 += bezier_size) { + cal1.curveto(bp1[1], bp1[2], bp1[3]); + } + +- for (Geom::Point *bp2 = b2; bp2 < b2 + bezier_size * nb2; bp2 += bezier_size) { ++ for (Geom::Point *bp2 = b2; bp2 < b2 + static_cast(bezier_size * )nb2; bp2 += bezier_size) { + cal2.curveto(bp2[1], bp2[2], bp2[3]); + } + } +diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp +index 3e94f353c5..51cbcada32 100644 +--- a/src/ui/tools/flood-tool.cpp ++++ b/src/ui/tools/flood-tool.cpp +@@ -20,47 +20,39 @@ + + #include "flood-tool.h" + ++#include <2geom/pathvector.h> + #include +-#include +- ++#include + #include + #include +- +-#include <2geom/pathvector.h> ++#include + + #include "async/progress.h" + #include "color.h" + #include "context-fns.h" + #include "desktop-style.h" + #include "desktop.h" +-#include "document-undo.h" +-#include "document.h" +-#include "layer-manager.h" +-#include "message-context.h" +-#include "message-stack.h" +-#include "rubberband.h" +-#include "selection.h" +-#include "page-manager.h" +- + #include "display/cairo-utils.h" + #include "display/drawing-context.h" + #include "display/drawing-image.h" + #include "display/drawing.h" +- ++#include "document-undo.h" ++#include "document.h" + #include "include/macros.h" +- ++#include "layer-manager.h" + #include "livarot/Path.h" + #include "livarot/Shape.h" +- ++#include "message-context.h" ++#include "message-stack.h" + #include "object/sp-namedview.h" + #include "object/sp-path.h" + #include "object/sp-root.h" +- ++#include "page-manager.h" ++#include "rubberband.h" ++#include "selection.h" + #include "svg/svg.h" +- + #include "trace/imagemap.h" + #include "trace/potrace/inkscape-potrace.h" +- + #include "ui/icon-names.h" + #include "ui/shape-editor.h" + #include "ui/widget/canvas.h" // Canvas area +@@ -174,7 +166,7 @@ inline static guint32 compose_onto(guint32 px, guint32 bg) + * @param stride The rowstride of the pixel buffer. + */ + inline guint32 get_pixel(guchar *px, int x, int y, int stride) { +- return *reinterpret_cast(px + y * stride + x * 4); ++ return *reinterpret_cast(px + y * stride + static_cast(x * )4); + } + + inline unsigned char * get_trace_pixel(guchar *trace_px, int x, int y, int width) { +@@ -801,7 +793,7 @@ static void sp_flood_do_flood_fill(SPDesktop *desktop, GdkEvent *event, + // } + + guchar *trace_px = g_new(guchar, width * height); +- memset(trace_px, 0x00, width * height); ++ memset(trace_px, 0x00, static_cast(width * )height); + + std::deque fill_queue; + std::queue color_queue; +@@ -1177,7 +1169,7 @@ bool FloodTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_Down: + // prevent the zoom field from activation +- if (!MOD__CTRL_ONLY(event)) ++ if (!MOD_CTRL_ONLY(event)) + ret = TRUE; + break; + default: +diff --git a/src/ui/tools/flood-tool.h b/src/ui/tools/flood-tool.h +index 290021e173..34a75ca105 100644 +--- a/src/ui/tools/flood-tool.h ++++ b/src/ui/tools/flood-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_FLOOD_CONTEXT_H__ +-#define __SP_FLOOD_CONTEXT_H__ ++#define SP_FLOOD_CONTEXT_H_ + + /* + * Flood fill drawing context +@@ -18,8 +18,8 @@ + + #include "ui/tools/tool-base.h" + +-#define SP_FLOOD_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_FLOOD_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_FLOOD_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_FLOOD_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + +diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp +index 30768208e5..ff4fec50b8 100644 +--- a/src/ui/tools/freehand-base.cpp ++++ b/src/ui/tools/freehand-base.cpp +@@ -144,7 +144,7 @@ bool FreehandBase::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_Down: + // prevent the zoom field from activation +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + ret = TRUE; + } + break; +diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp +index 04acf4b176..36105084e8 100644 +--- a/src/ui/tools/gradient-tool.cpp ++++ b/src/ui/tools/gradient-tool.cpp +@@ -622,7 +622,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("altx-grad"); + ret = TRUE; + } +@@ -630,7 +630,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + + case GDK_KEY_A: + case GDK_KEY_a: +- if (MOD__CTRL_ONLY(event) && drag->isNonEmpty()) { ++ if (MOD_CTRL_ONLY(event) && drag->isNonEmpty()) { + drag->selectAll(); + ret = TRUE; + } +@@ -638,7 +638,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + + case GDK_KEY_L: + case GDK_KEY_l: +- if (MOD__CTRL_ONLY(event) && drag->isNonEmpty() && drag->hasSelection()) { ++ if (MOD_CTRL_ONLY(event) && drag->isNonEmpty() && drag->hasSelection()) { + this->simplify(1e-4); + ret = TRUE; + } +@@ -656,7 +656,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + + case GDK_KEY_r: + case GDK_KEY_R: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + sp_gradient_reverse_selected_gradients(_desktop); + ret = TRUE; + } +@@ -671,7 +671,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + + case GDK_KEY_i: + case GDK_KEY_I: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + // Shift+I - insert stops (alternate keybinding for keyboards + // that don't have the Insert key) + this->add_stops_between_selected_stops(); +@@ -682,7 +682,7 @@ bool GradientTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + case GDK_KEY_Tab: +diff --git a/src/ui/tools/gradient-tool.h b/src/ui/tools/gradient-tool.h +index 6098a46a72..d61fda4b4e 100644 +--- a/src/ui/tools/gradient-tool.h ++++ b/src/ui/tools/gradient-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_GRADIENT_CONTEXT_H__ +-#define __SP_GRADIENT_CONTEXT_H__ ++#define SP_GRADIENT_CONTEXT_H_ + + /* + * Gradient drawing and editing tool +@@ -20,8 +20,8 @@ + #include + #include "ui/tools/tool-base.h" + +-#define SP_GRADIENT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_GRADIENT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_GRADIENT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_GRADIENT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + class GrDrag; + +diff --git a/src/ui/tools/lpe-tool.h b/src/ui/tools/lpe-tool.h +index 498031e73d..4e5788a0b5 100644 +--- a/src/ui/tools/lpe-tool.h ++++ b/src/ui/tools/lpe-tool.h +@@ -18,8 +18,8 @@ + + #include "ui/tools/pen-tool.h" + +-#define SP_LPETOOL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_LPETOOL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_LPETOOL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_LPETOOL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + /* This is the list of subtools from which the toolbar of the LPETool is built automatically */ + extern const int num_subtools; +diff --git a/src/ui/tools/marker-tool.h b/src/ui/tools/marker-tool.h +index 92d77a2c65..3ed58a3b3d 100644 +--- a/src/ui/tools/marker-tool.h ++++ b/src/ui/tools/marker-tool.h +@@ -11,7 +11,7 @@ + */ + + #ifndef __SP_MARKER_CONTEXT_H__ +-#define __SP_MARKER_CONTEXT_H__ ++#define SP_MARKER_CONTEXT_H_ + + #include + #include +diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp +index 25214713e6..f36a7f684d 100644 +--- a/src/ui/tools/mesh-tool.cpp ++++ b/src/ui/tools/mesh-tool.cpp +@@ -755,7 +755,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_A: + case GDK_KEY_a: +- if (MOD__CTRL_ONLY(event) && _grdrag->isNonEmpty()) { ++ if (MOD_CTRL_ONLY(event) && _grdrag->isNonEmpty()) { + _grdrag->selectAll(); + ret = TRUE; + } +@@ -783,7 +783,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_i: + case GDK_KEY_I: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + // Shift+I - insert corners (alternate keybinding for keyboards + // that don't have the Insert key) + this->corner_operation(MG_CORNER_INSERT); +@@ -801,7 +801,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_b: // Toggle mesh side between lineto and curveto. + case GDK_KEY_B: +- if (MOD__ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { ++ if (MOD_ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { + this->corner_operation(MG_CORNER_SIDE_TOGGLE); + ret = TRUE; + } +@@ -809,7 +809,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_c: // Convert mesh side from generic Bezier to Bezier approximating arc, + case GDK_KEY_C: // preserving handle direction. +- if (MOD__ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { ++ if (MOD_ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { + this->corner_operation(MG_CORNER_SIDE_ARC); + ret = TRUE; + } +@@ -817,7 +817,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_g: // Toggle mesh tensor points on/off + case GDK_KEY_G: +- if (MOD__ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { ++ if (MOD_ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { + this->corner_operation(MG_CORNER_TENSOR_TOGGLE); + ret = TRUE; + } +@@ -825,7 +825,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_j: // Smooth corner color + case GDK_KEY_J: +- if (MOD__ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { ++ if (MOD_ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { + this->corner_operation(MG_CORNER_COLOR_SMOOTH); + ret = TRUE; + } +@@ -833,7 +833,7 @@ bool MeshTool::root_handler(GdkEvent* event) { + + case GDK_KEY_k: // Pick corner color + case GDK_KEY_K: +- if (MOD__ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { ++ if (MOD_ALT(event) && _grdrag->isNonEmpty() && _grdrag->hasSelection()) { + this->corner_operation(MG_CORNER_COLOR_PICK); + ret = TRUE; + } +diff --git a/src/ui/tools/mesh-tool.h b/src/ui/tools/mesh-tool.h +index 8fcf163987..93cfa4410b 100644 +--- a/src/ui/tools/mesh-tool.h ++++ b/src/ui/tools/mesh-tool.h +@@ -25,8 +25,8 @@ + + #include "object/sp-mesh-array.h" + +-#define SP_MESH_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_MESH_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_MESH_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_MESH_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + +diff --git a/src/ui/tools/node-tool.h b/src/ui/tools/node-tool.h +index d02481bd00..8f4a623910 100644 +--- a/src/ui/tools/node-tool.h ++++ b/src/ui/tools/node-tool.h +@@ -37,8 +37,8 @@ namespace Inkscape { + + struct SPCanvasGroup; + +-#define INK_NODE_TOOL(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define INK_IS_NODE_TOOL(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj)) ++#define INK_NODE_TOOL(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define INK_IS_NODE_TOOL(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj))) + + namespace Inkscape { + namespace UI { +diff --git a/src/ui/tools/pages-tool.cpp b/src/ui/tools/pages-tool.cpp +index dd93957ee6..7ae14c5fcb 100644 +--- a/src/ui/tools/pages-tool.cpp ++++ b/src/ui/tools/pages-tool.cpp +@@ -38,7 +38,7 @@ + + using Inkscape::Modifiers::Modifier; + +-#define INDEX_OF(v, k) (std::distance(v.begin(), std::find(v.begin(), v.end(), k))); ++#define INDEX_OF(v, k) (std::distance((v).begin(), std::find((v).begin(), (v).end(), k))); + + namespace Inkscape { + namespace UI { +diff --git a/src/ui/tools/pages-tool.h b/src/ui/tools/pages-tool.h +index 30887b1e87..fc243d9ae5 100644 +--- a/src/ui/tools/pages-tool.h ++++ b/src/ui/tools/pages-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __UI_TOOLS_PAGES_CONTEXT_H__ +-#define __UI_TOOLS_PAGES_CONTEXT_H__ ++#define UI_TOOLS_PAGES_CONTEXT_H_ + + /* + * Page editing tool +@@ -17,9 +17,9 @@ + #include "2geom/rect.h" + #include "display/control/canvas-item-ptr.h" + +-#define SP_PAGES_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase *)obj)) ++#define SP_PAGES_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase *)(obj))) + #define SP_IS_PAGES_CONTEXT(obj) \ +- (dynamic_cast((const Inkscape::UI::Tools::ToolBase *)obj) != NULL) ++ (dynamic_cast((const Inkscape::UI::Tools::ToolBase *)(obj)) != NULL) + + class SPDocument; + class SPObject; +diff --git a/src/ui/tools/pen-tool.cpp b/src/ui/tools/pen-tool.cpp +index 2c280c665e..f576cf1a35 100644 +--- a/src/ui/tools/pen-tool.cpp ++++ b/src/ui/tools/pen-tool.cpp +@@ -985,9 +985,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + switch (get_latin_keyval (&event->key)) { + case GDK_KEY_Left: // move last point left + case GDK_KEY_KP_Left: +- if (!MOD__CTRL(event)) { // not ctrl +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (!MOD_CTRL(event)) { // not ctrl ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + this->_lastpointMoveScreen(-10, 0); // shift + } + else { +@@ -995,7 +995,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + } + } + else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + this->_lastpointMove(-10*nudge, 0); // shift + } + else { +@@ -1007,9 +1007,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + break; + case GDK_KEY_Up: // move last point up + case GDK_KEY_KP_Up: +- if (!MOD__CTRL(event)) { // not ctrl +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (!MOD_CTRL(event)) { // not ctrl ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + this->_lastpointMoveScreen(0, 10); // shift + } + else { +@@ -1017,7 +1017,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + } + } + else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + this->_lastpointMove(0, 10*nudge); // shift + } + else { +@@ -1029,9 +1029,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + break; + case GDK_KEY_Right: // move last point right + case GDK_KEY_KP_Right: +- if (!MOD__CTRL(event)) { // not ctrl +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (!MOD_CTRL(event)) { // not ctrl ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + this->_lastpointMoveScreen(10, 0); // shift + } + else { +@@ -1039,7 +1039,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + } + } + else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + this->_lastpointMove(10*nudge, 0); // shift + } + else { +@@ -1051,9 +1051,9 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + break; + case GDK_KEY_Down: // move last point down + case GDK_KEY_KP_Down: +- if (!MOD__CTRL(event)) { // not ctrl +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (!MOD_CTRL(event)) { // not ctrl ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + this->_lastpointMoveScreen(0, -10); // shift + } + else { +@@ -1061,7 +1061,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + } + } + else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + this->_lastpointMove(0, -10*nudge); // shift + } + else { +@@ -1108,14 +1108,14 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + + case GDK_KEY_U: + case GDK_KEY_u: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + this->_lastpointToCurve(); + ret = true; + } + break; + case GDK_KEY_L: + case GDK_KEY_l: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + this->_lastpointToLine(); + ret = true; + } +@@ -1125,7 +1125,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + case GDK_KEY_KP_Enter: + if (this->npoints != 0) { + this->ea = nullptr; // unset end anchor if set (otherwise crashes) +- if(MOD__SHIFT_ONLY(event)) { ++ if(MOD_SHIFT_ONLY(event)) { + // All this is needed to stop the last control + // point dispeating and stop making an n-1 shape. + Geom::Point const p(0, 0); +@@ -1149,7 +1149,7 @@ bool PenTool::_handleKeyPress(GdkEvent *event) { + break; + case GDK_KEY_g: + case GDK_KEY_G: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + _desktop->getSelection()->toGuides(); + ret = true; + } +diff --git a/src/ui/tools/pen-tool.h b/src/ui/tools/pen-tool.h +index a7053e8c4a..1a0dee14ef 100644 +--- a/src/ui/tools/pen-tool.h ++++ b/src/ui/tools/pen-tool.h +@@ -18,8 +18,8 @@ + #include "ui/tools/freehand-base.h" + #include "util/action-accel.h" + +-#define SP_PEN_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_PEN_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_PEN_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_PEN_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + +diff --git a/src/ui/tools/pencil-tool.h b/src/ui/tools/pencil-tool.h +index b1e0b2c1a9..04b4668d28 100644 +--- a/src/ui/tools/pencil-tool.h ++++ b/src/ui/tools/pencil-tool.h +@@ -26,8 +26,8 @@ class SPShape; + #define DDC_MIN_PRESSURE 0.0 + #define DDC_MAX_PRESSURE 1.0 + #define DDC_DEFAULT_PRESSURE 1.0 +-#define SP_PENCIL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_PENCIL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_PENCIL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_PENCIL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + namespace UI { +diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp +index ae252afa43..13769bcdd5 100644 +--- a/src/ui/tools/rect-tool.cpp ++++ b/src/ui/tools/rect-tool.cpp +@@ -249,7 +249,7 @@ bool RectTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("rect-width"); + ret = TRUE; + } +@@ -257,7 +257,7 @@ bool RectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_g: + case GDK_KEY_G: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + _desktop->getSelection()->toGuides(); + ret = true; + } +@@ -290,7 +290,7 @@ bool RectTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/rect-tool.h b/src/ui/tools/rect-tool.h +index 79d1a8aba7..ca4cd7b7ed 100644 +--- a/src/ui/tools/rect-tool.h ++++ b/src/ui/tools/rect-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_RECT_CONTEXT_H__ +-#define __SP_RECT_CONTEXT_H__ ++#define SP_RECT_CONTEXT_H_ + + /* + * Rectangle drawing context +diff --git a/src/ui/tools/select-tool.cpp b/src/ui/tools/select-tool.cpp +index 6137c9473e..1fac250e20 100644 +--- a/src/ui/tools/select-tool.cpp ++++ b/src/ui/tools/select-tool.cpp +@@ -828,7 +828,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + guint keyval = get_latin_keyval(&event->key); + { + +- bool alt = ( MOD__ALT(event) ++ bool alt = ( MOD_ALT(event) + || (keyval == GDK_KEY_Alt_L) + || (keyval == GDK_KEY_Alt_R) + || (keyval == GDK_KEY_Meta_L) +@@ -875,17 +875,17 @@ bool SelectTool::root_handler(GdkEvent* event) { + switch (keyval) { + case GDK_KEY_Left: // move selection left + case GDK_KEY_KP_Left: +- if (!MOD__CTRL(event)) { // not ctrl ++ if (!MOD_CTRL(event)) { // not ctrl + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->moveScreen(mul*-10, 0); // shift + } else { + _desktop->getSelection()->moveScreen(mul*-1, 0); // no shift + } + } else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->move(mul*-10*nudge, 0); // shift + } else { + _desktop->getSelection()->move(mul*-nudge, 0); // no shift +@@ -898,18 +898,18 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_Up: // move selection up + case GDK_KEY_KP_Up: +- if (!MOD__CTRL(event)) { // not ctrl ++ if (!MOD_CTRL(event)) { // not ctrl + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + mul *= -y_dir; + +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->moveScreen(0, mul*10); // shift + } else { + _desktop->getSelection()->moveScreen(0, mul*1); // no shift + } + } else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->move(0, mul*10*nudge); // shift + } else { + _desktop->getSelection()->move(0, mul*nudge); // no shift +@@ -922,17 +922,17 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_Right: // move selection right + case GDK_KEY_KP_Right: +- if (!MOD__CTRL(event)) { // not ctrl ++ if (!MOD_CTRL(event)) { // not ctrl + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->moveScreen(mul*10, 0); // shift + } else { + _desktop->getSelection()->moveScreen(mul*1, 0); // no shift + } + } else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->move(mul*10*nudge, 0); // shift + } else { + _desktop->getSelection()->move(mul*nudge, 0); // no shift +@@ -945,18 +945,18 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_Down: // move selection down + case GDK_KEY_KP_Down: +- if (!MOD__CTRL(event)) { // not ctrl ++ if (!MOD_CTRL(event)) { // not ctrl + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + mul *= -y_dir; + +- if (MOD__ALT(event)) { // alt +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event)) { // alt ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->moveScreen(0, mul*-10); // shift + } else { + _desktop->getSelection()->moveScreen(0, mul*-1); // no shift + } + } else { // no alt +- if (MOD__SHIFT(event)) { ++ if (MOD_SHIFT(event)) { + _desktop->getSelection()->move(0, mul*-10*nudge); // shift + } else { + _desktop->getSelection()->move(0, mul*-nudge); // no shift +@@ -977,7 +977,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_a: + case GDK_KEY_A: +- if (MOD__CTRL_ONLY(event)) { ++ if (MOD_CTRL_ONLY(event)) { + sp_edit_select_all(_desktop); + ret = TRUE; + } +@@ -995,17 +995,17 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("select-x"); + ret = TRUE; + } + break; + + case GDK_KEY_bracketleft: +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + selection->rotateScreen(-mul * y_dir); +- } else if (MOD__CTRL(event)) { ++ } else if (MOD_CTRL(event)) { + selection->rotate(-90 * y_dir); + } else if (snaps) { + selection->rotate(-180.0/snaps * y_dir); +@@ -1015,10 +1015,10 @@ bool SelectTool::root_handler(GdkEvent* event) { + break; + + case GDK_KEY_bracketright: +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events(keyval, 0); // with any mask + selection->rotateScreen(mul * y_dir); +- } else if (MOD__CTRL(event)) { ++ } else if (MOD_CTRL(event)) { + selection->rotate(90 * y_dir); + } else if (snaps) { + selection->rotate(180.0/snaps * y_dir); +@@ -1028,7 +1028,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + break; + + case GDK_KEY_Return: +- if (MOD__CTRL_ONLY(event)) { ++ if (MOD_CTRL_ONLY(event)) { + if (selection->singleItem()) { + SPItem *clicked_item = selection->singleItem(); + auto clickedGroup = cast(clicked_item); +@@ -1045,7 +1045,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + break; + + case GDK_KEY_BackSpace: +- if (MOD__CTRL_ONLY(event)) { ++ if (MOD_CTRL_ONLY(event)) { + sp_select_context_up_one_layer(_desktop); + ret = TRUE; + } +@@ -1053,7 +1053,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_s: + case GDK_KEY_S: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + if (!selection->isEmpty()) { + _seltrans->increaseState(); + } +@@ -1064,7 +1064,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + + case GDK_KEY_g: + case GDK_KEY_G: +- if (MOD__SHIFT_ONLY(event)) { ++ if (MOD_SHIFT_ONLY(event)) { + _desktop->getSelection()->toGuides(); + ret = true; + } +@@ -1081,7 +1081,7 @@ bool SelectTool::root_handler(GdkEvent* event) { + this->defaultMessageContext()->clear(); + } + +- bool alt = ( MOD__ALT(event) ++ bool alt = ( MOD_ALT(event) + || (keyval == GDK_KEY_Alt_L) + || (keyval == GDK_KEY_Alt_R) + || (keyval == GDK_KEY_Meta_L) +diff --git a/src/ui/tools/select-tool.h b/src/ui/tools/select-tool.h +index e71a61ff77..17db78ae4d 100644 +--- a/src/ui/tools/select-tool.h ++++ b/src/ui/tools/select-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_SELECT_CONTEXT_H__ +-#define __SP_SELECT_CONTEXT_H__ ++#define SP_SELECT_CONTEXT_H_ + + /* + * Select tool +@@ -15,8 +15,8 @@ + + #include "ui/tools/tool-base.h" + +-#define SP_SELECT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_SELECT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_SELECT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_SELECT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + class SelTrans; +diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp +index eb17f96735..fdf9ef3c41 100644 +--- a/src/ui/tools/spiral-tool.cpp ++++ b/src/ui/tools/spiral-tool.cpp +@@ -224,7 +224,7 @@ bool SpiralTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("spiral-revolutions"); + ret = TRUE; + } +@@ -257,7 +257,7 @@ bool SpiralTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/spiral-tool.h b/src/ui/tools/spiral-tool.h +index 203617c67c..0b6617910c 100644 +--- a/src/ui/tools/spiral-tool.h ++++ b/src/ui/tools/spiral-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_SPIRAL_CONTEXT_H__ +-#define __SP_SPIRAL_CONTEXT_H__ ++#define SP_SPIRAL_CONTEXT_H_ + + /** \file + * Spiral drawing context +@@ -20,8 +20,8 @@ + #include <2geom/point.h> + #include "ui/tools/tool-base.h" + +-#define SP_SPIRAL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_SPIRAL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_SPIRAL_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_SPIRAL_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + class SPSpiral; + +diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp +index c6089b3c5c..8ca731c1d8 100644 +--- a/src/ui/tools/spray-tool.cpp ++++ b/src/ui/tools/spray-tool.cpp +@@ -1250,7 +1250,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + this->single_path_output = nullptr; + } + +- sp_spray_dilate(this, motion_w, this->last_push, Geom::Point(0,0), MOD__SHIFT(event)); ++ sp_spray_dilate(this, motion_w, this->last_push, Geom::Point(0,0), MOD_SHIFT(event)); + + this->has_dilated = true; + ret = TRUE; +@@ -1347,7 +1347,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + if (!this->has_dilated) { + // If we did not rub, do a light tap + this->pressure = 0.03; +- sp_spray_dilate(this, motion_w, _desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD__SHIFT(event)); ++ sp_spray_dilate(this, motion_w, _desktop->dt2doc(motion_dt), Geom::Point(0,0), MOD_SHIFT(event)); + } + this->is_dilating = false; + this->has_dilated = false; +@@ -1372,30 +1372,30 @@ bool SprayTool::root_handler(GdkEvent* event) { + switch (get_latin_keyval (&event->key)) { + case GDK_KEY_j: + case GDK_KEY_J: +- if (MOD__SHIFT_ONLY(event)) { +- sp_spray_switch_mode(this, SPRAY_MODE_COPY, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_spray_switch_mode(this, SPRAY_MODE_COPY, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_k: + case GDK_KEY_K: +- if (MOD__SHIFT_ONLY(event)) { +- sp_spray_switch_mode(this, SPRAY_MODE_CLONE, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_spray_switch_mode(this, SPRAY_MODE_CLONE, MOD_SHIFT(event)); + ret = TRUE; + } + break; + #ifdef ENABLE_SPRAY_MODE_SINGLE_PATH + case GDK_KEY_l: + case GDK_KEY_L: +- if (MOD__SHIFT_ONLY(event)) { +- sp_spray_switch_mode(this, SPRAY_MODE_SINGLE_PATH, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_spray_switch_mode(this, SPRAY_MODE_SINGLE_PATH, MOD_SHIFT(event)); + ret = TRUE; + } + break; + #endif + case GDK_KEY_Up: + case GDK_KEY_KP_Up: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->population += 0.01; + if (this->population > 1.0) { + this->population = 1.0; +@@ -1406,7 +1406,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Down: + case GDK_KEY_KP_Down: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->population -= 0.01; + if (this->population < 0.0) { + this->population = 0.0; +@@ -1417,7 +1417,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Right: + case GDK_KEY_KP_Right: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width += 0.01; + if (this->width > 1.0) { + this->width = 1.0; +@@ -1430,7 +1430,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Left: + case GDK_KEY_KP_Left: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width -= 0.01; + if (this->width < 0.01) { + this->width = 0.01; +@@ -1456,7 +1456,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("spray-width"); + ret = TRUE; + } +@@ -1471,7 +1471,7 @@ bool SprayTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +@@ -1488,11 +1488,11 @@ bool SprayTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: +- sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); ++ sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD_SHIFT(event)); + this->message_context->clear(); + break; + default: +- sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD__SHIFT(event)); ++ sp_spray_switch_mode (this, prefs->getInt("/tools/spray/mode"), MOD_SHIFT(event)); + break; + } + } +diff --git a/src/ui/tools/spray-tool.h b/src/ui/tools/spray-tool.h +index f8bda365a1..50d5b8c736 100644 +--- a/src/ui/tools/spray-tool.h ++++ b/src/ui/tools/spray-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_SPRAY_CONTEXT_H__ +-#define __SP_SPRAY_CONTEXT_H__ ++#define SP_SPRAY_CONTEXT_H_ + + /* + * Spray Tool +@@ -26,8 +26,8 @@ + #include "object/object-set.h" + #include "display/control/canvas-item-ptr.h" + +-#define SP_SPRAY_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_SPRAY_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_SPRAY_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_SPRAY_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + class CanvasItemBpath; +diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp +index 48bd45a085..858e1d749f 100644 +--- a/src/ui/tools/star-tool.cpp ++++ b/src/ui/tools/star-tool.cpp +@@ -235,7 +235,7 @@ bool StarTool::root_handler(GdkEvent* event) { + + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("altx-star"); + ret = TRUE; + } +@@ -270,7 +270,7 @@ bool StarTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/star-tool.h b/src/ui/tools/star-tool.h +index 4a06a428f9..e052a65033 100644 +--- a/src/ui/tools/star-tool.h ++++ b/src/ui/tools/star-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_STAR_CONTEXT_H__ +-#define __SP_STAR_CONTEXT_H__ ++#define SP_STAR_CONTEXT_H_ + + /* + * Star drawing context +diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp +index 9aaffa7d0c..b3fe86abc1 100644 +--- a/src/ui/tools/text-tool.cpp ++++ b/src/ui/tools/text-tool.cpp +@@ -651,14 +651,14 @@ bool TextTool::root_handler(GdkEvent* event) { + + // Input methods often use Ctrl+Shift+U for preediting (unimode). + // Override it so we can use our unimode. +- bool preedit_activation = (MOD__CTRL(event) && MOD__SHIFT(event) && !MOD__ALT(event)) ++ bool preedit_activation = (MOD_CTRL(event) && MOD_SHIFT(event) && !MOD_ALT(event)) + && (group0_keyval == GDK_KEY_U || group0_keyval == GDK_KEY_u); + + if (this->unimode || !this->imc || preedit_activation + || !gtk_im_context_filter_keypress(this->imc, (GdkEventKey*) event)) { + // IM did not consume the key, or we're in unimode + +- if (!MOD__CTRL_ONLY(event) && this->unimode) { ++ if (!MOD_CTRL_ONLY(event) && this->unimode) { + /* TODO: ISO 14755 (section 3 Definitions) says that we should also + accept the first 6 characters of alphabets other than the latin + alphabet "if the Latin alphabet is not used". The below is also +@@ -755,13 +755,13 @@ bool TextTool::root_handler(GdkEvent* event) { + switch (group0_keyval) { + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("TextFontFamilyAction_entry"); + return TRUE; + } + break; + case GDK_KEY_space: +- if (MOD__CTRL_ONLY(event)) { ++ if (MOD_CTRL_ONLY(event)) { + /* No-break space */ + if (!this->text) { // printable key; create text if none (i.e. if nascent_object) + sp_text_context_setup_text(this); +@@ -777,7 +777,7 @@ bool TextTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_U: + case GDK_KEY_u: +- if (MOD__CTRL_ONLY(event) || (MOD__CTRL(event) && MOD__SHIFT(event))) { ++ if (MOD_CTRL_ONLY(event) || (MOD_CTRL(event) && MOD_SHIFT(event))) { + if (this->unimode) { + this->unimode = false; + this->defaultMessageContext()->clear(); +@@ -794,7 +794,7 @@ bool TextTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_B: + case GDK_KEY_b: +- if (MOD__CTRL_ONLY(event) && this->text) { ++ if (MOD_CTRL_ONLY(event) && this->text) { + SPStyle const *style = sp_te_style_at_position(this->text, std::min(this->text_sel_start, this->text_sel_end)); + SPCSSAttr *css = sp_repr_css_attr_new(); + if (style->font_weight.computed == SP_CSS_FONT_WEIGHT_NORMAL +@@ -815,7 +815,7 @@ bool TextTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_I: + case GDK_KEY_i: +- if (MOD__CTRL_ONLY(event) && this->text) { ++ if (MOD_CTRL_ONLY(event) && this->text) { + SPStyle const *style = sp_te_style_at_position(this->text, std::min(this->text_sel_start, this->text_sel_end)); + SPCSSAttr *css = sp_repr_css_attr_new(); + if (style->font_style.computed != SP_CSS_FONT_STYLE_NORMAL) +@@ -833,7 +833,7 @@ bool TextTool::root_handler(GdkEvent* event) { + + case GDK_KEY_A: + case GDK_KEY_a: +- if (MOD__CTRL_ONLY(event) && this->text) { ++ if (MOD_CTRL_ONLY(event) && this->text) { + Inkscape::Text::Layout const *layout = te_get_layout(this->text); + if (layout) { + this->text_sel_start = layout->begin(); +@@ -876,12 +876,12 @@ bool TextTool::root_handler(GdkEvent* event) { + + bool noSelection = false; + +- if (MOD__CTRL(event)) { ++ if (MOD_CTRL(event)) { + this->text_sel_start = this->text_sel_end; + } + + if (this->text_sel_start == this->text_sel_end) { +- if (MOD__CTRL(event)) { ++ if (MOD_CTRL(event)) { + this->text_sel_start.prevStartOfWord(); + } else { + this->text_sel_start.prevCursorPosition(); +@@ -917,12 +917,12 @@ bool TextTool::root_handler(GdkEvent* event) { + if (this->text) { + bool noSelection = false; + +- if (MOD__CTRL(event)) { ++ if (MOD_CTRL(event)) { + this->text_sel_start = this->text_sel_end; + } + + if (this->text_sel_start == this->text_sel_end) { +- if (MOD__CTRL(event)) { ++ if (MOD_CTRL(event)) { + this->text_sel_end.nextEndOfWord(); + } else { + this->text_sel_end.nextCursorPosition(); +@@ -954,10 +954,10 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Left: + case GDK_KEY_KP_4: + if (this->text) { +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events( + get_latin_keyval(&event->key), 0); // with any mask +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(mul*-10, 0)); + else + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(mul*-1, 0)); +@@ -965,7 +965,7 @@ bool TextTool::root_handler(GdkEvent* event) { + sp_text_context_update_text_selection(this); + DocumentUndo::maybeDone(_desktop->getDocument(), "kern:left", _("Kern to the left"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.cursorLeftWithControl(); + else + this->text_sel_end.cursorLeft(); +@@ -978,10 +978,10 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Right: + case GDK_KEY_KP_6: + if (this->text) { +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events( + get_latin_keyval(&event->key), 0); // with any mask +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(mul*10, 0)); + else + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(mul*1, 0)); +@@ -989,7 +989,7 @@ bool TextTool::root_handler(GdkEvent* event) { + sp_text_context_update_text_selection(this); + DocumentUndo::maybeDone(_desktop->getDocument(), "kern:right", _("Kern to the right"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.cursorRightWithControl(); + else + this->text_sel_end.cursorRight(); +@@ -1002,10 +1002,10 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_8: + if (this->text) { +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events( + get_latin_keyval(&event->key), 0); // with any mask +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(0, mul*-10)); + else + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(0, mul*-1)); +@@ -1013,7 +1013,7 @@ bool TextTool::root_handler(GdkEvent* event) { + sp_text_context_update_text_selection(this); + DocumentUndo::maybeDone(_desktop->getDocument(), "kern:up", _("Kern up"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.cursorUpWithControl(); + else + this->text_sel_end.cursorUp(); +@@ -1026,10 +1026,10 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Down: + case GDK_KEY_KP_2: + if (this->text) { +- if (MOD__ALT(event)) { ++ if (MOD_ALT(event)) { + gint mul = 1 + gobble_key_events( + get_latin_keyval(&event->key), 0); // with any mask +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(0, mul*10)); + else + sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, Geom::Point(0, mul*1)); +@@ -1037,7 +1037,7 @@ bool TextTool::root_handler(GdkEvent* event) { + sp_text_context_update_text_selection(this); + DocumentUndo::maybeDone(_desktop->getDocument(), "kern:down", _("Kern down"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.cursorDownWithControl(); + else + this->text_sel_end.cursorDown(); +@@ -1049,7 +1049,7 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_Home: + case GDK_KEY_KP_Home: + if (this->text) { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.thisStartOfShape(); + else + this->text_sel_end.thisStartOfLine(); +@@ -1060,7 +1060,7 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_End: + case GDK_KEY_KP_End: + if (this->text) { +- if (MOD__CTRL(event)) ++ if (MOD_CTRL(event)) + this->text_sel_end.nextStartOfShape(); + else + this->text_sel_end.thisEndOfLine(); +@@ -1096,9 +1096,9 @@ bool TextTool::root_handler(GdkEvent* event) { + return TRUE; + case GDK_KEY_bracketleft: + if (this->text) { +- if (MOD__ALT(event) || MOD__CTRL(event)) { +- if (MOD__ALT(event)) { +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event) || MOD_CTRL(event)) { ++ if (MOD_ALT(event)) { ++ if (MOD_SHIFT(event)) { + // FIXME: alt+shift+[] does not work, don't know why + sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, -10); + } else { +@@ -1116,9 +1116,9 @@ bool TextTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_bracketright: + if (this->text) { +- if (MOD__ALT(event) || MOD__CTRL(event)) { +- if (MOD__ALT(event)) { +- if (MOD__SHIFT(event)) { ++ if (MOD_ALT(event) || MOD_CTRL(event)) { ++ if (MOD_ALT(event)) { ++ if (MOD_SHIFT(event)) { + // FIXME: alt+shift+[] does not work, don't know why + sp_te_adjust_rotation_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, 10); + } else { +@@ -1137,15 +1137,15 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_less: + case GDK_KEY_comma: + if (this->text) { +- if (MOD__ALT(event)) { +- if (MOD__CTRL(event)) { +- if (MOD__SHIFT(event)) ++ if (MOD_ALT(event)) { ++ if (MOD_CTRL(event)) { ++ if (MOD_SHIFT(event)) + sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, -10); + else + sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, -1); + DocumentUndo::maybeDone(_desktop->getDocument(), "linespacing:dec", _("Contract line spacing"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, -10); + else + sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, -1); +@@ -1160,15 +1160,15 @@ bool TextTool::root_handler(GdkEvent* event) { + case GDK_KEY_greater: + case GDK_KEY_period: + if (this->text) { +- if (MOD__ALT(event)) { +- if (MOD__CTRL(event)) { +- if (MOD__SHIFT(event)) ++ if (MOD_ALT(event)) { ++ if (MOD_CTRL(event)) { ++ if (MOD_SHIFT(event)) + sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, 10); + else + sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, 1); + DocumentUndo::maybeDone(_desktop->getDocument(), "linespacing:inc", _("Expand line spacing"), INKSCAPE_ICON("draw-text")); + } else { +- if (MOD__SHIFT(event)) ++ if (MOD_SHIFT(event)) + sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, 10); + else + sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, _desktop, 1); +@@ -1185,7 +1185,7 @@ bool TextTool::root_handler(GdkEvent* event) { + } + + if (cursor_moved) { +- if (!MOD__SHIFT(event)) ++ if (!MOD_SHIFT(event)) + this->text_sel_start = this->text_sel_end; + if (old_start != this->text_sel_start || old_end != this->text_sel_end) { + sp_text_context_update_cursor(this); +@@ -1201,7 +1201,7 @@ bool TextTool::root_handler(GdkEvent* event) { + group0_keyval == GDK_KEY_Down || + group0_keyval == GDK_KEY_KP_Up || + group0_keyval == GDK_KEY_KP_Down ) +- && !MOD__CTRL_ONLY(event)) { ++ && !MOD_CTRL_ONLY(event)) { + return TRUE; + } else if (group0_keyval == GDK_KEY_Escape) { // cancel rubberband + if (this->creating) { +@@ -1209,7 +1209,7 @@ bool TextTool::root_handler(GdkEvent* event) { + ungrabCanvasEvents(); + Inkscape::Rubberband::get(_desktop)->stop(); + } +- } else if ((group0_keyval == GDK_KEY_x || group0_keyval == GDK_KEY_X) && MOD__ALT_ONLY(event)) { ++ } else if ((group0_keyval == GDK_KEY_x || group0_keyval == GDK_KEY_X) && MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("TextFontFamilyAction_entry"); + return TRUE; + } +diff --git a/src/ui/tools/text-tool.h b/src/ui/tools/text-tool.h +index c87431e68b..55dcaedd45 100644 +--- a/src/ui/tools/text-tool.h ++++ b/src/ui/tools/text-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_TEXT_CONTEXT_H__ +-#define __SP_TEXT_CONTEXT_H__ ++#define SP_TEXT_CONTEXT_H_ + + /* + * TextTool +@@ -22,8 +22,8 @@ + #include "libnrtype/Layout-TNG.h" + #include "display/control/canvas-item-ptr.h" + +-#define SP_TEXT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_TEXT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_TEXT_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_TEXT_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + typedef struct _GtkIMContext GtkIMContext; + +diff --git a/src/ui/tools/tweak-tool.cpp b/src/ui/tools/tweak-tool.cpp +index 808a4b4719..5aec8affe6 100644 +--- a/src/ui/tools/tweak-tool.cpp ++++ b/src/ui/tools/tweak-tool.cpp +@@ -1193,7 +1193,7 @@ bool TweakTool::root_handler(GdkEvent* event) { + if (!this->has_dilated) { + // if we did not rub, do a light tap + this->pressure = 0.03; +- sp_tweak_dilate(this, motion_w, _desktop->dt2doc(motion_dt), Geom::Point(0, 0), MOD__SHIFT(event)); ++ sp_tweak_dilate(this, motion_w, _desktop->dt2doc(motion_dt), Geom::Point(0, 0), MOD_SHIFT(event)); + } + this->is_dilating = false; + this->has_dilated = false; +@@ -1249,24 +1249,24 @@ bool TweakTool::root_handler(GdkEvent* event) { + case GDK_KEY_m: + case GDK_KEY_M: + case GDK_KEY_0: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_MOVE, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_MOVE, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_i: + case GDK_KEY_I: + case GDK_KEY_1: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_MOVE_IN_OUT, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_MOVE_IN_OUT, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_z: + case GDK_KEY_Z: + case GDK_KEY_2: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_MOVE_JITTER, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_MOVE_JITTER, MOD_SHIFT(event)); + ret = TRUE; + } + break; +@@ -1275,84 +1275,84 @@ bool TweakTool::root_handler(GdkEvent* event) { + case GDK_KEY_greater: + case GDK_KEY_period: + case GDK_KEY_3: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_SCALE, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_SCALE, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_bracketright: + case GDK_KEY_bracketleft: + case GDK_KEY_4: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_ROTATE, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_ROTATE, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_d: + case GDK_KEY_D: + case GDK_KEY_5: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_MORELESS, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_MORELESS, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_p: + case GDK_KEY_P: + case GDK_KEY_6: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_PUSH, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_PUSH, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_s: + case GDK_KEY_S: + case GDK_KEY_7: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_SHRINK_GROW, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_SHRINK_GROW, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_a: + case GDK_KEY_A: + case GDK_KEY_8: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_ATTRACT_REPEL, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_ATTRACT_REPEL, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_r: + case GDK_KEY_R: + case GDK_KEY_9: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_ROUGHEN, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_ROUGHEN, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_c: + case GDK_KEY_C: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_COLORPAINT, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_COLORPAINT, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_j: + case GDK_KEY_J: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_COLORJITTER, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_COLORJITTER, MOD_SHIFT(event)); + ret = TRUE; + } + break; + case GDK_KEY_b: + case GDK_KEY_B: +- if (MOD__SHIFT_ONLY(event)) { +- sp_tweak_switch_mode(this, TWEAK_MODE_BLUR, MOD__SHIFT(event)); ++ if (MOD_SHIFT_ONLY(event)) { ++ sp_tweak_switch_mode(this, TWEAK_MODE_BLUR, MOD_SHIFT(event)); + ret = TRUE; + } + break; + + case GDK_KEY_Up: + case GDK_KEY_KP_Up: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->force += 0.05; + if (this->force > 1.0) { + this->force = 1.0; +@@ -1363,7 +1363,7 @@ bool TweakTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Down: + case GDK_KEY_KP_Down: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->force -= 0.05; + if (this->force < 0.0) { + this->force = 0.0; +@@ -1374,7 +1374,7 @@ bool TweakTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Right: + case GDK_KEY_KP_Right: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width += 0.01; + if (this->width > 1.0) { + this->width = 1.0; +@@ -1386,7 +1386,7 @@ bool TweakTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Left: + case GDK_KEY_KP_Left: +- if (!MOD__CTRL_ONLY(event)) { ++ if (!MOD_CTRL_ONLY(event)) { + this->width -= 0.01; + if (this->width < 0.01) { + this->width = 0.01; +@@ -1412,7 +1412,7 @@ bool TweakTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_x: + case GDK_KEY_X: +- if (MOD__ALT_ONLY(event)) { ++ if (MOD_ALT_ONLY(event)) { + _desktop->setToolboxFocusTo("tweak-width"); + ret = TRUE; + } +@@ -1425,12 +1425,12 @@ bool TweakTool::root_handler(GdkEvent* event) { + + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: +- sp_tweak_switch_mode_temporarily(this, TWEAK_MODE_SHRINK_GROW, MOD__SHIFT(event)); ++ sp_tweak_switch_mode_temporarily(this, TWEAK_MODE_SHRINK_GROW, MOD_SHIFT(event)); + break; + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +@@ -1447,11 +1447,11 @@ bool TweakTool::root_handler(GdkEvent* event) { + break; + case GDK_KEY_Control_L: + case GDK_KEY_Control_R: +- sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD__SHIFT(event)); ++ sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD_SHIFT(event)); + this->message_context->clear(); + break; + default: +- sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD__SHIFT(event)); ++ sp_tweak_switch_mode (this, prefs->getInt("/tools/tweak/mode"), MOD_SHIFT(event)); + break; + } + } +diff --git a/src/ui/tools/tweak-tool.h b/src/ui/tools/tweak-tool.h +index 77bfb1ffea..3990ab832d 100644 +--- a/src/ui/tools/tweak-tool.h ++++ b/src/ui/tools/tweak-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_TWEAK_CONTEXT_H__ +-#define __SP_TWEAK_CONTEXT_H__ ++#define SP_TWEAK_CONTEXT_H_ + + /* + * tweaking paths without node editing +diff --git a/src/ui/tools/zoom-tool.cpp b/src/ui/tools/zoom-tool.cpp +index dec3a52147..2f2055412b 100644 +--- a/src/ui/tools/zoom-tool.cpp ++++ b/src/ui/tools/zoom-tool.cpp +@@ -158,7 +158,7 @@ bool ZoomTool::root_handler(GdkEvent* event) { + case GDK_KEY_KP_Up: + case GDK_KEY_KP_Down: + // prevent the zoom field from activation +- if (!MOD__CTRL_ONLY(event)) ++ if (!MOD_CTRL_ONLY(event)) + ret = true; + break; + +@@ -170,7 +170,7 @@ bool ZoomTool::root_handler(GdkEvent* event) { + case GDK_KEY_Delete: + case GDK_KEY_KP_Delete: + case GDK_KEY_BackSpace: +- ret = this->deleteSelectedDrag(MOD__CTRL_ONLY(event)); ++ ret = this->deleteSelectedDrag(MOD_CTRL_ONLY(event)); + break; + + default: +diff --git a/src/ui/tools/zoom-tool.h b/src/ui/tools/zoom-tool.h +index d7b97add59..c3e8277c22 100644 +--- a/src/ui/tools/zoom-tool.h ++++ b/src/ui/tools/zoom-tool.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SP_ZOOM_CONTEXT_H__ +-#define __SP_ZOOM_CONTEXT_H__ ++#define SP_ZOOM_CONTEXT_H_ + + /* + * Handy zooming tool +@@ -16,8 +16,8 @@ + + #include "ui/tools/tool-base.h" + +-#define SP_ZOOM_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)obj)) +-#define SP_IS_ZOOM_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)obj) != NULL) ++#define SP_ZOOM_CONTEXT(obj) (dynamic_cast((Inkscape::UI::Tools::ToolBase*)(obj))) ++#define SP_IS_ZOOM_CONTEXT(obj) (dynamic_cast((const Inkscape::UI::Tools::ToolBase*)(obj)) != NULL) + + namespace Inkscape { + namespace UI { +diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp +index 0bc3f706b7..7f50dc46a9 100644 +--- a/src/ui/widget/canvas.cpp ++++ b/src/ui/widget/canvas.cpp +@@ -9,45 +9,43 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +-#include // Logging ++#include "canvas.h" ++ ++#include <2geom/convex-hull.h> + #include // Sort +-#include // Coarsener +-#include +-#include + #include +-#include +-#include + #include +-#include <2geom/convex-hull.h> ++#include ++#include ++#include ++#include // Logging ++#include ++#include // Coarsener ++#include + +-#include "canvas.h" + #include "canvas-grid.h" +- +-#include "color.h" // Background color +-#include "cms-system.h" // Color correction +-#include "desktop.h" +-#include "document.h" +-#include "preferences.h" +-#include "ui/util.h" +-#include "helper/geom.h" +- +-#include "canvas/prefs.h" + #include "canvas/fragment.h" +-#include "canvas/util.h" +-#include "canvas/stores.h" ++#include "canvas/framecheck.h" // For frame profiling + #include "canvas/graphics.h" ++#include "canvas/prefs.h" ++#include "canvas/stores.h" + #include "canvas/synchronizer.h" +-#include "display/drawing.h" ++#include "canvas/updaters.h" // Update strategies ++#include "canvas/util.h" ++#include "cms-system.h" // Color correction ++#include "color.h" // Background color ++#include "desktop.h" + #include "display/control/canvas-item-drawing.h" + #include "display/control/canvas-item-group.h" + #include "display/control/snap-indicator.h" +- ++#include "display/drawing.h" ++#include "document.h" ++#include "helper/geom.h" ++#include "preferences.h" + #include "ui/tools/tool-base.h" // Default cursor +- +-#include "canvas/updaters.h" // Update strategies +-#include "canvas/framecheck.h" // For frame profiling ++#include "ui/util.h" + #define framecheck_whole_function(D) \ +- auto framecheckobj = D->prefs.debug_framecheck ? FrameCheck::Event(__func__) : FrameCheck::Event(); ++ auto framecheckobj = (D)->prefs.debug_framecheck ? FrameCheck::Event(__func__) : FrameCheck::Event(); + + /* + * The canvas is responsible for rendering the SVG drawing with various "control" +@@ -736,7 +734,7 @@ void CanvasPrivate::commit_tiles() + auto px = tile.surface->get_data(); + int stride = tile.surface->get_stride(); + for (int i = 0; i < tile.surface->get_height(); i++) { +- auto row = px + i * stride; ++ auto row = px + static_cast(i * )stride; + Inkscape::CMSSystem::doTransform(transf, row, row, tile.surface->get_width()); + } + tile.surface->mark_dirty(); +@@ -2252,7 +2250,7 @@ void CanvasPrivate::render_tile(int debug_id) + if (rd.interruptible) { + auto now = g_get_monotonic_time(); + auto elapsed = now - rd.start_time; +- if (elapsed > rd.render_time_limit * 1000) { ++ if (elapsed > static_cast(rd.render_time_limit * )1000) { + // Timed out. Temporarily return to GTK main loop, and come back here when next idle. + rd.timeoutflag = true; + break; +diff --git a/src/ui/widget/canvas/glgraphics.cpp b/src/ui/widget/canvas/glgraphics.cpp +index b00503c00f..7eceed3d34 100644 +--- a/src/ui/widget/canvas/glgraphics.cpp ++++ b/src/ui/widget/canvas/glgraphics.cpp +@@ -1,12 +1,15 @@ + // SPDX-License-Identifier: GPL-2.0-or-later +-#include <2geom/transforms.h> ++#include "glgraphics.h" ++ + #include <2geom/rect.h> +-#include "ui/util.h" ++#include <2geom/transforms.h> ++#include ++ + #include "helper/geom.h" +-#include "glgraphics.h" +-#include "stores.h" +-#include "prefs.h" + #include "pixelstreamer.h" ++#include "prefs.h" ++#include "stores.h" ++#include "ui/util.h" + #include "util.h" + + namespace Inkscape { +@@ -62,7 +65,7 @@ static auto region_shrink_vao(Cairo::RefPtr const ®, Geom::Int + // Preallocate the vertex buffer. + int nrects = reg2->get_num_rectangles(); + std::vector verts; +- verts.reserve(nrects * 12); ++ verts.reserve(static_cast(nrects * )12); + + // Add a vertex to the buffer, transformed to a coordinate system in which the enclosing rectangle 'rel' goes from 0 to 1. + // Also shift them up/left by 0.5px; combined with the width/height increase from earlier, this shrinks the region by 0.5px. +diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp +index 184427f2bf..7297bc3df0 100644 +--- a/src/ui/widget/color-icc-selector.cpp ++++ b/src/ui/widget/color-icc-selector.cpp +@@ -11,20 +11,18 @@ + # include "config.h" // only include where actually required! + #endif + +-#include +-#include +- ++#include ++#include + #include + #include + #include +-#include ++#include ++#include + + #include "colorspace.h" + #include "inkscape.h" + #include "profile-manager.h" +- + #include "svg/svg-icc-color.h" +- + #include "ui/dialog-events.h" + #include "ui/util.h" + #include "ui/widget/color-icc-selector.h" +@@ -433,7 +431,7 @@ void ColorICCSelector::init(bool no_alpha) + attachToGridOrTable(t, _impl->_compUI[i]._btn, 2, row, 1, 1, false, true); + + _impl->_compUI[i]._map = g_new(guchar, 4 * 1024); +- memset(_impl->_compUI[i]._map, 0x0ff, 1024 * 4); ++ memset(_impl->_compUI[i]._map, 0x0ff, static_cast(1024 * )4); + + + // Signals +diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp +index 579406546b..5ee44946e6 100644 +--- a/src/ui/widget/color-picker.cpp ++++ b/src/ui/widget/color-picker.cpp +@@ -22,7 +22,7 @@ + #include "ui/widget/color-notebook.h" + + +-static bool _in_use = false; ++static bool in_use = false; + + namespace Inkscape { + namespace UI { +@@ -73,7 +73,7 @@ void ColorPicker::setSensitive(bool sensitive) { set_sensitive(sensitive); } + + void ColorPicker::setRgba32 (guint32 rgba) + { +- if (_in_use) return; ++ if (in_use) return; + + set_preview(rgba); + _rgba = rgba; +@@ -124,10 +124,10 @@ void ColorPicker::_onSelectedColorChanged() { + return; + } + +- if (_in_use) { ++ if (in_use) { + return; + } else { +- _in_use = true; ++ in_use = true; + } + + guint32 rgba = _selected_color.value(); +@@ -138,7 +138,7 @@ void ColorPicker::_onSelectedColorChanged() { + } + + on_changed(rgba); +- _in_use = false; ++ in_use = false; + _rgba = rgba; + _changed_signal.emit(rgba); + } +diff --git a/src/ui/widget/color-picker.h b/src/ui/widget/color-picker.h +index 61b3834de5..eda3bc0ba6 100644 +--- a/src/ui/widget/color-picker.h ++++ b/src/ui/widget/color-picker.h +@@ -12,7 +12,7 @@ + */ + + #ifndef __COLOR_PICKER_H__ +-#define __COLOR_PICKER_H__ ++#define COLOR_PICKER_H_ + + #include "labelled.h" + +diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp +index 5a2fe4205c..a9da045f31 100644 +--- a/src/ui/widget/color-scales.cpp ++++ b/src/ui/widget/color-scales.cpp +@@ -11,28 +11,29 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "ui/widget/color-scales.h" ++ ++#include ++#include ++#include + #include + #include +-#include + #include +-#include +-#include ++#include + #include + #include + #include + ++#include "oklab.h" ++#include "preferences.h" + #include "ui/dialog-events.h" ++#include "ui/icon-loader.h" + #include "ui/selected-color.h" +-#include "ui/widget/color-scales.h" +-#include "ui/widget/color-slider.h" + #include "ui/widget/color-icc-selector.h" +-#include "ui/widget/scrollprotected.h" +-#include "ui/icon-loader.h" +-#include "oklab.h" +-#include "preferences.h" +- ++#include "ui/widget/color-slider.h" + #include "ui/widget/ink-color-wheel.h" + #include "ui/widget/oklab-color-wheel.h" ++#include "ui/widget/scrollprotected.h" + + static int const CSC_CHANNEL_R = (1 << 0); + static int const CSC_CHANNEL_G = (1 << 1); +@@ -1078,8 +1079,8 @@ void ColorScales::_updateSliders(guint channels) + + static guchar const *sp_color_scales_hue_map() + { +- static std::array const map = []() { +- std::array m; ++ static std::array(4 * )1024> const map = []() { ++ std::array(4 * )1024> m; + + guchar *p; + p = m.data(); +@@ -1144,13 +1145,13 @@ static guchar const *sp_color_scales_hsluv_map(guchar *map, + // Generate color steps + gfloat colors[COLORS]; + for (int i = 0; i < STEPS+1; i++) { +- callback(colors+(i*3), steps[i]); ++ callback(colors+(static_cast(i*)3), steps[i]); + } + + for (int i = 0; i < STEPS; i++) { + int a = steps[i] * 1023, + b = steps[i+1] * 1023; +- sp_color_interp(map+(a * 4), b-a, colors+(i*3), colors+((i+1)*3)); ++ sp_color_interp(map+(static_cast(a * )4), b-a, colors+(static_cast(i*)3), colors+(static_cast((i+1)*)3)); + } + + return map; +@@ -1158,7 +1159,7 @@ static guchar const *sp_color_scales_hsluv_map(guchar *map, + + template + guchar const *ColorScales::hsluvHueMap(gfloat s, gfloat l, +- std::array *map) ++ std::array(4 * )1024> *map) + { + return sp_color_scales_hsluv_map(map->data(), [s, l] (float *colors, float h) { + SPColor::hsluv_to_rgb_floatv(colors, h, s, l); +@@ -1167,7 +1168,7 @@ guchar const *ColorScales::hsluvHueMap(gfloat s, gfloat l, + + template + guchar const *ColorScales::hsluvSaturationMap(gfloat h, gfloat l, +- std::array *map) ++ std::array(4 * )1024> *map) + { + return sp_color_scales_hsluv_map(map->data(), [h, l] (float *colors, float s) { + SPColor::hsluv_to_rgb_floatv(colors, h, s, l); +@@ -1176,7 +1177,7 @@ guchar const *ColorScales::hsluvSaturationMap(gfloat h, gfloat l, + + template + guchar const *ColorScales::hsluvLightnessMap(gfloat h, gfloat s, +- std::array *map) ++ std::array(4 * )1024> *map) + { + return sp_color_scales_hsluv_map(map->data(), [h, s] (float *colors, float l) { + SPColor::hsluv_to_rgb_floatv(colors, h, s, l); +diff --git a/src/ui/widget/color-scales.h b/src/ui/widget/color-scales.h +index 0ded543ab2..52686b8172 100644 +--- a/src/ui/widget/color-scales.h ++++ b/src/ui/widget/color-scales.h +@@ -12,8 +12,9 @@ + #ifndef SEEN_SP_COLOR_SCALES_H + #define SEEN_SP_COLOR_SCALES_H + +-#include + #include ++#include ++#include + #include + + #include "ui/selected-color.h" +@@ -53,11 +54,11 @@ public: + SPColorScalesMode getMode() const; + + static guchar const *hsluvHueMap(gfloat s, gfloat l, +- std::array *map); ++ std::array(4 * )1024> *map); + static guchar const *hsluvSaturationMap(gfloat h, gfloat l, +- std::array *map); ++ std::array(4 * )1024> *map); + static guchar const *hsluvLightnessMap(gfloat h, gfloat s, +- std::array *map); ++ std::array(4 * )1024> *map); + + protected: + void _onColorChanged(); +@@ -88,7 +89,7 @@ protected: + Inkscape::UI::Widget::ColorSlider *_s[5]; /* Channel sliders */ + Gtk::Widget *_b[5]; /* Spinbuttons */ + Gtk::Label *_l[5]; /* Labels */ +- std::array _sliders_maps[4]; ++ std::array(4 * )1024> _sliders_maps[4]; + Inkscape::UI::Widget::ColorWheel *_wheel; + + const Glib::ustring _prefs = "/color_scales"; +diff --git a/src/ui/widget/color-slider.cpp b/src/ui/widget/color-slider.cpp +index 2b71e6c1fc..176264761b 100644 +--- a/src/ui/widget/color-slider.cpp ++++ b/src/ui/widget/color-slider.cpp +@@ -11,14 +11,16 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + ++#include "ui/widget/color-slider.h" ++ ++#include + #include + #include + #include + #include + +-#include "ui/widget/color-scales.h" +-#include "ui/widget/color-slider.h" + #include "preferences.h" ++#include "ui/widget/color-scales.h" + + static const gint SLIDER_WIDTH = 96; + static const gint SLIDER_HEIGHT = 8; +@@ -476,7 +478,7 @@ static const guchar *sp_color_slider_render_gradient(gint x0, gint y0, gint widt + d[1] = bg + ((fc + (fc >> 8) + 0x80) >> 8); + fc = (cb - bg) * ca; + d[2] = bg + ((fc + (fc >> 8) + 0x80) >> 8); +- d += 3 * width; ++ d += static_cast(3 * )width; + } + r += dc[0]; + g += dc[1]; +@@ -511,7 +513,7 @@ static const guchar *sp_color_slider_render_map(gint x0, gint y0, gint width, gi + for (x = x0; x < x0 + width; x++) { + gint cr, cg, cb, ca; + guchar *d = dp; +- guchar *sp = map + 4 * (start >> 16); ++ guchar *sp = map + static_cast(4 * (start >> 16)); + cr = *sp++; + cg = *sp++; + cb = *sp++; +@@ -526,7 +528,7 @@ static const guchar *sp_color_slider_render_map(gint x0, gint y0, gint width, gi + d[1] = bg + ((fc + (fc >> 8) + 0x80) >> 8); + fc = (cb - bg) * ca; + d[2] = bg + ((fc + (fc >> 8) + 0x80) >> 8); +- d += 3 * width; ++ d += static_cast(3 * )width; + } + dp += 3; + start += step; +diff --git a/src/ui/widget/dash-selector.cpp b/src/ui/widget/dash-selector.cpp +index c3f40ab599..571e0e0b63 100644 +--- a/src/ui/widget/dash-selector.cpp ++++ b/src/ui/widget/dash-selector.cpp +@@ -121,13 +121,13 @@ void DashSelector::init_dashes() { + if (!style.stroke_dasharray.values.empty()) { + s_dashes.emplace_back(map_values(style.stroke_dasharray.values)); + } else { +- s_dashes.emplace_back(std::vector()); ++ s_dashes.emplace_back(); + } + } + } else { + g_warning("Missing stock dash definitions. DashSelector::init_dashes."); + // This code may never execute - a new preferences.xml is created for a new user. Maybe if the user deletes dashes from preferences.xml? +- s_dashes.emplace_back(std::vector()); ++ s_dashes.emplace_back(); + } + + std::vector custom {1, 2, 1, 4}; // 'custom' dashes second on the list, so they are at the top of the second column in a combo box +diff --git a/src/ui/widget/entity-entry.h b/src/ui/widget/entity-entry.h +index 7fd243bb1f..e4090bdf2e 100644 +--- a/src/ui/widget/entity-entry.h ++++ b/src/ui/widget/entity-entry.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_UI_WIDGET_ENTITY_ENTRY__H +-#define INKSCAPE_UI_WIDGET_ENTITY_ENTRY__H ++#define INKSCAPE_UI_WIDGET_ENTITY_ENTRY_H + + #include + #include +diff --git a/src/ui/widget/entry.h b/src/ui/widget/entry.h +index 3674d51d45..f6b9ef22a0 100644 +--- a/src/ui/widget/entry.h ++++ b/src/ui/widget/entry.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_UI_WIDGET_ENTRY__H +-#define INKSCAPE_UI_WIDGET_ENTRY__H ++#define INKSCAPE_UI_WIDGET_ENTRY_H + + #include "labelled.h" + +diff --git a/src/ui/widget/filter-effect-chooser.h b/src/ui/widget/filter-effect-chooser.h +index 5001e5b4a2..d2ed3b95fd 100644 +--- a/src/ui/widget/filter-effect-chooser.h ++++ b/src/ui/widget/filter-effect-chooser.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __FILTER_EFFECT_CHOOSER_H__ +-#define __FILTER_EFFECT_CHOOSER_H__ ++#define FILTER_EFFECT_CHOOSER_H_ + + /* + * Filter effect selection selection widget +diff --git a/src/ui/widget/font-collection-selector.cpp b/src/ui/widget/font-collection-selector.cpp +index 631a00cc9b..8dd040cd48 100644 +--- a/src/ui/widget/font-collection-selector.cpp ++++ b/src/ui/widget/font-collection-selector.cpp +@@ -59,8 +59,8 @@ void FontCollectionSelector::setup_tree_view(Gtk::TreeView *tv) + treeview->set_headers_visible (false); + + // Target entries for Drag and Drop. +- target_entries.emplace_back(Gtk::TargetEntry("STRING", (Gtk::TargetFlags)0, 0)); +- target_entries.emplace_back(Gtk::TargetEntry("text/plain", (Gtk::TargetFlags)0, 0)); ++ target_entries.emplace_back("STRING", (Gtk::TargetFlags)0, 0); ++ target_entries.emplace_back("text/plain", (Gtk::TargetFlags)0, 0); + + treeview->drag_dest_set(target_entries, Gtk::DEST_DEFAULT_ALL, Gdk::ACTION_COPY); + +diff --git a/src/ui/widget/font-selector.cpp b/src/ui/widget/font-selector.cpp +index ea7d53b2e3..73e304274e 100644 +--- a/src/ui/widget/font-selector.cpp ++++ b/src/ui/widget/font-selector.cpp +@@ -128,8 +128,8 @@ FontSelector::FontSelector (bool with_size, bool with_variations) + // For drag and drop. + // Target entries for Drag and Drop. + // target_entries.emplace_back(Gtk::TargetEntry("text/uri-list", (Gtk::TargetFlags)0, 0)); +- target_entries.emplace_back(Gtk::TargetEntry("STRING", (Gtk::TargetFlags)0, 0)); +- target_entries.emplace_back(Gtk::TargetEntry("text/plain", (Gtk::TargetFlags)0, 0)); ++ target_entries.emplace_back("STRING", (Gtk::TargetFlags)0, 0); ++ target_entries.emplace_back("text/plain", (Gtk::TargetFlags)0, 0); + + family_treeview.drag_source_set(target_entries, Gdk::BUTTON1_MASK, Gdk::ACTION_COPY | Gdk::ACTION_DEFAULT); + family_treeview.signal_drag_data_get().connect(sigc::mem_fun(*this, &FontSelector::on_drag_data_get)); +diff --git a/src/ui/widget/iconrenderer.h b/src/ui/widget/iconrenderer.h +index 01d6277634..1d16686c56 100644 +--- a/src/ui/widget/iconrenderer.h ++++ b/src/ui/widget/iconrenderer.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __UI_WIDGET_ICONRENDERER_H__ +-#define __UI_WIDGET_ICONRENDERER_H__ ++#define UI_WIDGET_ICONRENDERER_H_ + /* + * Authors: + * Theodore Janeczko +diff --git a/src/ui/widget/imagetoggler.h b/src/ui/widget/imagetoggler.h +index 579f6b9ff9..68058bdd62 100644 +--- a/src/ui/widget/imagetoggler.h ++++ b/src/ui/widget/imagetoggler.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __UI_DIALOG_IMAGETOGGLER_H__ +-#define __UI_DIALOG_IMAGETOGGLER_H__ ++#define UI_DIALOG_IMAGETOGGLER_H_ + /* + * Authors: + * Jon A. Cruz +diff --git a/src/ui/widget/ink-color-wheel.cpp b/src/ui/widget/ink-color-wheel.cpp +index 3c3577905a..651e3906b1 100644 +--- a/src/ui/widget/ink-color-wheel.cpp ++++ b/src/ui/widget/ink-color-wheel.cpp +@@ -13,16 +13,18 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +-#include +-#include ++#include "ui/widget/ink-color-wheel.h" ++ + #include <2geom/angle.h> + #include <2geom/coord.h> +-#include <2geom/point.h> + #include <2geom/line.h> ++#include <2geom/point.h> ++#include ++#include ++#include + +-#include "ui/dialog/color-item.h" + #include "hsluv.h" +-#include "ui/widget/ink-color-wheel.h" ++#include "ui/dialog/color-item.h" + + // Sizes in pixels + static int const SIZE = 400; +@@ -255,7 +257,7 @@ bool ColorWheelHSL::on_draw(::Cairo::RefPtr<::Cairo::Context> const &cr) + double r2_min = (r_min-2) * (r_min-2); // Must shrink a bit to avoid edge effects. + + for (int i = 0; i < height; ++i) { +- guint32* p = buffer_ring + i * width; ++ guint32* p = buffer_ring + static_cast(i * )width; + double dy = (cy - i); + for (int j = 0; j < width; ++j) { + double dx = (j - cx); +@@ -350,7 +352,7 @@ bool ColorWheelHSL::on_draw(::Cairo::RefPtr<::Cairo::Context> const &cr) + guint32* buffer_triangle = g_new(guint32, height * stride / 4); + + for (int y = 0; y < height; ++y) { +- guint32 *p = buffer_triangle + y * (stride / 4); ++ guint32 *p = buffer_triangle + static_cast(y * (stride / 4)); + + if (p0.y <= y+padding && y-padding < p2.y) { + +@@ -1042,7 +1044,7 @@ void ColorWheelHSLuv::_updatePolygon() + auto rgb = Hsluv::luv_to_rgb(_values[2], point[Geom::X], point[Geom::Y]); // safe with _values[2] == 0 + clr.set_color(rgb); + +- guint32 *p = buffer_line.data() + (x * _square_size); ++ guint32 *p = buffer_line.data() + (static_cast(x * )_square_size); + for (int i = 0; i < _square_size; i++) { + p[i] = clr.get_color(); + } +@@ -1051,7 +1053,7 @@ void ColorWheelHSLuv::_updatePolygon() + // Copy the line buffer to the surface buffer + int const scaled_y = y * _square_size; + for (int i = 0; i < _square_size; i++) { +- guint32 *t = _buffer_polygon.data() + (scaled_y + i) * (stride / 4); ++ guint32 *t = _buffer_polygon.data() + static_cast((scaled_y + i) * (stride / 4)); + std::memcpy(t, buffer_line.data(), stride); + } + } +@@ -1325,7 +1327,7 @@ void draw_vertical_padding(ColorPoint p0, ColorPoint p1, int padding, bool pad_u + std::swap(start_x, end_x); + } + +- guint32 *p = buffer + y * stride; ++ guint32 *p = buffer + static_cast(y * )stride; + p += static_cast(start_x); + for (int x = start_x; x <= end_x; ++x) { + // get the color at this point on the line +@@ -1334,9 +1336,9 @@ void draw_vertical_padding(ColorPoint p0, ColorPoint p1, int padding, bool pad_u + // paint the padding vertically above or below this point + for (int offset = 0; offset <= padding; ++offset) { + if (pad_upwards && (point.y - offset) >= 0) { +- *(p - (offset * stride)) = point.get_color(); ++ *(p - (static_cast(offset * )stride)) = point.get_color(); + } else if (!pad_upwards && (point.y + offset) < height) { +- *(p + (offset * stride)) = point.get_color(); ++ *(p + (static_cast(offset * )stride)) = point.get_color(); + } + } + ++p; +diff --git a/src/ui/widget/oklab-color-wheel.cpp b/src/ui/widget/oklab-color-wheel.cpp +index 4324b4e796..9cb7486deb 100644 +--- a/src/ui/widget/oklab-color-wheel.cpp ++++ b/src/ui/widget/oklab-color-wheel.cpp +@@ -14,6 +14,7 @@ + #include "ui/widget/oklab-color-wheel.h" + + #include ++#include + + #include "display/cairo-utils.h" + #include "oklab.h" +@@ -204,7 +205,7 @@ bool OKWheel::on_draw(Cairo::RefPtr const &cr) + void OKWheel::_redrawDisc() + { + int const size = std::ceil(2.0 * _disc_radius); +- _pixbuf.resize(4 * size * size); ++ _pixbuf.resize(static_cast(4 * size * )size); + + double const radius = 0.5 * size; + double const inverse_radius = 1.0 / radius; +diff --git a/src/ui/widget/paint-selector.cpp b/src/ui/widget/paint-selector.cpp +index 480bea03bc..7a3f1b64cd 100644 +--- a/src/ui/widget/paint-selector.cpp ++++ b/src/ui/widget/paint-selector.cpp +@@ -956,7 +956,7 @@ SPMeshGradient *PaintSelector::getMeshGradient() + } + + SPMeshGradient *mesh = nullptr; +- if (strcmp(meshid, "none")) { ++ if (strcmp(meshid, "none") != 0) { + + gchar *mesh_name; + if (stockid) { +diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h +index 9e3d8152c3..a02f90ee1e 100644 +--- a/src/ui/widget/registered-widget.h ++++ b/src/ui/widget/registered-widget.h +@@ -15,7 +15,7 @@ + */ + + #ifndef INKSCAPE_UI_WIDGET_REGISTERED_WIDGET__H_ +-#define INKSCAPE_UI_WIDGET_REGISTERED_WIDGET__H_ ++#define INKSCAPE_UI_WIDGET_REGISTERED_WIDGET_H_ + + #include <2geom/affine.h> + #include "xml/node.h" +@@ -121,7 +121,7 @@ protected: + local_repr->setAttribute(_key, svgstr); + } + } +- if (svgstr_old && svgstr && strcmp(svgstr_old,svgstr)) { ++ if (svgstr_old && svgstr && strcmp(svgstr_old,svgstr) != 0) { + local_doc->setModifiedSinceSave(); + } + +diff --git a/src/ui/widget/registry.h b/src/ui/widget/registry.h +index e6a190d0ef..05e8f01f84 100644 +--- a/src/ui/widget/registry.h ++++ b/src/ui/widget/registry.h +@@ -8,7 +8,7 @@ + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + #ifndef INKSCAPE_UI_WIDGET_REGISTRY__H +-#define INKSCAPE_UI_WIDGET_REGISTRY__H ++#define INKSCAPE_UI_WIDGET_REGISTRY_H + + class SPDesktop; + +diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp +index 43a90393d6..bbd28884b4 100644 +--- a/src/ui/widget/selected-style.cpp ++++ b/src/ui/widget/selected-style.cpp +@@ -50,8 +50,8 @@ + + using Inkscape::Util::unit_table; + +-static gdouble const _sw_presets[] = { 32 , 16 , 10 , 8 , 6 , 4 , 3 , 2 , 1.5 , 1 , 0.75 , 0.5 , 0.25 , 0.1 }; +-static gchar const *const _sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"}; ++static gdouble const sw_presets[] = { 32 , 16 , 10 , 8 , 6 , 4 , 3 , 2 , 1.5 , 1 , 0.75 , 0.5 , 0.25 , 0.1 }; ++static gchar const *const sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"}; + + static void + ss_selection_changed (Inkscape::Selection *, gpointer data) +@@ -163,7 +163,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + + _na[i].set_markup (_("N/A")); + _na[i].show_all(); +- __na[i] = (_("Nothing selected")); ++ _na[i] = (_("Nothing selected")); + + if (i == SS_FILL) { + _none[i].set_markup (C_("Fill", "None")); +@@ -171,19 +171,19 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + _none[i].set_markup (C_("Stroke", "None")); + } + _none[i].show_all(); +- __none[i] = (i == SS_FILL)? (C_("Fill and stroke", "No fill, middle-click for black fill")) : (C_("Fill and stroke", "No stroke, middle-click for black stroke")); ++ _none[i] = (i == SS_FILL)? (C_("Fill and stroke", "No fill, middle-click for black fill")) : (C_("Fill and stroke", "No stroke, middle-click for black stroke")); + + _pattern[i].set_markup (_("Pattern")); + _pattern[i].show_all(); +- __pattern[i] = (i == SS_FILL)? (_("Pattern (fill)")) : (_("Pattern (stroke)")); ++ _pattern[i] = (i == SS_FILL)? (_("Pattern (fill)")) : (_("Pattern (stroke)")); + + _hatch[i].set_markup(_("Hatch")); + _hatch[i].show_all(); +- __hatch[i] = (i == SS_FILL) ? (_("Hatch (fill)")) : (_("Hatch (stroke)")); ++ _hatch[i] = (i == SS_FILL) ? (_("Hatch (fill)")) : (_("Hatch (stroke)")); + + _lgradient[i].set_markup (_("L")); + _lgradient[i].show_all(); +- __lgradient[i] = (i == SS_FILL)? (_("Linear gradient (fill)")) : (_("Linear gradient (stroke)")); ++ _lgradient[i] = (i == SS_FILL)? (_("Linear gradient (fill)")) : (_("Linear gradient (stroke)")); + + _gradient_preview_l[i] = Gtk::manage(new GradientImage(nullptr)); + _gradient_box_l[i].set_orientation(Gtk::ORIENTATION_HORIZONTAL); +@@ -193,7 +193,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + + _rgradient[i].set_markup (_("R")); + _rgradient[i].show_all(); +- __rgradient[i] = (i == SS_FILL)? (_("Radial gradient (fill)")) : (_("Radial gradient (stroke)")); ++ _rgradient[i] = (i == SS_FILL)? (_("Radial gradient (fill)")) : (_("Radial gradient (stroke)")); + + _gradient_preview_r[i] = Gtk::manage(new GradientImage(nullptr)); + _gradient_box_r[i].set_orientation(Gtk::ORIENTATION_HORIZONTAL); +@@ -204,7 +204,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + #ifdef WITH_MESH + _mgradient[i].set_markup (_("M")); + _mgradient[i].show_all(); +- __mgradient[i] = (i == SS_FILL)? (_("Mesh gradient (fill)")) : (_("Mesh gradient (stroke)")); ++ _mgradient[i] = (i == SS_FILL)? (_("Mesh gradient (fill)")) : (_("Mesh gradient (stroke)")); + + _gradient_preview_m[i] = Gtk::manage(new GradientImage(nullptr)); + _gradient_box_m[i].set_orientation(Gtk::ORIENTATION_HORIZONTAL); +@@ -215,24 +215,24 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + + _many[i].set_markup (_("≠")); + _many[i].show_all(); +- __many[i] = (i == SS_FILL)? (_("Different fills")) : (_("Different strokes")); ++ _many[i] = (i == SS_FILL)? (_("Different fills")) : (_("Different strokes")); + + _unset[i].set_markup (_("Unset")); + _unset[i].show_all(); +- __unset[i] = (i == SS_FILL)? (_("Unset fill")) : (_("Unset stroke")); ++ _unset[i] = (i == SS_FILL)? (_("Unset fill")) : (_("Unset stroke")); + + _color_preview[i] = new Inkscape::UI::Widget::ColorPreview (0); +- __color[i] = (i == SS_FILL)? (_("Flat color (fill)")) : (_("Flat color (stroke)")); ++ _color[i] = (i == SS_FILL)? (_("Flat color (fill)")) : (_("Flat color (stroke)")); + + // TRANSLATORS: A means "Averaged" + _averaged[i].set_markup (_("a")); + _averaged[i].show_all(); +- __averaged[i] = (i == SS_FILL)? (_("Fill is averaged over selected objects")) : (_("Stroke is averaged over selected objects")); ++ _averaged[i] = (i == SS_FILL)? (_("Fill is averaged over selected objects")) : (_("Stroke is averaged over selected objects")); + + // TRANSLATORS: M means "Multiple" + _multiple[i].set_markup (_("m")); + _multiple[i].show_all(); +- __multiple[i] = (i == SS_FILL)? (_("Multiple selected objects have the same fill")) : (_("Multiple selected objects have the same stroke")); ++ _multiple[i] = (i == SS_FILL)? (_("Multiple selected objects have the same fill")) : (_("Multiple selected objects have the same stroke")); + + _popup_edit[i].add(*(new Gtk::Label((i == SS_FILL)? _("Edit fill...") : _("Edit stroke..."), Gtk::ALIGN_START))); + _popup_edit[i].signal_activate().connect(sigc::mem_fun(*this, +@@ -325,9 +325,9 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + _popup_sw.attach(*(new Gtk::SeparatorMenuItem()), 0,1, row, row+1); + row++; + +- for (guint i = 0; i < G_N_ELEMENTS(_sw_presets_str); ++i) { ++ for (guint i = 0; i < G_N_ELEMENTS(sw_presets_str); ++i) { + Gtk::MenuItem *mi = Gtk::manage(new Gtk::MenuItem()); +- mi->add(*(new Gtk::Label(_sw_presets_str[i], Gtk::ALIGN_START))); ++ mi->add(*(new Gtk::Label(sw_presets_str[i], Gtk::ALIGN_START))); + mi->signal_activate().connect(sigc::bind(sigc::mem_fun(*this, &SelectedStyle::on_popup_preset), i)); + _popup_sw.attach(*mi, 0,1, row, row+1); + row++; +@@ -347,7 +347,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + _fill_flag_place.set_size_request(SELECTED_STYLE_FLAG_WIDTH , -1); + + _fill_place.add(_na[SS_FILL]); +- _fill_place.set_tooltip_text(__na[SS_FILL]); ++ _fill_place.set_tooltip_text(_na[SS_FILL]); + _fill.set_size_request(SELECTED_STYLE_PLACE_WIDTH, -1); + _fill.pack_start(_fill_place, Gtk::PACK_EXPAND_WIDGET); + +@@ -357,7 +357,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) + _stroke_flag_place.set_size_request(SELECTED_STYLE_FLAG_WIDTH, -1); + + _stroke_place.add(_na[SS_STROKE]); +- _stroke_place.set_tooltip_text(__na[SS_STROKE]); ++ _stroke_place.set_tooltip_text(_na[SS_STROKE]); + _stroke.set_size_request(SELECTED_STYLE_PLACE_WIDTH, -1); + _stroke.pack_start(_stroke_place, Gtk::PACK_EXPAND_WIDGET); + +@@ -853,9 +853,9 @@ void SelectedStyle::on_popup_preset(int i) { + SPCSSAttr *css = sp_repr_css_attr_new (); + gdouble w; + if (_sw_unit) { +- w = Inkscape::Util::Quantity::convert(_sw_presets[i], _sw_unit, "px"); ++ w = Inkscape::Util::Quantity::convert(sw_presets[i], _sw_unit, "px"); + } else { +- w = _sw_presets[i]; ++ w = sw_presets[i]; + } + Inkscape::CSSOStringStream os; + os << w; +@@ -896,7 +896,7 @@ SelectedStyle::update() + switch (result) { + case QUERY_STYLE_NOTHING: + place->add(_na[i]); +- place->set_tooltip_text(__na[i]); ++ place->set_tooltip_text(_na[i]); + _mode[i] = SS_NA; + if (_dropEnabled[i]) { + auto widget = i == SS_FILL ? &_fill_place : &_stroke_place; +@@ -927,29 +927,29 @@ SelectedStyle::update() + auto vector = cast(server)->getVector(); + _gradient_preview_l[i]->set_gradient(vector); + place->add(_gradient_box_l[i]); +- place->set_tooltip_text(__lgradient[i]); ++ place->set_tooltip_text(_lgradient[i]); + _mode[i] = SS_LGRADIENT; + } else if (is(server)) { + auto vector = cast(server)->getVector(); + _gradient_preview_r[i]->set_gradient(vector); + place->add(_gradient_box_r[i]); +- place->set_tooltip_text(__rgradient[i]); ++ place->set_tooltip_text(_rgradient[i]); + _mode[i] = SS_RGRADIENT; + #ifdef WITH_MESH + } else if (is(server)) { + auto array = cast(server)->getArray(); + _gradient_preview_m[i]->set_gradient(array); + place->add(_gradient_box_m[i]); +- place->set_tooltip_text(__mgradient[i]); ++ place->set_tooltip_text(_mgradient[i]); + _mode[i] = SS_MGRADIENT; + #endif + } else if (is(server)) { + place->add(_pattern[i]); +- place->set_tooltip_text(__pattern[i]); ++ place->set_tooltip_text(_pattern[i]); + _mode[i] = SS_PATTERN; + } else if (is(server)) { + place->add(_hatch[i]); +- place->set_tooltip_text(__hatch[i]); ++ place->set_tooltip_text(_hatch[i]); + _mode[i] = SS_HATCH; + } + } else { +@@ -965,31 +965,31 @@ SelectedStyle::update() + place->add(*_color_preview[i]); + gchar c_string[64]; + g_snprintf (c_string, 64, "%06x/%.3g", color >> 8, SP_RGBA32_A_F(color)); +- place->set_tooltip_text(__color[i] + ": " + c_string + _(", drag to adjust, middle-click to remove")); ++ place->set_tooltip_text(_color[i] + ": " + c_string + _(", drag to adjust, middle-click to remove")); + _mode[i] = SS_COLOR; + _popup_copy[i].set_sensitive(true); + + } else if (paint->set && paint->isNone()) { + place->add(_none[i]); +- place->set_tooltip_text(__none[i]); ++ place->set_tooltip_text(_none[i]); + _mode[i] = SS_NONE; + } else if (!paint->set) { + place->add(_unset[i]); +- place->set_tooltip_text(__unset[i]); ++ place->set_tooltip_text(_unset[i]); + _mode[i] = SS_UNSET; + } + if (result == QUERY_STYLE_MULTIPLE_AVERAGED) { + flag_place->add(_averaged[i]); +- flag_place->set_tooltip_text(__averaged[i]); ++ flag_place->set_tooltip_text(_averaged[i]); + } else if (result == QUERY_STYLE_MULTIPLE_SAME) { + flag_place->add(_multiple[i]); +- flag_place->set_tooltip_text(__multiple[i]); ++ flag_place->set_tooltip_text(_multiple[i]); + } + break; + } + case QUERY_STYLE_MULTIPLE_DIFFERENT: + place->add(_many[i]); +- place->set_tooltip_text(__many[i]); ++ place->set_tooltip_text(_many[i]); + _mode[i] = SS_MANY; + break; + default: +diff --git a/src/ui/widget/selected-style.h b/src/ui/widget/selected-style.h +index 0ad002bfb2..008969a700 100644 +--- a/src/ui/widget/selected-style.h ++++ b/src/ui/widget/selected-style.h +@@ -155,50 +155,50 @@ protected: + Inkscape::UI::Widget::SpinButton _opacity_sb; + + Gtk::Label _na[2]; +- Glib::ustring __na[2]; ++ Glib::ustring _na[2]; + + Gtk::Label _none[2]; +- Glib::ustring __none[2]; ++ Glib::ustring _none[2]; + + Gtk::Label _pattern[2]; +- Glib::ustring __pattern[2]; ++ Glib::ustring _pattern[2]; + + Gtk::Label _hatch[2]; +- Glib::ustring __hatch[2]; ++ Glib::ustring _hatch[2]; + + Gtk::Label _lgradient[2]; +- Glib::ustring __lgradient[2]; ++ Glib::ustring _lgradient[2]; + + GradientImage *_gradient_preview_l[2]; + Gtk::Box _gradient_box_l[2]; + + Gtk::Label _rgradient[2]; +- Glib::ustring __rgradient[2]; ++ Glib::ustring _rgradient[2]; + + GradientImage *_gradient_preview_r[2]; + Gtk::Box _gradient_box_r[2]; + + #ifdef WITH_MESH + Gtk::Label _mgradient[2]; +- Glib::ustring __mgradient[2]; ++ Glib::ustring _mgradient[2]; + + GradientImage *_gradient_preview_m[2]; + Gtk::Box _gradient_box_m[2]; + #endif + + Gtk::Label _many[2]; +- Glib::ustring __many[2]; ++ Glib::ustring _many[2]; + + Gtk::Label _unset[2]; +- Glib::ustring __unset[2]; ++ Glib::ustring _unset[2]; + + Gtk::Widget *_color_preview[2]; +- Glib::ustring __color[2]; ++ Glib::ustring _color[2]; + + Gtk::Label _averaged[2]; +- Glib::ustring __averaged[2]; ++ Glib::ustring _averaged[2]; + Gtk::Label _multiple[2]; +- Glib::ustring __multiple[2]; ++ Glib::ustring _multiple[2]; + + Gtk::Box _fill; + Gtk::Box _stroke; +diff --git a/src/ui/widget/shapeicon.h b/src/ui/widget/shapeicon.h +index 8e09e64fe8..d6ad27f558 100644 +--- a/src/ui/widget/shapeicon.h ++++ b/src/ui/widget/shapeicon.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __UI_DIALOG_SHAPEICON_H__ +-#define __UI_DIALOG_SHAPEICON_H__ ++#define UI_DIALOG_SHAPEICON_H_ + /* + * Authors: + * Martin Owens +diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h +index 514cd6d294..0a1597e54e 100644 +--- a/src/ui/widget/style-swatch.h ++++ b/src/ui/widget/style-swatch.h +@@ -78,7 +78,7 @@ private: + Gtk::Label _value[2]; + Gtk::Label _opacity_value; + Gtk::Widget *_color_preview[2]; +- Glib::ustring __color[2]; ++ Glib::ustring _color[2]; + Gtk::Box _stroke; + Gtk::EventBox _stroke_width_place; + Gtk::Label _stroke_width; +diff --git a/src/ui/widget/tolerance-slider.h b/src/ui/widget/tolerance-slider.h +index cb12116155..ca3f1339bd 100644 +--- a/src/ui/widget/tolerance-slider.h ++++ b/src/ui/widget/tolerance-slider.h +@@ -9,7 +9,7 @@ + */ + + #ifndef INKSCAPE_UI_WIDGET_TOLERANCE_SLIDER__H_ +-#define INKSCAPE_UI_WIDGET_TOLERANCE_SLIDER__H_ ++#define INKSCAPE_UI_WIDGET_TOLERANCE_SLIDER_H_ + + #include + +diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h +index 918fec792d..890bd90405 100644 +--- a/src/widgets/desktop-widget.h ++++ b/src/widgets/desktop-widget.h +@@ -30,7 +30,7 @@ + #include "display/control/canvas-item-ptr.h" + + // forward declaration +-typedef struct _EgeColorProfTracker EgeColorProfTracker; ++typedef struct EgeColorProfTracker EgeColorProfTracker; + + class InkscapeWindow; + struct SPCanvasItem; +@@ -61,7 +61,7 @@ namespace Widget { + } // namespace UI + } // namespace Inkscape + +-#define SP_DESKTOP_WIDGET(o) dynamic_cast(o) ++#define SP_DESKTOP_WIDGET(o) (dynamic_cast(o)) + #define SP_IS_DESKTOP_WIDGET(o) bool(dynamic_cast(o)) + + void sp_desktop_widget_show_decorations(SPDesktopWidget *dtw, gboolean show); +diff --git a/src/widgets/spw-utilities.h b/src/widgets/spw-utilities.h +index fc37792b3e..363605de4a 100644 +--- a/src/widgets/spw-utilities.h ++++ b/src/widgets/spw-utilities.h +@@ -1,6 +1,6 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + #ifndef __SPW_UTILITIES_H__ +-#define __SPW_UTILITIES_H__ ++#define SPW_UTILITIES_H_ + + /* + * Inkscape Widget Utilities +diff --git a/src/xml/simple-document.h b/src/xml/simple-document.h +index 5c661a2809..4da94d6be9 100644 +--- a/src/xml/simple-document.h ++++ b/src/xml/simple-document.h +@@ -65,7 +65,7 @@ public: + + protected: + SimpleDocument(SimpleDocument const &doc) +- : Node(), SimpleNode(doc), Document(), NodeObserver(), ++ : Node(doc), SimpleNode(doc), Document(doc), NodeObserver(), + _in_transaction(false) + {} + +diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp +index 9dd19f984c..9455599f4d 100644 +--- a/src/xml/simple-node.cpp ++++ b/src/xml/simple-node.cpp +@@ -387,7 +387,7 @@ SimpleNode::setAttributeImpl(gchar const *name, gchar const *value) + } + } + +- if ( new_value != old_value && (!old_value || !new_value || strcmp(old_value, new_value))) { ++ if ( new_value != old_value && (!old_value || !new_value || strcmp(old_value, new_value) != 0)) { + _document->logger()->notifyAttributeChanged(*this, key, old_value, new_value); + _observers.notifyAttributeChanged(*this, key, old_value, new_value); + //g_warning( "setAttribute notified: %s: %s: %s: %s", name, element.c_str(), old_value, new_value ); diff --git a/packaging/cairo.patch b/packaging/cairo.patch index dc92e263a3..054c719208 100644 --- a/packaging/cairo.patch +++ b/packaging/cairo.patch @@ -1,371 +1,195 @@ -From e0d713b9bbd6d4a1e27e18c15141fa7f568001c7 Mon Sep 17 00:00:00 2001 +From 311f986ecc9a41888d96ff56688ee823c6d8bb7e Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin -Date: Wed, 29 May 2019 09:44:09 +0200 -Subject: [PATCH 1/3] Enable access to the pixman dithering path Code to choose - between dithering quality is modeled on the filter rendering choice +Date: Thu, 25 May 2023 18:50:38 +0200 +Subject: [PATCH] Enable access to the pixman dithering path --- - src/cairo-gl-gradient.c | 4 +++- - src/cairo-image-source.c | 48 +++++++++++++++++++++++++++++++++++++ - src/cairo-pattern-private.h | 1 + - src/cairo-pattern.c | 45 ++++++++++++++++++++++++++++++++++ - src/cairo.h | 14 +++++++++++ - 5 files changed, 111 insertions(+), 1 deletion(-) + doc/public/cairo-sections.txt | 3 + + src/cairo-backend-private.h | 2 + + src/cairo-default-context.c | 19 +++++++ + src/cairo-gstate-private.h | 9 +++ + src/cairo-gstate.c | 19 +++++++ + src/cairo-image-surface.c | 23 ++++++++ + src/cairo-surface-private.h | 2 + + src/cairo-surface.c | 14 ++++- + src/cairo.c | 44 +++++++++++++++ + src/cairo.h | 28 +++++++++ + src/cairoint.h | 6 ++ + test/dithergradient.c | 53 ++++++++++++++++++ + test/meson.build | 1 + + .../dithergradient.image.argb32.ref.png | Bin 0 -> 10442 bytes + .../dithergradient.image.rgb24.ref.png | Bin 0 -> 10442 bytes + 15 files changed, 220 insertions(+), 3 deletions(-) + create mode 100644 test/dithergradient.c + create mode 100644 test/reference/dithergradient.image.argb32.ref.png + create mode 100644 test/reference/dithergradient.image.rgb24.ref.png -diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c -index 293d4e30e..a22cca729 100644 ---- a/src/cairo-gl-gradient.c -+++ b/src/cairo-gl-gradient.c -@@ -160,7 +160,9 @@ _cairo_gl_gradient_render (const cairo_gl_context_t *ctx, - - pixman_image_set_filter (gradient, PIXMAN_FILTER_BILINEAR, NULL, 0); - pixman_image_set_repeat (gradient, PIXMAN_REPEAT_PAD); -- -+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+ pixman_image_set_dither (gradient, PIXMAN_DITHER_BEST); -+#endif - image = pixman_image_create_bits (gradient_pixman_format, width, 1, - bytes, sizeof(uint32_t)*width); - if (unlikely (image == NULL)) { -diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c -index c56845ab2..274f43df7 100644 ---- a/src/cairo-image-source.c -+++ b/src/cairo-image-source.c -@@ -383,6 +383,30 @@ _pixman_image_for_gradient (const cairo_gradient_pattern_t *pattern, +diff --git a/doc/public/cairo-sections.txt b/doc/public/cairo-sections.txt +index 5f53fc49c..0dc0dfb77 100644 +--- a/doc/public/cairo-sections.txt ++++ b/doc/public/cairo-sections.txt +@@ -642,6 +642,9 @@ cairo_get_antialias + cairo_set_dash + cairo_get_dash_count + cairo_get_dash ++cairo_dither_t ++cairo_set_dither ++cairo_get_dither + cairo_fill_rule_t + cairo_set_fill_rule + cairo_get_fill_rule +diff --git a/src/cairo-backend-private.h b/src/cairo-backend-private.h +index 86689c795..e9b2b9731 100644 +--- a/src/cairo-backend-private.h ++++ b/src/cairo-backend-private.h +@@ -64,6 +64,7 @@ struct _cairo_backend { + + cairo_status_t (*set_antialias) (void *cr, cairo_antialias_t antialias); + cairo_status_t (*set_dash) (void *cr, const double *dashes, int num_dashes, double offset); ++ cairo_status_t (*set_dither) (void *cr, cairo_dither_t dither); + cairo_status_t (*set_fill_rule) (void *cr, cairo_fill_rule_t fill_rule); + cairo_status_t (*set_line_cap) (void *cr, cairo_line_cap_t line_cap); + cairo_status_t (*set_line_join) (void *cr, cairo_line_join_t line_join); +@@ -76,6 +77,7 @@ struct _cairo_backend { + + cairo_antialias_t (*get_antialias) (void *cr); + void (*get_dash) (void *cr, double *dashes, int *num_dashes, double *offset); ++ cairo_dither_t (*get_dither) (void *cr); + cairo_fill_rule_t (*get_fill_rule) (void *cr); + cairo_line_cap_t (*get_line_cap) (void *cr); + cairo_line_join_t (*get_line_join) (void *cr); +diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c +index 87370cdc7..788bdab8d 100644 +--- a/src/cairo-default-context.c ++++ b/src/cairo-default-context.c +@@ -441,6 +441,15 @@ _cairo_default_context_set_dash (void *abstract_cr, + dashes, num_dashes, offset); + } - pixman_image_set_repeat (pixman_image, pixman_repeat); - } -+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+ { -+ pixman_dither_t pixman_dither; ++static cairo_status_t ++_cairo_default_context_set_dither (void *abstract_cr, ++ cairo_dither_t dither) ++{ ++ cairo_default_context_t *cr = abstract_cr; + -+ switch (pattern->base.dither) { -+ default: -+ case CAIRO_DITHER_NONE: -+ case CAIRO_DITHER_DEFAULT: -+ pixman_dither = PIXMAN_DITHER_NONE; -+ break; -+ case CAIRO_DITHER_FAST: -+ pixman_dither = PIXMAN_DITHER_FAST; -+ break; -+ case CAIRO_DITHER_GOOD: -+ pixman_dither = PIXMAN_DITHER_GOOD; -+ break; -+ case CAIRO_DITHER_BEST: -+ pixman_dither = PIXMAN_DITHER_BEST; -+ break; -+ } ++ return _cairo_gstate_set_dither (cr->gstate, dither); ++} + -+ pixman_image_set_dither (pixman_image, pixman_dither); -+ } -+#endif - - return pixman_image; + static cairo_status_t + _cairo_default_context_set_miter_limit (void *abstract_cr, + double limit) +@@ -469,6 +478,14 @@ _cairo_default_context_get_dash (void *abstract_cr, + _cairo_gstate_get_dash (cr->gstate, dashes, num_dashes, offset); } -@@ -1047,6 +1071,30 @@ _pixman_image_set_properties (pixman_image_t *pixman_image, - pixman_image_set_repeat (pixman_image, pixman_repeat); - } -+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+ { -+ pixman_dither_t pixman_dither; ++static cairo_dither_t ++_cairo_default_context_get_dither (void *abstract_cr) ++{ ++ cairo_default_context_t *cr = abstract_cr; + -+ switch (pattern->dither) { -+ default: -+ case CAIRO_DITHER_NONE: -+ case CAIRO_DITHER_DEFAULT: -+ pixman_dither = PIXMAN_DITHER_NONE; -+ break; -+ case CAIRO_DITHER_FAST: -+ pixman_dither = PIXMAN_DITHER_FAST; -+ break; -+ case CAIRO_DITHER_GOOD: -+ pixman_dither = PIXMAN_DITHER_GOOD; -+ break; -+ case CAIRO_DITHER_BEST: -+ pixman_dither = PIXMAN_DITHER_BEST; -+ break; -+ } ++ return _cairo_gstate_get_dither (cr->gstate); ++} + -+ pixman_image_set_dither (pixman_image, pixman_dither); -+ } -+#endif - - if (pattern->has_component_alpha) - pixman_image_set_component_alpha (pixman_image, TRUE); -diff --git a/src/cairo-pattern-private.h b/src/cairo-pattern-private.h -index f6138fb70..96ae4f615 100644 ---- a/src/cairo-pattern-private.h -+++ b/src/cairo-pattern-private.h -@@ -70,6 +70,7 @@ struct _cairo_pattern { - cairo_pattern_type_t type; - - cairo_filter_t filter; -+ cairo_dither_t dither; - cairo_extend_t extend; - cairo_bool_t has_component_alpha; - cairo_bool_t is_userfont_foreground; -diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c -index 6bd3edfd8..6cf907f36 100644 ---- a/src/cairo-pattern.c -+++ b/src/cairo-pattern.c -@@ -74,6 +74,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil = { - - CAIRO_PATTERN_TYPE_SOLID, /* type */ - CAIRO_FILTER_DEFAULT, /* filter */ -+ CAIRO_DITHER_DEFAULT, /* dither */ - CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ - FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ -@@ -91,6 +92,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil_null_pointer = { - - CAIRO_PATTERN_TYPE_SOLID, /* type */ - CAIRO_FILTER_DEFAULT, /* filter */ -+ CAIRO_DITHER_DEFAULT, /* dither */ - CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ - FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ -@@ -108,6 +110,7 @@ const cairo_solid_pattern_t _cairo_pattern_black = { + static cairo_fill_rule_t + _cairo_default_context_get_fill_rule (void *abstract_cr) + { +@@ -1383,6 +1400,7 @@ static const cairo_backend_t _cairo_default_context_backend = { + + _cairo_default_context_set_antialias, + _cairo_default_context_set_dash, ++ _cairo_default_context_set_dither, + _cairo_default_context_set_fill_rule, + _cairo_default_context_set_line_cap, + _cairo_default_context_set_line_join, +@@ -1394,6 +1412,7 @@ static const cairo_backend_t _cairo_default_context_backend = { + _cairo_default_context_set_tolerance, + _cairo_default_context_get_antialias, + _cairo_default_context_get_dash, ++ _cairo_default_context_get_dither, + _cairo_default_context_get_fill_rule, + _cairo_default_context_get_line_cap, + _cairo_default_context_get_line_join, +diff --git a/src/cairo-gstate-private.h b/src/cairo-gstate-private.h +index fe1556b03..e97ce1906 100644 +--- a/src/cairo-gstate-private.h ++++ b/src/cairo-gstate-private.h +@@ -44,6 +44,7 @@ struct _cairo_gstate { + double opacity; + double tolerance; + cairo_antialias_t antialias; ++ cairo_dither_t dither; + + cairo_stroke_style_t stroke_style; + +@@ -399,4 +400,12 @@ _cairo_gstate_set_antialias (cairo_gstate_t *gstate, + cairo_private cairo_antialias_t + _cairo_gstate_get_antialias (cairo_gstate_t *gstate); + ++cairo_private cairo_status_t ++_cairo_gstate_set_dither (cairo_gstate_t *gstate, ++ cairo_dither_t dither); ++ ++cairo_private cairo_dither_t ++_cairo_gstate_get_dither (cairo_gstate_t *gstate); ++ ++ + #endif /* CAIRO_GSTATE_PRIVATE_H */ +diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c +index 8a253468d..e3d6abc72 100644 +--- a/src/cairo-gstate.c ++++ b/src/cairo-gstate.c +@@ -93,6 +93,7 @@ _cairo_gstate_init (cairo_gstate_t *gstate, - CAIRO_PATTERN_TYPE_SOLID, /* type */ - CAIRO_FILTER_NEAREST, /* filter */ -+ CAIRO_DITHER_DEFAULT, /* dither */ - CAIRO_EXTEND_REPEAT, /* extend */ - FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ -@@ -126,6 +129,7 @@ const cairo_solid_pattern_t _cairo_pattern_clear = { + gstate->tolerance = CAIRO_GSTATE_TOLERANCE_DEFAULT; + gstate->antialias = CAIRO_ANTIALIAS_DEFAULT; ++ gstate->dither = CAIRO_DITHER_DEFAULT; //why not from target - CAIRO_PATTERN_TYPE_SOLID, /* type */ - CAIRO_FILTER_NEAREST, /* filter */ -+ CAIRO_DITHER_DEFAULT, /* dither */ - CAIRO_EXTEND_REPEAT, /* extend */ - FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ -@@ -144,6 +148,7 @@ const cairo_solid_pattern_t _cairo_pattern_white = { + _cairo_stroke_style_init (&gstate->stroke_style); - CAIRO_PATTERN_TYPE_SOLID, /* type */ - CAIRO_FILTER_NEAREST, /* filter */ -+ CAIRO_DITHER_DEFAULT, /* dither */ - CAIRO_EXTEND_REPEAT, /* extend */ - FALSE, /* has component alpha */ - FALSE, /* is_userfont_foreground */ -@@ -235,6 +240,7 @@ _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type) - pattern->extend = CAIRO_EXTEND_GRADIENT_DEFAULT; +@@ -150,6 +151,7 @@ _cairo_gstate_init_copy (cairo_gstate_t *gstate, cairo_gstate_t *other) - pattern->filter = CAIRO_FILTER_DEFAULT; -+ pattern->dither = CAIRO_DITHER_DEFAULT; - pattern->opacity = 1.0; + gstate->tolerance = other->tolerance; + gstate->antialias = other->antialias; ++ gstate->dither = other->dither; - pattern->has_component_alpha = FALSE; -@@ -2074,6 +2080,28 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) - _cairo_pattern_notify_observers (pattern, CAIRO_PATTERN_NOTIFY_FILTER); + status = _cairo_stroke_style_init_copy (&gstate->stroke_style, + &other->stroke_style); +@@ -2168,6 +2170,23 @@ _cairo_gstate_get_antialias (cairo_gstate_t *gstate) + return gstate->antialias; } -+/** -+ * cairo_pattern_set_dither: -+ * @pattern: a #cairo_pattern_t -+ * @filter: a #cairo_dither_t describing the dithering to use -+ * -+ * See #cairo_dither_t for details on each algorithm. -+ * -+ * Since: TODO -+ **/ -+void -+cairo_pattern_set_dither (cairo_pattern_t *pattern, cairo_dither_t dither) ++cairo_status_t ++_cairo_gstate_set_dither (cairo_gstate_t *gstate, ++ cairo_dither_t dither) +{ -+ if (pattern->status) -+ return; ++ gstate->dither = dither; ++ if (gstate->target) gstate->target->dither = dither; //maybe unnecessary + -+ pattern->dither = dither; -+ _cairo_pattern_notify_observers (pattern, CAIRO_PATTERN_NOTIFY_FILTER); -+ /* We probably can notify the same observers as when we notify filter -+ * changes (?) TODO CHECK THAT */ ++ return CAIRO_STATUS_SUCCESS; +} + -+ - /** - * cairo_pattern_get_filter: - * @pattern: a #cairo_pattern_t -@@ -2091,6 +2119,23 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) - return pattern->filter; - } - -+/** -+ * cairo_pattern_get_dither: -+ * @pattern: a #cairo_pattern_t -+ * -+ * Gets the current dithering for a pattern. See #cairo_dither_t -+ * for details. -+ * -+ * Return value: the current dithering algorithm of the pattern -+ * -+ * Since: TODO -+ **/ +cairo_dither_t -+cairo_pattern_get_dither (cairo_pattern_t *pattern) ++_cairo_gstate_get_dither (cairo_gstate_t *gstate) +{ -+ return pattern->dither; ++ return gstate->dither; +} + - /** - * cairo_pattern_set_extend: - * @pattern: a #cairo_pattern_t -diff --git a/src/cairo.h b/src/cairo.h -index fb1da4146..1c911d09d 100644 ---- a/src/cairo.h -+++ b/src/cairo.h -@@ -3003,12 +3003,26 @@ typedef enum _cairo_filter { - CAIRO_FILTER_GAUSSIAN - } cairo_filter_t; - -+typedef enum _cairo_dither { -+ CAIRO_DITHER_NONE, -+ CAIRO_DITHER_DEFAULT, -+ CAIRO_DITHER_FAST, -+ CAIRO_DITHER_GOOD, -+ CAIRO_DITHER_BEST -+} cairo_dither_t; -+ - cairo_public void - cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter); - - cairo_public cairo_filter_t - cairo_pattern_get_filter (cairo_pattern_t *pattern); - -+cairo_public void -+cairo_pattern_set_dither (cairo_pattern_t *pattern, cairo_dither_t dither); + -+cairo_public cairo_dither_t -+cairo_pattern_get_dither (cairo_pattern_t *pattern); -+ - cairo_public cairo_status_t - cairo_pattern_get_rgba (cairo_pattern_t *pattern, - double *red, double *green, --- -2.25.1 - - -From 659173b4bb01e2de438d894dca9ed01838eaf028 Mon Sep 17 00:00:00 2001 -From: Marc Jeanmougin -Date: Sat, 27 Mar 2021 23:53:28 +0100 -Subject: [PATCH 2/3] Expose dithering property at the image surface level. - -Copies the property on push_group ---- - src/cairo-default-context.c | 6 ++- - src/cairo-image-source.c | 40 ++---------------- - src/cairo-image-surface-private.h | 1 + - src/cairo-image-surface.c | 67 +++++++++++++++++++++++++++++++ - src/cairo.h | 22 ++++++---- - src/cairoint.h | 5 +++ - 6 files changed, 96 insertions(+), 45 deletions(-) - -diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c -index 567c5d4d5..24af125da 100644 ---- a/src/cairo-default-context.c -+++ b/src/cairo-default-context.c -@@ -180,7 +180,11 @@ _cairo_default_context_push_group (void *abstract_cr, cairo_content_t content) - if (unlikely (status)) - goto bail; - -- /* Set device offsets on the new surface so that logically it appears at -+ /* copies over the dither property */ -+ cairo_image_surface_set_dither(group_surface, -+ cairo_image_surface_get_dither(parent_surface)); -+ -+ /* Set device offsets on the new surface so that logically it appears at - * the same location on the parent surface -- when we pop_group this, - * the source pattern will get fixed up for the appropriate target surface - * device offsets, so we want to set our own surface offsets from /that/, -diff --git a/src/cairo-image-source.c b/src/cairo-image-source.c -index 274f43df7..93daff3c0 100644 ---- a/src/cairo-image-source.c -+++ b/src/cairo-image-source.c -@@ -385,24 +385,8 @@ _pixman_image_for_gradient (const cairo_gradient_pattern_t *pattern, - } - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) - { -- pixman_dither_t pixman_dither; -- -- switch (pattern->base.dither) { -- default: -- case CAIRO_DITHER_NONE: -- case CAIRO_DITHER_DEFAULT: -- pixman_dither = PIXMAN_DITHER_NONE; -- break; -- case CAIRO_DITHER_FAST: -- pixman_dither = PIXMAN_DITHER_FAST; -- break; -- case CAIRO_DITHER_GOOD: -- pixman_dither = PIXMAN_DITHER_GOOD; -- break; -- case CAIRO_DITHER_BEST: -- pixman_dither = PIXMAN_DITHER_BEST; -- break; -- } -+ pixman_dither_t pixman_dither = -+ _pixman_dither_from_cairo_dither(pattern->base.dither); - - pixman_image_set_dither (pixman_image, pixman_dither); - } -@@ -1073,24 +1057,8 @@ _pixman_image_set_properties (pixman_image_t *pixman_image, - } - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) - { -- pixman_dither_t pixman_dither; -- -- switch (pattern->dither) { -- default: -- case CAIRO_DITHER_NONE: -- case CAIRO_DITHER_DEFAULT: -- pixman_dither = PIXMAN_DITHER_NONE; -- break; -- case CAIRO_DITHER_FAST: -- pixman_dither = PIXMAN_DITHER_FAST; -- break; -- case CAIRO_DITHER_GOOD: -- pixman_dither = PIXMAN_DITHER_GOOD; -- break; -- case CAIRO_DITHER_BEST: -- pixman_dither = PIXMAN_DITHER_BEST; -- break; -- } -+ pixman_dither_t pixman_dither = -+ _pixman_dither_from_cairo_dither (pattern->dither); - - pixman_image_set_dither (pixman_image, pixman_dither); - } -diff --git a/src/cairo-image-surface-private.h b/src/cairo-image-surface-private.h -index 2b7921133..c06b9737b 100644 ---- a/src/cairo-image-surface-private.h -+++ b/src/cairo-image-surface-private.h -@@ -78,6 +78,7 @@ struct _cairo_image_surface { - unsigned owns_data : 1; - unsigned transparency : 2; - unsigned color : 2; -+ cairo_dither_t dither : 3; - }; - #define to_image_surface(S) ((cairo_image_surface_t *)(S)) - + /** + * _cairo_gstate_transform_glyphs_to_backend: + * @gstate: a #cairo_gstate_t diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c -index 3b11eb981..977bb48e6 100644 +index 3b11eb981..aaad1c17b 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c -@@ -169,6 +169,7 @@ _cairo_image_surface_init (cairo_image_surface_t *surface, - surface->owns_data = FALSE; - surface->transparency = CAIRO_IMAGE_UNKNOWN; - surface->color = CAIRO_IMAGE_UNKNOWN_COLOR; -+ surface->dither = CAIRO_DITHER_DEFAULT; - - surface->width = pixman_image_get_width (pixman_image); - surface->height = pixman_image_get_height (pixman_image); -@@ -248,6 +249,25 @@ _pixman_format_from_masks (cairo_format_masks_t *masks, +@@ -248,6 +248,27 @@ _pixman_format_from_masks (cairo_format_masks_t *masks, return TRUE; } +#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+/* Convenience function to convert cairo_dither_t into pixman_dither_t */ -+pixman_dither_t _pixman_dither_from_cairo_dither(cairo_dither_t dither) ++/* Convenience function to convert #cairo_dither_t into #pixman_dither_t */ ++pixman_dither_t ++_pixman_dither_from_cairo_dither (cairo_dither_t dither) +{ + switch(dither) { + default: @@ -381,83 +205,160 @@ index 3b11eb981..977bb48e6 100644 + } +} +#endif ++ + /* A mask consisting of N bits set to 1. */ #define MASK(N) ((1UL << (N))-1) -@@ -631,6 +651,30 @@ cairo_image_surface_get_width (cairo_surface_t *surface) +@@ -938,6 +959,8 @@ _cairo_image_surface_paint (void *abstract_surface, + const cairo_clip_t *clip) + { + cairo_image_surface_t *surface = abstract_surface; ++ pixman_dither_t pixman_dither = _pixman_dither_from_cairo_dither(surface->base.dither); ++ pixman_image_set_dither (surface->pixman_image, pixman_dither); + + TRACE ((stderr, "%s (surface=%d)\n", + __FUNCTION__, surface->base.unique_id)); +diff --git a/src/cairo-surface-private.h b/src/cairo-surface-private.h +index 35b559f9c..40149500d 100644 +--- a/src/cairo-surface-private.h ++++ b/src/cairo-surface-private.h +@@ -83,6 +83,8 @@ struct _cairo_surface { + double x_resolution; + double y_resolution; + ++ cairo_dither_t dither; ++ + /* The resolution that should be used when generating image-based + * fallback; generally only used by the analysis/paginated + * surfaces +diff --git a/src/cairo-surface.c b/src/cairo-surface.c +index f1292e0bb..4f6a165dc 100644 +--- a/src/cairo-surface.c ++++ b/src/cairo-surface.c +@@ -121,19 +121,25 @@ const cairo_surface_t name = { \ + { NULL, NULL }, /* device_transform_observers */ \ + 0.0, /* x_resolution */ \ + 0.0, /* y_resolution */ \ ++ CAIRO_DITHER_DEFAULT, /* dither */ \ + 0.0, /* x_fallback_resolution */ \ + 0.0, /* y_fallback_resolution */ \ + NULL, /* snapshot_of */ \ + NULL, /* snapshot_detach */ \ + { NULL, NULL }, /* snapshots */ \ + { NULL, NULL }, /* snapshot */ \ +- { CAIRO_ANTIALIAS_DEFAULT, /* antialias */ \ ++ { /* font options begin */\ ++ CAIRO_ANTIALIAS_DEFAULT, /* antialias */ \ + CAIRO_SUBPIXEL_ORDER_DEFAULT, /* subpixel_order */ \ + CAIRO_LCD_FILTER_DEFAULT, /* lcd_filter */ \ + CAIRO_HINT_STYLE_DEFAULT, /* hint_style */ \ + CAIRO_HINT_METRICS_DEFAULT, /* hint_metrics */ \ +- CAIRO_ROUND_GLYPH_POS_DEFAULT /* round_glyph_positions */ \ +- }, /* font_options */ \ ++ CAIRO_ROUND_GLYPH_POS_DEFAULT, /* round_glyph_positions */ \ ++ NULL, /* variations */ \ ++ CAIRO_COLOR_MODE_DEFAULT, /* color mode */ \ ++ CAIRO_COLOR_PALETTE_DEFAULT, /* color palette */ \ ++ NULL, 0, /* custom palette */ \ ++ }, /* font_options end */ \ + NULL, /* foreground_source */ \ + FALSE, /* foreground_used */ \ + } +@@ -432,6 +438,7 @@ _cairo_surface_init (cairo_surface_t *surface, + + surface->x_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT; + surface->y_resolution = CAIRO_SURFACE_RESOLUTION_DEFAULT; ++ surface->dither = CAIRO_DITHER_DEFAULT; + + surface->x_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT; + surface->y_fallback_resolution = CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT; +@@ -459,6 +466,7 @@ _cairo_surface_copy_similar_properties (cairo_surface_t *surface, + cairo_surface_set_fallback_resolution (surface, + other->x_fallback_resolution, + other->y_fallback_resolution); ++ surface->dither = other->dither; + } + + /** +diff --git a/src/cairo.c b/src/cairo.c +index 3d4fea601..8facb9a3c 100644 +--- a/src/cairo.c ++++ b/src/cairo.c +@@ -1393,6 +1393,50 @@ cairo_get_dash (cairo_t *cr, + cr->backend->get_dash (cr, dashes, NULL, offset); } - slim_hidden_def (cairo_image_surface_get_width); +/** -+ * cairo_image_surface_get_dither: -+ * @surface: a #cairo_image_surface_t ++ * cairo_get_dither: ++ * @cr: a cairo context + * -+ * Get the current dithering method ++ * Gets the current dithering mode, as set by ++ * cairo_set_dither(). + * -+ * Return value: the current dithering method. ++ * Return value: the current dithering mode. + * -+ * Since: TODO ++ * Since: 1.18 + **/ +cairo_dither_t -+cairo_image_surface_get_dither (cairo_surface_t *surface) ++cairo_get_dither (cairo_t *cr) +{ -+ cairo_image_surface_t *image_surface = (cairo_image_surface_t *) surface; ++ if (unlikely (cr->status)) ++ return CAIRO_DITHER_DEFAULT; + -+ if (! _cairo_surface_is_image (surface)) { -+ _cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH); -+ return CAIRO_DITHER_DEFAULT; -+ } -+ -+ return image_surface->dither; ++ return cr->backend->get_dither (cr); +} -+//slim_hidden_def (cairo_image_surface_get_dither); -+ - /** - * cairo_image_surface_get_height: - * @surface: a #cairo_image_surface_t -@@ -792,6 +836,7 @@ _cairo_image_surface_snapshot (void *abstract_surface) - - clone->transparency = image->transparency; - clone->color = image->color; -+ clone->dither = image->dither; - - clone->owns_data = TRUE; - return &clone->base; -@@ -1361,3 +1406,25 @@ error: - cairo_surface_destroy (image); - return to_image_surface (_cairo_surface_create_in_error (status)); - } + -+cairo_public int -+cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) ++/** ++ * cairo_set_dither: ++ * @cr: a #cairo_t ++ * @dither: the new antialiasing mode ++ * ++ * Set the dithering mode of the rasterizer used for drawing shapes. ++ * This value is a hint, and a particular backend may or may not support ++ * a particular value. At the current time, only pixman is supported. ++ * ++ * Since: 1.18 ++ **/ ++void ++cairo_set_dither (cairo_t *cr, cairo_dither_t dither) +{ -+ cairo_image_surface_t *image_surface = (cairo_image_surface_t *) surface; -+ -+ if (! _cairo_surface_is_image (surface)) { -+ _cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH); -+ return 0; -+ } ++ cairo_status_t status; + -+ image_surface->dither = dither; -+ if (image_surface->pixman_image) { -+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+ pixman_image_set_dither(image_surface->pixman_image, -+ _pixman_dither_from_cairo_dither(dither)); -+#endif -+ } ++ if (unlikely (cr->status)) ++ return; + ++ status = cr->backend->set_dither (cr, dither); ++ if (unlikely (status)) ++ _cairo_set_error (cr, status); +} -+//slim_hidden_def (cairo_image_surface_set_dither); + + /** + * cairo_set_miter_limit: + * @cr: a cairo context diff --git a/src/cairo.h b/src/cairo.h -index 1c911d09d..76db87d2e 100644 +index a2c955281..495305176 100644 --- a/src/cairo.h +++ b/src/cairo.h -@@ -427,6 +427,14 @@ typedef enum _cairo_format { +@@ -429,6 +429,31 @@ typedef enum _cairo_format { CAIRO_FORMAT_RGBA128F = 7 } cairo_format_t; ++/** ++ * cairo_dither_t: ++ * @CAIRO_DITHER_NONE: No dithering. ++ * @CAIRO_DITHER_DEFAULT: Default choice at cairo compile time. Currently NONE. ++ * @CAIRO_DITHER_FAST: Corresponds to PIXMAN_DITHER_FAST ++ * @CAIRO_DITHER_GOOD: Corresponds to PIXMAN_DITHER_GOOD ++ * @CAIRO_DITHER_BEST: Corresponds to PIXMAN_DITHER_BEST ++ * ++ * #cairo_dither_t is modeled on pixman dithering algorithm choice. ++ * As of Pixman 0.40, FAST corresponds to a 8x8 ordered bayer noise and GOOD ++ * and BEST use an ordered 64x64 precomputed blue noise. ++ * ++ * Since: 1.18 ++ **/ ++#define CAIRO_HAS_DITHER +typedef enum _cairo_dither { + CAIRO_DITHER_NONE, + CAIRO_DITHER_DEFAULT, @@ -466,194 +367,531 @@ index 1c911d09d..76db87d2e 100644 + CAIRO_DITHER_BEST +} cairo_dither_t; + ++cairo_public void ++cairo_set_dither (cairo_t *pattern, cairo_dither_t dither); /** * cairo_write_func_t: -@@ -2607,6 +2615,12 @@ cairo_image_surface_create_for_data (unsigned char *data, - cairo_public unsigned char * - cairo_image_surface_get_data (cairo_surface_t *surface); +@@ -2079,6 +2104,9 @@ cairo_get_target (cairo_t *cr); + cairo_public cairo_surface_t * + cairo_get_group_target (cairo_t *cr); +cairo_public cairo_dither_t -+cairo_image_surface_get_dither (cairo_surface_t *surface); ++cairo_get_dither (cairo_t *cr); + -+cairo_public int -+cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither); -+ - cairo_public cairo_format_t - cairo_image_surface_get_format (cairo_surface_t *surface); - -@@ -3003,14 +3017,6 @@ typedef enum _cairo_filter { - CAIRO_FILTER_GAUSSIAN - } cairo_filter_t; - --typedef enum _cairo_dither { -- CAIRO_DITHER_NONE, -- CAIRO_DITHER_DEFAULT, -- CAIRO_DITHER_FAST, -- CAIRO_DITHER_GOOD, -- CAIRO_DITHER_BEST --} cairo_dither_t; -- - cairo_public void - cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter); - + /** + * cairo_path_data_type_t: + * @CAIRO_PATH_MOVE_TO: A move-to operation, since 1.0 diff --git a/src/cairoint.h b/src/cairoint.h -index 80b695feb..a8442b5fe 100644 +index ddbbe7baa..0c94f1e02 100644 --- a/src/cairoint.h +++ b/src/cairoint.h -@@ -1592,6 +1592,11 @@ cairo_private cairo_bool_t +@@ -1610,6 +1610,12 @@ cairo_private cairo_bool_t _pixman_format_to_masks (pixman_format_code_t pixman_format, cairo_format_masks_t *masks); +#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) +cairo_private pixman_dither_t -+_pixman_dither_from_cairo_dither(cairo_dither_t dither); ++_pixman_dither_from_cairo_dither (cairo_dither_t dither); +#endif ++ + cairo_private void _cairo_image_scaled_glyph_fini (cairo_scaled_font_t *scaled_font, cairo_scaled_glyph_t *scaled_glyph); --- -2.25.1 - - -From edf60824e871d2393136303761135bb49986fa33 Mon Sep 17 00:00:00 2001 -From: Marc Jeanmougin -Date: Mon, 29 Mar 2021 12:18:56 +0200 -Subject: [PATCH 3/3] make lint tests pass - ---- - src/cairo-image-surface.c | 20 +++++++++++++++----- - src/cairo-pattern.c | 4 ++-- - src/cairoint.h | 4 +++- - 3 files changed, 20 insertions(+), 8 deletions(-) - -diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c -index 977bb48e6..d2f544a68 100644 ---- a/src/cairo-image-surface.c -+++ b/src/cairo-image-surface.c -@@ -250,8 +250,9 @@ _pixman_format_from_masks (cairo_format_masks_t *masks, - } - - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) --/* Convenience function to convert cairo_dither_t into pixman_dither_t */ --pixman_dither_t _pixman_dither_from_cairo_dither(cairo_dither_t dither) -+/* Convenience function to convert #cairo_dither_t into #pixman_dither_t */ -+pixman_dither_t -+_pixman_dither_from_cairo_dither (cairo_dither_t dither) - { - switch(dither) { - default: -@@ -659,7 +660,7 @@ slim_hidden_def (cairo_image_surface_get_width); - * - * Return value: the current dithering method. - * -- * Since: TODO -+ * Since: 1.18 - **/ - cairo_dither_t - cairo_image_surface_get_dither (cairo_surface_t *surface) -@@ -673,7 +674,7 @@ cairo_image_surface_get_dither (cairo_surface_t *surface) - - return image_surface->dither; - } --//slim_hidden_def (cairo_image_surface_get_dither); -+slim_hidden_def (cairo_image_surface_get_dither); - - /** - * cairo_image_surface_get_height: -@@ -1407,6 +1408,15 @@ error: - return to_image_surface (_cairo_surface_create_in_error (status)); - } - -+/** -+ * cairo_image_surface_set_dither: -+ * @surface: a #cairo_image_surface_t -+ * @dither: a #cairo_dither_t +diff --git a/test/dithergradient.c b/test/dithergradient.c +new file mode 100644 +index 000000000..26b76eab1 +--- /dev/null ++++ b/test/dithergradient.c +@@ -0,0 +1,53 @@ ++/* ++ * Copyright © 2023 Marc Jeanmougin + * -+ * Sets the current dithering method ++ * Permission to use, copy, modify, distribute, and sell this software ++ * and its documentation for any purpose is hereby granted without ++ * fee, provided that the above copyright notice appear in all copies ++ * and that both that copyright notice and this permission notice ++ * appear in supporting documentation, and that the name of ++ * Red Hat, Inc. not be used in advertising or publicity pertaining to ++ * distribution of the software without specific, written prior ++ * permission. Red Hat, Inc. makes no representations about the ++ * suitability of this software for any purpose. It is provided "as ++ * is" without express or implied warranty. + * -+ * Since: 1.18 -+ **/ - cairo_public int - cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) - { -@@ -1426,5 +1436,5 @@ cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) - } - - } --//slim_hidden_def (cairo_image_surface_set_dither); -+slim_hidden_def (cairo_image_surface_set_dither); - -diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c -index 6cf907f36..7d05b06a1 100644 ---- a/src/cairo-pattern.c -+++ b/src/cairo-pattern.c -@@ -2087,7 +2087,7 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) - * - * See #cairo_dither_t for details on each algorithm. - * -- * Since: TODO -+ * Since: 1.18 - **/ - void - cairo_pattern_set_dither (cairo_pattern_t *pattern, cairo_dither_t dither) -@@ -2128,7 +2128,7 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) - * - * Return value: the current dithering algorithm of the pattern - * -- * Since: TODO -+ * Since: 1.18 - **/ - cairo_dither_t - cairo_pattern_get_dither (cairo_pattern_t *pattern) -diff --git a/src/cairoint.h b/src/cairoint.h -index a8442b5fe..274d43556 100644 ---- a/src/cairoint.h -+++ b/src/cairoint.h -@@ -1594,7 +1594,7 @@ _pixman_format_to_masks (pixman_format_code_t pixman_format, - - #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) - cairo_private pixman_dither_t --_pixman_dither_from_cairo_dither(cairo_dither_t dither); -+_pixman_dither_from_cairo_dither (cairo_dither_t dither); - #endif - - cairo_private void -@@ -1982,6 +1982,8 @@ slim_hidden_proto (cairo_image_surface_get_format); - slim_hidden_proto (cairo_image_surface_get_height); - slim_hidden_proto (cairo_image_surface_get_stride); - slim_hidden_proto (cairo_image_surface_get_width); -+slim_hidden_proto (cairo_image_surface_get_dither); -+slim_hidden_proto (cairo_image_surface_set_dither); - slim_hidden_proto (cairo_line_to); - slim_hidden_proto (cairo_mask); - slim_hidden_proto (cairo_matrix_init); --- -2.25.1 ++ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS ++ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND ++ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL, ++ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ++ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION ++ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR ++ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * ++ * Author: Marc Jeanmougin ++ */ ++ ++#include "cairo-test.h" ++ ++/* History: ++ * ++ * 2023: v3 of a patch to use pixman dithering with cairo ++ */ ++static cairo_test_status_t ++draw (cairo_t *cr, int width, int height) ++{ ++ cairo_pattern_t *gradient = cairo_pattern_create_linear (0, 0, width, 0); ++ cairo_pattern_add_color_stop_rgba (gradient, 0., 25./255, 25./255, 25./255, 1.0); ++ cairo_pattern_add_color_stop_rgba (gradient, 1., 45./255, 45./255, 45./255, 1.0); ++ ++ cairo_set_source (cr, gradient); ++ cairo_set_dither (cr, CAIRO_DITHER_BEST); ++ cairo_paint (cr); ++ ++ cairo_pattern_destroy (gradient); ++ ++ return CAIRO_TEST_SUCCESS; ++} ++ ++CAIRO_TEST (dithergradient, ++ "Testing the creation of a dithered gradient (in argb32)", ++ "gradient, dither", /* keywords */ ++ NULL, /* requirements */ ++ 400, 100, ++ NULL, draw) +diff --git a/test/meson.build b/test/meson.build +index 1d76d5daa..68fcee4c1 100644 +--- a/test/meson.build ++++ b/test/meson.build +@@ -124,6 +124,7 @@ test_sources = [ + 'device-offset-fractional.c', + 'device-offset-positive.c', + 'device-offset-scale.c', ++ 'dithergradient.c', + 'error-setters.c', + 'extend-pad.c', + 'extend-pad-border.c', +diff --git a/test/reference/dithergradient.image.argb32.ref.png b/test/reference/dithergradient.image.argb32.ref.png +new file mode 100644 +index 0000000000000000000000000000000000000000..c44e123806d8f7ea7a85aaa5a8875f5c221c151b +GIT binary patch +literal 10442 +zcmV;*C^grKP)E_Ua!~d{eGXHGjm=%xilnZ(AWQ*X|LnYR223B9No3jw+t`UpWye8cE+0iTejceYRB-|{{2#v8hK() +zqH{lXsI8s?syRQ8Y&fZi^=B-7-a1DLY=M2k$Ho&2>04z9g<>EW#sPGVJU-V*k&}E* +zdXvYw~Yh!pwKPgxvC*9uLedj92bpn +zz8ERS0>5X7I05+9#?#5%y`B`5amXSE#m<0EJP__A6$!?s~|tp +zzhAL7G~_hx3qH~mxyJn5HgPUjmn9~5&Kv`)E*&=3EupU$>qesB +zinj0Iibx0mfafC%rD!iYo#eJVv^3oAQ*L#!C81`=ya+?5Ha7aD*_S=KT9l4e`GNCe +zr!BK@Iz<@K#yg+k-!FXD&NWds9(6;U;dKtVD)J=xDgG!)WqQnUYmd0vnA3Uz2~xUJV@xW-pvoM&V%pX +z@s8t<2Vx=B(_9r30Z);_Emyj05ZDIf%T(7T{NRME@y@5dVHX!o@)A~wXNWF>EO-4V +zEwR(KXQQ4EU6JJ2_y_yEAohUF2FZzaKnR +zlqlD?Vs0&KkuA1_ +zD}I-03vYG>&rhxeKMqV9EAU6U91{Av#k`QPm-b`8uls0M7tTMKEY4$Rou9X!MEG-A +zI{qi+CJlNA{Q7hJ%U=?n$BTl{XHLZJc0Fg#zFZzD@lokawG4VEK1m#a!UKLU6ff-; +z%i!JJebsbK=(MPpTKo9M@sg*mwjWENiejy+xdQ#Or22modpKmNTqW8Tp*D>H^ +zd?1_#_2!aX;la0!5ZrH19w)7BSnp`zBr@Q4_EqaPZX|o@w_GoK2)B0PTP%WD4x}B- +zaRoTkhJQ?}IHm`dF-81+V&djOhG0CoBs^yjxl^gR+H- +z_^D#PWz!!Z0Ni$s-gMEo=jURr^ZM4q%GEzOF{T#SFeut(tYge*#hq#w;oH94`Q@GJ +zegupdt3}UGAdeCn8zP(^_1TbUQ61K8*O59e^vC)4-`~S>gPpgadsntj7v6|tMqPcY +zEVQ~fAD=~tZFzvd_1pNtba%8~NSj?mx#N$ziN_$v+rSp +z!vBP7gzJo!LJ=+Qc#qOJoBEG_f; +zIsU!*O?TatAO){s!dH2qH6Q9*6m{Li=HYq8yl5KumEvXgaN3h~gK(%2uv^rajC>C+ +zc2ZfWk#;k9FS-^X%7=8RM%($Z={Wuf4|!aWO2s}YJ^XNkxZiZQF69)Ds{-qCnbc?d +z_iL=Aj@h9^h$Cxq-_v7Uv8TB_52BOU^M(oLJhptKQPagc`y2-{QKo4 +zRmZV6To5#hY0j1e&@r1PDTS@WhB1~}O7Vy>+Su?GbZOcrYfia>8yit$BsapBx_VQi +z_C*O!-oLJ8RcSU=R4f`Z=zzd8X6H%bx&inG+eHHWu~SEWUb~f4FtN0r^x+~uTK-`F +zhQCXw@sX@{X+1Un6X;&zeci7ftDl~qQPb_MiW|n;TL!aH%8l`;)VM}(xdMJK8fER4 +zgSaCwmGa1!JI^1HtD;mJx6)FQHDuq9o&@W1*&yCaBcTDtTrkro_)!9@WC@>7_wN_t +z&uhKl&j=cQ!cN-2^PV-_W3?Z(fwnN~jB#K66Xm;Hz6Y0PwNpJ0jV`s~dK#P2{;6hb +z>jtURff)3@@AS3r_t>nWb#=kOfE~5x?%fH89(FHiMVvX+8`=eczTQ{W5Ap9y|4nz$ +z3L+ZfmpyRw*xQzL91OZr7z<6P4vJ4Zd*F`$yA^@oS4NAS#G9`(*B^53MIEHSURrMW +zcg6rL;$Mb^>ffsC89Wegoi2y>ExORVC-Di!n-87%+5Ua`|Abqp-)%OM{6vjY4DfuW3*g^t +z_MsiLisQeH{Yd}vmxSji9)0>Wcv$iT0{7nS>(}-Eb)B2BsG`+lkY+0isBig#s`y)V +zmja6V?B_Z^ui|9JqTpmH*Lc&{ZQDleI^m9AOZX67PTp^9;dY+_xld3>90UEB>wn=H +zAHf2*mr|;+s+Jarq95tse-~EUj*7m)ZCXDFo{)tBdjqlPtjcKXMn6@)9NTT|f`5`B +zBTE{%VAcaFO4u(>>fC&%r|1&{`=Wf}My;#((N1)}%jR|c$`Av!ubqD&iLs}Oqm5CH +z^W1l-csSJfD&Kk*J2)qw$*zsN!fJXm6sXM<3h +zo+1pbu5)TmaDH?PX!YfCHG8%t7O1pwz1g~kG1^{;khEEhJEDDff6)~lMNkV?N$as; +zaOI=Q4!ae7$wSEXu&?Ql_iz5MgbM|J%oPxqWh*6P&D)RNMS3IDg|wGk@9R^v;a4y^mvjGC9u3=WznHyZBx~KcUi~@Y +z4L)~)e(F4H<`(`#{QK{pbXS_RUL3qv^0_Jn%aAk=s(?hNDZc(E!xK%b)fGQ@Z?GZg +zc{cBJQrD$tj=cGPJbPzkb{^<*RQxgdx#{62Cq&YusVl(odpXSy{O{|v6xHd#Mc6nI +zgY%C-uj`Uiibe+1kh{G>(e29kc>iAhq&wOMzdHEXgGywsmUhHQ;$}WkkQZ>GE(E$L +zBj(YW?Ry8qIGC|S9P@eozOF^r$_^M?z;{+tC-BGE1^JjR6-Enp-DA!9lo$Tb)nK|&UWy-giZ^z`N +z&jP|8Y1I{g<8S50To$*?KB*7(?-!1G0hqAijuXZhZaxQVRA-K+q_($40eb1uR8d@@4!QN#dXLhaJ +zy69!kKpj(8I@o=!#0bf{GG5o`N&^X0ID9)A*T1e> +z%^WXRy9@Pspby>8{}BK3mxS+M*Vss+t78MWABkv0Hx|Y;H$pK)4CgyG4OE!ei~PP7x}oh#7??!yg&Nucv(NEq$W)+CA@zpFue +zzr{Q((@02x5%$4h%pa#-Y#cXZHIKOa$KwUlOqqY<< +zzq4_CLp1=qn4-`lm{@UH(9j(89jy{EVDD%n2*+m83?uAK(G}J-#)=U~J?lqq$R=h_ +z<+T<`w>3T2IWCe$wh!|!|A}N!12OI6fm=ZO(kc#s);3@jpDW4p;HF+4;w4&}2R}R< +z`;EH;$=kBSr@tquC=RTfMv-F!;qmevt@o$Q*C8Q~_7eMbl0Cyh_1K8dpxbW62%@CX +zop&A8tLnPl?Aq7o`Imo}@GZX`bMENlWv=Xl*11Z}-R01gRy>Ztc=I_VsN+%CjVz^g +zQBtdWFf0Du37SW3;JS<%^qZX~|h!@PxFhtVYoU8sn*uVK7@Y6(3F0hI5?7ILN{O}&@+xoA`2X!+{_`@v-TkLu@liA7TWG7Lj}bi6S_Z9kw)^?{E&K>nY%MT`++J>{^Y(y@ +zPox70v_M{ak0Vrr?b~L(_t=^r*6I;|OoIFv>n(<813e#kj%}i7Y*0VdIr`(F4M;mW +zMZwaoBR<~0|Nf@CZ#Z3b%behx)2D-W3C>kF8a|2l$d|rQz>a(wKN?3}ZQPCR_#Fp(7V9ptXt_1(W^OMcDwozIt~`muduRsD@C5&)nL2)))C;JN34wWE +z91F0W;rRjn{hH*21NS8>6F~K?>*-)>PKX(n!ybEpMZgPFelxCyHseKZD(N$ +ze&7~AsE8jeXj>rqbvHV4?bPShtT-mQ#!owdLC>9@Pm~KAzF5fAHW&Q3?>kEY?^YV~ +zkplY+|6cwamOmC+z2*lUYIKo{c=5SPZK26Wd!`%NId7o`)x@o!M>M2wwFM7!Il45F +zN-s6`!K^EzHH(elD`P1-HW8<2DGEX3fFj>{9&yorUctcUkWK7YM}rV=WN%r~It(ug +zilAiQLGi_B`}aS8{q>jkKUr`?r)>*06sR*LG`1F+<181&R@+-q@$8gNa{%7M@$$<+1P2(!+LCKbm!xVEbiEu}W;& +z>w*g9w)w%Q{|~&#lCP5Z^L5?PUJF`+q?NtcKDg3^I=fgdw*Qg-{W?_@F4mjdZ@09z +z=OK|SEsFl1KR+AJ-G{&i`|T#wlW4q^*37;*JYhrLXnZ)D$ad=&>QR=|Kg~if*~kx9 +zbL>Uw+A%})u#n=9f%y5lK2chDl);`h_Ui&rZAaKY$G=~vn9f*bf%{8UAZxoh&Iy)K +z_I=l)sJ75LUofNYDSF%TJ3T^|qDU3-dp4Zcijz#TS4Ro$!r4}4006vAQZ^*6OW9K` +zbDl@@(IFG#|}TNm1UOFqV-?$(hJdzGK#U;a5Pu;9Tl5gLO-h>abgqL)UM +zlQW7knqRv{W=z)Afd)q{AB-_s+A9OucaEZ8rQl{^h@i +zHKvk_l{@wDLc20-#Hm08T-Q1dPRMq+8Eui||52NIgqqQ2c)zq(=o8*9QdfM=9$ +zfj`8*;eSE_AC3%o=NC7zp%+QbRn~C+5{|Bvve)`B^gC{b))!uAw&?t*5*-rgb^c@5 +z3UY+E*eqbjb>mRS7>)@~FH!nYPSB_$nKXCJ+|(F#s4aWQzGpEY%%w4gy80sS4&P|5 +z5brKx{%rq#A>Q|5>^9Cx4>bQc2n<-6YD?NViXXw!4X_I+n%OV-(+#P|Jn$u#vga>6 +zaEx$ZSO7!H8tYV_K;LxQ#SVLfQZ*#Z883)F>M(8)sL|WJ1>EYo-t;xBd+Y-r`GPnv +zbcutpTdqFdzyJNq&%g@G6rA@E=j{@2TOiVeC?|AJGFOMRC@qTc+oE6z6Vf5w0+=+j +z+w=MpPIyu@;z#}^MA1e|Xp%Ve+j2|SyZKw%rpXqyB>xt@igVZ1;$(cf%n&I74Jf2`swy90Ya28@@zU-3za0{uLWpWPwTpvU2fu)UvLUZ!Kw8~b>Y^>* +zQ#vf~Xh9C1byBw;#uEY)+_{R&@%E|UdsYJh+s&qIE +z#=5a(tp!oWy6$1%Szu$csA-offPG?pj;$ijpjj1joQMXV@aM5(n*2Qfe)-3c!u$F- +zUHa5d0XME#uyYPzPfu4QlDy=Bb}+;Y*beYR1m+h?j|nC2l=E7Js5;ZwwgMDC_T40X +zU^ijJe%@g#nM#!MyvxpegkG23fjNSr-Al(jjmg&X2)#)7a5|CyrIx-`Zrd3o`3e5z +zerRrzxeqW%=m1<*Xex$itucu>Z+Z+3;$|bN +z)r}h=2CBBSW#u_ukUoU&>j1GHh!#8wE3(nJaHYVY|7B6SXdz%Ptw~(}c)KiFRR2`} +zenq}C1qQRfjsD)A0bWCShBZL +zZX;HOVTeFG*BR;0rK!0}8U0TBZs@VTbWnYw^ +z>F$-{AdwO1_x&1GGNyP{hP%sC%~f8mOCWd6sR!WL=tD)`bh8-PeH*(*9(Q1*$Vt{U +ziYf>Ht(W5Niy;xMc75x7XC@jo4mU2H*pWYb^bGW`+HSo!F|_@QlVI4l0AP)lPx@WZ6RU_udd+c;1U3f%&ps~Y0+YG4$@anT6pi;-e1 +z@Oy@c6M%1RJe|zlOWGYY-7?4g8i+lz)K$g~QEsHzG7jL*LX-mb!L_Kl3i2cU8~z;D +zn1-CDeZfbXBG;Io+a`_&6}9`&8M$r%fRq?yJg8rL@2cE;BEr6{A8LNCoz( +z{=NK?&~>19;XsU`IFV%!r<2@vhn9xheafvawj|W-m=|H_)W$}?H2bngSBuiIDnD?3?6hU} +zO{WMW+IZ(P{QHH^+PNmm#-ncNxGB*O@+e=9&}(_--9^6F^`oe4Bv)WBd;Y}r0n_4V +z>Bz%h|%l6WBENAD<# +z!%bIF?f&y4{Tu#G_v2U$qrr`6;H4%GU+~)e+nz0v?&v+2h2ud&m-TLbcy%6p_l|cQ +ze>@Nish;MlmJ{mz-g2oQT#THR;DIZi@4|1-f}uhi&PMxoCu_bF;M! +zGI0z!WBXA4Q6p5n#D2Da|NGCue})QD<&Rr5FK8V>)rim~&C|2EJ8jBK$bT=Bb1 +zTX?f8cz$v%_;Fy;Sb;y%<&e-@a+B*LG|((ykj +zH)+s2;MbqyU;dKtJYE!pK64^&x9d4`_T}iQ1@pz?yII_LZ?N&)Y`{4j+Z=jwf$HEUA*Li7Jd4Sfw_vO5rQ@qbEL>i=r%+P +zv)W-~O!51|?Z%0V5-XrJt1aVZ1N;a1H~bUHi_?~>?lFiGY5ja-xe>kZg}IIaC*uR* +zG^jV19b6vL&t3nyk`EgEI7K(Vcv|n9+(m)h@!feYx|?JJtON +z7%^6ho}WM-B{VifI6vyMAGTFusNV +z3DpSK87+k(THNs@Kg7SUzyJPwWFF^ZAITFnYZCPKU2*Kr_nsU6C*>U8!_rflJxO#P +zx8FgY;P**+ttD!y{(R$1BCWY7Mvc++1ph9urRbAKcN|uf;&W+DV)#~{P5-wcll1dp +z{>^`va2I#GiKv4E!`^Y@jyo+H;JF%5>m|REdjGmk={-D}Rtaq6oaCoE+|t-sGHWUa +zjHuVIYu1Uh44`_^C8AEJTH3=w#iXGx__3H&63$!PV({%b;2R`zZJfAA1+J4iX<<9d*l|%`#m|92|_zpsoIJBc@6 +zXRbfw+>1I$f4#Ka@b8QPSj4{!3)R0>*E4t^-a1_l?^|@CcTeIIj5i-T@w5GVSy(_E +zxxQTi|3^&&0~%<7BetKS%iHSuHV$A%{%}ImJH2K23GxOw`Vja%a8Yxc^23e!-DV@n +zPt-WY0MBQ-0RFvZAKF2yIR4w%kMu8pNqCOp(Wg&?hb2!SaPQr|eqHZh*SQ&sDq1}T +zX||$(`j#)KioaENDWIs&ey;QLDo$oB3Qm@CjW>PWwr$j|6Ylu6gb&f>{uiF{5iD?fDWw{#YH5Ke`jP(qcVV^dsOTHqruBp130WAhHxP@?s*JX7 +z^i$=_vE9Zl_$L`MvZR3vW<8*yg#F^A&dqmvias&0FUluw)Vhiv?L_ChY+l!|3^7pq +z+W7~P7<;NX+8E_H&wZDQheM68@~vmFgLCpp{tf@UjQ6$-X-pH*JWy&(t^;;)w+;Qe +zel>W@gC$0JHVCEZDZqDtveu33)t?jI;Byz~r_QrxZs9+~zyJP8ccn?|#ld?epQ}=^3`z5#3P^OC;_H7h +zJkhjTUGanW1{;E&XY)QMbzOSq$eZuSvv)>j=YcLq#UGQOn;w30LL^O^x&j=(m(%>f +z|Gr*JQJoH4gpCt1IR6Orx-L1TXkyQtLZFK>Vji8@zIQN;gBeT2F`w7(>soZJ?0~Tad}lRv0)LEMkdNt7VYG19 +zJ=UC0dEx(D4R*`p(|NM*P83v%3{n5FP}>5~zgzuwxF7G|@Ry$v>^6(I8z5|f$dP)+ +z_1A1LCY`x@X}1uPqXiJ>v2jhn|FLuvt7B`TjCUZNSi+UzjWodeHWKRw_M0%U7F`HY +zNx+0trhJ?Ec1&LSEFkQWR$T!&{#I_xWpT^wllox)e&MJWfC(G!SR1d~sGy0Mq{U)u +z#6`1#9zkXd)yyQ{(+5tDJZ#!z5{0aW$A8SzI#@Ej;rC^@~1dT#_Y*ZUoz*4j& +zU&gOd?!a4Jo)Dkw?Q~VIZK&=yjdl6@0*a+If7><9!zyB5a6mZ5gC28+7Z0B#Z~2&@!N++tD>XYA1o*x +zm$Y91cAOCX;QT~9Pe#>54E#HIY=LvL9UhayqzOizA=$TFexQ-y)A1F#uXs(UQf?mh +zw2r6koslOBc9ydjpAB)p+-}&W|A=tu4);IFzh6H1qbHOH5kBnSSfw70TJ6EoC{~?C +zXQFyrAGhszX4lHCi(d8&)KNv);7ye=#SFOV!a}pn1CGRZSz}D6gWcCkjF7A=<8^(m +zG>|}r!?&Yx{p+gL%<*!yyHKA8`q2IS5AiR5N%;PCjg2I_IyQj&k%&fgV_{5lBNRi# +zaK2;HK*ibk^-lHhDfhZQD8|Md-zt9Gci64*=g9r7m%i;`GCGODaoxiFPFb_WT)Ex}Y9KvT%+_X% +z^9v^k)YWr7YD)q0I~&J0R0FV!DGEJ;i4~Ux4b4H{(JB!G_Kr4!aBLRMFv8vxU13dQ +ztQc|Bvwq};Y-09QUTcwbThnu$<05Hf`!N6hFY1nVbE -Date: Mon, 24 Jan 2022 21:28:44 +0100 -Subject: [PATCH] add define to detect patched cairo +diff --git a/test/reference/dithergradient.image.rgb24.ref.png b/test/reference/dithergradient.image.rgb24.ref.png +new file mode 100644 +index 0000000000000000000000000000000000000000..c44e123806d8f7ea7a85aaa5a8875f5c221c151b +GIT binary patch +literal 10442 +zcmV;*C^grKP)E_Ua!~d{eGXHGjm=%xilnZ(AWQ*X|LnYR223B9No3jw+t`UpWye8cE+0iTejceYRB-|{{2#v8hK() +zqH{lXsI8s?syRQ8Y&fZi^=B-7-a1DLY=M2k$Ho&2>04z9g<>EW#sPGVJU-V*k&}E* +zdXvYw~Yh!pwKPgxvC*9uLedj92bpn +zz8ERS0>5X7I05+9#?#5%y`B`5amXSE#m<0EJP__A6$!?s~|tp +zzhAL7G~_hx3qH~mxyJn5HgPUjmn9~5&Kv`)E*&=3EupU$>qesB +zinj0Iibx0mfafC%rD!iYo#eJVv^3oAQ*L#!C81`=ya+?5Ha7aD*_S=KT9l4e`GNCe +zr!BK@Iz<@K#yg+k-!FXD&NWds9(6;U;dKtVD)J=xDgG!)WqQnUYmd0vnA3Uz2~xUJV@xW-pvoM&V%pX +z@s8t<2Vx=B(_9r30Z);_Emyj05ZDIf%T(7T{NRME@y@5dVHX!o@)A~wXNWF>EO-4V +zEwR(KXQQ4EU6JJ2_y_yEAohUF2FZzaKnR +zlqlD?Vs0&KkuA1_ +zD}I-03vYG>&rhxeKMqV9EAU6U91{Av#k`QPm-b`8uls0M7tTMKEY4$Rou9X!MEG-A +zI{qi+CJlNA{Q7hJ%U=?n$BTl{XHLZJc0Fg#zFZzD@lokawG4VEK1m#a!UKLU6ff-; +z%i!JJebsbK=(MPpTKo9M@sg*mwjWENiejy+xdQ#Or22modpKmNTqW8Tp*D>H^ +zd?1_#_2!aX;la0!5ZrH19w)7BSnp`zBr@Q4_EqaPZX|o@w_GoK2)B0PTP%WD4x}B- +zaRoTkhJQ?}IHm`dF-81+V&djOhG0CoBs^yjxl^gR+H- +z_^D#PWz!!Z0Ni$s-gMEo=jURr^ZM4q%GEzOF{T#SFeut(tYge*#hq#w;oH94`Q@GJ +zegupdt3}UGAdeCn8zP(^_1TbUQ61K8*O59e^vC)4-`~S>gPpgadsntj7v6|tMqPcY +zEVQ~fAD=~tZFzvd_1pNtba%8~NSj?mx#N$ziN_$v+rSp +z!vBP7gzJo!LJ=+Qc#qOJoBEG_f; +zIsU!*O?TatAO){s!dH2qH6Q9*6m{Li=HYq8yl5KumEvXgaN3h~gK(%2uv^rajC>C+ +zc2ZfWk#;k9FS-^X%7=8RM%($Z={Wuf4|!aWO2s}YJ^XNkxZiZQF69)Ds{-qCnbc?d +z_iL=Aj@h9^h$Cxq-_v7Uv8TB_52BOU^M(oLJhptKQPagc`y2-{QKo4 +zRmZV6To5#hY0j1e&@r1PDTS@WhB1~}O7Vy>+Su?GbZOcrYfia>8yit$BsapBx_VQi +z_C*O!-oLJ8RcSU=R4f`Z=zzd8X6H%bx&inG+eHHWu~SEWUb~f4FtN0r^x+~uTK-`F +zhQCXw@sX@{X+1Un6X;&zeci7ftDl~qQPb_MiW|n;TL!aH%8l`;)VM}(xdMJK8fER4 +zgSaCwmGa1!JI^1HtD;mJx6)FQHDuq9o&@W1*&yCaBcTDtTrkro_)!9@WC@>7_wN_t +z&uhKl&j=cQ!cN-2^PV-_W3?Z(fwnN~jB#K66Xm;Hz6Y0PwNpJ0jV`s~dK#P2{;6hb +z>jtURff)3@@AS3r_t>nWb#=kOfE~5x?%fH89(FHiMVvX+8`=eczTQ{W5Ap9y|4nz$ +z3L+ZfmpyRw*xQzL91OZr7z<6P4vJ4Zd*F`$yA^@oS4NAS#G9`(*B^53MIEHSURrMW +zcg6rL;$Mb^>ffsC89Wegoi2y>ExORVC-Di!n-87%+5Ua`|Abqp-)%OM{6vjY4DfuW3*g^t +z_MsiLisQeH{Yd}vmxSji9)0>Wcv$iT0{7nS>(}-Eb)B2BsG`+lkY+0isBig#s`y)V +zmja6V?B_Z^ui|9JqTpmH*Lc&{ZQDleI^m9AOZX67PTp^9;dY+_xld3>90UEB>wn=H +zAHf2*mr|;+s+Jarq95tse-~EUj*7m)ZCXDFo{)tBdjqlPtjcKXMn6@)9NTT|f`5`B +zBTE{%VAcaFO4u(>>fC&%r|1&{`=Wf}My;#((N1)}%jR|c$`Av!ubqD&iLs}Oqm5CH +z^W1l-csSJfD&Kk*J2)qw$*zsN!fJXm6sXM<3h +zo+1pbu5)TmaDH?PX!YfCHG8%t7O1pwz1g~kG1^{;khEEhJEDDff6)~lMNkV?N$as; +zaOI=Q4!ae7$wSEXu&?Ql_iz5MgbM|J%oPxqWh*6P&D)RNMS3IDg|wGk@9R^v;a4y^mvjGC9u3=WznHyZBx~KcUi~@Y +z4L)~)e(F4H<`(`#{QK{pbXS_RUL3qv^0_Jn%aAk=s(?hNDZc(E!xK%b)fGQ@Z?GZg +zc{cBJQrD$tj=cGPJbPzkb{^<*RQxgdx#{62Cq&YusVl(odpXSy{O{|v6xHd#Mc6nI +zgY%C-uj`Uiibe+1kh{G>(e29kc>iAhq&wOMzdHEXgGywsmUhHQ;$}WkkQZ>GE(E$L +zBj(YW?Ry8qIGC|S9P@eozOF^r$_^M?z;{+tC-BGE1^JjR6-Enp-DA!9lo$Tb)nK|&UWy-giZ^z`N +z&jP|8Y1I{g<8S50To$*?KB*7(?-!1G0hqAijuXZhZaxQVRA-K+q_($40eb1uR8d@@4!QN#dXLhaJ +zy69!kKpj(8I@o=!#0bf{GG5o`N&^X0ID9)A*T1e> +z%^WXRy9@Pspby>8{}BK3mxS+M*Vss+t78MWABkv0Hx|Y;H$pK)4CgyG4OE!ei~PP7x}oh#7??!yg&Nucv(NEq$W)+CA@zpFue +zzr{Q((@02x5%$4h%pa#-Y#cXZHIKOa$KwUlOqqY<< +zzq4_CLp1=qn4-`lm{@UH(9j(89jy{EVDD%n2*+m83?uAK(G}J-#)=U~J?lqq$R=h_ +z<+T<`w>3T2IWCe$wh!|!|A}N!12OI6fm=ZO(kc#s);3@jpDW4p;HF+4;w4&}2R}R< +z`;EH;$=kBSr@tquC=RTfMv-F!;qmevt@o$Q*C8Q~_7eMbl0Cyh_1K8dpxbW62%@CX +zop&A8tLnPl?Aq7o`Imo}@GZX`bMENlWv=Xl*11Z}-R01gRy>Ztc=I_VsN+%CjVz^g +zQBtdWFf0Du37SW3;JS<%^qZX~|h!@PxFhtVYoU8sn*uVK7@Y6(3F0hI5?7ILN{O}&@+xoA`2X!+{_`@v-TkLu@liA7TWG7Lj}bi6S_Z9kw)^?{E&K>nY%MT`++J>{^Y(y@ +zPox70v_M{ak0Vrr?b~L(_t=^r*6I;|OoIFv>n(<813e#kj%}i7Y*0VdIr`(F4M;mW +zMZwaoBR<~0|Nf@CZ#Z3b%behx)2D-W3C>kF8a|2l$d|rQz>a(wKN?3}ZQPCR_#Fp(7V9ptXt_1(W^OMcDwozIt~`muduRsD@C5&)nL2)))C;JN34wWE +z91F0W;rRjn{hH*21NS8>6F~K?>*-)>PKX(n!ybEpMZgPFelxCyHseKZD(N$ +ze&7~AsE8jeXj>rqbvHV4?bPShtT-mQ#!owdLC>9@Pm~KAzF5fAHW&Q3?>kEY?^YV~ +zkplY+|6cwamOmC+z2*lUYIKo{c=5SPZK26Wd!`%NId7o`)x@o!M>M2wwFM7!Il45F +zN-s6`!K^EzHH(elD`P1-HW8<2DGEX3fFj>{9&yorUctcUkWK7YM}rV=WN%r~It(ug +zilAiQLGi_B`}aS8{q>jkKUr`?r)>*06sR*LG`1F+<181&R@+-q@$8gNa{%7M@$$<+1P2(!+LCKbm!xVEbiEu}W;& +z>w*g9w)w%Q{|~&#lCP5Z^L5?PUJF`+q?NtcKDg3^I=fgdw*Qg-{W?_@F4mjdZ@09z +z=OK|SEsFl1KR+AJ-G{&i`|T#wlW4q^*37;*JYhrLXnZ)D$ad=&>QR=|Kg~if*~kx9 +zbL>Uw+A%})u#n=9f%y5lK2chDl);`h_Ui&rZAaKY$G=~vn9f*bf%{8UAZxoh&Iy)K +z_I=l)sJ75LUofNYDSF%TJ3T^|qDU3-dp4Zcijz#TS4Ro$!r4}4006vAQZ^*6OW9K` +zbDl@@(IFG#|}TNm1UOFqV-?$(hJdzGK#U;a5Pu;9Tl5gLO-h>abgqL)UM +zlQW7knqRv{W=z)Afd)q{AB-_s+A9OucaEZ8rQl{^h@i +zHKvk_l{@wDLc20-#Hm08T-Q1dPRMq+8Eui||52NIgqqQ2c)zq(=o8*9QdfM=9$ +zfj`8*;eSE_AC3%o=NC7zp%+QbRn~C+5{|Bvve)`B^gC{b))!uAw&?t*5*-rgb^c@5 +z3UY+E*eqbjb>mRS7>)@~FH!nYPSB_$nKXCJ+|(F#s4aWQzGpEY%%w4gy80sS4&P|5 +z5brKx{%rq#A>Q|5>^9Cx4>bQc2n<-6YD?NViXXw!4X_I+n%OV-(+#P|Jn$u#vga>6 +zaEx$ZSO7!H8tYV_K;LxQ#SVLfQZ*#Z883)F>M(8)sL|WJ1>EYo-t;xBd+Y-r`GPnv +zbcutpTdqFdzyJNq&%g@G6rA@E=j{@2TOiVeC?|AJGFOMRC@qTc+oE6z6Vf5w0+=+j +z+w=MpPIyu@;z#}^MA1e|Xp%Ve+j2|SyZKw%rpXqyB>xt@igVZ1;$(cf%n&I74Jf2`swy90Ya28@@zU-3za0{uLWpWPwTpvU2fu)UvLUZ!Kw8~b>Y^>* +zQ#vf~Xh9C1byBw;#uEY)+_{R&@%E|UdsYJh+s&qIE +z#=5a(tp!oWy6$1%Szu$csA-offPG?pj;$ijpjj1joQMXV@aM5(n*2Qfe)-3c!u$F- +zUHa5d0XME#uyYPzPfu4QlDy=Bb}+;Y*beYR1m+h?j|nC2l=E7Js5;ZwwgMDC_T40X +zU^ijJe%@g#nM#!MyvxpegkG23fjNSr-Al(jjmg&X2)#)7a5|CyrIx-`Zrd3o`3e5z +zerRrzxeqW%=m1<*Xex$itucu>Z+Z+3;$|bN +z)r}h=2CBBSW#u_ukUoU&>j1GHh!#8wE3(nJaHYVY|7B6SXdz%Ptw~(}c)KiFRR2`} +zenq}C1qQRfjsD)A0bWCShBZL +zZX;HOVTeFG*BR;0rK!0}8U0TBZs@VTbWnYw^ +z>F$-{AdwO1_x&1GGNyP{hP%sC%~f8mOCWd6sR!WL=tD)`bh8-PeH*(*9(Q1*$Vt{U +ziYf>Ht(W5Niy;xMc75x7XC@jo4mU2H*pWYb^bGW`+HSo!F|_@QlVI4l0AP)lPx@WZ6RU_udd+c;1U3f%&ps~Y0+YG4$@anT6pi;-e1 +z@Oy@c6M%1RJe|zlOWGYY-7?4g8i+lz)K$g~QEsHzG7jL*LX-mb!L_Kl3i2cU8~z;D +zn1-CDeZfbXBG;Io+a`_&6}9`&8M$r%fRq?yJg8rL@2cE;BEr6{A8LNCoz( +z{=NK?&~>19;XsU`IFV%!r<2@vhn9xheafvawj|W-m=|H_)W$}?H2bngSBuiIDnD?3?6hU} +zO{WMW+IZ(P{QHH^+PNmm#-ncNxGB*O@+e=9&}(_--9^6F^`oe4Bv)WBd;Y}r0n_4V +z>Bz%h|%l6WBENAD<# +z!%bIF?f&y4{Tu#G_v2U$qrr`6;H4%GU+~)e+nz0v?&v+2h2ud&m-TLbcy%6p_l|cQ +ze>@Nish;MlmJ{mz-g2oQT#THR;DIZi@4|1-f}uhi&PMxoCu_bF;M! +zGI0z!WBXA4Q6p5n#D2Da|NGCue})QD<&Rr5FK8V>)rim~&C|2EJ8jBK$bT=Bb1 +zTX?f8cz$v%_;Fy;Sb;y%<&e-@a+B*LG|((ykj +zH)+s2;MbqyU;dKtJYE!pK64^&x9d4`_T}iQ1@pz?yII_LZ?N&)Y`{4j+Z=jwf$HEUA*Li7Jd4Sfw_vO5rQ@qbEL>i=r%+P +zv)W-~O!51|?Z%0V5-XrJt1aVZ1N;a1H~bUHi_?~>?lFiGY5ja-xe>kZg}IIaC*uR* +zG^jV19b6vL&t3nyk`EgEI7K(Vcv|n9+(m)h@!feYx|?JJtON +z7%^6ho}WM-B{VifI6vyMAGTFusNV +z3DpSK87+k(THNs@Kg7SUzyJPwWFF^ZAITFnYZCPKU2*Kr_nsU6C*>U8!_rflJxO#P +zx8FgY;P**+ttD!y{(R$1BCWY7Mvc++1ph9urRbAKcN|uf;&W+DV)#~{P5-wcll1dp +z{>^`va2I#GiKv4E!`^Y@jyo+H;JF%5>m|REdjGmk={-D}Rtaq6oaCoE+|t-sGHWUa +zjHuVIYu1Uh44`_^C8AEJTH3=w#iXGx__3H&63$!PV({%b;2R`zZJfAA1+J4iX<<9d*l|%`#m|92|_zpsoIJBc@6 +zXRbfw+>1I$f4#Ka@b8QPSj4{!3)R0>*E4t^-a1_l?^|@CcTeIIj5i-T@w5GVSy(_E +zxxQTi|3^&&0~%<7BetKS%iHSuHV$A%{%}ImJH2K23GxOw`Vja%a8Yxc^23e!-DV@n +zPt-WY0MBQ-0RFvZAKF2yIR4w%kMu8pNqCOp(Wg&?hb2!SaPQr|eqHZh*SQ&sDq1}T +zX||$(`j#)KioaENDWIs&ey;QLDo$oB3Qm@CjW>PWwr$j|6Ylu6gb&f>{uiF{5iD?fDWw{#YH5Ke`jP(qcVV^dsOTHqruBp130WAhHxP@?s*JX7 +z^i$=_vE9Zl_$L`MvZR3vW<8*yg#F^A&dqmvias&0FUluw)Vhiv?L_ChY+l!|3^7pq +z+W7~P7<;NX+8E_H&wZDQheM68@~vmFgLCpp{tf@UjQ6$-X-pH*JWy&(t^;;)w+;Qe +zel>W@gC$0JHVCEZDZqDtveu33)t?jI;Byz~r_QrxZs9+~zyJP8ccn?|#ld?epQ}=^3`z5#3P^OC;_H7h +zJkhjTUGanW1{;E&XY)QMbzOSq$eZuSvv)>j=YcLq#UGQOn;w30LL^O^x&j=(m(%>f +z|Gr*JQJoH4gpCt1IR6Orx-L1TXkyQtLZFK>Vji8@zIQN;gBeT2F`w7(>soZJ?0~Tad}lRv0)LEMkdNt7VYG19 +zJ=UC0dEx(D4R*`p(|NM*P83v%3{n5FP}>5~zgzuwxF7G|@Ry$v>^6(I8z5|f$dP)+ +z_1A1LCY`x@X}1uPqXiJ>v2jhn|FLuvt7B`TjCUZNSi+UzjWodeHWKRw_M0%U7F`HY +zNx+0trhJ?Ec1&LSEFkQWR$T!&{#I_xWpT^wllox)e&MJWfC(G!SR1d~sGy0Mq{U)u +z#6`1#9zkXd)yyQ{(+5tDJZ#!z5{0aW$A8SzI#@Ej;rC^@~1dT#_Y*ZUoz*4j& +zU&gOd?!a4Jo)Dkw?Q~VIZK&=yjdl6@0*a+If7><9!zyB5a6mZ5gC28+7Z0B#Z~2&@!N++tD>XYA1o*x +zm$Y91cAOCX;QT~9Pe#>54E#HIY=LvL9UhayqzOizA=$TFexQ-y)A1F#uXs(UQf?mh +zw2r6koslOBc9ydjpAB)p+-}&W|A=tu4);IFzh6H1qbHOH5kBnSSfw70TJ6EoC{~?C +zXQFyrAGhszX4lHCi(d8&)KNv);7ye=#SFOV!a}pn1CGRZSz}D6gWcCkjF7A=<8^(m +zG>|}r!?&Yx{p+gL%<*!yyHKA8`q2IS5AiR5N%;PCjg2I_IyQj&k%&fgV_{5lBNRi# +zaK2;HK*ibk^-lHhDfhZQD8|Md-zt9Gci64*=g9r7m%i;`GCGODaoxiFPFb_WT)Ex}Y9KvT%+_X% +z^9v^k)YWr7YD)q0I~&J0R0FV!DGEJ;i4~Ux4b4H{(JB!G_Kr4!aBLRMFv8vxU13dQ +ztQc|Bvwq};Y-09QUTcwbThnu$<05Hf`!N6hFY1nVbE