Example #1
0
PyMODINIT_FUNC
initgimpthumb(void)
{
    PyObject *m, *d;
    
    pygimp_init_pygobject();

    m = Py_InitModule3("gimpthumb", gimpthumb_functions, gimpthumb_doc);
    d = PyModule_GetDict(m);

    gimpthumb_register_classes(d);
    gimpthumb_add_constants(m, "GIMP_THUMB_");

    if (PyErr_Occurred())
	Py_FatalError("can't initialize module gimpthumb");
}
Example #2
0
PyMODINIT_FUNC
initgimpcolor(void)
{
    PyObject *m, *d;

    pygimp_init_pygobject();

    /* Create the module and add the functions */
    m = Py_InitModule3("gimpcolor", gimpcolor_methods, gimpcolor_doc);

    d = PyModule_GetDict(m);

    pyg_register_boxed(d, "RGB", GIMP_TYPE_RGB, &PyGimpRGB_Type);
    pyg_register_boxed(d, "HSV", GIMP_TYPE_HSV, &PyGimpHSV_Type);
    pyg_register_boxed(d, "HSL", GIMP_TYPE_HSL, &PyGimpHSL_Type);
    pyg_register_boxed(d, "CMYK", GIMP_TYPE_CMYK, &PyGimpCMYK_Type);

    PyModule_AddObject(m, "RGB_COMPOSITE_NONE",
		       PyInt_FromLong(GIMP_RGB_COMPOSITE_NONE));
    PyModule_AddObject(m, "RGB_COMPOSITE_NORMAL",
		       PyInt_FromLong(GIMP_RGB_COMPOSITE_NORMAL));
    PyModule_AddObject(m, "RGB_COMPOSITE_BEHIND",
		       PyInt_FromLong(GIMP_RGB_COMPOSITE_BEHIND));

    PyModule_AddObject(m, "RGB_LUMINANCE_RED",
		       PyFloat_FromDouble(GIMP_RGB_LUMINANCE_RED));
    PyModule_AddObject(m, "RGB_LUMINANCE_GREEN",
		       PyFloat_FromDouble(GIMP_RGB_LUMINANCE_GREEN));
    PyModule_AddObject(m, "RGB_LUMINANCE_BLUE",
		       PyFloat_FromDouble(GIMP_RGB_LUMINANCE_BLUE));

    /* for other modules */
    PyModule_AddObject(m, "_PyGimpColor_API",
                       PyCObject_FromVoidPtr(&pygimpcolor_api_functions, NULL));

    /* Check for errors */
    if (PyErr_Occurred())
	Py_FatalError("can't initialize module gimpcolor");
}
Example #3
0
PyMODINIT_FUNC
init_gimpenums(void)
{
    PyObject *m;

    pygimp_init_pygobject();

    init_pygimp();

    gimp_enums_init();

    /* Create the module and add the functions */
    m = Py_InitModule3("_gimpenums", NULL, gimpenums_doc);

    add_misc_enums(m);
    add_compat_enums(m);
    add_registered_enums(m);

    /* Check for errors */
    if (PyErr_Occurred())
        Py_FatalError("can't initialize module _gimpenums");
}