コード例 #1
0
ファイル: gimpthumb.c プロジェクト: trenta-os/gimp
/* initialise stuff extension classes */
void
gimpthumb_register_classes(PyObject *d)
{
    PyObject *module;

    if ((module = PyImport_ImportModule("gobject")) != NULL) {
        _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
        if (_PyGObject_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name GObject from gobject");
            return ;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gobject");
        return ;
    }
    if ((module = PyImport_ImportModule("gtk.gdk")) != NULL) {
        _PyGdkPixbuf_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Pixbuf");
        if (_PyGdkPixbuf_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Pixbuf from gtk.gdk");
            return ;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gtk.gdk");
        return ;
    }


#line 692 "gimpthumb.c"
    pygobject_register_class(d, "GimpThumbnail", GIMP_TYPE_THUMBNAIL, &PyGimpThumbnail_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(GIMP_TYPE_THUMBNAIL);
}
コード例 #2
0
void py_midgard_schema_object_factory_register_class(
    PyObject *d, gpointer pygobject_type)
{
    pygobject_register_class (d, "schema_object_factory",
                              MIDGARD_TYPE_SCHEMA_OBJECT_FACTORY,
                              &Pymidgard_schema_object_factory_Type,
                              Py_BuildValue("(O)", pygobject_type));
}
コード例 #3
0
void py_midgard_base_view_register_class(
		PyObject *d, gpointer pygobject_type)
{
	pygobject_register_class(d, 
			"view", 
			MIDGARD_TYPE_VIEW, 
			&Pymidgard_view_Type, 
			Py_BuildValue("(O)", pygobject_type));
}
コード例 #4
0
void py_midgard_key_config_file_context_register_class(
		PyObject *d, gpointer ot)
{
	pygobject_register_class(d, 
			"key_config_file_context", 
			MIDGARD_TYPE_KEY_CONFIG_FILE_CONTEXT, 
			&Pymidgard_key_config_file_context_Type, NULL);
			//Py_BuildValue("(O)", ot));

}
コード例 #5
0
ファイル: tag.c プロジェクト: zsx/ossbuild
/* initialise stuff extension classes */
void
pytag_register_classes(PyObject *d)
{
    PyObject *module;

    if ((module = PyImport_ImportModule("gobject")) != NULL) {
        PyObject *moddict = PyModule_GetDict(module);

        _PyGObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "GObject");
        if (_PyGObject_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name GObject from gobject");
            return;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gobject");
        return;
    }
    if ((module = PyImport_ImportModule("gst")) != NULL) {
        PyObject *moddict = PyModule_GetDict(module);

        _PyGstObject_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Object");
        if (_PyGstObject_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Object from gst");
            return;
        }
        _PyGstStructure_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Structure");
        if (_PyGstStructure_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Structure from gst");
            return;
        }
        _PyGstElement_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Element");
        if (_PyGstElement_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Element from gst");
            return;
        }
        _PyGstPad_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Pad");
        if (_PyGstPad_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Pad from gst");
            return;
        }
        _PyGstBuffer_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Buffer");
        if (_PyGstBuffer_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Buffer from gst");
            return;
        }
        _PyGstMessage_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "Message");
        if (_PyGstMessage_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Message from gst");
            return;
        }
        _PyGstSystemClock_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "SystemClock");
        if (_PyGstSystemClock_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name SystemClock from gst");
            return;
        }
        _PyGstBaseTransform_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "BaseTransform");
        if (_PyGstBaseTransform_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name BaseTransform from gst");
            return;
        }
        _PyGstBaseSink_Type = (PyTypeObject *)PyDict_GetItemString(moddict, "BaseSink");
        if (_PyGstBaseSink_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name BaseSink from gst");
            return;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gst");
        return;
    }


#line 408 "..\\..\\..\\Source\\gst-python\\gst\\tag.c"
    pygobject_register_class(d, "GstTagDemux", GST_TYPE_TAG_DEMUX, &PyGstTagDemux_Type, Py_BuildValue("(O)", &PyGstElement_Type));
}
コード例 #6
0
/* initialise stuff extension classes */
void
py_sugarext_register_classes(PyObject *d)
{
    PyObject *module;

    if ((module = PyImport_ImportModule("gobject")) != NULL) {
        _PyGObject_Type = (PyTypeObject *)PyObject_GetAttrString(module, "GObject");
        if (_PyGObject_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name GObject from gobject");
            return ;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gobject");
        return ;
    }
    if ((module = PyImport_ImportModule("gtk")) != NULL) {
        _PyGtkWidget_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Widget");
        if (_PyGtkWidget_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Widget from gtk");
            return ;
        }
        _PyGtkEntry_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Entry");
        if (_PyGtkEntry_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Entry from gtk");
            return ;
        }
        _PyGtkMenu_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Menu");
        if (_PyGtkMenu_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Menu from gtk");
            return ;
        }
        _PyGtkContainer_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Container");
        if (_PyGtkContainer_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Container from gtk");
            return ;
        }
        _PyGtkImage_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Image");
        if (_PyGtkImage_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Image from gtk");
            return ;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gtk");
        return ;
    }
    if ((module = PyImport_ImportModule("gtk.gdk")) != NULL) {
        _PyGdkWindow_Type = (PyTypeObject *)PyObject_GetAttrString(module, "Window");
        if (_PyGdkWindow_Type == NULL) {
            PyErr_SetString(PyExc_ImportError,
                "cannot import name Window from gtk.gdk");
            return ;
        }
    } else {
        PyErr_SetString(PyExc_ImportError,
            "could not import gtk.gdk");
        return ;
    }


#line 1063 "_sugarext.c"
    pygobject_register_class(d, "SugarKeyGrabber", SUGAR_TYPE_KEY_GRABBER, &PySugarKeyGrabber_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(SUGAR_TYPE_KEY_GRABBER);
    pygobject_register_class(d, "SugarMenu", SUGAR_TYPE_MENU, &PySugarMenu_Type, Py_BuildValue("(O)", &PyGtkMenu_Type));
    pygobject_register_class(d, "SugarGrid", SUGAR_TYPE_GRID, &PySugarGrid_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(SUGAR_TYPE_GRID);
    pygobject_register_class(d, "EggSMClient", EGG_TYPE_SM_CLIENT, &PyEggSMClient_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(EGG_TYPE_SM_CLIENT);
    pygobject_register_class(d, "EggSMClientXSMP", EGG_TYPE_SM_CLIENT_XSMP, &PyEggSMClientXSMP_Type, Py_BuildValue("(O)", &PyEggSMClient_Type));
    pyg_set_object_has_new_constructor(EGG_TYPE_SM_CLIENT_XSMP);
    pygobject_register_class(d, "GsmSession", GSM_TYPE_SESSION, &PyGsmSession_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(GSM_TYPE_SESSION);
    pygobject_register_class(d, "AcmeVolume", ACME_TYPE_VOLUME, &PyAcmeVolume_Type, Py_BuildValue("(O)", &PyGObject_Type));
    pyg_set_object_has_new_constructor(ACME_TYPE_VOLUME);
    pygobject_register_class(d, "AcmeVolumeAlsa", ACME_TYPE_VOLUME_ALSA, &PyAcmeVolumeAlsa_Type, Py_BuildValue("(O)", &PyAcmeVolume_Type));
    pyg_set_object_has_new_constructor(ACME_TYPE_VOLUME_ALSA);
}