rename text_convert to text_transform to match css naming convention (also matching enums to css)
This commit is contained in:
parent
ec8de98740
commit
c35310445a
11 changed files with 46 additions and 46 deletions
|
@ -666,7 +666,7 @@ __all__ = [
|
|||
'label_placement',
|
||||
'line_cap',
|
||||
'line_join',
|
||||
'text_convert',
|
||||
'text_transform',
|
||||
'vertical_alignment',
|
||||
'horizontal_alignment',
|
||||
'justify_alignment',
|
||||
|
|
|
@ -83,7 +83,7 @@ struct text_symbolizer_pickle_suite : boost::python::pickle_suite
|
|||
extras.append(t.get_wrap_char_string());
|
||||
extras.append(t.get_line_spacing());
|
||||
extras.append(t.get_character_spacing());
|
||||
extras.append(t.get_text_convert());
|
||||
extras.append(t.get_text_transform());
|
||||
extras.append(t.get_wrap_before());
|
||||
extras.append(t.get_horizontal_alignment());
|
||||
extras.append(t.get_justify_alignment());
|
||||
|
@ -146,7 +146,7 @@ struct text_symbolizer_pickle_suite : boost::python::pickle_suite
|
|||
t.set_wrap_char_from_string(extract<std::string>(extras[0]));
|
||||
t.set_line_spacing(extract<unsigned>(extras[1]));
|
||||
t.set_character_spacing(extract<unsigned>(extras[2]));
|
||||
t.set_text_convert(extract<text_convert_e>(extras[3]));
|
||||
t.set_text_transform(extract<text_transform_e>(extras[3]));
|
||||
t.set_wrap_before(extract<bool>(extras[4]));
|
||||
t.set_horizontal_alignment(extract<horizontal_alignment_e>(extras[5]));
|
||||
t.set_justify_alignment(extract<justify_alignment_e>(extras[6]));
|
||||
|
@ -182,10 +182,10 @@ void export_text_symbolizer()
|
|||
.value("RIGHT",J_RIGHT)
|
||||
;
|
||||
|
||||
enumeration_<text_convert_e>("text_convert")
|
||||
enumeration_<text_transform_e>("text_transform")
|
||||
.value("NONE",NONE)
|
||||
.value("TOUPPER",TOUPPER)
|
||||
.value("TOLOWER",TOLOWER)
|
||||
.value("UPPERCASE",UPPERCASE)
|
||||
.value("LOWERCASE",LOWERCASE)
|
||||
;
|
||||
|
||||
class_<text_symbolizer>("TextSymbolizer",init<expression_ptr,std::string const&, unsigned,color const&>())
|
||||
|
@ -258,9 +258,9 @@ void export_text_symbolizer()
|
|||
&text_symbolizer::get_text_opacity,
|
||||
&text_symbolizer::set_text_opacity,
|
||||
"Set/get the text opacity")
|
||||
.add_property("text_convert",
|
||||
&text_symbolizer::get_text_convert,
|
||||
&text_symbolizer::set_text_convert,
|
||||
.add_property("text_transform",
|
||||
&text_symbolizer::get_text_transform,
|
||||
&text_symbolizer::set_text_transform,
|
||||
"Set/get the text conversion method")
|
||||
.add_property("text_ratio",
|
||||
&text_symbolizer::get_text_ratio,
|
||||
|
|
|
@ -80,15 +80,15 @@ enum justify_alignment
|
|||
|
||||
DEFINE_ENUM( justify_alignment_e, justify_alignment );
|
||||
|
||||
enum text_convert
|
||||
enum text_transform
|
||||
{
|
||||
NONE = 0,
|
||||
TOUPPER,
|
||||
TOLOWER,
|
||||
text_convert_MAX
|
||||
UPPERCASE,
|
||||
LOWERCASE,
|
||||
text_transform_MAX
|
||||
};
|
||||
|
||||
DEFINE_ENUM( text_convert_e, text_convert );
|
||||
DEFINE_ENUM( text_transform_e, text_transform );
|
||||
|
||||
typedef boost::tuple<double,double> position;
|
||||
|
||||
|
@ -113,8 +113,8 @@ struct MAPNIK_DECL text_symbolizer : public symbolizer_base
|
|||
std::string get_wrap_char_string() const; // character used to wrap lines as std::string
|
||||
void set_wrap_char(unsigned char character);
|
||||
void set_wrap_char_from_string(std::string const& character);
|
||||
text_convert_e get_text_convert() const; // text conversion on strings before display
|
||||
void set_text_convert(text_convert_e convert);
|
||||
text_transform_e get_text_transform() const; // text conversion on strings before display
|
||||
void set_text_transform(text_transform_e convert);
|
||||
unsigned get_line_spacing() const; // spacing between lines of text
|
||||
void set_line_spacing(unsigned spacing);
|
||||
unsigned get_character_spacing() const; // spacing between characters in text
|
||||
|
@ -171,7 +171,7 @@ private:
|
|||
unsigned text_ratio_;
|
||||
unsigned wrap_width_;
|
||||
unsigned char wrap_char_;
|
||||
text_convert_e text_convert_;
|
||||
text_transform_e text_transform_;
|
||||
unsigned line_spacing_;
|
||||
unsigned character_spacing_;
|
||||
unsigned label_spacing_;
|
||||
|
|
|
@ -62,11 +62,11 @@ void agg_renderer<T>::process(shield_symbolizer const& sym,
|
|||
text = result.to_unicode();
|
||||
}
|
||||
|
||||
if ( sym.get_text_convert() == TOUPPER)
|
||||
if ( sym.get_text_transform() == UPPERCASE)
|
||||
{
|
||||
text = text.toUpper();
|
||||
}
|
||||
else if ( sym.get_text_convert() == TOLOWER)
|
||||
else if ( sym.get_text_transform() == LOWERCASE)
|
||||
{
|
||||
text = text.toLower();
|
||||
}
|
||||
|
|
|
@ -47,11 +47,11 @@ void agg_renderer<T>::process(text_symbolizer const& sym,
|
|||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature),*name_expr);
|
||||
UnicodeString text = result.to_unicode();
|
||||
|
||||
if ( sym.get_text_convert() == TOUPPER)
|
||||
if ( sym.get_text_transform() == UPPERCASE)
|
||||
{
|
||||
text = text.toUpper();
|
||||
}
|
||||
else if ( sym.get_text_convert() == TOLOWER)
|
||||
else if ( sym.get_text_transform() == LOWERCASE)
|
||||
{
|
||||
text = text.toLower();
|
||||
}
|
||||
|
|
|
@ -1169,11 +1169,11 @@ void cairo_renderer_base::process(text_symbolizer const& sym,
|
|||
value_type result = boost::apply_visitor(evaluate<Feature,value_type>(feature),*name_expr);
|
||||
UnicodeString text = result.to_unicode();
|
||||
|
||||
if ( sym.get_text_convert() == TOUPPER)
|
||||
if ( sym.get_text_transform() == UPPERCASE)
|
||||
{
|
||||
text = text.toUpper();
|
||||
}
|
||||
else if ( sym.get_text_convert() == TOLOWER)
|
||||
else if ( sym.get_text_transform() == LOWERCASE)
|
||||
{
|
||||
text = text.toLower();
|
||||
}
|
||||
|
|
|
@ -1104,8 +1104,8 @@ void map_parser::parse_text_symbolizer( rule_type & rule, ptree const & sym )
|
|||
label_placement_e placement =
|
||||
get_attr<label_placement_e>(sym, "placement", POINT_PLACEMENT);
|
||||
text_symbol.set_label_placement( placement );
|
||||
|
||||
// vertical alignment
|
||||
|
||||
vertical_alignment_e default_vertical_alignment = MIDDLE;
|
||||
if (dy > 0.0 )
|
||||
{
|
||||
|
@ -1163,9 +1163,9 @@ void map_parser::parse_text_symbolizer( rule_type & rule, ptree const & sym )
|
|||
}
|
||||
|
||||
// text conversion before rendering
|
||||
text_convert_e tconvert =
|
||||
get_attr<text_convert_e>(sym, "text_convert", NONE);
|
||||
text_symbol.set_text_convert(tconvert);
|
||||
text_transform_e tconvert =
|
||||
get_attr<text_transform_e>(sym, "text_transform", NONE);
|
||||
text_symbol.set_text_transform(tconvert);
|
||||
|
||||
// spacing between text lines
|
||||
optional<unsigned> line_spacing = get_opt_attr<unsigned>(sym, "line_spacing");
|
||||
|
@ -1408,9 +1408,9 @@ void map_parser::parse_shield_symbolizer( rule_type & rule, ptree const & sym )
|
|||
}
|
||||
|
||||
// text conversion before rendering
|
||||
text_convert_e tconvert =
|
||||
get_attr<text_convert_e>(sym, "text_convert", NONE);
|
||||
shield_symbol.set_text_convert(tconvert);
|
||||
text_transform_e tconvert =
|
||||
get_attr<text_transform_e>(sym, "text_transform", NONE);
|
||||
shield_symbol.set_text_transform(tconvert);
|
||||
|
||||
// spacing between text lines
|
||||
optional<unsigned> line_spacing = get_opt_attr<unsigned>(sym, "line_spacing");
|
||||
|
|
|
@ -449,9 +449,9 @@ private:
|
|||
{
|
||||
set_attr( node, "wrap_character", std::string(1, sym.get_wrap_char()) );
|
||||
}
|
||||
if (sym.get_text_convert() != dfl.get_text_convert() || explicit_defaults_ )
|
||||
if (sym.get_text_transform() != dfl.get_text_transform() || explicit_defaults_ )
|
||||
{
|
||||
set_attr( node, "text_convert", sym.get_text_convert() );
|
||||
set_attr( node, "text_transform", sym.get_text_transform() );
|
||||
}
|
||||
if (sym.get_line_spacing() != dfl.get_line_spacing() || explicit_defaults_ )
|
||||
{
|
||||
|
|
|
@ -70,15 +70,15 @@ static const char * justify_alignment_strings[] = {
|
|||
|
||||
IMPLEMENT_ENUM( justify_alignment_e, justify_alignment_strings );
|
||||
|
||||
static const char * text_convert_strings[] = {
|
||||
static const char * text_transform_strings[] = {
|
||||
"none",
|
||||
"toupper",
|
||||
"tolower",
|
||||
"uppercase",
|
||||
"lowercase",
|
||||
""
|
||||
};
|
||||
|
||||
|
||||
IMPLEMENT_ENUM( text_convert_e, text_convert_strings );
|
||||
IMPLEMENT_ENUM( text_transform_e, text_transform_strings );
|
||||
|
||||
|
||||
|
||||
|
@ -91,7 +91,7 @@ text_symbolizer::text_symbolizer(expression_ptr name, std::string const& face_na
|
|||
text_ratio_(0),
|
||||
wrap_width_(0),
|
||||
wrap_char_(' '),
|
||||
text_convert_(NONE),
|
||||
text_transform_(NONE),
|
||||
line_spacing_(0),
|
||||
character_spacing_(0),
|
||||
label_spacing_(0),
|
||||
|
@ -122,7 +122,7 @@ text_symbolizer::text_symbolizer(expression_ptr name, unsigned size, color const
|
|||
text_ratio_(0),
|
||||
wrap_width_(0),
|
||||
wrap_char_(' '),
|
||||
text_convert_(NONE),
|
||||
text_transform_(NONE),
|
||||
line_spacing_(0),
|
||||
character_spacing_(0),
|
||||
label_spacing_(0),
|
||||
|
@ -154,7 +154,7 @@ text_symbolizer::text_symbolizer(text_symbolizer const& rhs)
|
|||
text_ratio_(rhs.text_ratio_),
|
||||
wrap_width_(rhs.wrap_width_),
|
||||
wrap_char_(rhs.wrap_char_),
|
||||
text_convert_(rhs.text_convert_),
|
||||
text_transform_(rhs.text_transform_),
|
||||
line_spacing_(rhs.line_spacing_),
|
||||
character_spacing_(rhs.character_spacing_),
|
||||
label_spacing_(rhs.label_spacing_),
|
||||
|
@ -188,7 +188,7 @@ text_symbolizer& text_symbolizer::operator=(text_symbolizer const& other)
|
|||
text_ratio_ = other.text_ratio_;
|
||||
wrap_width_ = other.wrap_width_;
|
||||
wrap_char_ = other.wrap_char_;
|
||||
text_convert_ = other.text_convert_;
|
||||
text_transform_ = other.text_transform_;
|
||||
line_spacing_ = other.line_spacing_;
|
||||
character_spacing_ = other.character_spacing_;
|
||||
label_spacing_ = other.label_spacing_;
|
||||
|
@ -303,14 +303,14 @@ void text_symbolizer::set_wrap_char_from_string(std::string const& character)
|
|||
wrap_char_ = (character)[0];
|
||||
}
|
||||
|
||||
text_convert_e text_symbolizer::get_text_convert() const
|
||||
text_transform_e text_symbolizer::get_text_transform() const
|
||||
{
|
||||
return text_convert_;
|
||||
return text_transform_;
|
||||
}
|
||||
|
||||
void text_symbolizer::set_text_convert(text_convert_e convert)
|
||||
void text_symbolizer::set_text_transform(text_transform_e convert)
|
||||
{
|
||||
text_convert_ = convert;
|
||||
text_transform_ = convert;
|
||||
}
|
||||
|
||||
unsigned text_symbolizer::get_line_spacing() const
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<Rule title="foo">
|
||||
<Filter>([name]='CHILE')</Filter>
|
||||
<TextSymbolizer face_name="DejaVu Sans Book" size="10"
|
||||
name="[name] + ' (default OGC pixel)'" text_convert="tolower" wrap_width="10" wrap_character=" " halo_radius="1" dy="5"/>
|
||||
name="[name] + ' (default OGC pixel)'" text_transform="lowercase" wrap_width="10" wrap_character=" " halo_radius="1" dy="5"/>
|
||||
<PointSymbolizer />
|
||||
</Rule>
|
||||
<Rule title="foo">
|
||||
|
|
|
@ -225,7 +225,7 @@ def test_textsymbolizer_pickle():
|
|||
eq_(ts.label_position_tolerance, ts2.label_position_tolerance)
|
||||
|
||||
eq_(ts.wrap_character, ts2.wrap_character)
|
||||
eq_(ts.text_convert, ts2.text_convert)
|
||||
eq_(ts.text_transform, ts2.text_transform)
|
||||
eq_(ts.line_spacing, ts2.line_spacing)
|
||||
eq_(ts.character_spacing, ts2.character_spacing)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue