Merge commit 'eb15d0bd8a9a748b2381c9e09575a98f3c5861f5' into harfbuzz

This commit is contained in:
Hermann Kraus 2013-03-16 15:11:12 +01:00
commit 2735b47bd3
7 changed files with 26 additions and 23 deletions

View file

@ -40,8 +40,6 @@
namespace mapnik { namespace mapnik {
typedef MAPNIK_DECL boost::shared_ptr<Feature> feature_ptr;
struct MAPNIK_DECL Featureset : private mapnik::noncopyable struct MAPNIK_DECL Featureset : private mapnik::noncopyable
{ {
virtual feature_ptr next() = 0; virtual feature_ptr next() = 0;

View file

@ -313,6 +313,8 @@ inline std::ostream& operator<< (std::ostream & out,feature_impl const& f)
typedef feature_impl Feature; typedef feature_impl Feature;
typedef MAPNIK_DECL boost::shared_ptr<Feature> feature_ptr;
} }
#endif // MAPNIK_FEATURE_HPP #endif // MAPNIK_FEATURE_HPP

View file

@ -26,8 +26,8 @@
// mapnik // mapnik
#include <mapnik/config.hpp> #include <mapnik/config.hpp>
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include <mapnik/datasource.hpp>
#include <mapnik/noncopyable.hpp> #include <mapnik/noncopyable.hpp>
#include <mapnik/unicode.hpp>
// boost // boost
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
@ -43,7 +43,7 @@ template <typename Iterator>
class feature_collection_parser : private mapnik::noncopyable class feature_collection_parser : private mapnik::noncopyable
{ {
typedef Iterator iterator_type; typedef Iterator iterator_type;
typedef mapnik::Feature feature_type; typedef mapnik::feature_impl feature_type;
public: public:
feature_collection_parser(mapnik::context_ptr const& ctx, mapnik::transcoder const& tr); feature_collection_parser(mapnik::context_ptr const& ctx, mapnik::transcoder const& tr);
~feature_collection_parser(); ~feature_collection_parser();

View file

@ -25,6 +25,7 @@
// mapnik // mapnik
#include <mapnik/global.hpp> #include <mapnik/global.hpp>
#include <mapnik/value.hpp>
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include <mapnik/json/geometry_generator_grammar.hpp> #include <mapnik/json/geometry_generator_grammar.hpp>
#include <mapnik/feature_kv_iterator.hpp> #include <mapnik/feature_kv_iterator.hpp>
@ -43,29 +44,29 @@
namespace boost { namespace spirit { namespace traits { namespace boost { namespace spirit { namespace traits {
template <> template <>
struct is_container<mapnik::Feature const> : mpl::false_ {} ; struct is_container<mapnik::feature_impl const> : mpl::false_ {} ;
template <> template <>
struct container_iterator<mapnik::Feature const> struct container_iterator<mapnik::feature_impl const>
{ {
typedef mapnik::feature_kv_iterator2 type; typedef mapnik::feature_kv_iterator2 type;
}; };
template <> template <>
struct begin_container<mapnik::Feature const> struct begin_container<mapnik::feature_impl const>
{ {
static mapnik::feature_kv_iterator2 static mapnik::feature_kv_iterator2
call (mapnik::Feature const& f) call (mapnik::feature_impl const& f)
{ {
return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.begin(),f.end()); return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.begin(),f.end());
} }
}; };
template <> template <>
struct end_container<mapnik::Feature const> struct end_container<mapnik::feature_impl const>
{ {
static mapnik::feature_kv_iterator2 static mapnik::feature_kv_iterator2
call (mapnik::Feature const& f) call (mapnik::feature_impl const& f)
{ {
return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.end(),f.end()); return mapnik::feature_kv_iterator2(mapnik::value_not_null(),f.end(),f.end());
} }
@ -94,7 +95,7 @@ struct get_id
template <typename T> template <typename T>
struct result { typedef int type; }; struct result { typedef int type; };
int operator() (mapnik::Feature const& f) const int operator() (mapnik::feature_impl const& f) const
{ {
return f.id(); return f.id();
} }
@ -107,7 +108,7 @@ struct make_properties_range
template <typename T> template <typename T>
struct result { typedef properties_range_type type; }; struct result { typedef properties_range_type type; };
properties_range_type operator() (mapnik::Feature const& f) const properties_range_type operator() (mapnik::feature_impl const& f) const
{ {
return boost::make_iterator_range(f.begin(),f.end()); return boost::make_iterator_range(f.begin(),f.end());
} }
@ -173,7 +174,7 @@ struct escaped_string
template <typename OutputIterator> template <typename OutputIterator>
struct feature_generator_grammar: struct feature_generator_grammar:
karma::grammar<OutputIterator, mapnik::Feature const&()> karma::grammar<OutputIterator, mapnik::feature_impl const&()>
{ {
typedef boost::tuple<std::string, mapnik::value> pair_type; typedef boost::tuple<std::string, mapnik::value> pair_type;
typedef make_properties_range::properties_range_type range_type; typedef make_properties_range::properties_range_type range_type;
@ -224,10 +225,10 @@ struct feature_generator_grammar:
} }
// rules // rules
karma::rule<OutputIterator, mapnik::Feature const&()> feature; karma::rule<OutputIterator, mapnik::feature_impl const&()> feature;
multi_geometry_generator_grammar<OutputIterator> geometry; multi_geometry_generator_grammar<OutputIterator> geometry;
escaped_string<OutputIterator> escaped_string_; escaped_string<OutputIterator> escaped_string_;
karma::rule<OutputIterator, mapnik::Feature const&()> properties; karma::rule<OutputIterator, mapnik::feature_impl const&()> properties;
karma::rule<OutputIterator, pair_type()> pair; karma::rule<OutputIterator, pair_type()> pair;
karma::rule<OutputIterator, void(mapnik::value const&)> value; karma::rule<OutputIterator, void(mapnik::value const&)> value;
karma::rule<OutputIterator, mapnik::value_null()> value_null_; karma::rule<OutputIterator, mapnik::value_null()> value_null_;

View file

@ -25,6 +25,7 @@
// mapnik // mapnik
#include <mapnik/json/geometry_grammar.hpp> #include <mapnik/json/geometry_grammar.hpp>
#include <mapnik/value.hpp>
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include <mapnik/unicode.hpp> #include <mapnik/unicode.hpp>
#include <mapnik/value.hpp> #include <mapnik/value.hpp>

View file

@ -43,7 +43,7 @@ class MAPNIK_DECL feature_generator : private mapnik::noncopyable
public: public:
feature_generator(); feature_generator();
~feature_generator(); ~feature_generator();
bool generate(std::string & geojson, mapnik::Feature const& f); bool generate(std::string & geojson, mapnik::feature_impl const& f);
private: private:
boost::scoped_ptr<feature_generator_grammar<sink_type> > grammar_; boost::scoped_ptr<feature_generator_grammar<sink_type> > grammar_;
}; };
@ -66,7 +66,7 @@ class MAPNIK_DECL feature_generator : private mapnik::noncopyable
public: public:
feature_generator() {} feature_generator() {}
~feature_generator() {} ~feature_generator() {}
bool generate(std::string & geojson, mapnik::Feature const& f); bool generate(std::string & geojson, mapnik::feature_impl const& f);
}; };
class MAPNIK_DECL geometry_generator : private mapnik::noncopyable class MAPNIK_DECL geometry_generator : private mapnik::noncopyable

View file

@ -24,6 +24,7 @@
#define MAPNIK_MARKER_HELPERS_HPP #define MAPNIK_MARKER_HELPERS_HPP
#include <mapnik/color.hpp> #include <mapnik/color.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/geometry.hpp> #include <mapnik/geometry.hpp>
#include <mapnik/geom_util.hpp> #include <mapnik/geom_util.hpp>
#include <mapnik/markers_symbolizer.hpp> #include <mapnik/markers_symbolizer.hpp>
@ -303,17 +304,17 @@ void build_ellipse(T const& sym, mapnik::feature_impl const& feature, svg_storag
double height = 0; double height = 0;
if (width_expr && height_expr) if (width_expr && height_expr)
{ {
width = boost::apply_visitor(evaluate<Feature,value_type>(feature), *width_expr).to_double(); width = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *width_expr).to_double();
height = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr).to_double(); height = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr).to_double();
} }
else if (width_expr) else if (width_expr)
{ {
width = boost::apply_visitor(evaluate<Feature,value_type>(feature), *width_expr).to_double(); width = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *width_expr).to_double();
height = width; height = width;
} }
else if (height_expr) else if (height_expr)
{ {
height = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr).to_double(); height = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr).to_double();
width = height; width = height;
} }
svg::svg_converter_type styled_svg(svg_path, marker_ellipse.attributes()); svg::svg_converter_type styled_svg(svg_path, marker_ellipse.attributes());
@ -386,11 +387,11 @@ void setup_transform_scaling(agg::trans_affine & tr, box2d<double> const& bbox,
expression_ptr const& width_expr = sym.get_width(); expression_ptr const& width_expr = sym.get_width();
if (width_expr) if (width_expr)
width = boost::apply_visitor(evaluate<Feature,value_type>(feature), *width_expr).to_double(); width = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *width_expr).to_double();
expression_ptr const& height_expr = sym.get_height(); expression_ptr const& height_expr = sym.get_height();
if (height_expr) if (height_expr)
height = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr).to_double(); height = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr).to_double();
if (width > 0 && height > 0) if (width > 0 && height > 0)
{ {