summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gui/item.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/gui/item.c')
-rw-r--r--plugins/pychrysalide/gui/item.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/plugins/pychrysalide/gui/item.c b/plugins/pychrysalide/gui/item.c
index 2e32167..2046587 100644
--- a/plugins/pychrysalide/gui/item.c
+++ b/plugins/pychrysalide/gui/item.c
@@ -73,7 +73,7 @@
/* Fournit le nom interne attribué à l'élément réactif. */
-static char *py_editor_item_get_key_wrapper(const GEditorItem *);
+static char *py_editor_item_get_key_wrapper(const GEditorItemClass *);
/* Fournit le composant GTK associé à l'élément réactif. */
static GtkWidget *py_editor_item_get_widget_wrapper(const GEditorItem *);
@@ -141,7 +141,7 @@ void py_editor_item_init_gclass(GEditorItemClass *class, gpointer unused)
/******************************************************************************
* *
-* Paramètres : item = instance à consulter. *
+* Paramètres : class = classe à consulter. *
* *
* Description : Fournit le nom interne attribué à l'élément réactif. *
* *
@@ -151,31 +151,31 @@ void py_editor_item_init_gclass(GEditorItemClass *class, gpointer unused)
* *
******************************************************************************/
-static char *py_editor_item_get_key_wrapper(const GEditorItem *item)
+static char *py_editor_item_get_key_wrapper(const GEditorItemClass *class)
{
char *result; /* Désignation à retourner */
PyGILState_STATE gstate; /* Sauvegarde d'environnement */
- PyObject *pyobj; /* Objet Python concerné */
+ PyTypeObject *pytype; /* Classe Python concernée */
PyObject *pykey; /* Clef en objet Python */
int ret; /* Bilan d'une conversion */
#define EDITOR_ITEM_KEY_ATTRIB_WRAPPER PYTHON_GETTER_WRAPPER_DEF \
( \
- _key, \
+ _key, \
"Provide the internal name to use for the editor item.\n" \
"\n" \
- "The result has to be a string." \
+ "The value has to be a string." \
)
result = NULL;
gstate = PyGILState_Ensure();
- pyobj = pygobject_new(G_OBJECT(item));
+ pytype = pygobject_lookup_class(G_TYPE_FROM_CLASS(class));
- if (PyObject_HasAttrString(pyobj, "_key"))
+ if (PyObject_HasAttrString((PyObject *)pytype, "_key"))
{
- pykey = PyObject_GetAttrString(pyobj, "_key");
+ pykey = PyObject_GetAttrString((PyObject *)pytype, "_key");
if (pykey != NULL)
{
@@ -190,8 +190,6 @@ static char *py_editor_item_get_key_wrapper(const GEditorItem *item)
}
- Py_DECREF(pyobj);
-
PyGILState_Release(gstate);
return result;
@@ -226,7 +224,7 @@ static GtkWidget *py_editor_item_get_widget_wrapper(const GEditorItem *item)
_widget, \
"Provide the Gtk widget base involved in the editor item.\n" \
"\n" \
- "The result has to be a Gtk.Widget instance." \
+ "The value has to be a Gtk.Widget instance." \
)
result = NULL;
@@ -574,11 +572,11 @@ static PyObject *py_editor_item_get_key(PyObject *self, void *closure)
#define EDITOR_ITEM_KEY_ATTRIB PYTHON_GET_DEF_FULL \
( \
key, py_editor_item, \
- "Internal name given to the editor item." \
+ "Internal string name given to the editor item." \
)
item = G_EDITOR_ITEM(pygobject_get(self));
- key = g_editor_item_get_key(item);
+ key = g_editor_item_class_get_key(G_EDITOR_ITEM_GET_CLASS(item));
if (key != NULL)
{