Merge commit 'a75cfa111bb1bf943acf92df0a4d2490a5e8ef72' into harfbuzz

Conflicts:
	src/text/formatting/expression.cpp
	src/text/formatting/format.cpp
	src/text/formatting/list.cpp
	src/text/formatting/text.cpp
This commit is contained in:
Hermann Kraus 2013-03-16 13:25:44 +01:00
commit 701a407087
9 changed files with 55 additions and 18 deletions

View file

@ -24,6 +24,7 @@
// mapnik
#include <mapnik/layer.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/feature_type_style.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/cairo_renderer.hpp>
@ -925,7 +926,7 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
expression_ptr height_expr = sym.height();
if (height_expr)
{
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature), *height_expr);
value_type result = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *height_expr);
height = result.to_double() * scale_factor_;
}

View file

@ -25,11 +25,22 @@
#include <mapnik/map.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/layer.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/params.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/util/deepcopy.hpp>
#include <mapnik/rule.hpp>
#include <mapnik/symbolizer.hpp>
#include <mapnik/building_symbolizer.hpp>
#include <mapnik/line_symbolizer.hpp>
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/polygon_symbolizer.hpp>
#include <mapnik/polygon_pattern_symbolizer.hpp>
#include <mapnik/point_symbolizer.hpp>
#include <mapnik/raster_symbolizer.hpp>
#include <mapnik/shield_symbolizer.hpp>
#include <mapnik/text_symbolizer.hpp>
#include <mapnik/markers_symbolizer.hpp>
#include <mapnik/debug_symbolizer.hpp>
// boost
#include <boost/optional.hpp>

View file

@ -21,6 +21,7 @@
*****************************************************************************/
#include <mapnik/feature_type_style.hpp>
#include <mapnik/rule.hpp>
// boost
#include <boost/foreach.hpp>

View file

@ -22,6 +22,9 @@
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/value.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/raster.hpp>
#include <mapnik/raster_colorizer.hpp>
// stl
@ -116,7 +119,7 @@ bool raster_colorizer::add_stop(colorizer_stop const& stop)
return true;
}
void raster_colorizer::colorize(raster_ptr const& raster, Feature const& f) const
void raster_colorizer::colorize(raster_ptr const& raster, feature_impl const& f) const
{
unsigned *imageData = raster->data_.getData();

View file

@ -24,6 +24,25 @@
#include <mapnik/rule.hpp>
#include <mapnik/debug.hpp>
#include <mapnik/raster_colorizer.hpp>
#include <mapnik/expression_string.hpp>
// all symbolizers
#include <mapnik/building_symbolizer.hpp>
#include <mapnik/line_symbolizer.hpp>
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/polygon_symbolizer.hpp>
#include <mapnik/polygon_pattern_symbolizer.hpp>
#include <mapnik/point_symbolizer.hpp>
#include <mapnik/raster_symbolizer.hpp>
#include <mapnik/shield_symbolizer.hpp>
#include <mapnik/text_symbolizer.hpp>
#include <mapnik/markers_symbolizer.hpp>
#include <mapnik/debug_symbolizer.hpp>
// boost
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/concept_check.hpp>
// stl
#include <limits>

View file

@ -82,27 +82,27 @@ expression_ptr expression_format::get_expression(xml_node const& xml, std::strin
}
void expression_format::apply(char_properties_ptr p, const Feature &feature, text_layout &output) const
void expression_format::apply(char_properties_ptr p, const feature_impl &feature, text_layout &output) const
{
char_properties_ptr new_properties = boost::make_shared<char_properties>(*p);
if (face_name) new_properties->face_name =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *face_name).to_string();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *face_name).to_string();
if (text_size) new_properties->text_size =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_size).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_size).to_double();
if (character_spacing) new_properties->character_spacing =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *character_spacing).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *character_spacing).to_double();
if (line_spacing) new_properties->line_spacing =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *line_spacing).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *line_spacing).to_double();
if (text_opacity) new_properties->text_opacity =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_opacity).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_opacity).to_double();
if (wrap_char) new_properties->wrap_char =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *character_spacing).to_unicode()[0];
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *character_spacing).to_unicode()[0];
// if (fill) new_properties->fill =
// boost::apply_visitor(evaluate<Feature,value_type>(feature), *fill).to_color();
// boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *fill).to_color();
// if (halo_fill) new_properties->halo_fill =
// boost::apply_visitor(evaluate<Feature,value_type>(feature), *halo_fill).to_color();
// boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *halo_fill).to_color();
if (halo_radius) new_properties->halo_radius =
boost::apply_visitor(evaluate<Feature,value_type>(feature), *halo_radius).to_double();
boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *halo_radius).to_double();
if (child_) {
child_->apply(new_properties, feature, output);

View file

@ -22,6 +22,7 @@
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/text/formatting/format.hpp>
#include <mapnik/ptree_helpers.hpp>
#include <mapnik/xml_node.hpp>
@ -76,7 +77,7 @@ node_ptr format_node::from_xml(xml_node const& xml)
}
void format_node::apply(char_properties_ptr p, const Feature &feature, text_layout &output) const
void format_node::apply(char_properties_ptr p, const feature_impl &feature, text_layout &output) const
{
char_properties_ptr new_properties = boost::make_shared<char_properties>(*p);
if (face_name) new_properties->face_name = *face_name;

View file

@ -22,6 +22,7 @@
// mapnik
#include <mapnik/text/formatting/list.hpp>
#include <mapnik/feature.hpp>
// boost
#include <boost/foreach.hpp>
@ -42,7 +43,7 @@ void list_node::to_xml(boost::property_tree::ptree & xml) const
}
void list_node::apply(char_properties_ptr p, Feature const& feature, text_layout &output) const
void list_node::apply(char_properties_ptr p, feature_impl const& feature, text_layout &output) const
{
BOOST_FOREACH(node_ptr const& node, children_)
{

View file

@ -53,9 +53,9 @@ node_ptr text_node::from_xml(xml_node const& xml)
return boost::make_shared<text_node>(xml.get_value<expression_ptr>());
}
void text_node::apply(char_properties_ptr p, Feature const& feature, text_layout &output) const
void text_node::apply(char_properties_ptr p, feature_impl const& feature, text_layout &output) const
{
UnicodeString text_str = boost::apply_visitor(evaluate<Feature,value_type>(feature), *text_).to_unicode();
UnicodeString text_str = boost::apply_visitor(evaluate<feature_impl,value_type>(feature), *text_).to_unicode();
if (p->text_transform == UPPERCASE)
{
text_str = text_str.toUpper();