Permalink
Browse files

various header fixes to include what is actually used and better futu…

…re-proof compile for mapnik refactoring upstream
  • Loading branch information...
Dane Springmeyer
Dane Springmeyer committed Jan 7, 2013
1 parent ad43b91 commit 6a63a5c2d09acab5db29a67c9490ec4af292c670
View
@@ -4,19 +4,19 @@
// v8
#include <v8.h>
-// node
-#include <node.h>
+#include "utils.hpp"
// mapnik
-#include <mapnik/version.hpp>
-#include <mapnik/layer.hpp>
-#include <mapnik/params.hpp>
-#include <mapnik/feature_layer_desc.hpp>
-#include <mapnik/feature.hpp>
-#include <mapnik/feature_kv_iterator.hpp>
+#include <mapnik/attribute_descriptor.hpp> // for attribute_descriptor, etc
+#include <mapnik/datasource.hpp> // for datasource, etc
+#include <mapnik/feature.hpp> // for feature_impl::iterator, etc
+#include <mapnik/feature_kv_iterator.hpp> // for feature_kv_iterator
+#include <mapnik/feature_layer_desc.hpp> // for layer_descriptor
+#include <mapnik/query.hpp> // for query
+#include <mapnik/value.hpp> // for value_base, value
+#include <mapnik/version.hpp> // for MAPNIK_VERSION
using namespace v8;
-using namespace node;
namespace node_mapnik {
View
@@ -5,13 +5,19 @@
#include <v8.h>
// mapnik
-#include <mapnik/version.hpp>
-#include <mapnik/grid/grid.hpp>
+#include <mapnik/feature.hpp> // for feature_impl, etc
+#include <mapnik/grid/grid.hpp> // for grid
+#include <mapnik/version.hpp> // for MAPNIK_VERSION
#include "utils.hpp"
// boost
#include <boost/foreach.hpp>
+#include "boost/ptr_container/ptr_vector.hpp" // for ptr_vector
+
+// stl
+#include <cmath> // ceil
+#include <stdint.h> // for uint16_t
using namespace v8;
using namespace node;
View
@@ -2,7 +2,6 @@
#define __NODE_MAPNIK_•_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
// mapnik
@@ -12,7 +11,6 @@
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
typedef boost::shared_ptr<mapnik::•> •_ptr;
View
@@ -1,8 +1,17 @@
-
-#include "utils.hpp"
#include "mapnik_color.hpp"
-#include <mapnik/color_factory.hpp>
+#include "node.h" // for NODE_SET_PROTOTYPE_METHOD
+#include "node_object_wrap.h" // for ObjectWrap
+#include "utils.hpp" // for ATTR, TOSTR
+#include "v8.h" // for Handle, String, Integer, etc
+
+// mapnik
+#include <mapnik/color.hpp> // for color
+
+// stl
+#include <exception> // for exception
+
+// boost
#include <boost/make_shared.hpp>
Persistent<FunctionTemplate> Color::constructor;
View
@@ -1,19 +1,15 @@
#ifndef __NODE_MAPNIK_COLOR_H__
#define __NODE_MAPNIK_COLOR_H__
-#include <v8.h>
-#include <node.h>
-#include <node_object_wrap.h>
-
-// mapnik
-#include <mapnik/color.hpp>
+#include <node_object_wrap.h> // for ObjectWrap
+#include <v8.h> // for Handle, AccessorInfo, etc
// boost
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
+namespace mapnik { class color; }
typedef boost::shared_ptr<mapnik::color> color_ptr;
class Color: public node::ObjectWrap {
View
@@ -1,13 +1,26 @@
-#include <mapnik/version.hpp>
-#include <mapnik/datasource_cache.hpp>
-
#include "mapnik_datasource.hpp"
#include "mapnik_featureset.hpp"
#include "utils.hpp"
#include "ds_emitter.hpp"
+// node
+#include "node.h" // for NODE_SET_PROTOTYPE_METHOD
+#include "node_object_wrap.h" // for ObjectWrap
+#include "v8.h" // for String, Handle, Object, etc
+
+// mapnik
+#include <mapnik/attribute_descriptor.hpp> // for attribute_descriptor
+#include <mapnik/box2d.hpp> // for box2d
+#include <mapnik/datasource.hpp> // for datasource, datasource_ptr, etc
+#include <mapnik/datasource_cache.hpp> // for datasource_cache
+#include <mapnik/feature_layer_desc.hpp> // for layer_descriptor
+#include <mapnik/params.hpp> // for parameters
+#include <mapnik/query.hpp> // for query
+#include <mapnik/version.hpp> // for MAPNIK_VERSION
+
// stl
#include <exception>
+#include <vector>
Persistent<FunctionTemplate> Datasource::constructor;
@@ -78,8 +91,8 @@ Handle<Value> Datasource::New(const Arguments& args)
mapnik::parameters params;
Local<Array> names = options->GetPropertyNames();
- uint32_t i = 0;
- uint32_t a_length = names->Length();
+ unsigned int i = 0;
+ unsigned int a_length = names->Length();
while (i < a_length) {
Local<Value> name = names->Get(i)->ToString();
Local<Value> value = options->Get(name);
View
@@ -2,20 +2,22 @@
#define __NODE_MAPNIK_DATASOURCE_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
-#include <mapnik/datasource.hpp>
+#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
+
+namespace mapnik { class datasource; }
+
+typedef boost::shared_ptr<mapnik::datasource> datasource_ptr;
class Datasource: public node::ObjectWrap {
public:
static Persistent<FunctionTemplate> constructor;
static void Initialize(Handle<Object> target);
static Handle<Value> New(const Arguments &args);
- static Handle<Value> New(mapnik::datasource_ptr ds_ptr);
+ static Handle<Value> New(datasource_ptr ds_ptr);
static Handle<Value> parameters(const Arguments &args);
static Handle<Value> describe(const Arguments &args);
@@ -24,11 +26,11 @@ class Datasource: public node::ObjectWrap {
static Handle<Value> extent(const Arguments &args);
Datasource();
- inline mapnik::datasource_ptr get() { return datasource_; }
+ inline datasource_ptr get() { return datasource_; }
private:
~Datasource();
- mapnik::datasource_ptr datasource_;
+ datasource_ptr datasource_;
};
#endif
@@ -1,10 +1,19 @@
+#include <node.h>
#include "utils.hpp"
#include "mapnik_expression.hpp"
#include "mapnik_feature.hpp"
#include "utils.hpp"
+// mapnik
+#include <mapnik/expression_string.hpp>
+#include <mapnik/expression_evaluator.hpp>
+
+// boost
#include <boost/make_shared.hpp>
+// stl
+#include <exception> // for exception
+
Persistent<FunctionTemplate> Expression::constructor;
void Expression::Initialize(Handle<Object> target) {
@@ -2,7 +2,6 @@
#define __NODE_MAPNIK_EXPRESSION_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
// mapnik
@@ -12,16 +11,11 @@
#else
#include <mapnik/filter_factory.hpp>
#endif
-#include <mapnik/expression_node.hpp>
-#include <mapnik/expression_string.hpp>
-#include <mapnik/expression_evaluator.hpp>
-
// boost
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
class Expression: public node::ObjectWrap {
public:
View
@@ -213,8 +213,8 @@ Handle<Value> Feature::addAttributes(const Arguments& args)
try
{
Local<Array> names = attr->GetPropertyNames();
- uint32_t i = 0;
- uint32_t a_length = names->Length();
+ unsigned int i = 0;
+ unsigned int a_length = names->Length();
boost::scoped_ptr<mapnik::transcoder> tr(new mapnik::transcoder("utf8"));
while (i < a_length) {
Local<Value> name = names->Get(i)->ToString();
View
@@ -2,7 +2,6 @@
#define __NODE_MAPNIK_FEATURE_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
// mapnik
@@ -14,8 +13,6 @@
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
-
class Feature: public node::ObjectWrap {
public:
@@ -2,12 +2,10 @@
#define __NODE_MAPNIK_FEATURESET_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
#include <mapnik/datasource_cache.hpp>
using namespace v8;
-using namespace node;
typedef mapnik::featureset_ptr fs_ptr;
View
@@ -5,9 +5,6 @@
// v8
#include <v8.h>
-// node
-#include <node.h>
-
// mapnik
#include <mapnik/version.hpp>
#include <mapnik/font_engine_freetype.hpp>
@@ -18,7 +15,6 @@
#include "utils.hpp"
using namespace v8;
-using namespace node;
namespace node_mapnik {
View
@@ -2,7 +2,6 @@
#define __NODE_MAPNIK_GEOMETRY_H__
#include <v8.h>
-#include <node.h>
#include <node_object_wrap.h>
// mapnik
@@ -12,7 +11,6 @@
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
typedef std::auto_ptr<mapnik::geometry_type> geometry_ptr;
View
@@ -1,13 +1,18 @@
// node
-#include <node_buffer.h>
+#include <node.h> // for NODE_SET_PROTOTYPE_METHOD, etc
+#include <node_object_wrap.h> // for ObjectWrap
+#include <v8.h>
+#include <uv.h>
// mapnik
#include <mapnik/version.hpp>
-#include <mapnik/image_data.hpp>
// boost
+#include "boost/ptr_container/ptr_sequence_adapter.hpp"
+#include "boost/ptr_container/ptr_vector.hpp" // for ptr_vector
#include <boost/make_shared.hpp>
+#include "boost/cstdint.hpp" // for uint16_t
#include "mapnik_grid.hpp"
#include "mapnik_grid_view.hpp"
@@ -202,7 +207,7 @@ void Grid::EIO_AfterClear(uv_work_t* req)
}
if (try_catch.HasCaught())
{
- FatalException(try_catch);
+ node::FatalException(try_catch);
}
closure->g->Unref();
closure->cb.Dispose();
@@ -546,7 +551,7 @@ void Grid::EIO_AfterEncode(uv_work_t* req)
}
if (try_catch.HasCaught()) {
- FatalException(try_catch);
+ node::FatalException(try_catch);
}
closure->g->Unref();
@@ -734,7 +739,7 @@ Handle<Value> Grid::encode(const Arguments& args) // format, resolution
Local<Value> argv[2] = { Local<Value>::New(Null()), Local<Value>::New(json) };
callback->Call(Context::GetCurrent()->Global(), 2, argv);
if (try_catch.HasCaught()) {
- FatalException(try_catch);
+ node::FatalException(try_catch);
}
}
catch (std::exception & ex)
View
@@ -2,13 +2,12 @@
#define __NODE_MAPNIK_GRID_H__
#include <v8.h>
-#include <node.h>
+#include <uv.h>
#include <node_object_wrap.h>
#include <mapnik/grid/grid.hpp>
#include <boost/shared_ptr.hpp>
using namespace v8;
-using namespace node;
typedef boost::shared_ptr<mapnik::grid> grid_ptr;
Oops, something went wrong.

0 comments on commit 6a63a5c

Please sign in to comment.