summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2023-05-22 20:56:32 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2023-05-22 20:56:32 (GMT)
commite1a2823b5d831349467d309ce42d56055ec9c04f (patch)
treebc4dd464d10cd379622ceb361398895d59849409 /plugins/pychrysalide/gtkext
parent15fb909bdd8ca0f37dd71da7427ea6bc6bb71cbb (diff)
Rely on GObject-introspection implementation for some registrations.
Diffstat (limited to 'plugins/pychrysalide/gtkext')
-rw-r--r--plugins/pychrysalide/gtkext/blockdisplay.c2
-rw-r--r--plugins/pychrysalide/gtkext/bufferdisplay.c2
-rw-r--r--plugins/pychrysalide/gtkext/displaypanel.c20
-rw-r--r--plugins/pychrysalide/gtkext/graph/cluster.c2
-rw-r--r--plugins/pychrysalide/gtkext/graph/edge.c2
-rw-r--r--plugins/pychrysalide/gtkext/named.c4
6 files changed, 8 insertions, 24 deletions
diff --git a/plugins/pychrysalide/gtkext/blockdisplay.c b/plugins/pychrysalide/gtkext/blockdisplay.c
index 6741553..b4b8515 100644
--- a/plugins/pychrysalide/gtkext/blockdisplay.c
+++ b/plugins/pychrysalide/gtkext/blockdisplay.c
@@ -115,7 +115,7 @@ bool ensure_python_block_display_is_registered(void)
if (!ensure_python_buffer_display_is_registered())
return false;
- if (!register_class_for_pygobject(dict, GTK_TYPE_BLOCK_DISPLAY, type, get_python_buffer_display_type()))
+ if (!register_class_for_pygobject(dict, GTK_TYPE_BLOCK_DISPLAY, type))
return false;
}
diff --git a/plugins/pychrysalide/gtkext/bufferdisplay.c b/plugins/pychrysalide/gtkext/bufferdisplay.c
index 310e60a..4babcc8 100644
--- a/plugins/pychrysalide/gtkext/bufferdisplay.c
+++ b/plugins/pychrysalide/gtkext/bufferdisplay.c
@@ -115,7 +115,7 @@ bool ensure_python_buffer_display_is_registered(void)
if (!ensure_python_display_panel_is_registered())
return false;
- if (!register_class_for_pygobject(dict, GTK_TYPE_BUFFER_DISPLAY, type, get_python_display_panel_type()))
+ if (!register_class_for_pygobject(dict, GTK_TYPE_BUFFER_DISPLAY, type))
return false;
}
diff --git a/plugins/pychrysalide/gtkext/displaypanel.c b/plugins/pychrysalide/gtkext/displaypanel.c
index dc7b8e5..b2eb038 100644
--- a/plugins/pychrysalide/gtkext/displaypanel.c
+++ b/plugins/pychrysalide/gtkext/displaypanel.c
@@ -100,8 +100,6 @@ bool ensure_python_display_panel_is_registered(void)
{
bool result; /* Bilan à retourner */
PyTypeObject *type; /* Type Python 'DisplayPanel' */
- PyObject *parent_mod; /* Module Python Fixed */
- PyObject *fixed; /* Module "GtkFixed" */
PyObject *module; /* Module à recompléter */
PyObject *dict; /* Dictionnaire du module */
@@ -113,27 +111,13 @@ bool ensure_python_display_panel_is_registered(void)
{
module = get_access_to_python_module("pychrysalide.gtkext");
- parent_mod = PyImport_ImportModule("gi.repository.Gtk");
-
- if (parent_mod == NULL)
- goto rpdp_exit;
-
- fixed = PyObject_GetAttrString(parent_mod, "Fixed");
-
- Py_DECREF(parent_mod);
-
dict = PyModule_GetDict(module);
- result = register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type, (PyTypeObject *)fixed);
- Py_DECREF(fixed);
+ if (!register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL, type))
+ return false;
}
- else
- result = true;
-
- rpdp_exit:
-
return result;
}
diff --git a/plugins/pychrysalide/gtkext/graph/cluster.c b/plugins/pychrysalide/gtkext/graph/cluster.c
index fc73276..11cb8fa 100644
--- a/plugins/pychrysalide/gtkext/graph/cluster.c
+++ b/plugins/pychrysalide/gtkext/graph/cluster.c
@@ -656,7 +656,7 @@ bool ensure_python_graph_cluster_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_CLUSTER, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_CLUSTER, type))
return false;
}
diff --git a/plugins/pychrysalide/gtkext/graph/edge.c b/plugins/pychrysalide/gtkext/graph/edge.c
index ce20ce9..d016e30 100644
--- a/plugins/pychrysalide/gtkext/graph/edge.c
+++ b/plugins/pychrysalide/gtkext/graph/edge.c
@@ -267,7 +267,7 @@ bool ensure_python_graph_edge_is_registered(void)
dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_EDGE, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, G_TYPE_GRAPH_EDGE, type))
return false;
if (!define_graph_edge_constants(type))
diff --git a/plugins/pychrysalide/gtkext/named.c b/plugins/pychrysalide/gtkext/named.c
index 1d336f1..ee963de 100644
--- a/plugins/pychrysalide/gtkext/named.c
+++ b/plugins/pychrysalide/gtkext/named.c
@@ -99,7 +99,7 @@ static PyObject *py_built_named_widget_new(PyTypeObject *type, PyObject *args, P
if (first_time)
{
- status = register_class_for_dynamic_pygobject(gtype, type, base);
+ status = register_class_for_dynamic_pygobject(gtype, type);
if (!status)
{
@@ -312,7 +312,7 @@ bool ensure_python_built_named_widget_is_registered(void)
if (!ensure_python_named_widget_is_registered())
return false;
- if (!register_class_for_pygobject(dict, GTK_TYPE_BUILT_NAMED_WIDGET, type, &PyGObject_Type))
+ if (!register_class_for_pygobject(dict, GTK_TYPE_BUILT_NAMED_WIDGET, type))
return false;
}