The following commit has been merged in the master branch:
commit e0d8387b101fff79f05f0d26bc0039d68d2ef703
Author: David Paleino <da...@debian.org>
Date:   Tue Mar 16 21:53:11 2010 +0100

    Fix Mapnik API calls

diff --git a/debian/patches/02-fix_mapnik_API.patch 
b/debian/patches/02-fix_mapnik_API.patch
new file mode 100644
index 0000000..1068c30
--- /dev/null
+++ b/debian/patches/02-fix_mapnik_API.patch
@@ -0,0 +1,263 @@
+From: David Paleino <da...@debian.org>
+Subject: fix Mapnik API calls
+Forwarded: no (needed?)
+
+---
+ layer_info_dialog.cpp |    2 +-
+ layer_info_dialog.hpp |    4 ++--
+ layerlistmodel.cpp    |   10 +++++-----
+ layerlistmodel.hpp    |    2 +-
+ layerwidget.cpp       |    2 +-
+ mainwindow.cpp        |    6 +++---
+ mainwindow.hpp        |    2 +-
+ mapwidget.cpp         |   22 +++++++++++-----------
+ mapwidget.hpp         |    4 ++--
+ styles_model.cpp      |    4 ++--
+ 10 files changed, 29 insertions(+), 29 deletions(-)
+
+--- mapnik-viewer.orig/mapwidget.hpp
++++ mapnik-viewer/mapwidget.hpp
+@@ -48,7 +48,7 @@ class MapWidget : public QWidget
+       boost::shared_ptr<mapnik::Map> map_;
+       int selected_;
+       QPixmap pix_;
+-      mapnik::box2d<double> extent_;
++      mapnik::Envelope<double> extent_;
+       eTool cur_tool_;
+       int start_x_;
+       int start_y_;
+@@ -65,7 +65,7 @@ class MapWidget : public QWidget
+       inline QPixmap const& pixmap() const { return pix_;}
+       void setMap(boost::shared_ptr<mapnik::Map> map);    
+       void defaultView();
+-      void zoomToBox(mapnik::box2d<double> const& box);
++      void zoomToBox(mapnik::Envelope<double> const& box);
+       void zoomIn();
+       void zoomOut();
+       void panLeft();
+--- mapnik-viewer.orig/mainwindow.cpp
++++ mapnik-viewer/mainwindow.cpp
+@@ -143,7 +143,7 @@ void MainWindow::reload()
+     if (!filename_.isEmpty())
+     {
+       
+-      mapnik::box2d<double> bbox = mapWidget_->getMap()->getCurrentExtent();
++      mapnik::Envelope<double> bbox = 
mapWidget_->getMap()->getCurrentExtent();
+       load_map_file(filename_);
+       mapWidget_->zoomToBox(bbox);
+       setWindowTitle(tr("%1 - *Reloaded*").arg(filename_));
+@@ -180,7 +180,7 @@ void MainWindow::load_map_file(QString c
+       std::cout << ex.what() << "\n";
+    }
+    map->zoom_all();
+-   mapnik::box2d<double> const& ext = map->getCurrentExtent();
++   mapnik::Envelope<double> const& ext = map->getCurrentExtent();
+    mapWidget_->zoomToBox(ext);
+    layerTab_->setModel(new LayerListModel(map,this));
+    styleTab_->setModel(new StyleModel(map,this));
+@@ -388,7 +388,7 @@ void MainWindow::set_default_extent(doub
+           mapnik::projection prj(map_ptr->srs());
+           prj.forward(x0,y0);
+           prj.forward(x1,y1);
+-          default_extent_=mapnik::box2d<double>(x0,y0,x1,y1);
++          default_extent_=mapnik::Envelope<double>(x0,y0,x1,y1);
+           mapWidget_->zoomToBox(default_extent_);
+           std::cout << "SET DEFAULT EXT\n";
+        }
+--- mapnik-viewer.orig/mainwindow.hpp
++++ mapnik-viewer/mainwindow.hpp
+@@ -105,7 +105,7 @@ public slots:
+       QStatusBar *status;
+       QSlider * slider_;
+ 
+-      mapnik::box2d<double> default_extent_;
++      mapnik::Envelope<double> default_extent_;
+ };
+ 
+ 
+--- mapnik-viewer.orig/mapwidget.cpp
++++ mapnik-viewer/mapwidget.cpp
+@@ -30,10 +30,10 @@
+ #include "mapwidget.hpp"
+ #include "info_dialog.hpp"
+ 
+-using mapnik::image_32;
++using mapnik::Image32;
+ using mapnik::Map;
+-using mapnik::layer;
+-using mapnik::box2d;
++using mapnik::Layer;
++using mapnik::Envelope;
+ using mapnik::coord2d;
+ using mapnik::feature_ptr;
+ using mapnik::geometry_ptr;
+@@ -149,7 +149,7 @@ void MapWidget::mousePressEvent(QMouseEv
+             {
+                if (int(index) != selectedLayer_) continue;
+                
+-               layer & layer = map_->layers()[index];
++               Layer & layer = map_->layers()[index];
+                if (!layer.isVisible(scale_denom)) continue;
+                std::string name = layer.name();
+                double x = e->x();
+@@ -216,7 +216,7 @@ void MapWidget::mousePressEvent(QMouseEv
+             // remove annotation layer
+             map_->layers().erase(remove_if(map_->layers().begin(),
+                                            map_->layers().end(),
+-                                           bind(&layer::name,_1) == 
"*annotations*")
++                                           bind(&Layer::name,_1) == 
"*annotations*")
+                                  , map_->layers().end());
+          }
+       } 
+@@ -249,7 +249,7 @@ void MapWidget::mouseReleaseEvent(QMouse
+          if (map_)
+          {
+             CoordTransform 
t(map_->getWidth(),map_->getHeight(),map_->getCurrentExtent());    
+-            box2d<double> box = 
t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
++            Envelope<double> box = 
t.backward(Envelope<double>(start_x_,start_y_,end_x_,end_y_));
+             map_->zoomToBox(box);
+             updateMap();
+          }
+@@ -331,7 +331,7 @@ void MapWidget::keyPressEvent(QKeyEvent
+    
+ }
+ 
+-void MapWidget::zoomToBox(mapnik::box2d<double> const& bbox)
++void MapWidget::zoomToBox(mapnik::Envelope<double> const& bbox)
+ {
+    if (map_)
+    {
+@@ -419,14 +419,14 @@ void MapWidget::zoomToLevel(int level)
+    {
+       double scale_denom  = scales[level];
+       std::cerr << "scale denominator = " << scale_denom << "\n";
+-      mapnik::box2d<double> ext = map_->getCurrentExtent();
++      mapnik::Envelope<double> ext = map_->getCurrentExtent();
+       double width = static_cast<double>(map_->getWidth());
+       double height= static_cast<double>(map_->getHeight()); 
+       mapnik::coord2d pt = ext.center();
+ 
+       double res = scale_denom * 0.00028;
+       
+-      mapnik::box2d<double> box(pt.x - 0.5 * width * res,
++      mapnik::Envelope<double> box(pt.x - 0.5 * width * res,
+                                    pt.y - 0.5 * height*res,
+                                    pt.x + 0.5 * width * res,
+                                    pt.y + 0.5 * height*res);
+@@ -451,11 +451,11 @@ void MapWidget::updateMap()
+       unsigned width=map_->getWidth();
+       unsigned height=map_->getHeight();
+       
+-      image_32 buf(width,height);
++      Image32 buf(width,height);
+ 
+       try 
+       {
+-        mapnik::agg_renderer<image_32> ren(*map_,buf);
++        mapnik::agg_renderer<Image32> ren(*map_,buf);
+         ren.apply();
+         
+         QImage 
image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
+--- mapnik-viewer.orig/layerlistmodel.hpp
++++ mapnik-viewer/layerlistmodel.hpp
+@@ -40,7 +40,7 @@ class LayerListModel : public QAbstractL
+       bool setData(const QModelIndex &index, const QVariant &value,
+                    int role = Qt::EditRole);
+       Qt::ItemFlags flags(QModelIndex const& index) const; 
+-      boost::optional<mapnik::layer&> map_layer(int i);
++      boost::optional<mapnik::Layer&> map_layer(int i);
+ 
+    private:
+       boost::shared_ptr<mapnik::Map> map_;
+--- mapnik-viewer.orig/layerwidget.cpp
++++ mapnik-viewer/layerwidget.cpp
+@@ -80,7 +80,7 @@ void LayerTab::layerInfo2(QModelIndex co
+    QVector<QString> style_names;
+    unsigned i = index.row();
+    LayerListModel * model = static_cast<LayerListModel*>(this->model());
+-   boost::optional<mapnik::layer&> layer = model->map_layer(i);
++   boost::optional<mapnik::Layer&> layer = model->map_layer(i);
+    
+    if (layer)
+    {
+--- mapnik-viewer.orig/layer_info_dialog.hpp
++++ mapnik-viewer/layer_info_dialog.hpp
+@@ -27,14 +27,14 @@
+ 
+ namespace mapnik
+ {
+-struct layer;
++struct Layer;
+ }
+ 
+ class layer_info_dialog : public QDialog
+ {
+   Q_OBJECT
+   public:
+-    layer_info_dialog(mapnik::layer& l, QWidget * parent = 0);
++    layer_info_dialog(mapnik::Layer& l, QWidget * parent = 0);
+     Ui::LayerInfoDialog& getUI();
+    private:
+       Ui::LayerInfoDialog ui;
+--- mapnik-viewer.orig/layerlistmodel.cpp
++++ mapnik-viewer/layerlistmodel.cpp
+@@ -90,7 +90,7 @@ bool LayerListModel::setData(const QMode
+    if (index.isValid() && role == Qt::CheckStateRole)
+    {
+       int status = value.toInt(); 
+-      std::vector<mapnik::layer> & layers = 
const_cast<std::vector<mapnik::layer>& >(map_->layers());
++      std::vector<mapnik::Layer> & layers = 
const_cast<std::vector<mapnik::Layer>& >(map_->layers());
+       layers.at(index.row()).setActive(status);
+       emit dataChanged(index, index);
+       return true;
+@@ -107,15 +107,15 @@ Qt::ItemFlags LayerListModel::flags(QMod
+     return flags;
+ }
+ 
+-boost::optional<mapnik::layer&> LayerListModel::map_layer(int i)
++boost::optional<mapnik::Layer&> LayerListModel::map_layer(int i)
+ {
+    if (map_)
+    {
+-      std::vector<mapnik::layer> & layers = 
const_cast<std::vector<mapnik::layer>& >(map_->layers());
++      std::vector<mapnik::Layer> & layers = 
const_cast<std::vector<mapnik::Layer>& >(map_->layers());
+       if (i < int(layers.size()))
+-        return boost::optional<mapnik::layer&>(layers[i]);
++        return boost::optional<mapnik::Layer&>(layers[i]);
+    }
+-   return boost::optional<mapnik::layer&>();
++   return boost::optional<mapnik::Layer&>();
+ }
+ 
+ 
+--- mapnik-viewer.orig/styles_model.cpp
++++ mapnik-viewer/styles_model.cpp
+@@ -247,7 +247,7 @@ class rule_node
+       ~rule_node() {}
+       QString name() const
+       {
+-         mapnik::expression_ptr filter = rule_.get_filter();
++         mapnik::filter_ptr filter = rule_.get_filter();
+          
+          return QString("TODO!");//filter->to_string().c_str());
+       } 
+@@ -323,7 +323,7 @@ StyleModel::StyleModel(boost::shared_ptr
+       for ( ; itr2 != rules.end();++itr2)
+       {
+          node* rule_n = style_n->add_child(new 
node(rule_node(QString("Rule"),*itr2),style_n));
+-         mapnik::rule_type::symbolizers::const_iterator itr3 = 
(*itr2).begin();
++         mapnik::symbolizers::const_iterator itr3 = (*itr2).begin();
+          for ( ; itr3 !=itr2->end();++itr3)
+          {
+             rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
+--- mapnik-viewer.orig/layer_info_dialog.cpp
++++ mapnik-viewer/layer_info_dialog.cpp
+@@ -24,7 +24,7 @@
+ #include <mapnik/layer.hpp>
+ 
+ 
+-layer_info_dialog::layer_info_dialog(mapnik::layer& lay, QWidget *parent)
++layer_info_dialog::layer_info_dialog(mapnik::Layer& lay, QWidget *parent)
+   : QDialog(parent)
+ {
+     ui.setupUi(this);
diff --git a/debian/patches/series b/debian/patches/series
index c35f4cc..f9b83ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 00-fix_build.patch
 01-fix_mapnik_paths.patch
+02-fix_mapnik_API.patch

-- 
mapnik-viewer

_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to