[Jahshaka-cvs] jah/jahwidgets/src/qt3/python color.cpp,1.1,1.2
Status: Beta
Brought to you by:
jahshaka
From: John B. <ok_...@us...> - 2006-09-05 17:15:56
|
Update of /cvsroot/jahshaka/jah/jahwidgets/src/qt3/python In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22294/jahwidgets/src/qt3/python Modified Files: color.cpp Log Message: * Fixing conflicting python scopes Index: color.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/python/color.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- color.cpp 5 Sep 2006 17:13:53 -0000 1.1 +++ color.cpp 5 Sep 2006 17:15:52 -0000 1.2 @@ -33,22 +33,6 @@ .def( "set_rgb", QColor_setRgb ) ; - // Color - define scope for structs and enums - py::scope in_qt3_color = py::class_< qt3::Color >( "color", py::init< int, int, int, int >( ) ) - .def( py::init<QColor>() ) - .add_property( "rgba", &qt3::Color::getRGBA, qt3::RGBA_setter ) - .add_property( "hsva", &qt3::Color::getHSVA, qt3::HSVA_setter ) - .add_property( "yuva", &qt3::Color::getYUVA, qt3::YUVA_setter ) - .add_property( "ycbcra", &qt3::Color::getYCbCrA, qt3::YCbCrA_setter ) - .def( "qcolor", &qt3::Color::toQColor ) - .def( "set_ycbcr_model", &qt3::Color::setYCbCrRGBModel ) - ; - - py::enum_<qt3::Color::YCbCrRGBModel>( "ycbcr_model" ) - .value( "itur_bt_601", qt3::Color::ITUR_BT_601 ) - .value( "itur_bt_709", qt3::Color::ITUR_BT_709 ) - ; - py::class_< qt3::RGBA >( "rgba", py::init< int, int, int, int >( ) ) .def_readwrite( "r", &qt3::RGBA::R ) .def_readwrite( "g", &qt3::RGBA::G ) @@ -76,5 +60,21 @@ .def_readwrite( "cr", &qt3::YCbCrA::Cr ) .def_readwrite( "a", &qt3::YCbCrA::A ) ; + + // Color - define scope for enum + py::scope in_qt3_color = py::class_< qt3::Color >( "color", py::init< int, int, int, int >( ) ) + .def( py::init<QColor>() ) + .add_property( "rgba", &qt3::Color::getRGBA, qt3::RGBA_setter ) + .add_property( "hsva", &qt3::Color::getHSVA, qt3::HSVA_setter ) + .add_property( "yuva", &qt3::Color::getYUVA, qt3::YUVA_setter ) + .add_property( "ycbcra", &qt3::Color::getYCbCrA, qt3::YCbCrA_setter ) + .def( "qcolor", &qt3::Color::toQColor ) + .def( "set_ycbcr_model", &qt3::Color::setYCbCrRGBModel ) + ; + + py::enum_<qt3::Color::YCbCrRGBModel>( "ycbcr_model" ) + .value( "itur_bt_601", qt3::Color::ITUR_BT_601 ) + .value( "itur_bt_709", qt3::Color::ITUR_BT_709 ) + ; } |