diff options
Diffstat (limited to 'plugins/pychrysa/glibext/bufferline.c')
-rw-r--r-- | plugins/pychrysa/glibext/bufferline.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/plugins/pychrysa/glibext/bufferline.c b/plugins/pychrysa/glibext/bufferline.c index 1e3b611..3804082 100644 --- a/plugins/pychrysa/glibext/bufferline.c +++ b/plugins/pychrysa/glibext/bufferline.c @@ -29,6 +29,9 @@ #include <pygobject.h> +#include <glibext/gbufferline.h> + + #include "../quirks.h" @@ -40,34 +43,6 @@ static PyObject *py_buffer_line_get_text(PyObject *, PyObject *); /****************************************************************************** * * -* Paramètres : binary = instance existante GLib. * -* * -* Description : Crée un nouvel objet Python de type 'BufferLine'. * -* * -* Retour : Instance Python mise en place. * -* * -* Remarques : - * -* * -******************************************************************************/ - -PyObject *py_buffer_line_from_c(GBufferLine *line) -{ - PyObject *module; /* Module d'appartenance */ - PyTypeObject *type; /* Type Python correspondant */ - - module = PyImport_ImportModule("pychrysalide.glibext"); - type = (PyTypeObject *)PyObject_GetAttrString(module, "BufferLine"); - Py_DECREF(module); - - pychrysalide_set_instance_data(G_OBJECT(line), type); - - return pygobject_new(G_OBJECT(line)); - -} - - -/****************************************************************************** -* * * Paramètres : self = classe représentant une ligne de tampon. * * args = arguments fournis à l'appel. * * * @@ -150,6 +125,9 @@ bool register_python_buffer_line(PyObject *module) Py_INCREF(&py_buffer_line_type); ret = PyModule_AddObject(module, "BufferLine", (PyObject *)&py_buffer_line_type); + pygobject_register_class(module, "GBufferLine", G_TYPE_BUFFER_LINE, &py_buffer_line_type, + Py_BuildValue("(O)", py_buffer_line_type.tp_base)); + return (ret == 0); } |