[pygtk] Manually wrap gtk_hsv_to_rgb() and fix a mistake in previous manual wraps.
- From: Gian Mario Tagliaretti <gianmt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygtk] Manually wrap gtk_hsv_to_rgb() and fix a mistake in previous manual wraps.
- Date: Sun, 4 Apr 2010 19:46:36 +0000 (UTC)
commit 45e22a4ad1bf91e3d4cc370923d257f4559c7bd2
Author: Gian Mario Tagliaretti <gianmt gnome org>
Date: Sun Apr 4 21:45:31 2010 +0200
Manually wrap gtk_hsv_to_rgb() and fix a mistake in previous manual wraps.
gtk/gtk.override | 26 ++++++++++++++++++++------
1 files changed, 20 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtk.override b/gtk/gtk.override
index c95b01f..3b7b86d 100644
--- a/gtk/gtk.override
+++ b/gtk/gtk.override
@@ -8741,9 +8741,7 @@ _wrap_gtk_hsv_get_color(PyGObject *self)
{
gdouble h, s, v;
- if (!gtk_hsv_get_color(GTK_HSV(self->obj), &h, &s, &v)) {
- return Py_BuildValue ("()");
- }
+ gtk_hsv_get_color(GTK_HSV(self->obj), &h, &s, &v);
return Py_BuildValue("(ddd)", h, s, v);
}
@@ -8754,9 +8752,25 @@ _wrap_gtk_hsv_get_metrics(PyGObject *self)
{
gint size, ring_width;
- if (!gtk_hsv_get_metrics(GTK_HSV(self->obj), &size, &ring_width)) {
- return Py_BuildValue ("()");
- }
+ gtk_hsv_get_metrics(GTK_HSV(self->obj), &size, &ring_width);
return Py_BuildValue("(ii)", size, ring_width);
}
+%%
+override gtk_hsv_to_rgb kwargs
+static PyObject *
+_wrap_gtk_hsv_to_rgb(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ static char *kwlist[] = { "h", "s", "v", NULL };
+ gdouble h=0, s=0, v=0;
+ gdouble r, g, b;
+
+ if (!PyArg_ParseTupleAndKeywords(args,kwargs,
+ "ddd:gtk.hsv_to_rgb",
+ kwlist, &h, &s, &v))
+ return NULL;
+
+ gtk_hsv_to_rgb(h, s, v, &r, &g, &b);
+
+ return Py_BuildValue("(ddd)", r, g, b);
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]