| 63 | ///////////////////////////////////////////////////////////////////////////////////////// |
| 64 | |
| 65 | PyObject* ITriColorFunction_Thunk::PyUpdateColor( PyObject* args ) |
| 66 | { |
| 67 | PyObject* t; |
| 68 | if( !PyArg_ParseTuple( args, "O", &t ) ) |
| 69 | return NULL; |
| 70 | |
| 71 | ITriColorPtr q; |
| 72 | q.Attach( new OTriColor ); |
| 73 | |
| 74 | if( PyLong_Check( t ) ) |
| 75 | { |
| 76 | Color tmpResult; |
| 77 | q->SetColor( Update( &tmpResult, Be::Time( PyLong_AsLongLong( t ) ) ) ); |
| 78 | } |
| 79 | else if( PyFloat_Check( t ) ) |
| 80 | { |
| 81 | Color tmpResult; |
| 82 | q->SetColor( Update( &tmpResult, PyFloat_AS_DOUBLE( t ) ) ); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | BeOS->SetError( BEDEF, Clsid(), "arg must be of type LongLong (Be::Time) or float" ); |
| 87 | return nullptr; |
| 88 | } |
| 89 | return PyOS->WrapBlueObject( q ); |
| 90 | } |
| 91 | |
| 92 | |
| 93 | PyObject* ITriColorFunction_Thunk::PyGetColorAt( PyObject* args ) |