More code clean-up and python3 compliance

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1022 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
remi-k 2009-02-26 12:36:06 +00:00
parent 79bf5c6252
commit af3dd7c630
40 changed files with 364 additions and 714 deletions

View file

@ -22,62 +22,26 @@
//
////////////////////////////////////////////////////////////
#include <SFML/Window/Event.hpp>
#include <Python.h>
#include <structmember.h>
#include "Joy.hpp"
#include "compat.hpp"
typedef struct {
PyObject_HEAD
} PySfJoy;
static PyMemberDef PySfJoy_members[] = {
{NULL} /* Sentinel */
};
static void
PySfJoy_dealloc(PySfJoy *self)
{
self->ob_type->tp_free((PyObject*)self);
}
static PyObject *
PySfJoy_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PySfJoy *self;
self = (PySfJoy *)type->tp_alloc(type, 0);
if (self != NULL)
{
}
return (PyObject *)self;
}
static int
PySfJoy_init(PySfJoy *self, PyObject *args, PyObject *kwds)
{
return 0;
}
static PyMethodDef PySfJoy_methods[] = {
{NULL} /* Sentinel */
};
PyTypeObject PySfJoyType = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
head_init
"Joy", /*tp_name*/
sizeof(PySfJoy), /*tp_basicsize*/
0, /*tp_itemsize*/
(destructor)PySfJoy_dealloc, /*tp_dealloc*/
0, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@ -100,15 +64,15 @@ PyTypeObject PySfJoyType = {
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
PySfJoy_methods, /* tp_methods */
PySfJoy_members, /* tp_members */
0, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
(initproc)PySfJoy_init, /* tp_init */
0, /* tp_init */
0, /* tp_alloc */
PySfJoy_new, /* tp_new */
};
@ -116,25 +80,25 @@ PyTypeObject PySfJoyType = {
void PySfJoy_InitConst()
{
PyObject *obj;
obj = PyInt_FromLong(sf::Joy::AxisX);
obj = PyLong_FromLong(sf::Joy::AxisX);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisX", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisY);
obj = PyLong_FromLong(sf::Joy::AxisY);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisY", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisZ);
obj = PyLong_FromLong(sf::Joy::AxisZ);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisZ", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisR);
obj = PyLong_FromLong(sf::Joy::AxisR);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisR", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisU);
obj = PyLong_FromLong(sf::Joy::AxisU);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisU", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisV);
obj = PyLong_FromLong(sf::Joy::AxisV);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisV", obj);
Py_DECREF(obj);
obj = PyInt_FromLong(sf::Joy::AxisPOV);
obj = PyLong_FromLong(sf::Joy::AxisPOV);
PyDict_SetItemString(PySfJoyType.tp_dict, "AxisPOV", obj);
Py_DECREF(obj);
}