workaround for enumeration python binding issue::
allow implicit conversion from long
This commit is contained in:
parent
f736196cb4
commit
1c5bbea587
2 changed files with 7 additions and 2 deletions
|
@ -30,12 +30,12 @@ void export_stroke ()
|
||||||
using namespace mapnik;
|
using namespace mapnik;
|
||||||
using namespace boost::python;
|
using namespace boost::python;
|
||||||
|
|
||||||
enum_<line_cap_enum>("line_cap")
|
enum_<line_cap_e>("line_cap")
|
||||||
.value("BUTT_CAP",BUTT_CAP)
|
.value("BUTT_CAP",BUTT_CAP)
|
||||||
.value("SQUARE_CAP",SQUARE_CAP)
|
.value("SQUARE_CAP",SQUARE_CAP)
|
||||||
.value("ROUND_CAP",ROUND_CAP)
|
.value("ROUND_CAP",ROUND_CAP)
|
||||||
;
|
;
|
||||||
enum_<line_join_enum>("line_join")
|
enum_<line_join_e>("line_join")
|
||||||
.value("MITER_JOIN",MITER_JOIN)
|
.value("MITER_JOIN",MITER_JOIN)
|
||||||
.value("MITER_REVERT_JOIN",MITER_REVERT_JOIN)
|
.value("MITER_REVERT_JOIN",MITER_REVERT_JOIN)
|
||||||
.value("ROUND_JOIN",ROUND_JOIN)
|
.value("ROUND_JOIN",ROUND_JOIN)
|
||||||
|
|
|
@ -134,6 +134,7 @@ class enumeration {
|
||||||
typedef ENUM Native;
|
typedef ENUM Native;
|
||||||
enumeration() {};
|
enumeration() {};
|
||||||
enumeration( ENUM v ) : value_(v) {}
|
enumeration( ENUM v ) : value_(v) {}
|
||||||
|
enumeration( long v ) : value_(ENUM(v)) {}
|
||||||
enumeration( const enumeration & other ) : value_(other.value_) {}
|
enumeration( const enumeration & other ) : value_(other.value_) {}
|
||||||
|
|
||||||
/** Assignment operator for native enum values. */
|
/** Assignment operator for native enum values. */
|
||||||
|
@ -141,6 +142,10 @@ class enumeration {
|
||||||
{
|
{
|
||||||
value_ = v;
|
value_ = v;
|
||||||
}
|
}
|
||||||
|
void operator=(long v)
|
||||||
|
{
|
||||||
|
value_ = ENUM(v);
|
||||||
|
}
|
||||||
|
|
||||||
/** Assignment operator. */
|
/** Assignment operator. */
|
||||||
void operator=(const enumeration & other)
|
void operator=(const enumeration & other)
|
||||||
|
|
Loading…
Reference in a new issue