#include <qpoint.h>

static void pyqt_qpoint_free( void* ptr )
{
    delete (QPoint*)ptr;
}

static QPoint* pyqt_qpoint_toCpp( PyObject* obj )
{
    return (QPoint*)getPointer( obj, Point );
}

static PyObject* pyqt_qpoint_toPython( const QPoint& ptr )
{
    return qobjectToPython( new QPoint( ptr ), Point );
}

static PyObject* pyqt_qpoint_constructor( void* /* ptr */, PyObject* obj, PyObject* arg_tuple )
{
    if ( !obj )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        void* ptr = new QPoint;
        mapObject( obj, ptr, pyqt_qpoint_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    PyObject* _0param = 0;
    if ( PyArg_ParseTuple( arg_tuple, "O", &_0param )  && inherits( _0param, Point ) )
    {
	PyErr_Clear();	
        void* ptr = new QPoint( *pyqt_qpoint_toCpp( _0param ) );
        mapObject( obj, ptr, pyqt_qpoint_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    int _1param;
    int _2param;
    if ( PyArg_ParseTuple( arg_tuple, "ii", &_1param, &_2param )  )
    {
	PyErr_Clear();	
        void* ptr = new QPoint( _1param, _2param );
        mapObject( obj, ptr, pyqt_qpoint_class, Python );
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qpoint_setY( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    int _0param;
    if ( PyArg_ParseTuple( arg_tuple, "i", &_0param )  )
    {
        ((QPoint*)ptr)->setY(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qpoint_setX( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    int _0param;
    if ( PyArg_ParseTuple( arg_tuple, "i", &_0param )  )
    {
        ((QPoint*)ptr)->setX(_0param);
        Py_INCREF( Py_None );
        return Py_None;
    }
    return NULL;
}

static PyObject* pyqt_qpoint_x( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("i", ((QPoint*)ptr)->x() );
    }
    return NULL;
}

static PyObject* pyqt_qpoint_y( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("i", ((QPoint*)ptr)->y() );
    }
    return NULL;
}

static PyObject* pyqt_qpoint_manhattanLength( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("i", ((QPoint*)ptr)->manhattanLength() );
    }
    return NULL;
}

static PyObject* pyqt_qpoint_isNull( void* ptr, PyObject* /* obj */, PyObject* arg_tuple )
{
    if ( !ptr )
        return NULL;
    if ( PyTuple_Size( arg_tuple ) == 0 )
    {
        return Py_BuildValue("b", (char)((QPoint*)ptr)->isNull() );
    }
    return NULL;
}

static PyQt_Method pyqt_qpoint_methods[] = {
    pyqt_qpoint_constructor,
    pyqt_qpoint_setY,
    pyqt_qpoint_setX,
    pyqt_qpoint_x,
    pyqt_qpoint_y,
    pyqt_qpoint_manhattanLength,
    pyqt_qpoint_isNull,
    0
};

static void pyqt_qpoint_init()
{
    if ( pyqt_qpoint_class )
        return;

    pyqt_qpoint_class = new PyQt_ClassInfo;
    pyqt_qpoint_class->freeQt = pyqt_qpoint_free;
    pyqt_qpoint_class->methods = pyqt_qpoint_methods;
    pyqt_qpoint_class->methodCount = methodCount( pyqt_qpoint_methods );
    pyqt_qpoint_class->next = 0;
    pyqt_qpoint_class->classid = Point;
    pyqt_qpoint_class->classObject = PyDict_GetItemString( pyqt_qt_dict, "QPoint" );
    pyqt_qpoint_class->className = "QPoint";
    ASSERT( pyqt_qpoint_class->classObject );
}


