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-clutter, clutter-devel: add custom bindings for ClutterPoint and ClutterSize Date: Mon, 28 Apr 2014 16:20:21 -0300 Message-ID: <20140428162021.2918b693@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/rWMp7iYGF7tmDHzG22_IwXk" X-Trace: ger.gmane.org 1398712884 21566 80.91.229.3 (28 Apr 2014 19:21:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 19:21:24 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 28 21:21:17 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 1Wer75-0002Q6-NP for guile-devel@m.gmane.org; Mon, 28 Apr 2014 21:21:15 +0200 Original-Received: from localhost ([::1]:45584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wer75-0002FW-4s for guile-devel@m.gmane.org; Mon, 28 Apr 2014 15:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wer6u-00025t-6w for guile-devel@gnu.org; Mon, 28 Apr 2014 15:21:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wer6l-0005lP-2r for guile-devel@gnu.org; Mon, 28 Apr 2014 15:21:04 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:44336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wer6k-0005hW-8p for guile-devel@gnu.org; Mon, 28 Apr 2014 15:20:54 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 1A971A04C122 for ; Mon, 28 Apr 2014 21:20:32 +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 N7977F6gc5kT for ; Mon, 28 Apr 2014 21:02:12 +0200 (CEST) Original-Received: from capac (unknown [189.60.2.251]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id AF936A04C0B5 for ; Mon, 28 Apr 2014 21:20:24 +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:17113 Archived-At: --MP_/rWMp7iYGF7tmDHzG22_IwXk Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, guile-clutter clutter-devel: add custom bindings for ClutterPoint and ClutterSize Patch review solicited. Thanks, David --MP_/rWMp7iYGF7tmDHzG22_IwXk Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0004-add-custom-bindings-for-ClutterPoint-and-ClutterSize.patch >From fd2da7831c966034649392ebac00214a3660b4cf Mon Sep 17 00:00:00 2001 From: David PIROTTE Date: Mon, 28 Apr 2014 16:12:45 -0300 Subject: [PATCH 4/4] add custom bindings for ClutterPoint and ClutterSize * clutter/gnome/gw/clutter-spec.scm: * clutter/gnome/gw/clutter-support.h: * clutter/gnome/gw/clutter-support.c: add custom bindings and support code for ClutterPoint and ClutterSize --- clutter/gnome/gw/clutter-spec.scm | 16 ++++++++++++++- clutter/gnome/gw/clutter-support.c | 41 +++++++++++++++++++++++++++++++++++++- clutter/gnome/gw/clutter-support.h | 11 +++++++++- 3 files changed, 65 insertions(+), 3 deletions(-) diff --git a/clutter/gnome/gw/clutter-spec.scm b/clutter/gnome/gw/clutter-spec.scm index b34cd3a..436967e 100644 --- a/clutter/gnome/gw/clutter-spec.scm +++ b/clutter/gnome/gw/clutter-spec.scm @@ -1,5 +1,5 @@ ;; guile-gnome -;; Copyright (C) 2008,2012 Free Software Foundation, Inc. +;; Copyright (C) 2008,2012,2014 Free Software Foundation, Inc. ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as @@ -156,6 +156,20 @@ ;; unwrap (list c-var " = scm_scm_to_clutter_perspective (" scm-var ");\n")) + (wrap-custom-boxed! + "ClutterPoint" "CLUTTER_TYPE_POINT" + ;; wrap + (list scm-var " = " c-var " ? scm_clutter_point_to_scm (" c-var ") : SCM_BOOL_F;\n") + ;; unwrap + (list c-var " = scm_scm_to_clutter_point (" scm-var ");\n")) + + (wrap-custom-boxed! + "ClutterSize" "CLUTTER_TYPE_SIZE" + ;; wrap + (list scm-var " = " c-var " ? scm_clutter_size_to_scm (" c-var ") : SCM_BOOL_F;\n") + ;; unwrap + (list c-var " = scm_scm_to_clutter_size (" scm-var ");\n")) + (wrap-opaque-pointer! ws "ClutterInputDevice*") (wrap-opaque-pointer! ws "ClutterEventSequence*") diff --git a/clutter/gnome/gw/clutter-support.c b/clutter/gnome/gw/clutter-support.c index e895d1e..ecba8f4 100644 --- a/clutter/gnome/gw/clutter-support.c +++ b/clutter/gnome/gw/clutter-support.c @@ -1,5 +1,5 @@ /* guile-gnome - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2012,2014 Free Software Foundation, Inc. * * clutter-support.c: Support routines for the clutter wrapper * @@ -298,3 +298,42 @@ wrap_clutter_units_from_string (const gchar *str) clutter_units_from_string (&units, str); return clutter_units_copy (&units); } + + +/* Since 1.12 */ + +SCM +scm_clutter_point_to_scm (ClutterPoint *c) +{ + return scm_list_2 (scm_from_double (c->x), + scm_from_double (c->y)); +} + +ClutterPoint* +scm_scm_to_clutter_point (SCM scm) +{ + ClutterPoint ret; + + ret.x = scm_to_double (scm_car (scm)); + ret.y = scm_to_double (scm_cadr (scm)); + + return clutter_point_copy (&ret); +} + +SCM +scm_clutter_size_to_scm (ClutterSize *c) +{ + return scm_list_2 (scm_from_double (c->width), + scm_from_double (c->height)); +} + +ClutterSize* +scm_scm_to_clutter_size (SCM scm) +{ + ClutterSize ret; + + ret.width = scm_to_double (scm_car (scm)); + ret.height = scm_to_double (scm_cadr (scm)); + + return clutter_size_copy (&ret); +} diff --git a/clutter/gnome/gw/clutter-support.h b/clutter/gnome/gw/clutter-support.h index 2f2bb62..c42fe1a 100644 --- a/clutter/gnome/gw/clutter-support.h +++ b/clutter/gnome/gw/clutter-support.h @@ -1,5 +1,5 @@ /* guile-gnome - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2012,2014 Free Software Foundation, Inc. * * clutter-support.h: * @@ -58,3 +58,12 @@ ClutterUnits* wrap_clutter_units_from_em_for_font (const gchar *font_name, gfloa ClutterUnits* wrap_clutter_units_from_mm (gfloat mm); ClutterUnits* wrap_clutter_units_from_pt (gfloat pt); ClutterUnits* wrap_clutter_units_from_string (const gchar *str); + + +/* Since 1.12 */ + +SCM scm_clutter_point_to_scm (ClutterPoint *k); +ClutterPoint* scm_scm_to_clutter_point (SCM scm); + +SCM scm_clutter_size_to_scm (ClutterSize *k); +ClutterSize* scm_scm_to_clutter_size (SCM scm); -- 1.9.2 --MP_/rWMp7iYGF7tmDHzG22_IwXk--