diff --git a/ChangeLog b/ChangeLog index a27bc2cb03..e3c6bb2ae7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-10-14 Edward Hervey + + * gst/gst-types.defs: + Added GstDate boxed type + * gst/gst.override: + Added setters and getters for GstDate's day/month/year + Added tp_repr for GstDate + 2005-10-14 Edward Hervey * gst/gst.defs: diff --git a/gst/gst-types.defs b/gst/gst-types.defs index ca19e6e037..6fc652292a 100644 --- a/gst/gst-types.defs +++ b/gst/gst-types.defs @@ -241,6 +241,17 @@ '("gchar*" "message")) ) +(define-boxed Date + (in-module "Gst") + (c-name "GstDate") + (gtype-id "GST_TYPE_DATE") + (fields + '("gint" "day") + '("gint" "month") + '("gint" "year") + ) +) + ;; Enumerations and flags ... (define-flags BinFlags diff --git a/gst/gst.override b/gst/gst.override index cd5e296106..5a65e1ede5 100644 --- a/gst/gst.override +++ b/gst/gst.override @@ -381,6 +381,73 @@ _wrap_gst_g_error_tp_str(PyGObject *self) error->code)); } %% +override-attr GstDate.day +static PyObject * +_wrap_gst_date__get_day(PyGObject *self, void *closure) +{ + return PyInt_FromLong(g_date_get_day((GDate*)self->obj)); +} + +static int +_wrap_gst_date__set_day(PyGObject *self, PyObject *value, void *closure) +{ + GDate *date = (GDate *) self->obj; + + if (!(PyInt_Check(value))) + return -1; + + g_date_set_day(date, (int) PyInt_AsLong(value)); + return 0; +} +%% +override-attr GstDate.month +static PyObject * +_wrap_gst_date__get_month(PyGObject *self, void *closure) +{ + return PyInt_FromLong(g_date_get_month((GDate*)self->obj)); +} +static int +_wrap_gst_date__set_month(PyGObject *self, PyObject *value, void *closure) +{ + GDate *date = (GDate *) self->obj; + + if (!(PyInt_Check(value))) + return -1; + + g_date_set_month(date, (int) PyInt_AsLong(value)); + return 0; +} +%% +override-attr GstDate.year +static PyObject * +_wrap_gst_date__get_year(PyGObject *self, void *closure) +{ + return PyInt_FromLong(g_date_get_year((GDate*)self->obj)); +} +static int +_wrap_gst_date__set_year(PyGObject *self, PyObject *value, void *closure) +{ + GDate *date = (GDate *) self->obj; + + if (!(PyInt_Check(value))) + return -1; + + g_date_set_year(date, (int) PyInt_AsLong(value)); + return 0; +} +%% +override-slot GstDate.tp_repr +static PyObject * +_wrap_gst_date_tp_repr(PyGObject *self) +{ + GDate *date = (GDate *) self->obj; + + return PyString_FromFormat ("", + g_date_get_day(date), + g_date_get_month(date), + g_date_get_year(date)); +} +%% override gst_registry_get_path_list static PyObject * _wrap_gst_registry_get_path_list (PyGObject *self)