summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gui/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-08-09 22:54:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-08-09 22:54:08 (GMT)
commit16498486a454f6042b881b77e572f342decf5851 (patch)
treec36b6697fc9de900ec8ecff428ba407639eff133 /plugins/pychrysalide/gui/core
parent4370d2d77d623f560c7df94a3bc15b1395e4878b (diff)
Provided Python bindings for the main menu bar.
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,