mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
gst/gst-types.defs: Added GstDate boxed type
Original commit message from CVS: * 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
This commit is contained in:
parent
2aa12f0142
commit
4bac0b3066
3 changed files with 86 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-10-14 Edward Hervey <edward@fluendo.com>
|
||||
|
||||
* 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 <edward@fluendo.com>
|
||||
|
||||
* gst/gst.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
|
||||
|
|
|
@ -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 ("<GstDate: %2d/%2d/%4d>",
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue