From: David Pirotte <david@altosw.be>
To: guile-devel <guile-devel@gnu.org>
Subject: guile-gnome, devel: fix <glib-wrapset>, wrap gdk_pixbuf_get_pixels
Date: Fri, 4 Jul 2014 00:27:25 -0300 [thread overview]
Message-ID: <20140704002725.77f2f2f9@capac> (raw)
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Hello,
guile-gnome
devel: fix <glib-wrapset> missing some basic pointer types
let's wrap gdk_pixbuf_get_pixels
Attached. Review welcome of course...
Hapy hacking,
David
[-- Attachment #2: 0008-fix-glib-wrapset-missing-some-basic-pointer-types.patch --]
[-- Type: text/x-patch, Size: 6311 bytes --]
From 2315700f868a19c2301ffc8891264888656ba6a5 Mon Sep 17 00:00:00 2001
From: David PIROTTE <david@altosw.be>
Date: Thu, 3 Jul 2014 15:22:32 -0300
Subject: [PATCH 8/9] fix <glib-wrapset> 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 <glist-of-type> #: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
[-- Attachment #3: 0009-let-s-wrap-gdk_pixbuf_get_pixels.patch --]
[-- Type: text/x-patch, Size: 1011 bytes --]
From 8b76b7a08b7387a146672e8a44a56e61e1b23289 Mon Sep 17 00:00:00 2001
From: David PIROTTE <david@altosw.be>
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
reply other threads:[~2014-07-04 3:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140704002725.77f2f2f9@capac \
--to=david@altosw.be \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).