diff --git a/bindings/python/mapnik_filter.cpp b/bindings/python/mapnik_filter.cpp index 6311e13b4..4039ce467 100644 --- a/bindings/python/mapnik_filter.cpp +++ b/bindings/python/mapnik_filter.cpp @@ -28,20 +28,13 @@ #include #include #include +#include using mapnik::filter; using mapnik::filter_ptr; using mapnik::filter_factory; using mapnik::Feature; - -namespace -{ - using namespace boost::python; - filter_ptr create_filter(string const& filter_text) - { - return filter_factory::compile(filter_text); - } -} +using mapnik::create_filter; void export_filter() { diff --git a/demo/c++/rundemo.cpp b/demo/c++/rundemo.cpp index 1f450ece5..2f1a51c75 100644 --- a/demo/c++/rundemo.cpp +++ b/demo/c++/rundemo.cpp @@ -4,17 +4,16 @@ using namespace mapnik; -// helper function -filter_ptr create_filter (std::string const& wkt) -{ - filter_factory factory; - return factory.compile(wkt); -} - int main ( int argc , char** argv) { + if (argc != 2) + { + std::cout << "usage: ./rundemo \n"; + return EXIT_SUCCESS; + } + std::cout << " running demo ... \n"; - datasource_cache::instance()->register_datasources("/usr/local/lib/mapnik/input"); + datasource_cache::instance()->register_datasources(argv[1]); freetype_engine::instance()->register_font("/usr/share/fonts/bitstream-vera/Vera.ttf"); Map m(800,600); @@ -217,5 +216,5 @@ int main ( int argc , char** argv) "- demo.png\n" "Have a look!\n"; - return 0; + return EXIT_SUCCESS; } diff --git a/include/color.hpp b/include/color.hpp index b9f75b600..8c74829ac 100644 --- a/include/color.hpp +++ b/include/color.hpp @@ -40,8 +40,11 @@ namespace mapnik { :abgr_(0xffffffff) {} Color(int red,int green,int blue,int alpha=0xff) - : abgr_((alpha&0xff) << 24 | (blue&0xff) << 16 | (green&0xff) << 8 | red&0xff) {} - + : abgr_((alpha&0xff) << 24 | + (blue&0xff) << 16 | + (green&0xff) << 8 | + red&0xff) {} + explicit Color(int rgba) : abgr_(rgba) {} diff --git a/include/mapnik.hpp b/include/mapnik.hpp index 5cc0c9d25..7281bded4 100644 --- a/include/mapnik.hpp +++ b/include/mapnik.hpp @@ -74,11 +74,11 @@ #include "feature_layer_desc.hpp" #include "css_color_parser.hpp" #include "color_factory.hpp" - - +#include "config.hpp" namespace mapnik { + MAPNIK_DECL filter_ptr create_filter (std::string const& wkt); } #endif //MAPNIK_HPP diff --git a/src/mapnik.cpp b/src/mapnik.cpp index 11c467494..6512751f3 100644 --- a/src/mapnik.cpp +++ b/src/mapnik.cpp @@ -22,11 +22,15 @@ //$Id$ -#include #include "mapnik.hpp" namespace mapnik { + filter_ptr create_filter (std::string const& wkt) + { + filter_factory factory; + return factory.compile(wkt); + } }