[Xfce4-commits] r30171 - pyxfce/branches/4.6/netk
Danny Milosavljevic
dannym at xfce.org
Fri Jul 3 00:23:29 CEST 2009
Author: dannym
Date: 2009-07-02 22:23:29 +0000 (Thu, 02 Jul 2009)
New Revision: 30171
Modified:
pyxfce/branches/4.6/netk/application.c
pyxfce/branches/4.6/netk/class_group.c
pyxfce/branches/4.6/netk/enum_types.c
pyxfce/branches/4.6/netk/pager.c
pyxfce/branches/4.6/netk/screen.c
pyxfce/branches/4.6/netk/tasklist.c
pyxfce/branches/4.6/netk/trayicon.c
pyxfce/branches/4.6/netk/util.c
pyxfce/branches/4.6/netk/window.c
pyxfce/branches/4.6/netk/window_action_menu.c
pyxfce/branches/4.6/netk/window_menu.c
pyxfce/branches/4.6/netk/workspace.c
Log:
pyxfce 4.6: commit pygtk-gen updates in 'netk'.
Modified: pyxfce/branches/4.6/netk/application.c
===================================================================
--- pyxfce/branches/4.6/netk/application.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/application.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -18,7 +18,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkApplication_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkApplication_Type;
#line 24 "application.c"
@@ -31,7 +31,9 @@
{
gulong ret;
+
ret = netk_application_get_xid(NETK_APPLICATION(self->obj));
+
return PyLong_FromUnsignedLong(ret);
}
@@ -71,7 +73,7 @@
}
return py_list;
}
-#line 75 "application.c"
+#line 77 "application.c"
static PyObject *
@@ -79,7 +81,9 @@
{
int ret;
+
ret = netk_application_get_n_windows(NETK_APPLICATION(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -88,7 +92,9 @@
{
const gchar *ret;
+
ret = netk_application_get_name(NETK_APPLICATION(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -100,7 +106,9 @@
{
const gchar *ret;
+
ret = netk_application_get_icon_name(NETK_APPLICATION(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -112,7 +120,9 @@
{
int ret;
+
ret = netk_application_get_pid(NETK_APPLICATION(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -121,7 +131,9 @@
{
GdkPixbuf *ret;
+
ret = netk_application_get_icon(NETK_APPLICATION(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -131,7 +143,9 @@
{
GdkPixbuf *ret;
+
ret = netk_application_get_mini_icon(NETK_APPLICATION(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -141,63 +155,74 @@
{
int ret;
+
ret = netk_application_get_icon_is_fallback(NETK_APPLICATION(self->obj));
+
return PyBool_FromLong(ret);
}
-static PyMethodDef _PyNetkApplication_methods[] = {
- { "get_xid", (PyCFunction)_wrap_netk_application_get_xid, METH_NOARGS },
- { "get_windows", (PyCFunction)_wrap_netk_application_get_windows, METH_NOARGS },
- { "get_n_windows", (PyCFunction)_wrap_netk_application_get_n_windows, METH_NOARGS },
- { "get_name", (PyCFunction)_wrap_netk_application_get_name, METH_NOARGS },
- { "get_icon_name", (PyCFunction)_wrap_netk_application_get_icon_name, METH_NOARGS },
- { "get_pid", (PyCFunction)_wrap_netk_application_get_pid, METH_NOARGS },
- { "get_icon", (PyCFunction)_wrap_netk_application_get_icon, METH_NOARGS },
- { "get_mini_icon", (PyCFunction)_wrap_netk_application_get_mini_icon, METH_NOARGS },
- { "get_icon_is_fallback", (PyCFunction)_wrap_netk_application_get_icon_is_fallback, METH_NOARGS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkApplication_methods[] = {
+ { "get_xid", (PyCFunction)_wrap_netk_application_get_xid, METH_NOARGS,
+ NULL },
+ { "get_windows", (PyCFunction)_wrap_netk_application_get_windows, METH_NOARGS,
+ NULL },
+ { "get_n_windows", (PyCFunction)_wrap_netk_application_get_n_windows, METH_NOARGS,
+ NULL },
+ { "get_name", (PyCFunction)_wrap_netk_application_get_name, METH_NOARGS,
+ NULL },
+ { "get_icon_name", (PyCFunction)_wrap_netk_application_get_icon_name, METH_NOARGS,
+ NULL },
+ { "get_pid", (PyCFunction)_wrap_netk_application_get_pid, METH_NOARGS,
+ NULL },
+ { "get_icon", (PyCFunction)_wrap_netk_application_get_icon, METH_NOARGS,
+ NULL },
+ { "get_mini_icon", (PyCFunction)_wrap_netk_application_get_mini_icon, METH_NOARGS,
+ NULL },
+ { "get_icon_is_fallback", (PyCFunction)_wrap_netk_application_get_icon_is_fallback, METH_NOARGS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkApplication_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkApplication_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "application.Application", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "application.Application", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkApplication_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkApplication_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)0, /* tp_init */
+ (initproc)0, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -215,16 +240,19 @@
unsigned long xwindow;
NetkApplication *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k:application_get", kwlist, &xwindow))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"k:application_get", kwlist, &xwindow))
return NULL;
+
ret = netk_application_get(xwindow);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
-PyMethodDef pyapplication_functions[] = {
- { "application_get", (PyCFunction)_wrap_netk_application_get, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+const PyMethodDef pyapplication_functions[] = {
+ { "application_get", (PyCFunction)_wrap_netk_application_get, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -234,22 +262,20 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 253 "application.c"
+#line 279 "application.c"
pygobject_register_class(d, "NetkApplication", NETK_TYPE_APPLICATION, &PyNetkApplication_Type, Py_BuildValue("(O)", &PyGObject_Type));
pyg_set_object_has_new_constructor(NETK_TYPE_APPLICATION);
}
Modified: pyxfce/branches/4.6/netk/class_group.c
===================================================================
--- pyxfce/branches/4.6/netk/class_group.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/class_group.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -21,7 +21,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkClassGroup_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkClassGroup_Type;
#line 27 "class_group.c"
@@ -72,7 +72,9 @@
{
const gchar *ret;
+
ret = netk_class_group_get_res_class(NETK_CLASS_GROUP(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -84,7 +86,9 @@
{
const gchar *ret;
+
ret = netk_class_group_get_name(NETK_CLASS_GROUP(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -96,7 +100,9 @@
{
GdkPixbuf *ret;
+
ret = netk_class_group_get_icon(NETK_CLASS_GROUP(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -106,59 +112,66 @@
{
GdkPixbuf *ret;
+
ret = netk_class_group_get_mini_icon(NETK_CLASS_GROUP(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
-static PyMethodDef _PyNetkClassGroup_methods[] = {
- { "get_windows", (PyCFunction)_wrap_netk_class_group_get_windows, METH_NOARGS },
- { "get_res_class", (PyCFunction)_wrap_netk_class_group_get_res_class, METH_NOARGS },
- { "get_name", (PyCFunction)_wrap_netk_class_group_get_name, METH_NOARGS },
- { "get_icon", (PyCFunction)_wrap_netk_class_group_get_icon, METH_NOARGS },
- { "get_mini_icon", (PyCFunction)_wrap_netk_class_group_get_mini_icon, METH_NOARGS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkClassGroup_methods[] = {
+ { "get_windows", (PyCFunction)_wrap_netk_class_group_get_windows, METH_NOARGS,
+ NULL },
+ { "get_res_class", (PyCFunction)_wrap_netk_class_group_get_res_class, METH_NOARGS,
+ NULL },
+ { "get_name", (PyCFunction)_wrap_netk_class_group_get_name, METH_NOARGS,
+ NULL },
+ { "get_icon", (PyCFunction)_wrap_netk_class_group_get_icon, METH_NOARGS,
+ NULL },
+ { "get_mini_icon", (PyCFunction)_wrap_netk_class_group_get_mini_icon, METH_NOARGS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkClassGroup_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkClassGroup_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "classgroup.ClassGroup", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "classgroup.ClassGroup", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkClassGroup_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkClassGroup_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)0, /* tp_init */
+ (initproc)0, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -176,9 +189,11 @@
char *res_class;
NetkClassGroup *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:class_group_get", kwlist, &res_class))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:class_group_get", kwlist, &res_class))
return NULL;
+
ret = netk_class_group_get(res_class);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -190,9 +205,11 @@
char *res_class;
NetkClassGroup *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:p_netk_class_group_create", kwlist, &res_class))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:p_netk_class_group_create", kwlist, &res_class))
return NULL;
+
ret = p_netk_class_group_create(res_class);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -203,9 +220,11 @@
static char *kwlist[] = { "class_group", NULL };
PyGObject *class_group;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:p_netk_class_group_destroy", kwlist, &PyNetkClassGroup_Type, &class_group))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:p_netk_class_group_destroy", kwlist, &PyNetkClassGroup_Type, &class_group))
return NULL;
+
p_netk_class_group_destroy(NETK_CLASS_GROUP(class_group->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -216,9 +235,11 @@
static char *kwlist[] = { "class_group", "window", NULL };
PyGObject *class_group, *window;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O!:p_netk_class_group_add_window", kwlist, &PyNetkClassGroup_Type, &class_group, &PyNetkWindow_Type, &window))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O!:p_netk_class_group_add_window", kwlist, &PyNetkClassGroup_Type, &class_group, &PyNetkWindow_Type, &window))
return NULL;
+
p_netk_class_group_add_window(NETK_CLASS_GROUP(class_group->obj), NETK_WINDOW(window->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -229,20 +250,27 @@
static char *kwlist[] = { "class_group", "window", NULL };
PyGObject *class_group, *window;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!O!:p_netk_class_group_remove_window", kwlist, &PyNetkClassGroup_Type, &class_group, &PyNetkWindow_Type, &window))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!O!:p_netk_class_group_remove_window", kwlist, &PyNetkClassGroup_Type, &class_group, &PyNetkWindow_Type, &window))
return NULL;
+
p_netk_class_group_remove_window(NETK_CLASS_GROUP(class_group->obj), NETK_WINDOW(window->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
-PyMethodDef pyclass_group_functions[] = {
- { "class_group_get", (PyCFunction)_wrap_netk_class_group_get, METH_VARARGS|METH_KEYWORDS },
- { "p_netk_class_group_create", (PyCFunction)_wrap_p_netk_class_group_create, METH_VARARGS|METH_KEYWORDS },
- { "p_netk_class_group_destroy", (PyCFunction)_wrap_p_netk_class_group_destroy, METH_VARARGS|METH_KEYWORDS },
- { "p_netk_class_group_add_window", (PyCFunction)_wrap_p_netk_class_group_add_window, METH_VARARGS|METH_KEYWORDS },
- { "p_netk_class_group_remove_window", (PyCFunction)_wrap_p_netk_class_group_remove_window, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+const PyMethodDef pyclass_group_functions[] = {
+ { "class_group_get", (PyCFunction)_wrap_netk_class_group_get, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "p_netk_class_group_create", (PyCFunction)_wrap_p_netk_class_group_create, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "p_netk_class_group_destroy", (PyCFunction)_wrap_p_netk_class_group_destroy, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "p_netk_class_group_add_window", (PyCFunction)_wrap_p_netk_class_group_add_window, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "p_netk_class_group_remove_window", (PyCFunction)_wrap_p_netk_class_group_remove_window, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -252,22 +280,20 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 271 "class_group.c"
+#line 297 "class_group.c"
pygobject_register_class(d, "NetkClassGroup", NETK_TYPE_CLASS_GROUP, &PyNetkClassGroup_Type, Py_BuildValue("(O)", &PyGObject_Type));
pyg_set_object_has_new_constructor(NETK_TYPE_CLASS_GROUP);
}
Modified: pyxfce/branches/4.6/netk/enum_types.c
===================================================================
--- pyxfce/branches/4.6/netk/enum_types.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/enum_types.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -25,8 +25,8 @@
/* ----------- functions ----------- */
-PyMethodDef pyenum_types_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pyenum_types_functions[] = {
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -36,20 +36,18 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 55 "enum_types.c"
+#line 53 "enum_types.c"
}
Modified: pyxfce/branches/4.6/netk/pager.c
===================================================================
--- pyxfce/branches/4.6/netk/pager.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/pager.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -22,7 +22,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkPager_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkPager_Type;
#line 28 "pager.c"
@@ -36,7 +36,7 @@
static char *kwlist[] = { "screen", NULL };
PyGObject *screen;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkPager.__init__", kwlist, &PyNetkScreen_Type, &screen))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkPager.__init__", kwlist, &PyNetkScreen_Type, &screen))
return -1;
self->obj = (GObject *)netk_pager_new(NETK_SCREEN(screen->obj));
@@ -54,9 +54,11 @@
static char *kwlist[] = { "screen", NULL };
PyGObject *screen;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkPager.set_screen", kwlist, &PyNetkScreen_Type, &screen))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkPager.set_screen", kwlist, &PyNetkScreen_Type, &screen))
return NULL;
+
netk_pager_set_screen(NETK_PAGER(self->obj), NETK_SCREEN(screen->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -68,11 +70,13 @@
GtkOrientation orientation;
PyObject *py_orientation = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:NetkPager.set_orientation", kwlist, &py_orientation))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:NetkPager.set_orientation", kwlist, &py_orientation))
return NULL;
- if (pyg_enum_get_value(GTK_TYPE_ORIENTATION, py_orientation, (gint *)&orientation))
+ if (pyg_enum_get_value(GTK_TYPE_ORIENTATION, py_orientation, (gpointer)&orientation))
return NULL;
+
netk_pager_set_orientation(NETK_PAGER(self->obj), orientation);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -83,9 +87,11 @@
static char *kwlist[] = { "n_rows", NULL };
int n_rows;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkPager.set_n_rows", kwlist, &n_rows))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkPager.set_n_rows", kwlist, &n_rows))
return NULL;
+
netk_pager_set_n_rows(NETK_PAGER(self->obj), n_rows);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -97,11 +103,13 @@
NetkPagerDisplayMode mode;
PyObject *py_mode = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:NetkPager.set_display_mode", kwlist, &py_mode))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:NetkPager.set_display_mode", kwlist, &py_mode))
return NULL;
- if (pyg_enum_get_value(NETK_TYPE_PAGER_DISPLAY_MODE, py_mode, (gint *)&mode))
+ if (pyg_enum_get_value(NETK_TYPE_PAGER_DISPLAY_MODE, py_mode, (gpointer)&mode))
return NULL;
+
netk_pager_set_display_mode(NETK_PAGER(self->obj), mode);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -112,78 +120,105 @@
static char *kwlist[] = { "show_all_workspaces", NULL };
int show_all_workspaces;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkPager.set_show_all", kwlist, &show_all_workspaces))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkPager.set_show_all", kwlist, &show_all_workspaces))
return NULL;
+
netk_pager_set_show_all(NETK_PAGER(self->obj), show_all_workspaces);
+
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
+_wrap_netk_pager_set_workspace_scrolling(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "workspace_scrolling", NULL };
+ int workspace_scrolling;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkPager.set_workspace_scrolling", kwlist, &workspace_scrolling))
+ return NULL;
+
+ netk_pager_set_workspace_scrolling(NETK_PAGER(self->obj), workspace_scrolling);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
_wrap_netk_pager_set_shadow_type(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "shadow_type", NULL };
PyObject *py_shadow_type = NULL;
GtkShadowType shadow_type;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:NetkPager.set_shadow_type", kwlist, &py_shadow_type))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:NetkPager.set_shadow_type", kwlist, &py_shadow_type))
return NULL;
- if (pyg_enum_get_value(GTK_TYPE_SHADOW_TYPE, py_shadow_type, (gint *)&shadow_type))
+ if (pyg_enum_get_value(GTK_TYPE_SHADOW_TYPE, py_shadow_type, (gpointer)&shadow_type))
return NULL;
+
netk_pager_set_shadow_type(NETK_PAGER(self->obj), shadow_type);
+
Py_INCREF(Py_None);
return Py_None;
}
-static PyMethodDef _PyNetkPager_methods[] = {
- { "set_screen", (PyCFunction)_wrap_netk_pager_set_screen, METH_VARARGS|METH_KEYWORDS },
- { "set_orientation", (PyCFunction)_wrap_netk_pager_set_orientation, METH_VARARGS|METH_KEYWORDS },
- { "set_n_rows", (PyCFunction)_wrap_netk_pager_set_n_rows, METH_VARARGS|METH_KEYWORDS },
- { "set_display_mode", (PyCFunction)_wrap_netk_pager_set_display_mode, METH_VARARGS|METH_KEYWORDS },
- { "set_show_all", (PyCFunction)_wrap_netk_pager_set_show_all, METH_VARARGS|METH_KEYWORDS },
- { "set_shadow_type", (PyCFunction)_wrap_netk_pager_set_shadow_type, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkPager_methods[] = {
+ { "set_screen", (PyCFunction)_wrap_netk_pager_set_screen, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_orientation", (PyCFunction)_wrap_netk_pager_set_orientation, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_n_rows", (PyCFunction)_wrap_netk_pager_set_n_rows, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_display_mode", (PyCFunction)_wrap_netk_pager_set_display_mode, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_show_all", (PyCFunction)_wrap_netk_pager_set_show_all, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_workspace_scrolling", (PyCFunction)_wrap_netk_pager_set_workspace_scrolling, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_shadow_type", (PyCFunction)_wrap_netk_pager_set_shadow_type, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkPager_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkPager_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "pager.Pager", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "pager.Pager", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkPager_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkPager_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)_wrap_netk_pager_new, /* tp_init */
+ (initproc)_wrap_netk_pager_new, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -194,8 +229,8 @@
/* ----------- functions ----------- */
-PyMethodDef pypager_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pypager_functions[] = {
+ { NULL, NULL, 0, NULL }
};
@@ -204,6 +239,9 @@
void
pypager_add_constants(PyObject *module, const gchar *strip_prefix)
{
+#ifdef VERSION
+ PyModule_AddStringConstant(module, "__version__", VERSION);
+#endif
pyg_enum_add(module, "PagerDisplayMode", strip_prefix, NETK_TYPE_PAGER_DISPLAY_MODE);
if (PyErr_Occurred())
@@ -217,35 +255,31 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGtkContainer_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Container");
+ _PyGtkContainer_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Container");
if (_PyGtkContainer_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Container from gtk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk");
- return;
+ return ;
}
-#line 250 "pager.c"
+#line 284 "pager.c"
pygobject_register_class(d, "NetkPager", NETK_TYPE_PAGER, &PyNetkPager_Type, Py_BuildValue("(O)", &PyGtkContainer_Type));
}
Modified: pyxfce/branches/4.6/netk/screen.c
===================================================================
--- pyxfce/branches/4.6/netk/screen.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/screen.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -18,7 +18,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkScreen_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkScreen_Type;
#line 24 "screen.c"
@@ -31,7 +31,9 @@
{
int ret;
+
ret = netk_screen_get_number(NETK_SCREEN(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -42,9 +44,11 @@
int workspace;
NetkWorkspace *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkScreen.get_workspace", kwlist, &workspace))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkScreen.get_workspace", kwlist, &workspace))
return NULL;
+
ret = netk_screen_get_workspace(NETK_SCREEN(self->obj), workspace);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -54,7 +58,9 @@
{
NetkWorkspace *ret;
+
ret = netk_screen_get_active_workspace(NETK_SCREEN(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -64,7 +70,9 @@
{
NetkWindow *ret;
+
ret = netk_screen_get_active_window(NETK_SCREEN(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -104,7 +112,7 @@
}
return py_list;
}
-#line 108 "screen.c"
+#line 116 "screen.c"
#line 63 "screen.override"
@@ -141,13 +149,40 @@
}
return py_list;
}
-#line 145 "screen.c"
+#line 153 "screen.c"
+#line 124 "screen.override"
static PyObject *
+_wrap_netk_screen_get_workspaces(PyGObject *self)
+{
+ PyObject *pyworkspace;
+ PyObject *py_list;
+ int cnt, i;
+
+ cnt = netk_screen_get_workspace_count(NETK_SCREEN(self->obj));
+
+ if ((py_list = PyList_New(0)) == NULL) {
+ return NULL;
+ }
+
+ for(i = 0; i < cnt; i++) {
+ pyworkspace = pygobject_new(G_OBJECT(netk_screen_get_workspace(NETK_SCREEN(self->obj), i))); /* will g_object_ref and sink if applicable */
+
+ PyList_Append(py_list, pyworkspace);
+ Py_DECREF(pyworkspace);
+ }
+ return py_list;
+}
+#line 178 "screen.c"
+
+
+static PyObject *
_wrap_netk_screen_force_update(PyGObject *self)
{
+
netk_screen_force_update(NETK_SCREEN(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -157,7 +192,9 @@
{
int ret;
+
ret = netk_screen_get_workspace_count(NETK_SCREEN(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -167,9 +204,11 @@
static char *kwlist[] = { "count", NULL };
int count;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkScreen.change_workspace_count", kwlist, &count))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkScreen.change_workspace_count", kwlist, &count))
return NULL;
+
netk_screen_change_workspace_count(NETK_SCREEN(self->obj), count);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -181,9 +220,11 @@
char *atom;
int ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:NetkScreen.net_wm_supports", kwlist, &atom))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:NetkScreen.net_wm_supports", kwlist, &atom))
return NULL;
+
ret = netk_screen_net_wm_supports(NETK_SCREEN(self->obj), atom);
+
return PyBool_FromLong(ret);
}
@@ -213,7 +254,7 @@
return Py_None;
}
}
-#line 217 "screen.c"
+#line 258 "screen.c"
static PyObject *
@@ -221,7 +262,9 @@
{
int ret;
+
ret = netk_screen_get_width(NETK_SCREEN(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -230,7 +273,9 @@
{
int ret;
+
ret = netk_screen_get_height(NETK_SCREEN(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -239,7 +284,9 @@
{
int ret;
+
ret = netk_screen_get_showing_desktop(NETK_SCREEN(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -250,9 +297,11 @@
static char *kwlist[] = { "show", NULL };
int show;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkScreen.toggle_showing_desktop", kwlist, &show))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkScreen.toggle_showing_desktop", kwlist, &show))
return NULL;
+
netk_screen_toggle_showing_desktop(NETK_SCREEN(self->obj), show);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -263,9 +312,11 @@
static char *kwlist[] = { "x", "y", NULL };
int x, y;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii:NetkScreen.move_viewport", kwlist, &x, &y))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ii:NetkScreen.move_viewport", kwlist, &x, &y))
return NULL;
+
netk_screen_move_viewport(NETK_SCREEN(self->obj), x, y);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -276,9 +327,11 @@
static char *kwlist[] = { "current_token", "rows", "columns", NULL };
int current_token, rows, columns, ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iii:NetkScreen.try_set_workspace_layout", kwlist, ¤t_token, &rows, &columns))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iii:NetkScreen.try_set_workspace_layout", kwlist, ¤t_token, &rows, &columns))
return NULL;
+
ret = netk_screen_try_set_workspace_layout(NETK_SCREEN(self->obj), current_token, rows, columns);
+
return PyInt_FromLong(ret);
}
@@ -288,100 +341,96 @@
static char *kwlist[] = { "current_token", NULL };
int current_token;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkScreen.release_workspace_layout", kwlist, ¤t_token))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkScreen.release_workspace_layout", kwlist, ¤t_token))
return NULL;
+
netk_screen_release_workspace_layout(NETK_SCREEN(self->obj), current_token);
+
Py_INCREF(Py_None);
return Py_None;
}
-#line 124 "screen.override"
-static PyObject *
-_wrap_netk_screen_get_workspaces(PyGObject *self)
-{
- PyObject *pyworkspace;
- PyObject *py_list;
- int cnt, i;
-
- cnt = netk_screen_get_workspace_count(NETK_SCREEN(self->obj));
-
- if ((py_list = PyList_New(0)) == NULL) {
- return NULL;
- }
-
- for(i = 0; i < cnt; i++) {
- pyworkspace = pygobject_new(G_OBJECT(netk_screen_get_workspace(NETK_SCREEN(self->obj), i))); /* will g_object_ref and sink if applicable */
-
- PyList_Append(py_list, pyworkspace);
- Py_DECREF(pyworkspace);
- }
- return py_list;
-}
-#line 321 "screen.c"
-
-
-static PyMethodDef _PyNetkScreen_methods[] = {
- { "get_number", (PyCFunction)_wrap_netk_screen_get_number, METH_NOARGS },
- { "get_workspace", (PyCFunction)_wrap_netk_screen_get_workspace, METH_VARARGS|METH_KEYWORDS },
- { "get_active_workspace", (PyCFunction)_wrap_netk_screen_get_active_workspace, METH_NOARGS },
- { "get_active_window", (PyCFunction)_wrap_netk_screen_get_active_window, METH_NOARGS },
- { "get_windows", (PyCFunction)_wrap_netk_screen_get_windows, METH_NOARGS },
- { "get_windows_stacked", (PyCFunction)_wrap_netk_screen_get_windows_stacked, METH_NOARGS },
- { "force_update", (PyCFunction)_wrap_netk_screen_force_update, METH_NOARGS },
- { "get_workspace_count", (PyCFunction)_wrap_netk_screen_get_workspace_count, METH_NOARGS },
- { "change_workspace_count", (PyCFunction)_wrap_netk_screen_change_workspace_count, METH_VARARGS|METH_KEYWORDS },
- { "net_wm_supports", (PyCFunction)_wrap_netk_screen_net_wm_supports, METH_VARARGS|METH_KEYWORDS },
- { "get_background_pixmap", (PyCFunction)_wrap_netk_screen_get_background_pixmap, METH_NOARGS },
- { "get_width", (PyCFunction)_wrap_netk_screen_get_width, METH_NOARGS },
- { "get_height", (PyCFunction)_wrap_netk_screen_get_height, METH_NOARGS },
- { "get_showing_desktop", (PyCFunction)_wrap_netk_screen_get_showing_desktop, METH_NOARGS },
- { "toggle_showing_desktop", (PyCFunction)_wrap_netk_screen_toggle_showing_desktop, METH_VARARGS|METH_KEYWORDS },
- { "move_viewport", (PyCFunction)_wrap_netk_screen_move_viewport, METH_VARARGS|METH_KEYWORDS },
- { "try_set_workspace_layout", (PyCFunction)_wrap_netk_screen_try_set_workspace_layout, METH_VARARGS|METH_KEYWORDS },
- { "release_workspace_layout", (PyCFunction)_wrap_netk_screen_release_workspace_layout, METH_VARARGS|METH_KEYWORDS },
- { "get_workspaces", (PyCFunction)_wrap_netk_screen_get_workspaces, METH_NOARGS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkScreen_methods[] = {
+ { "get_number", (PyCFunction)_wrap_netk_screen_get_number, METH_NOARGS,
+ NULL },
+ { "get_workspace", (PyCFunction)_wrap_netk_screen_get_workspace, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_active_workspace", (PyCFunction)_wrap_netk_screen_get_active_workspace, METH_NOARGS,
+ NULL },
+ { "get_active_window", (PyCFunction)_wrap_netk_screen_get_active_window, METH_NOARGS,
+ NULL },
+ { "get_windows", (PyCFunction)_wrap_netk_screen_get_windows, METH_NOARGS,
+ NULL },
+ { "get_windows_stacked", (PyCFunction)_wrap_netk_screen_get_windows_stacked, METH_NOARGS,
+ NULL },
+ { "get_workspaces", (PyCFunction)_wrap_netk_screen_get_workspaces, METH_NOARGS,
+ NULL },
+ { "force_update", (PyCFunction)_wrap_netk_screen_force_update, METH_NOARGS,
+ NULL },
+ { "get_workspace_count", (PyCFunction)_wrap_netk_screen_get_workspace_count, METH_NOARGS,
+ NULL },
+ { "change_workspace_count", (PyCFunction)_wrap_netk_screen_change_workspace_count, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "net_wm_supports", (PyCFunction)_wrap_netk_screen_net_wm_supports, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_background_pixmap", (PyCFunction)_wrap_netk_screen_get_background_pixmap, METH_NOARGS,
+ NULL },
+ { "get_width", (PyCFunction)_wrap_netk_screen_get_width, METH_NOARGS,
+ NULL },
+ { "get_height", (PyCFunction)_wrap_netk_screen_get_height, METH_NOARGS,
+ NULL },
+ { "get_showing_desktop", (PyCFunction)_wrap_netk_screen_get_showing_desktop, METH_NOARGS,
+ NULL },
+ { "toggle_showing_desktop", (PyCFunction)_wrap_netk_screen_toggle_showing_desktop, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "move_viewport", (PyCFunction)_wrap_netk_screen_move_viewport, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "try_set_workspace_layout", (PyCFunction)_wrap_netk_screen_try_set_workspace_layout, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "release_workspace_layout", (PyCFunction)_wrap_netk_screen_release_workspace_layout, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkScreen_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkScreen_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "netk.Screen", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "netk.Screen", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkScreen_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkScreen_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)0, /* tp_init */
+ (initproc)0, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -397,7 +446,9 @@
{
NetkScreen *ret;
+
ret = netk_screen_get_default();
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -409,9 +460,11 @@
int index;
NetkScreen *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:screen_get", kwlist, &index))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:screen_get", kwlist, &index))
return NULL;
+
ret = netk_screen_get(index);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -423,18 +476,23 @@
unsigned long root_window_id;
NetkScreen *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k:screen_get_for_root", kwlist, &root_window_id))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"k:screen_get_for_root", kwlist, &root_window_id))
return NULL;
+
ret = netk_screen_get_for_root(root_window_id);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
-PyMethodDef pyscreen_functions[] = {
- { "screen_get_default", (PyCFunction)_wrap_netk_screen_get_default, METH_NOARGS },
- { "screen_get", (PyCFunction)_wrap_netk_screen_get, METH_VARARGS|METH_KEYWORDS },
- { "screen_get_for_root", (PyCFunction)_wrap_netk_screen_get_for_root, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+const PyMethodDef pyscreen_functions[] = {
+ { "screen_get_default", (PyCFunction)_wrap_netk_screen_get_default, METH_NOARGS,
+ NULL },
+ { "screen_get", (PyCFunction)_wrap_netk_screen_get, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "screen_get_for_root", (PyCFunction)_wrap_netk_screen_get_for_root, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -444,22 +502,20 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 463 "screen.c"
+#line 519 "screen.c"
pygobject_register_class(d, "NetkScreen", NETK_TYPE_SCREEN, &PyNetkScreen_Type, Py_BuildValue("(O)", &PyGObject_Type));
pyg_set_object_has_new_constructor(NETK_TYPE_SCREEN);
}
Modified: pyxfce/branches/4.6/netk/tasklist.c
===================================================================
--- pyxfce/branches/4.6/netk/tasklist.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/tasklist.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -24,7 +24,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkTasklist_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkTasklist_Type;
#line 30 "tasklist.c"
@@ -38,7 +38,7 @@
static char *kwlist[] = { "screen", NULL };
PyGObject *screen;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkTasklist.__init__", kwlist, &PyNetkScreen_Type, &screen))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkTasklist.__init__", kwlist, &PyNetkScreen_Type, &screen))
return -1;
self->obj = (GObject *)netk_tasklist_new(NETK_SCREEN(screen->obj));
@@ -56,9 +56,11 @@
static char *kwlist[] = { "screen", NULL };
PyGObject *screen;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkTasklist.set_screen", kwlist, &PyNetkScreen_Type, &screen))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkTasklist.set_screen", kwlist, &PyNetkScreen_Type, &screen))
return NULL;
+
netk_tasklist_set_screen(NETK_TASKLIST(self->obj), NETK_SCREEN(screen->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -82,7 +84,7 @@
return py_tuple;
}
-#line 86 "tasklist.c"
+#line 88 "tasklist.c"
static PyObject *
@@ -92,11 +94,13 @@
NetkTasklistGroupingType grouping;
PyObject *py_grouping = NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:NetkTasklist.set_grouping", kwlist, &py_grouping))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:NetkTasklist.set_grouping", kwlist, &py_grouping))
return NULL;
- if (pyg_enum_get_value(NETK_TYPE_TASKLIST_GROUPING_TYPE, py_grouping, (gint *)&grouping))
+ if (pyg_enum_get_value(NETK_TYPE_TASKLIST_GROUPING_TYPE, py_grouping, (gpointer)&grouping))
return NULL;
+
netk_tasklist_set_grouping(NETK_TASKLIST(self->obj), grouping);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -107,9 +111,11 @@
static char *kwlist[] = { "switch_workspace_on_unminimize", NULL };
int switch_workspace_on_unminimize;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_switch_workspace_on_unminimize", kwlist, &switch_workspace_on_unminimize))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_switch_workspace_on_unminimize", kwlist, &switch_workspace_on_unminimize))
return NULL;
+
netk_tasklist_set_switch_workspace_on_unminimize(NETK_TASKLIST(self->obj), switch_workspace_on_unminimize);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -120,9 +126,11 @@
static char *kwlist[] = { "limit", NULL };
int limit;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_grouping_limit", kwlist, &limit))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_grouping_limit", kwlist, &limit))
return NULL;
+
netk_tasklist_set_grouping_limit(NETK_TASKLIST(self->obj), limit);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -133,9 +141,11 @@
static char *kwlist[] = { "include_all_workspaces", NULL };
int include_all_workspaces;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_include_all_workspaces", kwlist, &include_all_workspaces))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_include_all_workspaces", kwlist, &include_all_workspaces))
return NULL;
+
netk_tasklist_set_include_all_workspaces(NETK_TASKLIST(self->obj), include_all_workspaces);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -146,9 +156,11 @@
static char *kwlist[] = { "show_label", NULL };
int show_label;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_show_label", kwlist, &show_label))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_show_label", kwlist, &show_label))
return NULL;
+
netk_tasklist_set_show_label(NETK_TASKLIST(self->obj), show_label);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -159,9 +171,11 @@
static char *kwlist[] = { "size", NULL };
int size;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_minimum_width", kwlist, &size))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_minimum_width", kwlist, &size))
return NULL;
+
netk_tasklist_set_minimum_width(NETK_TASKLIST(self->obj), size);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -171,7 +185,9 @@
{
int ret;
+
ret = netk_tasklist_get_minimum_width(NETK_TASKLIST(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -181,9 +197,11 @@
static char *kwlist[] = { "size", NULL };
int size;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkTasklist.set_minimum_height", kwlist, &size))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkTasklist.set_minimum_height", kwlist, &size))
return NULL;
+
netk_tasklist_set_minimum_height(NETK_TASKLIST(self->obj), size);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -193,64 +211,192 @@
{
int ret;
+
ret = netk_tasklist_get_minimum_height(NETK_TASKLIST(self->obj));
+
return PyInt_FromLong(ret);
}
-static PyMethodDef _PyNetkTasklist_methods[] = {
- { "set_screen", (PyCFunction)_wrap_netk_tasklist_set_screen, METH_VARARGS|METH_KEYWORDS },
- { "get_size_hint_list", (PyCFunction)_wrap_netk_tasklist_get_size_hint_list, METH_NOARGS },
- { "set_grouping", (PyCFunction)_wrap_netk_tasklist_set_grouping, METH_VARARGS|METH_KEYWORDS },
- { "set_switch_workspace_on_unminimize", (PyCFunction)_wrap_netk_tasklist_set_switch_workspace_on_unminimize, METH_VARARGS|METH_KEYWORDS },
- { "set_grouping_limit", (PyCFunction)_wrap_netk_tasklist_set_grouping_limit, METH_VARARGS|METH_KEYWORDS },
- { "set_include_all_workspaces", (PyCFunction)_wrap_netk_tasklist_set_include_all_workspaces, METH_VARARGS|METH_KEYWORDS },
- { "set_show_label", (PyCFunction)_wrap_netk_tasklist_set_show_label, METH_VARARGS|METH_KEYWORDS },
- { "set_minimum_width", (PyCFunction)_wrap_netk_tasklist_set_minimum_width, METH_VARARGS|METH_KEYWORDS },
- { "get_minimum_width", (PyCFunction)_wrap_netk_tasklist_get_minimum_width, METH_NOARGS },
- { "set_minimum_height", (PyCFunction)_wrap_netk_tasklist_set_minimum_height, METH_VARARGS|METH_KEYWORDS },
- { "get_minimum_height", (PyCFunction)_wrap_netk_tasklist_get_minimum_height, METH_NOARGS },
- { NULL, NULL, 0 }
+static PyObject *
+_wrap_netk_tasklist_set_button_relief(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "relief", NULL };
+ GtkReliefStyle relief;
+ PyObject *py_relief = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O:NetkTasklist.set_button_relief", kwlist, &py_relief))
+ return NULL;
+ if (pyg_enum_get_value(GTK_TYPE_RELIEF_STYLE, py_relief, (gpointer)&relief))
+ return NULL;
+
+ netk_tasklist_set_button_relief(NETK_TASKLIST(self->obj), relief);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_screen(PyGObject *self)
+{
+ NetkScreen *ret;
+
+
+ ret = netk_tasklist_get_screen(NETK_TASKLIST(self->obj));
+
+ /* pygobject_new handles NULL checking */
+ return pygobject_new((GObject *)ret);
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_grouping(PyGObject *self)
+{
+ gint ret;
+
+
+ ret = netk_tasklist_get_grouping(NETK_TASKLIST(self->obj));
+
+ return pyg_enum_from_gtype(NETK_TYPE_TASKLIST_GROUPING_TYPE, ret);
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_switch_workspace_on_unminimize(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_tasklist_get_switch_workspace_on_unminimize(NETK_TASKLIST(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_grouping_limit(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_tasklist_get_grouping_limit(NETK_TASKLIST(self->obj));
+
+ return PyInt_FromLong(ret);
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_include_all_workspaces(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_tasklist_get_include_all_workspaces(NETK_TASKLIST(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_show_label(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_tasklist_get_show_label(NETK_TASKLIST(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_netk_tasklist_get_button_relief(PyGObject *self)
+{
+ gint ret;
+
+
+ ret = netk_tasklist_get_button_relief(NETK_TASKLIST(self->obj));
+
+ return pyg_enum_from_gtype(GTK_TYPE_RELIEF_STYLE, ret);
+}
+
+static const PyMethodDef _PyNetkTasklist_methods[] = {
+ { "set_screen", (PyCFunction)_wrap_netk_tasklist_set_screen, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_size_hint_list", (PyCFunction)_wrap_netk_tasklist_get_size_hint_list, METH_NOARGS,
+ NULL },
+ { "set_grouping", (PyCFunction)_wrap_netk_tasklist_set_grouping, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_switch_workspace_on_unminimize", (PyCFunction)_wrap_netk_tasklist_set_switch_workspace_on_unminimize, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_grouping_limit", (PyCFunction)_wrap_netk_tasklist_set_grouping_limit, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_include_all_workspaces", (PyCFunction)_wrap_netk_tasklist_set_include_all_workspaces, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_show_label", (PyCFunction)_wrap_netk_tasklist_set_show_label, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_minimum_width", (PyCFunction)_wrap_netk_tasklist_set_minimum_width, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_minimum_width", (PyCFunction)_wrap_netk_tasklist_get_minimum_width, METH_NOARGS,
+ NULL },
+ { "set_minimum_height", (PyCFunction)_wrap_netk_tasklist_set_minimum_height, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_minimum_height", (PyCFunction)_wrap_netk_tasklist_get_minimum_height, METH_NOARGS,
+ NULL },
+ { "set_button_relief", (PyCFunction)_wrap_netk_tasklist_set_button_relief, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_screen", (PyCFunction)_wrap_netk_tasklist_get_screen, METH_NOARGS,
+ NULL },
+ { "get_grouping", (PyCFunction)_wrap_netk_tasklist_get_grouping, METH_NOARGS,
+ NULL },
+ { "get_switch_workspace_on_unminimize", (PyCFunction)_wrap_netk_tasklist_get_switch_workspace_on_unminimize, METH_NOARGS,
+ NULL },
+ { "get_grouping_limit", (PyCFunction)_wrap_netk_tasklist_get_grouping_limit, METH_NOARGS,
+ NULL },
+ { "get_include_all_workspaces", (PyCFunction)_wrap_netk_tasklist_get_include_all_workspaces, METH_NOARGS,
+ NULL },
+ { "get_show_label", (PyCFunction)_wrap_netk_tasklist_get_show_label, METH_NOARGS,
+ NULL },
+ { "get_button_relief", (PyCFunction)_wrap_netk_tasklist_get_button_relief, METH_NOARGS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkTasklist_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkTasklist_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "tasklist.Tasklist", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "tasklist.Tasklist", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkTasklist_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkTasklist_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)_wrap_netk_tasklist_new, /* tp_init */
+ (initproc)_wrap_netk_tasklist_new, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -261,8 +407,8 @@
/* ----------- functions ----------- */
-PyMethodDef pytasklist_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pytasklist_functions[] = {
+ { NULL, NULL, 0, NULL }
};
@@ -271,6 +417,9 @@
void
pytasklist_add_constants(PyObject *module, const gchar *strip_prefix)
{
+#ifdef VERSION
+ PyModule_AddStringConstant(module, "__version__", VERSION);
+#endif
pyg_enum_add(module, "TasklistGroupingType", strip_prefix, NETK_TYPE_TASKLIST_GROUPING_TYPE);
if (PyErr_Occurred())
@@ -284,49 +433,43 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("screen")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyNetkScreen_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Screen");
+ _PyNetkScreen_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Screen");
if (_PyNetkScreen_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Screen from screen");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import screen");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGtkContainer_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Container");
+ _PyGtkContainer_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Container");
if (_PyGtkContainer_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Container from gtk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk");
- return;
+ return ;
}
-#line 331 "tasklist.c"
+#line 474 "tasklist.c"
pygobject_register_class(d, "NetkTasklist", NETK_TYPE_TASKLIST, &PyNetkTasklist_Type, Py_BuildValue("(O)", &PyGtkContainer_Type));
}
Modified: pyxfce/branches/4.6/netk/trayicon.c
===================================================================
--- pyxfce/branches/4.6/netk/trayicon.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/trayicon.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -30,7 +30,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkTrayIcon_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkTrayIcon_Type;
#line 36 "trayicon.c"
@@ -98,15 +98,32 @@
static PyObject *
+_wrap_netk_tray_icon_set_gdkscreen(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "screen", NULL };
+ PyGObject *screen;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkTrayIcon.set_gdkscreen", kwlist, &PyGdkScreen_Type, &screen))
+ return NULL;
+
+ netk_tray_icon_set_gdkscreen(NETK_TRAY_ICON(self->obj), GDK_SCREEN(screen->obj));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
_wrap_netk_tray_icon_message_new(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "id", "text", NULL };
char *text;
glong id, ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ls:NetkTrayIcon.message_new", kwlist, &id, &text))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"ls:NetkTrayIcon.message_new", kwlist, &id, &text))
return NULL;
+
ret = netk_tray_icon_message_new(NETK_TRAY_ICON(self->obj), id, text);
+
return PyInt_FromLong(ret);
}
@@ -117,59 +134,66 @@
static char *kwlist[] = { "id", NULL };
glong id;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l:NetkTrayIcon.message_cancel", kwlist, &id))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"l:NetkTrayIcon.message_cancel", kwlist, &id))
return NULL;
+
netk_tray_icon_message_cancel(NETK_TRAY_ICON(self->obj), id);
+
Py_INCREF(Py_None);
return Py_None;
}
-static PyMethodDef _PyNetkTrayIcon_methods[] = {
- { "set_screen", (PyCFunction)_wrap_netk_tray_icon_set_screen, METH_VARARGS|METH_KEYWORDS },
- { "message_new", (PyCFunction)_wrap_netk_tray_icon_message_new, METH_VARARGS|METH_KEYWORDS },
- { "message_cancel", (PyCFunction)_wrap_netk_tray_icon_message_cancel, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkTrayIcon_methods[] = {
+ { "set_screen", (PyCFunction)_wrap_netk_tray_icon_set_screen, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_gdkscreen", (PyCFunction)_wrap_netk_tray_icon_set_gdkscreen, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "message_new", (PyCFunction)_wrap_netk_tray_icon_message_new, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "message_cancel", (PyCFunction)_wrap_netk_tray_icon_message_cancel, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkTrayIcon_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkTrayIcon_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "trayicon.TrayIcon", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "trayicon.TrayIcon", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkTrayIcon_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkTrayIcon_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)_wrap_netk_tray_icon_new, /* tp_init */
+ (initproc)_wrap_netk_tray_icon_new, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -180,8 +204,26 @@
/* ----------- functions ----------- */
-PyMethodDef pytrayicon_functions[] = {
- { NULL, NULL, 0 }
+static PyObject *
+_wrap_netk_tray_icon_new_gdk(PyObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "screen", NULL };
+ PyGObject *screen;
+ NetkTrayIcon *ret;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:tray_icon_new_gdk", kwlist, &PyGdkScreen_Type, &screen))
+ return NULL;
+
+ ret = netk_tray_icon_new_gdk(GDK_SCREEN(screen->obj));
+
+ /* pygobject_new handles NULL checking */
+ return pygobject_new((GObject *)ret);
+}
+
+const PyMethodDef pytrayicon_functions[] = {
+ { "tray_icon_new_gdk", (PyCFunction)_wrap_netk_tray_icon_new_gdk, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -191,49 +233,43 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGtkPlug_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Plug");
+ _PyGtkPlug_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Plug");
if (_PyGtkPlug_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Plug from gtk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk.gdk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGdkScreen_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Screen");
+ _PyGdkScreen_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Screen");
if (_PyGdkScreen_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Screen from gtk.gdk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk.gdk");
- return;
+ return ;
}
-#line 238 "trayicon.c"
+#line 274 "trayicon.c"
pygobject_register_class(d, "NetkTrayIcon", NETK_TYPE_TRAY_ICON, &PyNetkTrayIcon_Type, Py_BuildValue("(O)", &PyGtkPlug_Type));
}
Modified: pyxfce/branches/4.6/netk/util.c
===================================================================
--- pyxfce/branches/4.6/netk/util.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/util.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -27,8 +27,8 @@
/* ----------- functions ----------- */
-PyMethodDef pyutil_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pyutil_functions[] = {
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -38,34 +38,30 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGtkWindow_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Window");
+ _PyGtkWindow_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Window");
if (_PyGtkWindow_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Window from gtk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk");
- return;
+ return ;
}
-#line 71 "util.c"
+#line 67 "util.c"
}
Modified: pyxfce/branches/4.6/netk/window.c
===================================================================
--- pyxfce/branches/4.6/netk/window.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/window.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -23,7 +23,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkWindow_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkWindow_Type;
#line 29 "window.c"
@@ -36,7 +36,9 @@
{
NetkScreen *ret;
+
ret = netk_window_get_screen(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -46,7 +48,9 @@
{
const gchar *ret;
+
ret = netk_window_get_name(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -58,7 +62,9 @@
{
const gchar *ret;
+
ret = netk_window_get_icon_name(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -70,7 +76,9 @@
{
NetkApplication *ret;
+
ret = netk_window_get_application(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -80,7 +88,9 @@
{
gulong ret;
+
ret = netk_window_get_group_leader(NETK_WINDOW(self->obj));
+
return PyLong_FromUnsignedLong(ret);
}
@@ -90,7 +100,9 @@
{
gulong ret;
+
ret = netk_window_get_xid(NETK_WINDOW(self->obj));
+
return PyLong_FromUnsignedLong(ret);
}
@@ -100,7 +112,9 @@
{
NetkClassGroup *ret;
+
ret = netk_window_get_class_group(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -110,7 +124,9 @@
{
const gchar *ret;
+
ret = netk_window_get_session_id(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -122,7 +138,9 @@
{
const gchar *ret;
+
ret = netk_window_get_session_id_utf8(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -143,7 +161,7 @@
return PyInt_FromLong(ret);
}
-#line 147 "window.c"
+#line 165 "window.c"
static PyObject *
@@ -151,7 +169,9 @@
{
const gchar *ret;
+
ret = netk_window_get_client_machine(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -163,7 +183,9 @@
{
gint ret;
+
ret = netk_window_get_window_type(NETK_WINDOW(self->obj));
+
return pyg_enum_from_gtype(NETK_TYPE_WINDOW_TYPE, ret);
}
@@ -172,7 +194,9 @@
{
const gchar *ret;
+
ret = netk_window_get_resource_class(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -184,7 +208,9 @@
{
const gchar *ret;
+
ret = netk_window_get_resource_name(NETK_WINDOW(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -196,7 +222,9 @@
{
int ret;
+
ret = netk_window_is_minimized(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -206,7 +234,9 @@
{
int ret;
+
ret = netk_window_is_maximized_horizontally(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -216,7 +246,9 @@
{
int ret;
+
ret = netk_window_is_maximized_vertically(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -226,7 +258,9 @@
{
int ret;
+
ret = netk_window_is_maximized(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -236,7 +270,9 @@
{
int ret;
+
ret = netk_window_is_shaded(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -246,7 +282,9 @@
{
int ret;
+
ret = netk_window_is_skip_pager(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -256,7 +294,9 @@
{
int ret;
+
ret = netk_window_is_skip_tasklist(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -266,20 +306,60 @@
{
int ret;
+
ret = netk_window_is_sticky(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
static PyObject *
+_wrap_netk_window_is_fullscreen(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_window_is_fullscreen(NETK_WINDOW(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_netk_window_demands_attention(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_window_demands_attention(NETK_WINDOW(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
+_wrap_netk_window_or_transient_demands_attention(PyGObject *self)
+{
+ int ret;
+
+
+ ret = netk_window_or_transient_demands_attention(NETK_WINDOW(self->obj));
+
+ return PyBool_FromLong(ret);
+
+}
+
+static PyObject *
_wrap_netk_window_set_skip_pager(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "skip", NULL };
int skip;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkWindow.set_skip_pager", kwlist, &skip))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkWindow.set_skip_pager", kwlist, &skip))
return NULL;
+
netk_window_set_skip_pager(NETK_WINDOW(self->obj), skip);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -290,17 +370,36 @@
static char *kwlist[] = { "skip", NULL };
int skip;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i:NetkWindow.set_skip_tasklist", kwlist, &skip))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkWindow.set_skip_tasklist", kwlist, &skip))
return NULL;
+
netk_window_set_skip_tasklist(NETK_WINDOW(self->obj), skip);
+
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
+_wrap_netk_window_set_fullscreen(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "fullscreen", NULL };
+ int fullscreen;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"i:NetkWindow.set_fullscreen", kwlist, &fullscreen))
+ return NULL;
+
+ netk_window_set_fullscreen(NETK_WINDOW(self->obj), fullscreen);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyObject *
_wrap_netk_window_close(PyGObject *self)
{
+
netk_window_close(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -308,7 +407,9 @@
static PyObject *
_wrap_netk_window_minimize(PyGObject *self)
{
+
netk_window_minimize(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -316,7 +417,9 @@
static PyObject *
_wrap_netk_window_unminimize(PyGObject *self)
{
+
netk_window_unminimize(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -324,7 +427,9 @@
static PyObject *
_wrap_netk_window_maximize(PyGObject *self)
{
+
netk_window_maximize(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -332,7 +437,9 @@
static PyObject *
_wrap_netk_window_unmaximize(PyGObject *self)
{
+
netk_window_unmaximize(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -340,7 +447,9 @@
static PyObject *
_wrap_netk_window_maximize_horizontally(PyGObject *self)
{
+
netk_window_maximize_horizontally(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -348,7 +457,9 @@
static PyObject *
_wrap_netk_window_unmaximize_horizontally(PyGObject *self)
{
+
netk_window_unmaximize_horizontally(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -356,7 +467,9 @@
static PyObject *
_wrap_netk_window_maximize_vertically(PyGObject *self)
{
+
netk_window_maximize_vertically(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -364,7 +477,9 @@
static PyObject *
_wrap_netk_window_unmaximize_vertically(PyGObject *self)
{
+
netk_window_unmaximize_vertically(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -372,7 +487,9 @@
static PyObject *
_wrap_netk_window_shade(PyGObject *self)
{
+
netk_window_shade(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -380,7 +497,9 @@
static PyObject *
_wrap_netk_window_unshade(PyGObject *self)
{
+
netk_window_unshade(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -388,7 +507,9 @@
static PyObject *
_wrap_netk_window_stick(PyGObject *self)
{
+
netk_window_stick(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -396,7 +517,9 @@
static PyObject *
_wrap_netk_window_unstick(PyGObject *self)
{
+
netk_window_unstick(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -404,7 +527,9 @@
static PyObject *
_wrap_netk_window_keyboard_move(PyGObject *self)
{
+
netk_window_keyboard_move(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -412,7 +537,9 @@
static PyObject *
_wrap_netk_window_keyboard_size(PyGObject *self)
{
+
netk_window_keyboard_size(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -422,7 +549,9 @@
{
NetkWorkspace *ret;
+
ret = netk_window_get_workspace(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -433,9 +562,11 @@
static char *kwlist[] = { "space", NULL };
PyGObject *space;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkWindow.move_to_workspace", kwlist, &PyNetkWorkspace_Type, &space))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkWindow.move_to_workspace", kwlist, &PyNetkWorkspace_Type, &space))
return NULL;
+
netk_window_move_to_workspace(NETK_WINDOW(self->obj), NETK_WORKSPACE(space->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -445,7 +576,9 @@
{
int ret;
+
ret = netk_window_is_pinned(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -453,7 +586,9 @@
static PyObject *
_wrap_netk_window_pin(PyGObject *self)
{
+
netk_window_pin(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -461,7 +596,9 @@
static PyObject *
_wrap_netk_window_unpin(PyGObject *self)
{
+
netk_window_unpin(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -469,7 +606,9 @@
static PyObject *
_wrap_netk_window_activate(PyGObject *self)
{
+
netk_window_activate(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -479,7 +618,9 @@
{
int ret;
+
ret = netk_window_is_active(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -487,7 +628,9 @@
static PyObject *
_wrap_netk_window_activate_transient(PyGObject *self)
{
+
netk_window_activate_transient(NETK_WINDOW(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -497,7 +640,9 @@
{
GdkPixbuf *ret;
+
ret = netk_window_get_icon(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -507,7 +652,9 @@
{
GdkPixbuf *ret;
+
ret = netk_window_get_mini_icon(NETK_WINDOW(self->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
@@ -517,7 +664,9 @@
{
int ret;
+
ret = netk_window_get_icon_is_fallback(NETK_WINDOW(self->obj));
+
return PyBool_FromLong(ret);
}
@@ -528,9 +677,11 @@
static char *kwlist[] = { "x", "y", "width", "height", NULL };
int x, y, width, height;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iiii:NetkWindow.set_icon_geometry", kwlist, &x, &y, &width, &height))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"iiii:NetkWindow.set_icon_geometry", kwlist, &x, &y, &width, &height))
return NULL;
+
netk_window_set_icon_geometry(NETK_WINDOW(self->obj), x, y, width, height);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -540,7 +691,9 @@
{
guint ret;
+
ret = netk_window_get_actions(NETK_WINDOW(self->obj));
+
return pyg_flags_from_gtype(NETK_TYPE_WINDOW_ACTIONS, ret);
}
@@ -549,7 +702,9 @@
{
guint ret;
+
ret = netk_window_get_state(NETK_WINDOW(self->obj));
+
return pyg_flags_from_gtype(NETK_TYPE_WINDOW_STATE, ret);
}
@@ -562,7 +717,7 @@
netk_window_get_geometry(NETK_WINDOW(self->obj), &x, &y, &width, &height);
return Py_BuildValue("(iiii)", x, y, width, height);
}
-#line 566 "window.c"
+#line 721 "window.c"
static PyObject *
@@ -572,9 +727,11 @@
PyGObject *workspace;
int ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkWindow.is_visible_on_workspace", kwlist, &PyNetkWorkspace_Type, &workspace))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkWindow.is_visible_on_workspace", kwlist, &PyNetkWorkspace_Type, &workspace))
return NULL;
+
ret = netk_window_is_visible_on_workspace(NETK_WINDOW(self->obj), NETK_WORKSPACE(workspace->obj));
+
return PyBool_FromLong(ret);
}
@@ -586,9 +743,11 @@
PyGObject *workspace;
int ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkWindow.is_on_workspace", kwlist, &PyNetkWorkspace_Type, &workspace))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkWindow.is_on_workspace", kwlist, &PyNetkWorkspace_Type, &workspace))
return NULL;
+
ret = netk_window_is_on_workspace(NETK_WINDOW(self->obj), NETK_WORKSPACE(workspace->obj));
+
return PyBool_FromLong(ret);
}
@@ -600,113 +759,180 @@
PyGObject *workspace;
int ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:NetkWindow.is_in_viewport", kwlist, &PyNetkWorkspace_Type, &workspace))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:NetkWindow.is_in_viewport", kwlist, &PyNetkWorkspace_Type, &workspace))
return NULL;
+
ret = netk_window_is_in_viewport(NETK_WINDOW(self->obj), NETK_WORKSPACE(workspace->obj));
+
return PyBool_FromLong(ret);
}
-static PyMethodDef _PyNetkWindow_methods[] = {
- { "get_screen", (PyCFunction)_wrap_netk_window_get_screen, METH_NOARGS },
- { "get_name", (PyCFunction)_wrap_netk_window_get_name, METH_NOARGS },
- { "get_icon_name", (PyCFunction)_wrap_netk_window_get_icon_name, METH_NOARGS },
- { "get_application", (PyCFunction)_wrap_netk_window_get_application, METH_NOARGS },
- { "get_group_leader", (PyCFunction)_wrap_netk_window_get_group_leader, METH_NOARGS },
- { "get_xid", (PyCFunction)_wrap_netk_window_get_xid, METH_NOARGS },
- { "get_class_group", (PyCFunction)_wrap_netk_window_get_class_group, METH_NOARGS },
- { "get_session_id", (PyCFunction)_wrap_netk_window_get_session_id, METH_NOARGS },
- { "get_session_id_utf8", (PyCFunction)_wrap_netk_window_get_session_id_utf8, METH_NOARGS },
- { "get_pid", (PyCFunction)_wrap_netk_window_get_pid, METH_NOARGS },
- { "get_client_machine", (PyCFunction)_wrap_netk_window_get_client_machine, METH_NOARGS },
- { "get_window_type", (PyCFunction)_wrap_netk_window_get_window_type, METH_NOARGS },
- { "get_resource_class", (PyCFunction)_wrap_netk_window_get_resource_class, METH_NOARGS },
- { "get_resource_name", (PyCFunction)_wrap_netk_window_get_resource_name, METH_NOARGS },
- { "is_minimized", (PyCFunction)_wrap_netk_window_is_minimized, METH_NOARGS },
- { "is_maximized_horizontally", (PyCFunction)_wrap_netk_window_is_maximized_horizontally, METH_NOARGS },
- { "is_maximized_vertically", (PyCFunction)_wrap_netk_window_is_maximized_vertically, METH_NOARGS },
- { "is_maximized", (PyCFunction)_wrap_netk_window_is_maximized, METH_NOARGS },
- { "is_shaded", (PyCFunction)_wrap_netk_window_is_shaded, METH_NOARGS },
- { "is_skip_pager", (PyCFunction)_wrap_netk_window_is_skip_pager, METH_NOARGS },
- { "is_skip_tasklist", (PyCFunction)_wrap_netk_window_is_skip_tasklist, METH_NOARGS },
- { "is_sticky", (PyCFunction)_wrap_netk_window_is_sticky, METH_NOARGS },
- { "set_skip_pager", (PyCFunction)_wrap_netk_window_set_skip_pager, METH_VARARGS|METH_KEYWORDS },
- { "set_skip_tasklist", (PyCFunction)_wrap_netk_window_set_skip_tasklist, METH_VARARGS|METH_KEYWORDS },
- { "close", (PyCFunction)_wrap_netk_window_close, METH_NOARGS },
- { "minimize", (PyCFunction)_wrap_netk_window_minimize, METH_NOARGS },
- { "unminimize", (PyCFunction)_wrap_netk_window_unminimize, METH_NOARGS },
- { "maximize", (PyCFunction)_wrap_netk_window_maximize, METH_NOARGS },
- { "unmaximize", (PyCFunction)_wrap_netk_window_unmaximize, METH_NOARGS },
- { "maximize_horizontally", (PyCFunction)_wrap_netk_window_maximize_horizontally, METH_NOARGS },
- { "unmaximize_horizontally", (PyCFunction)_wrap_netk_window_unmaximize_horizontally, METH_NOARGS },
- { "maximize_vertically", (PyCFunction)_wrap_netk_window_maximize_vertically, METH_NOARGS },
- { "unmaximize_vertically", (PyCFunction)_wrap_netk_window_unmaximize_vertically, METH_NOARGS },
- { "shade", (PyCFunction)_wrap_netk_window_shade, METH_NOARGS },
- { "unshade", (PyCFunction)_wrap_netk_window_unshade, METH_NOARGS },
- { "stick", (PyCFunction)_wrap_netk_window_stick, METH_NOARGS },
- { "unstick", (PyCFunction)_wrap_netk_window_unstick, METH_NOARGS },
- { "keyboard_move", (PyCFunction)_wrap_netk_window_keyboard_move, METH_NOARGS },
- { "keyboard_size", (PyCFunction)_wrap_netk_window_keyboard_size, METH_NOARGS },
- { "get_workspace", (PyCFunction)_wrap_netk_window_get_workspace, METH_NOARGS },
- { "move_to_workspace", (PyCFunction)_wrap_netk_window_move_to_workspace, METH_VARARGS|METH_KEYWORDS },
- { "is_pinned", (PyCFunction)_wrap_netk_window_is_pinned, METH_NOARGS },
- { "pin", (PyCFunction)_wrap_netk_window_pin, METH_NOARGS },
- { "unpin", (PyCFunction)_wrap_netk_window_unpin, METH_NOARGS },
- { "activate", (PyCFunction)_wrap_netk_window_activate, METH_NOARGS },
- { "is_active", (PyCFunction)_wrap_netk_window_is_active, METH_NOARGS },
- { "activate_transient", (PyCFunction)_wrap_netk_window_activate_transient, METH_NOARGS },
- { "get_icon", (PyCFunction)_wrap_netk_window_get_icon, METH_NOARGS },
- { "get_mini_icon", (PyCFunction)_wrap_netk_window_get_mini_icon, METH_NOARGS },
- { "get_icon_is_fallback", (PyCFunction)_wrap_netk_window_get_icon_is_fallback, METH_NOARGS },
- { "set_icon_geometry", (PyCFunction)_wrap_netk_window_set_icon_geometry, METH_VARARGS|METH_KEYWORDS },
- { "get_actions", (PyCFunction)_wrap_netk_window_get_actions, METH_NOARGS },
- { "get_state", (PyCFunction)_wrap_netk_window_get_state, METH_NOARGS },
- { "get_geometry", (PyCFunction)_wrap_netk_window_get_geometry, METH_NOARGS },
- { "is_visible_on_workspace", (PyCFunction)_wrap_netk_window_is_visible_on_workspace, METH_VARARGS|METH_KEYWORDS },
- { "is_on_workspace", (PyCFunction)_wrap_netk_window_is_on_workspace, METH_VARARGS|METH_KEYWORDS },
- { "is_in_viewport", (PyCFunction)_wrap_netk_window_is_in_viewport, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkWindow_methods[] = {
+ { "get_screen", (PyCFunction)_wrap_netk_window_get_screen, METH_NOARGS,
+ NULL },
+ { "get_name", (PyCFunction)_wrap_netk_window_get_name, METH_NOARGS,
+ NULL },
+ { "get_icon_name", (PyCFunction)_wrap_netk_window_get_icon_name, METH_NOARGS,
+ NULL },
+ { "get_application", (PyCFunction)_wrap_netk_window_get_application, METH_NOARGS,
+ NULL },
+ { "get_group_leader", (PyCFunction)_wrap_netk_window_get_group_leader, METH_NOARGS,
+ NULL },
+ { "get_xid", (PyCFunction)_wrap_netk_window_get_xid, METH_NOARGS,
+ NULL },
+ { "get_class_group", (PyCFunction)_wrap_netk_window_get_class_group, METH_NOARGS,
+ NULL },
+ { "get_session_id", (PyCFunction)_wrap_netk_window_get_session_id, METH_NOARGS,
+ NULL },
+ { "get_session_id_utf8", (PyCFunction)_wrap_netk_window_get_session_id_utf8, METH_NOARGS,
+ NULL },
+ { "get_pid", (PyCFunction)_wrap_netk_window_get_pid, METH_NOARGS,
+ NULL },
+ { "get_client_machine", (PyCFunction)_wrap_netk_window_get_client_machine, METH_NOARGS,
+ NULL },
+ { "get_window_type", (PyCFunction)_wrap_netk_window_get_window_type, METH_NOARGS,
+ NULL },
+ { "get_resource_class", (PyCFunction)_wrap_netk_window_get_resource_class, METH_NOARGS,
+ NULL },
+ { "get_resource_name", (PyCFunction)_wrap_netk_window_get_resource_name, METH_NOARGS,
+ NULL },
+ { "is_minimized", (PyCFunction)_wrap_netk_window_is_minimized, METH_NOARGS,
+ NULL },
+ { "is_maximized_horizontally", (PyCFunction)_wrap_netk_window_is_maximized_horizontally, METH_NOARGS,
+ NULL },
+ { "is_maximized_vertically", (PyCFunction)_wrap_netk_window_is_maximized_vertically, METH_NOARGS,
+ NULL },
+ { "is_maximized", (PyCFunction)_wrap_netk_window_is_maximized, METH_NOARGS,
+ NULL },
+ { "is_shaded", (PyCFunction)_wrap_netk_window_is_shaded, METH_NOARGS,
+ NULL },
+ { "is_skip_pager", (PyCFunction)_wrap_netk_window_is_skip_pager, METH_NOARGS,
+ NULL },
+ { "is_skip_tasklist", (PyCFunction)_wrap_netk_window_is_skip_tasklist, METH_NOARGS,
+ NULL },
+ { "is_sticky", (PyCFunction)_wrap_netk_window_is_sticky, METH_NOARGS,
+ NULL },
+ { "is_fullscreen", (PyCFunction)_wrap_netk_window_is_fullscreen, METH_NOARGS,
+ NULL },
+ { "demands_attention", (PyCFunction)_wrap_netk_window_demands_attention, METH_NOARGS,
+ NULL },
+ { "or_transient_demands_attention", (PyCFunction)_wrap_netk_window_or_transient_demands_attention, METH_NOARGS,
+ NULL },
+ { "set_skip_pager", (PyCFunction)_wrap_netk_window_set_skip_pager, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_skip_tasklist", (PyCFunction)_wrap_netk_window_set_skip_tasklist, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "set_fullscreen", (PyCFunction)_wrap_netk_window_set_fullscreen, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "close", (PyCFunction)_wrap_netk_window_close, METH_NOARGS,
+ NULL },
+ { "minimize", (PyCFunction)_wrap_netk_window_minimize, METH_NOARGS,
+ NULL },
+ { "unminimize", (PyCFunction)_wrap_netk_window_unminimize, METH_NOARGS,
+ NULL },
+ { "maximize", (PyCFunction)_wrap_netk_window_maximize, METH_NOARGS,
+ NULL },
+ { "unmaximize", (PyCFunction)_wrap_netk_window_unmaximize, METH_NOARGS,
+ NULL },
+ { "maximize_horizontally", (PyCFunction)_wrap_netk_window_maximize_horizontally, METH_NOARGS,
+ NULL },
+ { "unmaximize_horizontally", (PyCFunction)_wrap_netk_window_unmaximize_horizontally, METH_NOARGS,
+ NULL },
+ { "maximize_vertically", (PyCFunction)_wrap_netk_window_maximize_vertically, METH_NOARGS,
+ NULL },
+ { "unmaximize_vertically", (PyCFunction)_wrap_netk_window_unmaximize_vertically, METH_NOARGS,
+ NULL },
+ { "shade", (PyCFunction)_wrap_netk_window_shade, METH_NOARGS,
+ NULL },
+ { "unshade", (PyCFunction)_wrap_netk_window_unshade, METH_NOARGS,
+ NULL },
+ { "stick", (PyCFunction)_wrap_netk_window_stick, METH_NOARGS,
+ NULL },
+ { "unstick", (PyCFunction)_wrap_netk_window_unstick, METH_NOARGS,
+ NULL },
+ { "keyboard_move", (PyCFunction)_wrap_netk_window_keyboard_move, METH_NOARGS,
+ NULL },
+ { "keyboard_size", (PyCFunction)_wrap_netk_window_keyboard_size, METH_NOARGS,
+ NULL },
+ { "get_workspace", (PyCFunction)_wrap_netk_window_get_workspace, METH_NOARGS,
+ NULL },
+ { "move_to_workspace", (PyCFunction)_wrap_netk_window_move_to_workspace, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "is_pinned", (PyCFunction)_wrap_netk_window_is_pinned, METH_NOARGS,
+ NULL },
+ { "pin", (PyCFunction)_wrap_netk_window_pin, METH_NOARGS,
+ NULL },
+ { "unpin", (PyCFunction)_wrap_netk_window_unpin, METH_NOARGS,
+ NULL },
+ { "activate", (PyCFunction)_wrap_netk_window_activate, METH_NOARGS,
+ NULL },
+ { "is_active", (PyCFunction)_wrap_netk_window_is_active, METH_NOARGS,
+ NULL },
+ { "activate_transient", (PyCFunction)_wrap_netk_window_activate_transient, METH_NOARGS,
+ NULL },
+ { "get_icon", (PyCFunction)_wrap_netk_window_get_icon, METH_NOARGS,
+ NULL },
+ { "get_mini_icon", (PyCFunction)_wrap_netk_window_get_mini_icon, METH_NOARGS,
+ NULL },
+ { "get_icon_is_fallback", (PyCFunction)_wrap_netk_window_get_icon_is_fallback, METH_NOARGS,
+ NULL },
+ { "set_icon_geometry", (PyCFunction)_wrap_netk_window_set_icon_geometry, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "get_actions", (PyCFunction)_wrap_netk_window_get_actions, METH_NOARGS,
+ NULL },
+ { "get_state", (PyCFunction)_wrap_netk_window_get_state, METH_NOARGS,
+ NULL },
+ { "get_geometry", (PyCFunction)_wrap_netk_window_get_geometry, METH_NOARGS,
+ NULL },
+ { "is_visible_on_workspace", (PyCFunction)_wrap_netk_window_is_visible_on_workspace, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "is_on_workspace", (PyCFunction)_wrap_netk_window_is_on_workspace, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "is_in_viewport", (PyCFunction)_wrap_netk_window_is_in_viewport, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkWindow_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkWindow_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "window.Window", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "window.Window", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkWindow_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkWindow_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)0, /* tp_init */
+ (initproc)0, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -724,16 +950,19 @@
unsigned long xwindow;
NetkWindow *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k:window_get", kwlist, &xwindow))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"k:window_get", kwlist, &xwindow))
return NULL;
+
ret = netk_window_get(xwindow);
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
-PyMethodDef pywindow_functions[] = {
- { "window_get", (PyCFunction)_wrap_netk_window_get, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+const PyMethodDef pywindow_functions[] = {
+ { "window_get", (PyCFunction)_wrap_netk_window_get, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
@@ -742,6 +971,9 @@
void
pywindow_add_constants(PyObject *module, const gchar *strip_prefix)
{
+#ifdef VERSION
+ PyModule_AddStringConstant(module, "__version__", VERSION);
+#endif
pyg_flags_add(module, "WindowState", strip_prefix, NETK_TYPE_WINDOW_STATE);
pyg_flags_add(module, "WindowActions", strip_prefix, NETK_TYPE_WINDOW_ACTIONS);
pyg_enum_add(module, "WindowType", strip_prefix, NETK_TYPE_WINDOW_TYPE);
@@ -757,36 +989,32 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
if ((module = PyImport_ImportModule("gtk.gdk")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGdkPixbuf_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Pixbuf");
+ _PyGdkPixbuf_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Pixbuf");
if (_PyGdkPixbuf_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name Pixbuf from gtk.gdk");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gtk.gdk");
- return;
+ return ;
}
-#line 790 "window.c"
+#line 1018 "window.c"
pygobject_register_class(d, "NetkWindow", NETK_TYPE_WINDOW, &PyNetkWindow_Type, Py_BuildValue("(O)", &PyGObject_Type));
pyg_set_object_has_new_constructor(NETK_TYPE_WINDOW);
}
Modified: pyxfce/branches/4.6/netk/window_action_menu.c
===================================================================
--- pyxfce/branches/4.6/netk/window_action_menu.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/window_action_menu.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -36,16 +36,19 @@
PyGObject *window;
GtkWidget *ret;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!:create_window_action_menu", kwlist, &PyNetkWindow_Type, &window))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"O!:create_window_action_menu", kwlist, &PyNetkWindow_Type, &window))
return NULL;
+
ret = netk_create_window_action_menu(NETK_WINDOW(window->obj));
+
/* pygobject_new handles NULL checking */
return pygobject_new((GObject *)ret);
}
-PyMethodDef pywindow_action_menu_functions[] = {
- { "create_window_action_menu", (PyCFunction)_wrap_netk_create_window_action_menu, METH_VARARGS|METH_KEYWORDS },
- { NULL, NULL, 0 }
+const PyMethodDef pywindow_action_menu_functions[] = {
+ { "create_window_action_menu", (PyCFunction)_wrap_netk_create_window_action_menu, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -55,20 +58,18 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 74 "window_action_menu.c"
+#line 75 "window_action_menu.c"
}
Modified: pyxfce/branches/4.6/netk/window_menu.c
===================================================================
--- pyxfce/branches/4.6/netk/window_menu.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/window_menu.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -25,8 +25,8 @@
/* ----------- functions ----------- */
-PyMethodDef pywindow_menu_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pywindow_menu_functions[] = {
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -36,20 +36,18 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 55 "window_menu.c"
+#line 53 "window_menu.c"
}
Modified: pyxfce/branches/4.6/netk/workspace.c
===================================================================
--- pyxfce/branches/4.6/netk/workspace.c 2009-07-02 21:58:45 UTC (rev 30170)
+++ pyxfce/branches/4.6/netk/workspace.c 2009-07-02 22:23:29 UTC (rev 30171)
@@ -18,7 +18,7 @@
/* ---------- forward type declarations ---------- */
-PyTypeObject PyNetkWorkspace_Type;
+PyTypeObject G_GNUC_INTERNAL PyNetkWorkspace_Type;
#line 24 "workspace.c"
@@ -31,7 +31,9 @@
{
int ret;
+
ret = netk_workspace_get_number(NETK_WORKSPACE(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -40,7 +42,9 @@
{
const gchar *ret;
+
ret = netk_workspace_get_name(NETK_WORKSPACE(self->obj));
+
if (ret)
return PyString_FromString(ret);
Py_INCREF(Py_None);
@@ -53,9 +57,11 @@
static char *kwlist[] = { "name", NULL };
char *name;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s:NetkWorkspace.change_name", kwlist, &name))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,"s:NetkWorkspace.change_name", kwlist, &name))
return NULL;
+
netk_workspace_change_name(NETK_WORKSPACE(self->obj), name);
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -63,7 +69,9 @@
static PyObject *
_wrap_netk_workspace_activate(PyGObject *self)
{
+
netk_workspace_activate(NETK_WORKSPACE(self->obj));
+
Py_INCREF(Py_None);
return Py_None;
}
@@ -73,7 +81,9 @@
{
int ret;
+
ret = netk_workspace_get_width(NETK_WORKSPACE(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -82,7 +92,9 @@
{
int ret;
+
ret = netk_workspace_get_height(NETK_WORKSPACE(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -91,7 +103,9 @@
{
int ret;
+
ret = netk_workspace_get_viewport_x(NETK_WORKSPACE(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -100,7 +114,9 @@
{
int ret;
+
ret = netk_workspace_get_viewport_y(NETK_WORKSPACE(self->obj));
+
return PyInt_FromLong(ret);
}
@@ -109,63 +125,74 @@
{
int ret;
+
ret = netk_workspace_is_virtual(NETK_WORKSPACE(self->obj));
+
return PyBool_FromLong(ret);
}
-static PyMethodDef _PyNetkWorkspace_methods[] = {
- { "get_number", (PyCFunction)_wrap_netk_workspace_get_number, METH_NOARGS },
- { "get_name", (PyCFunction)_wrap_netk_workspace_get_name, METH_NOARGS },
- { "change_name", (PyCFunction)_wrap_netk_workspace_change_name, METH_VARARGS|METH_KEYWORDS },
- { "activate", (PyCFunction)_wrap_netk_workspace_activate, METH_NOARGS },
- { "get_width", (PyCFunction)_wrap_netk_workspace_get_width, METH_NOARGS },
- { "get_height", (PyCFunction)_wrap_netk_workspace_get_height, METH_NOARGS },
- { "get_viewport_x", (PyCFunction)_wrap_netk_workspace_get_viewport_x, METH_NOARGS },
- { "get_viewport_y", (PyCFunction)_wrap_netk_workspace_get_viewport_y, METH_NOARGS },
- { "is_virtual", (PyCFunction)_wrap_netk_workspace_is_virtual, METH_NOARGS },
- { NULL, NULL, 0 }
+static const PyMethodDef _PyNetkWorkspace_methods[] = {
+ { "get_number", (PyCFunction)_wrap_netk_workspace_get_number, METH_NOARGS,
+ NULL },
+ { "get_name", (PyCFunction)_wrap_netk_workspace_get_name, METH_NOARGS,
+ NULL },
+ { "change_name", (PyCFunction)_wrap_netk_workspace_change_name, METH_VARARGS|METH_KEYWORDS,
+ NULL },
+ { "activate", (PyCFunction)_wrap_netk_workspace_activate, METH_NOARGS,
+ NULL },
+ { "get_width", (PyCFunction)_wrap_netk_workspace_get_width, METH_NOARGS,
+ NULL },
+ { "get_height", (PyCFunction)_wrap_netk_workspace_get_height, METH_NOARGS,
+ NULL },
+ { "get_viewport_x", (PyCFunction)_wrap_netk_workspace_get_viewport_x, METH_NOARGS,
+ NULL },
+ { "get_viewport_y", (PyCFunction)_wrap_netk_workspace_get_viewport_y, METH_NOARGS,
+ NULL },
+ { "is_virtual", (PyCFunction)_wrap_netk_workspace_is_virtual, METH_NOARGS,
+ NULL },
+ { NULL, NULL, 0, NULL }
};
-PyTypeObject PyNetkWorkspace_Type = {
+PyTypeObject G_GNUC_INTERNAL PyNetkWorkspace_Type = {
PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "workspace.Workspace", /* tp_name */
- sizeof(PyGObject), /* tp_basicsize */
- 0, /* tp_itemsize */
+ 0, /* ob_size */
+ "workspace.Workspace", /* tp_name */
+ sizeof(PyGObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
/* methods */
- (destructor)0, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)0, /* tp_dealloc */
+ (printfunc)0, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+ (cmpfunc)0, /* tp_compare */
+ (reprfunc)0, /* tp_repr */
(PyNumberMethods*)0, /* tp_as_number */
(PySequenceMethods*)0, /* tp_as_sequence */
(PyMappingMethods*)0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
- (PyBufferProcs*)0, /* tp_as_buffer */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)0, /* tp_str */
+ (getattrofunc)0, /* tp_getattro */
+ (setattrofunc)0, /* tp_setattro */
+ (PyBufferProcs*)0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* Documentation string */
+ (traverseproc)0, /* tp_traverse */
+ (inquiry)0, /* tp_clear */
+ (richcmpfunc)0, /* tp_richcompare */
offsetof(PyGObject, weakreflist), /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- _PyNetkWorkspace_methods, /* tp_methods */
- 0, /* tp_members */
- 0, /* tp_getset */
- NULL, /* tp_base */
- NULL, /* tp_dict */
- (descrgetfunc)0, /* tp_descr_get */
- (descrsetfunc)0, /* tp_descr_set */
+ (getiterfunc)0, /* tp_iter */
+ (iternextfunc)0, /* tp_iternext */
+ (struct PyMethodDef*)_PyNetkWorkspace_methods, /* tp_methods */
+ (struct PyMemberDef*)0, /* tp_members */
+ (struct PyGetSetDef*)0, /* tp_getset */
+ NULL, /* tp_base */
+ NULL, /* tp_dict */
+ (descrgetfunc)0, /* tp_descr_get */
+ (descrsetfunc)0, /* tp_descr_set */
offsetof(PyGObject, inst_dict), /* tp_dictoffset */
- (initproc)0, /* tp_init */
+ (initproc)0, /* tp_init */
(allocfunc)0, /* tp_alloc */
(newfunc)0, /* tp_new */
(freefunc)0, /* tp_free */
@@ -176,8 +203,8 @@
/* ----------- functions ----------- */
-PyMethodDef pyworkspace_functions[] = {
- { NULL, NULL, 0 }
+const PyMethodDef pyworkspace_functions[] = {
+ { NULL, NULL, 0, NULL }
};
/* initialise stuff extension classes */
@@ -187,22 +214,20 @@
PyObject *module;
if ((module = PyImport_ImportModule("gobject")) != NULL) {
- PyObject *moddict = PyModule_GetDict(module);
-
- _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
+ _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
if (_PyGObject_Type == NULL) {
PyErr_SetString(PyExc_ImportError,
"cannot import name GObject from gobject");
- return;
+ return ;
}
} else {
PyErr_SetString(PyExc_ImportError,
"could not import gobject");
- return;
+ return ;
}
-#line 206 "workspace.c"
+#line 231 "workspace.c"
pygobject_register_class(d, "NetkWorkspace", NETK_TYPE_WORKSPACE, &PyNetkWorkspace_Type, Py_BuildValue("(O)", &PyGObject_Type));
pyg_set_object_has_new_constructor(NETK_TYPE_WORKSPACE);
}
More information about the Xfce4-commits
mailing list