integrate a few changes from mapnik2 branch - making sure to pass strings by const ref + formatting
This commit is contained in:
parent
32cfd4766d
commit
c01d1d0c69
6 changed files with 12 additions and 67 deletions
|
@ -305,10 +305,8 @@ namespace mapnik
|
|||
|
||||
typedef boost::shared_ptr<font_face_set> face_set_ptr;
|
||||
|
||||
class MAPNIK_DECL freetype_engine // : public mapnik::singleton<freetype_engine,mapnik::CreateStatic>,
|
||||
// private boost::noncopyable
|
||||
class MAPNIK_DECL freetype_engine
|
||||
{
|
||||
// friend class mapnik::CreateStatic<freetype_engine>;
|
||||
public:
|
||||
static bool register_font(std::string const& file_name);
|
||||
static std::vector<std::string> face_names ();
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* This file is part of Mapnik (c++ mapping toolkit)
|
||||
*
|
||||
* Copyright (C) 2006 Artem Pavlenko
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*****************************************************************************/
|
||||
//$Id$
|
||||
|
||||
#ifndef LOCAL_DATASOURCE_HPP
|
||||
#define LOCAL_DATASOURCE_HPP
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
/*
|
||||
class local_datasource : public datasource
|
||||
{
|
||||
public:
|
||||
local_datasource(Parameters const& params);
|
||||
int type() const;
|
||||
static std::string name();
|
||||
featureset_ptr features(query const& q) const;
|
||||
const Envelope<double>& envelope() const;
|
||||
virtual ~local_datasource();
|
||||
private:
|
||||
static std::string name_;
|
||||
Envelope<double> extent_;
|
||||
std::vector<Feature*>
|
||||
};
|
||||
*/
|
||||
}
|
||||
|
||||
#endif //LOCAL_DATASOURCE_HPP
|
|
@ -104,7 +104,7 @@ namespace mapnik
|
|||
unsigned char get_wrap_char() const; // character used to wrap lines
|
||||
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 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);
|
||||
unsigned get_line_spacing() const; // spacing between lines of text
|
||||
|
@ -124,7 +124,7 @@ namespace mapnik
|
|||
std::string const& get_face_name() const;
|
||||
void set_face_name(std::string face_name);
|
||||
FontSet const& get_fontset() const;
|
||||
void set_fontset(FontSet fontset);
|
||||
void set_fontset(FontSet const& fontset);
|
||||
color const& get_fill() const;
|
||||
void set_fill(color const& fill);
|
||||
void set_halo_fill(color const& fill);
|
||||
|
|
|
@ -71,10 +71,10 @@ namespace mapnik
|
|||
unsigned int g = (in >> 8) & 0xff;
|
||||
unsigned int b = (in >> 0) & 0xff;
|
||||
|
||||
#define DE_ALPHA(x) do { \
|
||||
if (a == 0) x = 0; \
|
||||
else x = x * 255 / a; \
|
||||
if (x > 255) x = 255; \
|
||||
#define DE_ALPHA(x) do { \
|
||||
if (a == 0) x = 0; \
|
||||
else x = x * 255 / a; \
|
||||
if (x > 255) x = 255; \
|
||||
} while(0)
|
||||
|
||||
DE_ALPHA(r);
|
||||
|
|
|
@ -91,11 +91,9 @@ namespace mapnik
|
|||
allow_overlap(sym.get_allow_overlap()),
|
||||
dimensions(),
|
||||
text_size(sym.get_text_size())
|
||||
{
|
||||
}
|
||||
placement::~placement()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
placement::~placement() {}
|
||||
|
||||
template<typename T>
|
||||
std::pair<double, double> get_position_at_distance(double target_distance, T & shape_path)
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
#include <mapnik/text_symbolizer.hpp>
|
||||
// boost
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
//stl
|
||||
#include <iostream>
|
||||
|
||||
static const char * label_placement_strings[] = {
|
||||
"point",
|
||||
|
@ -227,7 +225,7 @@ namespace mapnik
|
|||
face_name_ = face_name;
|
||||
}
|
||||
|
||||
void text_symbolizer::set_fontset(FontSet fontset)
|
||||
void text_symbolizer::set_fontset(FontSet const& fontset)
|
||||
{
|
||||
fontset_ = fontset;
|
||||
}
|
||||
|
@ -282,7 +280,7 @@ namespace mapnik
|
|||
wrap_char_ = character;
|
||||
}
|
||||
|
||||
void text_symbolizer::set_wrap_char_from_string(std::string character)
|
||||
void text_symbolizer::set_wrap_char_from_string(std::string const& character)
|
||||
{
|
||||
wrap_char_ = (character)[0];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue