xed/plugin-loaders/python/bindings/plumaplugin.override

194 lines
4.9 KiB
Plaintext
Raw Normal View History

2011-11-07 13:46:58 -06:00
%%
headers
2011-11-07 16:52:18 -06:00
#include <pluma/pluma-plugin.h>
#include <pluma/pluma-window.h>
2011-11-07 13:46:58 -06:00
%%
2011-11-07 16:52:18 -06:00
override pluma_plugin_activate kwargs
2011-11-07 13:46:58 -06:00
static PyObject *
2011-11-07 16:52:18 -06:00
_wrap_pluma_plugin_activate(PyGObject *self, PyObject *args, PyObject *kwargs)
2011-11-07 13:46:58 -06:00
{
gpointer klass, klass2;
static char *kwlist[] = { "window", NULL };
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
2011-11-07 16:52:18 -06:00
"O!:PlumaPlugin.activate",
2011-11-07 13:46:58 -06:00
kwlist,
2011-11-07 16:52:18 -06:00
&PyPlumaWindow_Type,
2011-11-07 13:46:58 -06:00
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
2011-11-07 16:52:18 -06:00
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
2011-11-07 13:46:58 -06:00
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
2011-11-07 16:52:18 -06:00
if (PLUMA_PLUGIN_CLASS (klass)->activate)
PLUMA_PLUGIN_CLASS (klass)->activate (PLUMA_PLUGIN (self->obj),
PLUMA_WINDOW (window->obj));
2011-11-07 13:46:58 -06:00
else {
PyErr_SetString (PyExc_NotImplementedError,
2011-11-07 16:52:18 -06:00
"virtual method PlumaPlugin.activate not implemented");
2011-11-07 13:46:58 -06:00
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
2011-11-07 16:52:18 -06:00
override pluma_plugin_deactivate kwargs
2011-11-07 13:46:58 -06:00
static PyObject *
2011-11-07 16:52:18 -06:00
_wrap_pluma_plugin_deactivate(PyGObject *self, PyObject *args, PyObject *kwargs)
2011-11-07 13:46:58 -06:00
{
gpointer klass, klass2;
static char *kwlist[] = {"window", NULL};
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
2011-11-07 16:52:18 -06:00
"O!:PlumaPlugin.deactivate",
2011-11-07 13:46:58 -06:00
kwlist,
2011-11-07 16:52:18 -06:00
&PyPlumaWindow_Type,
2011-11-07 13:46:58 -06:00
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
2011-11-07 16:52:18 -06:00
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
2011-11-07 13:46:58 -06:00
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
2011-11-07 16:52:18 -06:00
if (PLUMA_PLUGIN_CLASS (klass)->deactivate)
PLUMA_PLUGIN_CLASS (klass)->deactivate (PLUMA_PLUGIN (self->obj),
PLUMA_WINDOW (window->obj));
2011-11-07 13:46:58 -06:00
else {
PyErr_SetString (PyExc_NotImplementedError,
2011-11-07 16:52:18 -06:00
"virtual method PlumaPlugin.deactivate not implemented");
2011-11-07 13:46:58 -06:00
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
2011-11-07 16:52:18 -06:00
override pluma_plugin_update_ui kwargs
2011-11-07 13:46:58 -06:00
static PyObject *
2011-11-07 16:52:18 -06:00
_wrap_pluma_plugin_update_ui (PyGObject *self, PyObject *args, PyObject *kwargs)
2011-11-07 13:46:58 -06:00
{
gpointer klass, klass2;
static char *kwlist[] = {"window", NULL};
PyGObject *window;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
if (!PyArg_ParseTupleAndKeywords (args,
kwargs,
2011-11-07 16:52:18 -06:00
"O!:PlumaPlugin.update_ui",
2011-11-07 13:46:58 -06:00
kwlist,
2011-11-07 16:52:18 -06:00
&PyPlumaWindow_Type,
2011-11-07 13:46:58 -06:00
&window))
return NULL;
klass = g_type_class_ref (pyg_type_from_object (cls));
2011-11-07 16:52:18 -06:00
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
2011-11-07 13:46:58 -06:00
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
2011-11-07 16:52:18 -06:00
if (PLUMA_PLUGIN_CLASS (klass)->update_ui)
PLUMA_PLUGIN_CLASS (klass)->update_ui (PLUMA_PLUGIN (self->obj),
PLUMA_WINDOW (window->obj));
2011-11-07 13:46:58 -06:00
else {
PyErr_SetString (PyExc_NotImplementedError,
2011-11-07 16:52:18 -06:00
"virtual method PlumaPlugin.update_ui not implemented");
2011-11-07 13:46:58 -06:00
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
Py_INCREF(Py_None);
return Py_None;
}
%%
2011-11-07 16:52:18 -06:00
override pluma_plugin_is_configurable
2011-11-07 13:46:58 -06:00
static PyObject *
2011-11-07 16:52:18 -06:00
_wrap_pluma_plugin_is_configurable (PyGObject *self)
2011-11-07 13:46:58 -06:00
{
int ret;
gpointer klass, klass2;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
klass = g_type_class_ref (pyg_type_from_object (cls));
2011-11-07 16:52:18 -06:00
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
2011-11-07 13:46:58 -06:00
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
2011-11-07 16:52:18 -06:00
if (PLUMA_PLUGIN_CLASS (klass)->is_configurable)
ret = PLUMA_PLUGIN_CLASS (klass)->is_configurable (PLUMA_PLUGIN (self->obj));
2011-11-07 13:46:58 -06:00
else {
PyErr_SetString (PyExc_NotImplementedError,
2011-11-07 16:52:18 -06:00
"virtual method PlumaPlugin.is_configurable not implemented");
2011-11-07 13:46:58 -06:00
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
return PyBool_FromLong (ret);
}
%%
2011-11-07 16:52:18 -06:00
override pluma_plugin_configure_dialog
2011-11-07 13:46:58 -06:00
static PyObject *
2011-11-07 16:52:18 -06:00
_wrap_pluma_plugin_create_configure_dialog (PyGObject *self)
2011-11-07 13:46:58 -06:00
{
GtkWidget *ret;
gpointer klass, klass2;
PyObject *cls = (PyObject *)(((PyObject *)self)->ob_type);
klass = g_type_class_ref(pyg_type_from_object (cls));
2011-11-07 16:52:18 -06:00
if (PLUMA_IS_PLUGIN_PYTHON_CLASS (klass))
2011-11-07 13:46:58 -06:00
{
klass2 = g_type_class_peek_parent (klass);
g_type_class_unref (klass);
klass = g_type_class_ref (G_TYPE_FROM_CLASS (klass2));
}
2011-11-07 16:52:18 -06:00
if (PLUMA_PLUGIN_CLASS (klass)->create_configure_dialog)
ret = PLUMA_PLUGIN_CLASS (klass)->create_configure_dialog (PLUMA_PLUGIN (self->obj));
2011-11-07 13:46:58 -06:00
else {
PyErr_SetString (PyExc_NotImplementedError,
2011-11-07 16:52:18 -06:00
"virtual method PlumaPlugin.create_configure_dialog not implemented");
2011-11-07 13:46:58 -06:00
g_type_class_unref (klass);
return NULL;
}
g_type_class_unref (klass);
/* pygobject_new handles NULL checking */
return pygobject_new ((GObject *)ret);
}