From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: guile-gnome, devel: fix , wrap gdk_pixbuf_get_pixels Date: Fri, 4 Jul 2014 00:27:25 -0300 Message-ID: <20140704002725.77f2f2f9@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/0_kjWWw0TH1rfxNs1/ra6GU" X-Trace: ger.gmane.org 1404444506 662 80.91.229.3 (4 Jul 2014 03:28:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Jul 2014 03:28:26 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 04 05:28:14 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X2uAX-0002hs-Tj for guile-devel@m.gmane.org; Fri, 04 Jul 2014 05:28:14 +0200 Original-Received: from localhost ([::1]:34360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2uAX-0000eX-8g for guile-devel@m.gmane.org; Thu, 03 Jul 2014 23:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2uAO-0000eE-Qo for guile-devel@gnu.org; Thu, 03 Jul 2014 23:28:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2uAI-0000fe-T3 for guile-devel@gnu.org; Thu, 03 Jul 2014 23:28:04 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:58260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2uAI-0000HL-JQ for guile-devel@gnu.org; Thu, 03 Jul 2014 23:27:58 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 6A2C4A04C151 for ; Fri, 4 Jul 2014 05:27:36 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id 8Aud5RJgk1SJ for ; Fri, 4 Jul 2014 05:07:52 +0200 (CEST) Original-Received: from capac (unknown [189.60.115.53]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 1B871A04C14D for ; Fri, 4 Jul 2014 05:27:28 +0200 (CEST) X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 79.99.200.102 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17287 Archived-At: --MP_/0_kjWWw0TH1rfxNs1/ra6GU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, guile-gnome devel: fix missing some basic pointer types let's wrap gdk_pixbuf_get_pixels Attached. Review welcome of course... Hapy hacking, David --MP_/0_kjWWw0TH1rfxNs1/ra6GU Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0008-fix-glib-wrapset-missing-some-basic-pointer-types.patch >From 2315700f868a19c2301ffc8891264888656ba6a5 Mon Sep 17 00:00:00 2001 From: David PIROTTE Date: Thu, 3 Jul 2014 15:22:32 -0300 Subject: [PATCH 8/9] fix missing some basic pointer types * glib/gnome/gw/glib-spec.scm: guint8*, guchar*, gunichar*, gunichar2* added and wrapped as opaque pointers. * glib/gnome/gw/glib-support.h: * glib/gnome/gw/glib-support.c: standard coding style changes, end of line white space removed. --- glib/gnome/gw/glib-spec.scm | 16 +++++++++++----- glib/gnome/gw/glib-support.c | 35 ++++++++++++++++++++++------------- glib/gnome/gw/glib-support.h | 11 +++++------ 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/glib/gnome/gw/glib-spec.scm b/glib/gnome/gw/glib-spec.scm index f99fd6a..b8f6817 100644 --- a/glib/gnome/gw/glib-spec.scm +++ b/glib/gnome/gw/glib-spec.scm @@ -74,6 +74,7 @@ ("void" void . #f) ("int" int) ("char" char . #f) + ("char*" mchars . #f) ("float" float) ("double" double) ("short" short) @@ -101,15 +102,14 @@ ;; GLib type aliases ("gboolean" bool) ("gchar" char . #f) - ("guchar" unsigned-char . #f) - ("char*" mchars . #f) ("gchar*" mchars . #f) + ("guchar" unsigned-char . #f) ("gdouble" double) ("gfloat" float) ("gshort" short) ("gushort" unsigned-short) ("gint8" int8) - ("guint8" unsigned-int8) + ("guint8" unsigned-int8 . #f) ("gint" int) ("gint16" int16) ("guint" unsigned-int) @@ -129,13 +129,19 @@ ("gssize" ssize_t) ("gsize" size_t) - ("gunichar" unsigned-int32) - + ("gunichar" unsigned-int32 . #f) + ("gunichar2" unsigned-int16 . #f) + ("none" void . #f))) (add-type-rule! ws "gchar**" '(mchars caller-owned out)) (add-type-rule! ws "const-gchar**" '(mchars callee-owned out)) + (wrap-opaque-pointer! ws "guint8*") + (wrap-opaque-pointer! ws "guchar*") + (wrap-opaque-pointer! ws "gunichar*") + (wrap-opaque-pointer! ws "gunichar2*") + (add-type! ws (make #:name 'glist-of #:type-cname "GList*" #:func-prefix "g_list")) (add-type-alias! ws "GList*" 'glist-of) diff --git a/glib/gnome/gw/glib-support.c b/glib/gnome/gw/glib-support.c index 0776d29..09dd3e4 100644 --- a/glib/gnome/gw/glib-support.c +++ b/glib/gnome/gw/glib-support.c @@ -348,47 +348,56 @@ _wrap_g_utf8_strrchr (const gchar *p, gunichar c) return g_utf8_strrchr (p, -1, c); } -char* _wrap_g_utf8_strreverse (const gchar *p) +char* +_wrap_g_utf8_strreverse (const gchar *p) { return g_utf8_strreverse (p, -1); } -gboolean _wrap_g_utf8_validate (const gchar *p) +gboolean +_wrap_g_utf8_validate (const gchar *p) { return g_utf8_validate (p, -1, NULL); } -char* _wrap_g_utf8_strup (const gchar *p) +char* +_wrap_g_utf8_strup (const gchar *p) { return g_utf8_strup (p, -1); } -char* _wrap_g_utf8_strdown (const gchar *p) +char* +_wrap_g_utf8_strdown (const gchar *p) { return g_utf8_strdown (p, -1); } -char* _wrap_g_utf8_casefold (const gchar *p) +char* +_wrap_g_utf8_casefold (const gchar *p) { return g_utf8_casefold (p, -1); } -char* _wrap_g_utf8_normalize (const gchar *p, GNormalizeMode mode) +char* +_wrap_g_utf8_normalize (const gchar *p, GNormalizeMode mode) { return g_utf8_normalize (p, -1, mode); } -char* _wrap_g_utf8_collate_key (const gchar *p) +char* +_wrap_g_utf8_collate_key (const gchar *p) { return g_utf8_collate_key (p, -1); } -char* _wrap_g_utf8_collate_key_for_filename (const gchar *p) +char* +_wrap_g_utf8_collate_key_for_filename (const gchar *p) { return g_utf8_collate_key_for_filename (p, -1); } -char* _wrap_g_unichar_to_utf8 (gunichar c) +char* +_wrap_g_unichar_to_utf8 (gunichar c) { char *ret; int n; @@ -412,25 +421,25 @@ _wrap_g_utf8_to_ucs4 (const gchar *str, GError **error) } gunichar* -_wrap_g_utf16_to_ucs4 (const gunichar2* str, GError **error) +_wrap_g_utf16_to_ucs4 (const gunichar2 *str, GError **error) { return g_utf16_to_ucs4 (str, -1, NULL, NULL, error); } gchar* -_wrap_g_utf16_to_utf8 (const gunichar2* str, GError **error) +_wrap_g_utf16_to_utf8 (const gunichar2 *str, GError **error) { return g_utf16_to_utf8 (str, -1, NULL, NULL, error); } gunichar2* -_wrap_g_ucs4_to_utf16 (const gunichar* str, GError **error) +_wrap_g_ucs4_to_utf16 (const gunichar *str, GError **error) { return g_ucs4_to_utf16 (str, -1, NULL, NULL, error); } gchar* -_wrap_g_ucs4_to_utf8 (const gunichar* str, GError **error) +_wrap_g_ucs4_to_utf8 (const gunichar *str, GError **error) { return g_ucs4_to_utf8 (str, -1, NULL, NULL, error); } diff --git a/glib/gnome/gw/glib-support.h b/glib/gnome/gw/glib-support.h index 16b4571..c82c790 100644 --- a/glib/gnome/gw/glib-support.h +++ b/glib/gnome/gw/glib-support.h @@ -52,8 +52,7 @@ SCM _wrap_g_string_get_str (GString *str); guint _wrap_g_io_add_watch (GIOChannel *channel, GIOCondition condition, SCM func); GIOStatus _wrap_g_io_channel_read_line (GIOChannel *channel, gchar **str_return, GError **error); -gunichar -_wrap_g_utf8_get_char (const gchar *p); +gunichar _wrap_g_utf8_get_char (const gchar *p); const char* _wrap_g_utf8_find_next_char (const gchar *p); long _wrap_g_utf8_strlen (const gchar *p); const char* _wrap_g_utf8_strchr (const gchar *p, gunichar c); @@ -69,10 +68,10 @@ char* _wrap_g_utf8_collate_key_for_filename (const gchar *p); char* _wrap_g_unichar_to_utf8 (gunichar c); gunichar2* _wrap_g_utf8_to_utf16 (const gchar *str, GError **error); gunichar* _wrap_g_utf8_to_ucs4 (const gchar *str, GError **error); -gunichar* _wrap_g_utf16_to_ucs4 (const gunichar2* str, GError **error); -gchar* _wrap_g_utf16_to_utf8 (const gunichar2* str, GError **error); -gunichar2* _wrap_g_ucs4_to_utf16 (const gunichar* str, GError **error); -gchar* _wrap_g_ucs4_to_utf8 (const gunichar* str, GError **error); +gunichar* _wrap_g_utf16_to_ucs4 (const gunichar2 *str, GError **error); +gchar* _wrap_g_utf16_to_utf8 (const gunichar2 *str, GError **error); +gunichar2* _wrap_g_ucs4_to_utf16 (const gunichar *str, GError **error); +gchar* _wrap_g_ucs4_to_utf8 (const gunichar *str, GError **error); G_END_DECLS -- 2.0.0 --MP_/0_kjWWw0TH1rfxNs1/ra6GU Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0009-let-s-wrap-gdk_pixbuf_get_pixels.patch >From 8b76b7a08b7387a146672e8a44a56e61e1b23289 Mon Sep 17 00:00:00 2001 From: David PIROTTE Date: Thu, 3 Jul 2014 15:33:33 -0300 Subject: [PATCH 9/9] let's wrap gdk_pixbuf_get_pixels * gtk/gnome/overrides/gdk-pixbuf.defs: gdk_pixbuf_get_pixels returns a guchar* which is wrapped as well now, so just commenting the ignore corresponding entry. --- gtk/gnome/overrides/gdk-pixbuf.defs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gnome/overrides/gdk-pixbuf.defs b/gtk/gnome/overrides/gdk-pixbuf.defs index e841c82..1a7f791 100644 --- a/gtk/gnome/overrides/gdk-pixbuf.defs +++ b/gtk/gnome/overrides/gdk-pixbuf.defs @@ -64,7 +64,8 @@ "*_valist" "*_setv") -(ignore "gdk_pixbuf_get_pixels" +(ignore ;; "gdk_pixbuf_get_pixels" ; it has to be wrapped, + ; clutter_image_set_data needs those pixels :) "gdk_pixbuf_new_from_data" "gdk_pixbuf_new_from_inline" "gdk_pixbuf_new_from_xpm_data" -- 2.0.0 --MP_/0_kjWWw0TH1rfxNs1/ra6GU--