diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-26 13:46:56 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-26 13:46:56 +0000 |
commit | 4cd2081ae3d8adacd4256742be9e90714783c242 (patch) | |
tree | c5e4fe6b3ca14cd5c994418a8f18a1d00116cfaf /glib/pygmaincontext.c | |
parent | ec4671da7f7fe70f40dafb91a870fa644c2b9f2c (diff) | |
download | pygobject-4cd2081ae3d8adacd4256742be9e90714783c242.tar.gz pygobject-4cd2081ae3d8adacd4256742be9e90714783c242.tar.xz pygobject-4cd2081ae3d8adacd4256742be9e90714783c242.zip |
Convert the pid/mainloop/maincontext/optiongroup/optioncontext.
2008-07-26 Johan Dahlin <johan@gnome.org>
* glib/pygmaincontext.c (pyglib_maincontext_register_types):
* glib/pygmainloop.c (pyg_main_loop_init),
(pyglib_mainloop_register_types):
* glib/pygoptioncontext.c (pyg_option_context_set_main_group),
(pyglib_option_context_register_types):
* glib/pygoptiongroup.c (pyglib_option_group_register_types):
* glib/pygspawn.c (pyglib_spawn_register_types):
Convert the pid/mainloop/maincontext/optiongroup/optioncontext.
svn path=/trunk/; revision=872
Diffstat (limited to 'glib/pygmaincontext.c')
-rw-r--r-- | glib/pygmaincontext.c | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/glib/pygmaincontext.c b/glib/pygmaincontext.c index c969af5..d4906be 100644 --- a/glib/pygmaincontext.c +++ b/glib/pygmaincontext.c @@ -31,6 +31,8 @@ #include "pyglib.h" #include "pyglib-private.h" +PYGLIB_DEFINE_TYPE("glib.MainContext", PyGMainContext_Type, PyGMainContext) + static int pyg_main_context_init(PyGMainContext *self) { @@ -85,49 +87,13 @@ static PyMethodDef _PyGMainContext_methods[] = { { NULL, NULL, 0 } }; -PyTypeObject PyGMainContext_Type = { - PyObject_HEAD_INIT(NULL) - 0, - "glib.MainContext", - sizeof(PyGMainContext), - 0, - /* methods */ - (destructor)pyg_main_context_dealloc, - (printfunc)0, - (getattrfunc)0, - (setattrfunc)0, - (cmpfunc)pyg_main_context_compare, - (reprfunc)0, - 0, - 0, - 0, - (hashfunc)0, - (ternaryfunc)0, - (reprfunc)0, - (getattrofunc)0, - (setattrofunc)0, - 0, - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, - NULL, - (traverseproc)0, - (inquiry)0, - (richcmpfunc)0, - 0, - (getiterfunc)0, - (iternextfunc)0, - _PyGMainContext_methods, - 0, - 0, - NULL, - NULL, - (descrgetfunc)0, - (descrsetfunc)0, - 0, - (initproc)pyg_main_context_init, -}; - void pyglib_maincontext_register_types(PyObject *d) { + PyGMainContext_Type.tp_dealloc = (destructor)pyg_main_context_dealloc; + PyGMainContext_Type.tp_compare = (cmpfunc)pyg_main_context_compare; + PyGMainContext_Type.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE; + PyGMainContext_Type.tp_methods = _PyGMainContext_methods; + PyGMainContext_Type.tp_init = (initproc)pyg_main_context_init; PYGLIB_REGISTER_TYPE(d, PyGMainContext_Type, "MainContext"); } |