diff --git a/bindings/python/mapnik_shield_symbolizer.cpp b/bindings/python/mapnik_shield_symbolizer.cpp index 28ae7083e..8a08900bb 100644 --- a/bindings/python/mapnik_shield_symbolizer.cpp +++ b/bindings/python/mapnik_shield_symbolizer.cpp @@ -21,6 +21,13 @@ * *****************************************************************************/ +/* The functions in this file produce deprecation warnings. + * But as shield symbolizer doesn't fully support more than one + * placement from python yet these functions are actually the + * correct ones. + */ +#define NO_DEPRECATION_WARNINGS + // boost #include @@ -53,12 +60,13 @@ tuple get_shield_displacement(const shield_symbolizer& s) void set_shield_displacement(shield_symbolizer & s, boost::python::tuple arg) { - s.set_shield_displacement(extract(arg[0]),extract(arg[1])); + s.get_placement_options()->defaults.displacement.first = extract(arg[0]); + s.get_placement_options()->defaults.displacement.second = extract(arg[1]); } tuple get_text_displacement(const shield_symbolizer& t) { - position const& pos = t.get_displacement(); + position const& pos = t.get_placement_options()->defaults.displacement; return boost::python::make_tuple(pos.first, pos.second); } @@ -79,46 +87,6 @@ void set_filename(shield_symbolizer & t, std::string const& file_expr) } -struct shield_symbolizer_pickle_suite : boost::python::pickle_suite -{ - static boost::python::tuple - getinitargs(const shield_symbolizer& s) - { - std::string filename = path_processor_type::to_string(*s.get_filename()); - //(name, font name, font size, font color, image file, image type, width, height) - return boost::python::make_tuple( "TODO",//s.get_name(), - s.get_face_name(),s.get_text_size(),s.get_fill(),filename,guess_type(filename)); - - } - - static boost::python::tuple - getstate(const shield_symbolizer& s) - { - return boost::python::make_tuple(s.get_halo_fill(),s.get_halo_radius()); - } - - // TODO add lots more... - static void - setstate (shield_symbolizer& s, boost::python::tuple state) - { - using namespace boost::python; - /*if (len(state) != 1) - { - PyErr_SetObject(PyExc_ValueError, - ("expected 1-item tuple in call to __setstate__; got %s" - % state).ptr() - ); - throw_error_already_set(); - }*/ - - s.set_halo_fill(extract(state[0])); - s.set_halo_radius(extract(state[1])); - - } - -}; - - void export_shield_symbolizer() { using namespace boost::python; @@ -126,7 +94,7 @@ void export_shield_symbolizer() init("TODO") + path_expression_ptr>() ) //.def_pickle(shield_symbolizer_pickle_suite()) .add_property("allow_overlap", diff --git a/include/mapnik/text_symbolizer.hpp b/include/mapnik/text_symbolizer.hpp index 05a9c2a39..1824f62fe 100644 --- a/include/mapnik/text_symbolizer.hpp +++ b/include/mapnik/text_symbolizer.hpp @@ -37,7 +37,7 @@ // stl #include -#if (1 && __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#if (!defined(NO_DEPRECATION_WARNINGS) && __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) #define func_deprecated __attribute__ ((deprecated)) #else #define func_deprecated