summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gui
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-07-21 20:21:59 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-07-21 20:21:59 (GMT)
commit6a8385724c74b07cf9ed4cb9052f1af1816e3ea5 (patch)
treea7bea8a4bb9c816da77cf5c3dd44fbd8fb89b3a7 /plugins/pychrysalide/gui
parentf0682e7b195acbd4d83148f3829479d682f9ee9f (diff)
Created more converters for Python arguments.
Diffstat (limited to 'plugins/pychrysalide/gui')
-rw-r--r--plugins/pychrysalide/gui/core/items.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/plugins/pychrysalide/gui/core/items.c b/plugins/pychrysalide/gui/core/items.c
index 0912bc4..bc5bbd6 100644
--- a/plugins/pychrysalide/gui/core/items.c
+++ b/plugins/pychrysalide/gui/core/items.c
@@ -68,15 +68,12 @@ static PyObject *py_items_update_project(PyObject *, PyObject *);
static PyObject *py_items_change_current_content(PyObject *self, PyObject *args)
{
- PyObject *content_obj; /* Objet pour le contenu */
- int ret; /* Bilan de lecture des args. */
GLoadedContent *content; /* Instance GLib correspondante*/
+ int ret; /* Bilan de lecture des args. */
- ret = PyArg_ParseTuple(args, "O!", get_python_loaded_content_type(), &content_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_loaded_content, &content);
if (!ret) return NULL;
- content = G_LOADED_CONTENT(pygobject_get(content_obj));
-
change_editor_items_current_content(content);
Py_RETURN_NONE;
@@ -99,15 +96,12 @@ static PyObject *py_items_change_current_content(PyObject *self, PyObject *args)
static PyObject *py_items_change_current_view(PyObject *self, PyObject *args)
{
- PyObject *panel_obj; /* Objet de panneau chargé */
- int ret; /* Bilan de lecture des args. */
GLoadedPanel *panel; /* Instance GLib correspondante*/
+ int ret; /* Bilan de lecture des args. */
- ret = PyArg_ParseTuple(args, "O!", get_python_loaded_panel_type(), &panel_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_loaded_panel, &panel);
if (!ret) return NULL;
- panel = G_LOADED_PANEL(pygobject_get(panel_obj));
-
change_editor_items_current_view(panel);
Py_RETURN_NONE;
@@ -130,15 +124,12 @@ static PyObject *py_items_change_current_view(PyObject *self, PyObject *args)
static PyObject *py_items_update_current_view(PyObject *self, PyObject *args)
{
- PyObject *panel_obj; /* Objet de panneau chargé */
- int ret; /* Bilan de lecture des args. */
GLoadedPanel *panel; /* Instance GLib correspondante*/
+ int ret; /* Bilan de lecture des args. */
- ret = PyArg_ParseTuple(args, "O!", get_python_loaded_panel_type(), &panel_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_loaded_panel, &panel);
if (!ret) return NULL;
- panel = G_LOADED_PANEL(pygobject_get(panel_obj));
-
update_editor_items_current_view(panel);
Py_RETURN_NONE;
@@ -163,15 +154,12 @@ static PyObject *py_items_update_current_view(PyObject *self, PyObject *args)
static PyObject *py_items_update_project(PyObject *self, PyObject *args)
{
- PyObject *project_obj; /* Objet de panneau chargé */
- int ret; /* Bilan de lecture des args. */
GStudyProject *project; /* Instance GLib correspondante*/
+ int ret; /* Bilan de lecture des args. */
- ret = PyArg_ParseTuple(args, "O!", get_python_study_project_type(), &project_obj);
+ ret = PyArg_ParseTuple(args, "O&", convert_to_study_project, &project);
if (!ret) return NULL;
- project = G_STUDY_PROJECT(pygobject_get(project_obj));
-
update_project_area(project);
Py_RETURN_NONE;