summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gui/core
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/gui/core')
-rw-r--r--plugins/pychrysalide/gui/core/items.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/pychrysalide/gui/core/items.c b/plugins/pychrysalide/gui/core/items.c
index a54e5f3..ce3eaee 100644
--- a/plugins/pychrysalide/gui/core/items.c
+++ b/plugins/pychrysalide/gui/core/items.c
@@ -66,6 +66,59 @@ static PyObject *py_items_update_project(PyObject *, PyObject *);
* *
******************************************************************************/
+static PyObject *py_items_find_editor_item_by_key(PyObject *self, PyObject *args)
+{
+ PyObject *result; /* Trouvaille à retourner */
+ const char *key; /* Objet des recherches */
+ int ret; /* Bilan de lecture des args. */
+ GEditorItem *found; /* Instance retrouvée ou NULL */
+
+#define ITEMS_FIND_EDITOR_ITEM_BY_KEY_METHOD PYTHON_METHOD_DEF \
+( \
+ find_editor_item_by_key, "key", \
+ METH_VARARGS, py_items, \
+ "Find the editor component belonging to a given key." \
+ "\n" \
+ "The key has to be provided as a simple (short) string, and the" \
+ " result is a pychrysalide.gui.EditorItem instance or None if no" \
+ " component is found for the given key." \
+)
+
+ ret = PyArg_ParseTuple(args, "s", &key);
+ if (!ret) return NULL;
+
+
+ found = find_editor_item_by_key(key);
+
+ if (found == NULL)
+ {
+ result = Py_None;
+ Py_INCREF(result);
+ }
+ else
+ {
+ result = pygobject_new(G_OBJECT(found));
+ g_object_ref(G_OBJECT(found));
+ }
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : self = classe représentant un binaire. *
+* args = arguments fournis à l'appel. *
+* *
+* Description : Lance une actualisation du fait d'un changement de contenu. *
+* *
+* Retour : None. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
static PyObject *py_items_change_current_content(PyObject *self, PyObject *args)
{
GLoadedContent *content; /* Instance GLib correspondante*/
@@ -223,6 +276,7 @@ bool populate_gui_core_module_with_items(void)
PyObject *module; /* Module à recompléter */
static PyMethodDef py_items_methods[] = {
+ ITEMS_FIND_EDITOR_ITEM_BY_KEY_METHOD,
ITEMS_CHANGE_CURRENT_CONTENT_METHOD,
ITEMS_CHANGE_CURRENT_VIEW_METHOD,
ITEMS_UPDATE_CURRENT_VIEW_METHOD,