diff --git a/bindings/python/mapnik_text_placement.cpp b/bindings/python/mapnik_text_placement.cpp index 2e8030a76..8814eba39 100644 --- a/bindings/python/mapnik_text_placement.cpp +++ b/bindings/python/mapnik_text_placement.cpp @@ -199,7 +199,8 @@ void export_text_placement() ; - class_("TextSymbolizerProperties") + class_ + ("TextSymbolizerProperties") .def_readwrite("orientation", &text_symbolizer_properties::orientation) .add_property("displacement", &get_displacement, @@ -224,13 +225,14 @@ void export_text_placement() &text_symbolizer_properties::format_tree, &text_symbolizer_properties::set_format_tree); /* from_xml, to_xml operate on mapnik's internal XML tree and don't make sense in python. - get_all_expressions isn't useful in python either. The result is only needed by + add_expressions isn't useful in python either. The result is only needed by attribute_collector (which isn't exposed in python) and it just calls add_expressions of the associated formating tree. set_old_style expression is just a compatibility wrapper and doesn't need to be exposed in python. */ ; - class_("CharProperties") + class_ + ("CharProperties") .def(init()) //Copy constructor .def_readwrite("face_name", &char_properties::face_name) .def_readwrite("fontset", &char_properties::fontset) @@ -248,20 +250,20 @@ void export_text_placement() ; class_, - boost::noncopyable> - ("TextPlacements") + boost::shared_ptr, + boost::noncopyable> + ("TextPlacements") .def_readwrite("defaults", &text_placements::properties) .def("get_placement_info", pure_virtual(&text_placements::get_placement_info)) - /* TODO: get_all_expressions() */ + /* TODO: add_expressions() */ ; register_ptr_to_python >(); class_, - boost::noncopyable> - ("TextPlacementInfo", - init()) + boost::shared_ptr, + boost::noncopyable> + ("TextPlacementInfo", + init()) .def("next", pure_virtual(&text_placement_info::next)) .def("get_actual_label_spacing", &text_placement_info::get_actual_label_spacing) .def("get_actual_minimum_distance", &text_placement_info::get_actual_minimum_distance) @@ -278,18 +280,22 @@ void export_text_placement() ; register_ptr_to_python >(); + class_, - boost::noncopyable>("ProcessedText", no_init) + boost::noncopyable> + ("ProcessedText", no_init) .def("push_back", &processed_text::push_back) .def("clear", &processed_text::clear) ; + class_, - boost::noncopyable>("ExpressionSet") - .def("insert", &insert_expression); - ; + boost::noncopyable> + ("ExpressionSet") + .def("insert", &insert_expression); + ; //TODO: Python namespace @@ -302,20 +308,19 @@ void export_text_placement() &NodeWrap::add_expressions, &NodeWrap::default_add_expressions) ; - register_ptr_to_python >(); + class_, bases, - boost::noncopyable>( - "FormatingTextNode", init()) - .def("apply", &formating::text_node::apply, &TextNodeWrap::default_apply) - .add_property("text", - &formating::text_node::get_text, - &formating::text_node::set_text) + boost::noncopyable> + ("FormatingTextNode", init()) + .def("apply", &formating::text_node::apply, &TextNodeWrap::default_apply) + .add_property("text", + &formating::text_node::get_text, + &formating::text_node::set_text) ; - register_ptr_to_python >(); }