initgoocanvas (void)
{
    PyObject *m, *d;


    Pycairo_IMPORT;
    if (Pycairo_CAPI == NULL)
        return;

    m = Py_InitModule ("goocanvas", pygoocanvas_functions);
    d = PyModule_GetDict (m);

    init_pygobject ();

    pygoocanvas_register_classes (d);
    pygoocanvas_add_constants(m, "GOO_CANVAS_");
    PyModule_AddObject(m, "TYPE_CAIRO_MATRIX", pyg_type_wrapper_new(GOO_TYPE_CAIRO_MATRIX));
    pyg_register_gtype_custom(GOO_TYPE_CAIRO_MATRIX,
                              _cairo_matrix_from_gvalue,
                              _cairo_matrix_to_gvalue);
    PyModule_AddObject(m, "TYPE_CAIRO_PATTERN", pyg_type_wrapper_new(GOO_TYPE_CAIRO_PATTERN));
    pyg_register_gtype_custom(GOO_TYPE_CAIRO_PATTERN,
                              _cairo_pattern_from_gvalue,
                              _cairo_pattern_to_gvalue);

    PyModule_AddObject(m, "pygoocanvas_version",
                       Py_BuildValue("iii",
                                     PYGOOCANVAS_MAJOR_VERSION,
                                     PYGOOCANVAS_MINOR_VERSION,
                                     PYGOOCANVAS_MICRO_VERSION));

    if (PyErr_Occurred ())
        Py_FatalError ("can't initialise module goocanvas");
}
예제 #2
0
void
gi_gst_register_types (PyObject * d)
{
  pyg_register_gtype_custom (GST_TYPE_FRACTION,
      gi_gst_fraction_from_value, gi_gst_fraction_to_value);
  pyg_register_gtype_custom (GST_TYPE_INT_RANGE,
      gi_gst_int_range_from_value, gi_gst_int_range_to_value);
  pyg_register_gtype_custom (GST_TYPE_INT64_RANGE,
      gi_gst_int64_range_from_value, gi_gst_int64_range_to_value);
  pyg_register_gtype_custom (GST_TYPE_DOUBLE_RANGE,
      gi_gst_double_range_from_value, gi_gst_double_range_to_value);
  pyg_register_gtype_custom (GST_TYPE_FRACTION_RANGE,
      gi_gst_fraction_range_from_value, gi_gst_fraction_range_to_value);
  pyg_register_gtype_custom (GST_TYPE_ARRAY,
      gi_gst_array_from_value, gi_gst_array_to_value);
  pyg_register_gtype_custom (GST_TYPE_LIST,
      gi_gst_list_from_value, gi_gst_list_to_value);
#if 0
  /* TODO */
  pyg_register_gtype_custom (GST_TYPE_DATE_TIME,
      gi_gst_date_time_from_value, gi_gst_date_time_to_value);
  pyg_register_gtype_custom (GST_TYPE_FLAG_SET,
      gi_gst_flag_set_from_value, gi_gst_flag_set_to_value);
#endif
  pyg_register_gtype_custom (GST_TYPE_BITMASK,
      gi_gst_bitmask_from_value, gi_gst_bitmask_to_value);
}
예제 #3
0
inithippo(void)
{
    PyObject *m, *d;

    init_pygobject ();

    Pycairo_IMPORT;

    m = Py_InitModule("hippo", pyhippo_functions);
    d = PyModule_GetDict(m);

    pygobject_register_sinkfunc(HIPPO_TYPE_CANVAS_BOX, sink_hippocanvasbox);

    pyhippo_register_classes(d);
    pyhippo_add_constants(m, "HIPPO_");
    PyModule_AddObject(m, "TYPE_CAIRO_SURFACE", pyg_type_wrapper_new(HIPPO_TYPE_CAIRO_SURFACE));
    pyg_register_gtype_custom(HIPPO_TYPE_CAIRO_SURFACE,
			      _cairo_surface_from_gvalue,
			      _cairo_surface_to_gvalue);


    if (PyErr_Occurred ()) {
        Py_FatalError ("can't initialise module hippo");
    }
}
예제 #4
0
void
pygi_error_register_types (PyObject *module)
{
    PyObject *error_module = PyImport_ImportModule ("gi._error");
    if (!error_module) {
        return;
    }

    /* Stash a reference to the Python implemented gi._error.GError. */
    PyGError = PyObject_GetAttrString (error_module, "GError");

    pyg_register_gtype_custom (G_TYPE_ERROR,
                               pygerror_from_gvalue,
                               pygerror_to_gvalue);
}
예제 #5
0
initplparser(void)
{
    PyObject *m, *d;

    init_pygobject();
    if (PyImport_ImportModule("gnomevfs") == NULL) {
        PyErr_SetString(PyExc_ImportError, 
                        "could not import gnomevfs");
        return;
    }
    m = Py_InitModule("plparser", pyplparser_functions);
    d = PyModule_GetDict(m);
        
    pyplparser_register_classes(d);
    pyplparser_add_constants(m, "TOTEM_PL_");

#ifdef TOTEM_TYPE_PL_PARSER_METADATA
    pyg_register_gtype_custom(TOTEM_TYPE_PL_PARSER_METADATA,
			      _totem_metadata_from_gvalue,
			      _totem_metadata_to_gvalue);
#endif

}
예제 #6
0
void
gi_gst_register_types (PyObject * d)
{
  pyg_register_gtype_custom (GST_TYPE_FRACTION,
      gi_gst_fraction_from_value, gi_gst_fraction_to_value);
}