equal
deleted
inserted
replaced
|
1 /* |
|
2 * |
|
3 * Contributors: |
|
4 * NTT DOCOMO, INC. -- Syborg QEMU crashes when using skin + touchscreen device |
|
5 * |
|
6 */ |
|
7 |
1 #include "Python.h" |
8 #include "Python.h" |
2 #include "structmember.h" |
9 #include "structmember.h" |
3 #include "hw/hw.h" |
10 #include "hw/hw.h" |
4 #include "sysemu.h" |
11 #include "sysemu.h" |
5 #include "devtree.h" |
12 #include "devtree.h" |
1860 } |
1867 } |
1861 |
1868 |
1862 static PyObject *qemu_py_register_mouse(PyObject *self, PyObject *args, |
1869 static PyObject *qemu_py_register_mouse(PyObject *self, PyObject *args, |
1863 PyObject *kwds) |
1870 PyObject *kwds) |
1864 { |
1871 { |
1865 static char *kwlist[] = {"handler", "absolute", NULL}; |
1872 static char *kwlist[] = {"handler", "absolute", "devid", NULL}; |
1866 PyObject *fn; |
1873 PyObject *fn; |
1867 int absolute; |
1874 int absolute; |
1868 |
1875 char *devid; |
1869 if (!PyArg_ParseTupleAndKeywords(args, kwds, "Oi", kwlist, &fn, &absolute)) |
1876 |
|
1877 if (!PyArg_ParseTupleAndKeywords(args, kwds, "Ois", kwlist, &fn, &absolute, &devid)) |
1870 return NULL; |
1878 return NULL; |
1871 |
1879 |
1872 if (!PyCallable_Check(fn)) { |
1880 if (!PyCallable_Check(fn)) { |
1873 PyErr_SetString(PyExc_TypeError, "mouse handler must be callable"); |
1881 PyErr_SetString(PyExc_TypeError, "mouse handler must be callable"); |
1874 return NULL; |
1882 return NULL; |
1875 } |
1883 } |
1876 |
1884 |
1877 Py_INCREF(fn); |
1885 Py_INCREF(fn); |
1878 gui_register_mouse_event_handler(qemu_py_mouse_event, fn, absolute, "dev"); |
1886 gui_register_mouse_event_handler(qemu_py_mouse_event, fn, absolute, devid); |
1879 |
1887 |
1880 Py_RETURN_NONE; |
1888 Py_RETURN_NONE; |
1881 } |
1889 } |
1882 |
1890 |
1883 static PyMethodDef qemu_py_methods[] = |
1891 static PyMethodDef qemu_py_methods[] = |