From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: gw:wcp types in Guile-Gnome Date: Sun, 27 Aug 2017 01:01:28 -0300 Message-ID: <20170827010128.1b27b900@capac> References: <51dae00f-08ae-be10-7589-94f3c01d9dfd@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/Avu=mh9R9BsJTuIg/velCvU"; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1503806537 2126 195.159.176.226 (27 Aug 2017 04:02:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Aug 2017 04:02:17 +0000 (UTC) Cc: guile-user@gnu.org To: Tommi =?UTF-8?B?SMO2eW7DpGzDpG5tYWE=?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 27 06:02:10 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlolt-0008DA-Iq for guile-user@m.gmane.org; Sun, 27 Aug 2017 06:02:01 +0200 Original-Received: from localhost ([::1]:59456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlom0-0000kG-DC for guile-user@m.gmane.org; Sun, 27 Aug 2017 00:02:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlole-0000k8-TV for guile-user@gnu.org; Sun, 27 Aug 2017 00:01:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dlolb-00056P-R2 for guile-user@gnu.org; Sun, 27 Aug 2017 00:01:46 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:41286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dlolb-00055O-Gy for guile-user@gnu.org; Sun, 27 Aug 2017 00:01:43 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 1FC47A04C191; Sun, 27 Aug 2017 06:01:40 +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 ukGRS5RNZYqg; Sun, 27 Aug 2017 06:01:35 +0200 (CEST) Original-Received: from capac (179.176.130.211.dynamic.adsl.gvt.net.br [179.176.130.211]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 308D3A04C18C; Sun, 27 Aug 2017 06:01:34 +0200 (CEST) In-Reply-To: <51dae00f-08ae-be10-7589-94f3c01d9dfd@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 79.99.200.102 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14063 Archived-At: --Sig_/Avu=mh9R9BsJTuIg/velCvU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello, Sorry for the late response, I was hoping someone else would answer before= I could, we are not that many but there are still a few very good guile-gnome users out there ... :) > Pango attributes are instances of class in Guile-Gnome but they= =20 > are not GOOPS instances (i.e. (instance? x) returns false). Class name=20 > is not defined at all. Indeed, pango attributes are opaque pointers, in the manual you see: Class: =09 Opaque pointer. This class defines no direct slots. Note that the manual is automatically generated, which is why you read 'Cla= ss: , but on the next entry you can also read 'Opaque pointer'= , which is an indication for users that the class has not been 'optimally' wrapped: they are not goops classes - subclass of , such as , they are (G-Wrap) opaque pointers. In the manual, references to means it wish to receive an = opaque pointer of the corresponding attribute ... and these are returned by the i= nterface creating pango attributes: pango-attr-size-new, pango-attr-font-desc-new ... Opaque pointers are low level G-Wrap beats, so you don't want to involve yo= urself there :). Their printing representation miss leaded you to believe they are instances of ... which is not the case. When you create an attribute: scheme@(guile-user)> (pango-attr-size-new 10) $3 =3D # 0x562572ca8c40> in the above, gw:wcp stands for 'g-wrap:wrap C type', and what you read is just an opaque pointer printing representation for (pango-attr-size-new 1= 0) Just for info, below is a copy ot the automatically G-Wrap generated defini= tion for pango-attr-size-new [1] > How can I test if an arbitrary object belongs to some specific = class, > e.g. if an object is a Pango attribute? You can't, you have to use their creator interfaces and attribute list oper= ators ... scheme@(guile-user)> (pango-attr-list-new) $2 =3D #< 562572e2f260 [native]> scheme@(guile-user)> (pango-attr-size-new 10) $3 =3D # 0x562572ca8c40> scheme@(guile-user)> (pango-attr-list-insert $2 $3) scheme@(guile-user)>=20 HTH, David [1] { const char *gw__tmp1217_arg_types[1]; static GWTypeSpec gw__tmp1218_arg_typespecs[] =3D { GW_TYPESPEC_CALLER_OW= NED, }; gw__tmp1217_arg_types[0] =3D "int"; gw_wrapset_add_function(gw__tmp0_c_info, pango_attr_size_new, 1, 0, "", GW_TYPESPEC_CALLER_OWNED, gw__tmp1217_arg_types, gw__tmp12= 18_arg_typespecs, "pango-attr-size-new", NULL, GW_FUNCTION_FLAG_LEAVE_RUNTI= ME); } --Sig_/Avu=mh9R9BsJTuIg/velCvU Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAlmiRBgACgkQ83T9k6MF etdaIwf9F9GImhDtlRbTHEjQ4W/wFqIfuco9L+bvMKvilKgwyHV9QemaRUIBmDKA 2bwohgUHlKUCRxMbfqUleYaQ3k5ElMgFfjVI135+MXCp2JZ66JmB/nECyMGSxF1j WVFiN+0yquq2mIcWx9hq72WhgePhkH/qfP0CLPb03oLDLhgbWUhOAuZkPc3gmYjx DnaDDB1d4yJwrZuz1gDAfdh1UCwTCu8TN4OJHXkZk6UyFdOsu7cZb1WfE04Pflmz oaTIHIYvRUHTduDq+icwY1S8JogqOct1ya3PfN3e+uBFMvytmvpzZX9jrk/5DyZj iPM/KVRllk1hhCYHhoFjyUlJtVU8zw== =7mbD -----END PGP SIGNATURE----- --Sig_/Avu=mh9R9BsJTuIg/velCvU--