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: 2 more patches Date: Sat, 25 Oct 2014 15:48:21 -0200 Message-ID: <20141025154821.1042e2c7@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/jOYkhY1ACEXn8STGScxU3wi"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1414259353 19503 80.91.229.3 (25 Oct 2014 17:49:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2014 17:49:13 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Oct 25 19:49:07 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 1Xi5Sc-0007n0-66 for guile-devel@m.gmane.org; Sat, 25 Oct 2014 19:49:06 +0200 Original-Received: from localhost ([::1]:54294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi5Sb-00068r-T3 for guile-devel@m.gmane.org; Sat, 25 Oct 2014 13:49:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi5SV-000677-2x for guile-devel@gnu.org; Sat, 25 Oct 2014 13:49:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xi5SP-0006Lt-RY for guile-devel@gnu.org; Sat, 25 Oct 2014 13:48:59 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:60983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xi5SP-0006Ig-Ga for guile-devel@gnu.org; Sat, 25 Oct 2014 13:48:53 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id 9291EA04C112 for ; Sat, 25 Oct 2014 19:48:31 +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 18Kifc1c3fqg for ; Sat, 25 Oct 2014 19:26:20 +0200 (CEST) Original-Received: from capac (unknown [179.210.38.77]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 07D09A04C0C3 for ; Sat, 25 Oct 2014 19:48:23 +0200 (CEST) X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.25; 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:17593 Archived-At: --Sig_/jOYkhY1ACEXn8STGScxU3wi Content-Type: multipart/mixed; boundary="MP_/kCN8uwXc.as7k9ZvrlXZt57" --MP_/kCN8uwXc.as7k9ZvrlXZt57 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello, guile-clutter clutter-devel: -] removing example based upon deprecated functionality; -] fix clutter_actor_get_margin needs a special wrapper. Happy hacking. David --MP_/kCN8uwXc.as7k9ZvrlXZt57 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0005-removing-example-based-upon-deprecated-functionality.patch =46rom ee05442e14c770a70c4ad941de2de00f5a211ee7 Mon Sep 17 00:00:00 2001 From: David PIROTTE Date: Thu, 16 Oct 2014 17:03:30 -0300 Subject: [PATCH 5/6] removing example based upon deprecated functionality * examples/hello-behaviours.scm: deleted. This example was written based on , but , all its subclasses and methods have been deprecated in 1.6. See the "Migrating from ClutterBehavior" section of the reference manual for further information. --- examples/hello-behaviours.scm | 95 ---------------------------------------= ---- 1 file changed, 95 deletions(-) delete mode 100755 examples/hello-behaviours.scm diff --git a/examples/hello-behaviours.scm b/examples/hello-behaviours.scm deleted file mode 100755 index 86d46ac..0000000 --- a/examples/hello-behaviours.scm +++ /dev/null @@ -1,95 +0,0 @@ -#! /bin/sh -# -*- scheme -*- -exec guile -e main -s $0 "$@" -!# -;; guile-gnome -;; Copyright (C) 2008, 2012 Free Software Foundation, Inc. - -;; This program is free software; you can redistribute it and/or =20 -;; modify it under the terms of the GNU General Public License as =20 -;; published by the Free Software Foundation; either version 2 of =20 -;; the License, or (at your option) any later version. =20 -;; =20 -;; This program is distributed in the hope that it will be useful, =20 -;; but WITHOUT ANY WARRANTY; without even the implied warranty of =20 -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =20 -;; GNU General Public License for more details. =20 -;; =20 -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, contact: -;; -;; Free Software Foundation Voice: +1-617-542-5942 -;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652 -;; Boston, MA 02111-1307, USA gnu@gnu.org - - -(use-modules (gnome-2) - (srfi srfi-11) - (oop goops) - (gnome gobject) - (gnome glib) - (gnome clutter)) - -(define *loop* (g-main-loop-new)) -(define *stage* #f) -(define *color* '(#xff #xcc #xcc #xdd)) - -(define (on-button-press stage event) - (pk 'button-pressed! stage event) - #t) - -(define (prep-stage) - (set! *stage* (clutter-stage-get-default)) - (set-color *stage* (pk (clutter-color-from-string "DarkSlateGrey"))) - (set-size *stage* 800 600) - (set-title *stage* "My First Clutter Application") - (connect *stage* 'key-press-event - (lambda (s e) (g-main-loop-quit *loop*) #t)) - (connect *stage* 'button-press-event on-button-press)) - -(define (fold-pack w h . procs) - (pk w h procs) - (if (pair? procs) - (let-values (((w h) ((car procs) w h))) - (apply fold-pack w h (cdr procs))))) - -(define (show-message msg) - (define (make-label sw sh) - (let ((l (make - #:font-name "Mono 22" #:text msg #:color *color*))) - (let-values (((w h) (get-size l))) - (pk w h) - (set-position l (- sw w 50) (- sh h)) - (add-actor *stage* l) - (values sw (- sh h))))) - - (define (make-cursor sw sh) - (let* ((c (make - #:color *color* #:width 20 #:height (pk (- (get-height *st= age*) sh)) - #:x (- sw 50) #:y sh)) - (t (make - #:duration 800 ; milliseconds - #:loop #t)) - (b (make - #:opacity-start #xdd #:opacity-end #x0 - #:alpha (let ((a (clutter-alpha-new))) - (set-mode a 'linear) - (set-timeline a t) - a)))) - (add-actor *stage* c) - ;; FIXME: apply is not being made into a generic! - (clutter-behaviour-apply b c) - (start t) - (values sw sh))) - - (fold-pack (get-width *stage*) (get-height *stage*) - make-label - make-cursor)) - -(define (main args) - (let ((message (if (pair? (cdr args)) (cadr args) "Hello from Guile-Clut= ter!"))) - (prep-stage) - (show-message message) - (show-all *stage*) - (g-main-loop-run *loop*) - (exit 0))) --=20 2.1.1 --MP_/kCN8uwXc.as7k9ZvrlXZt57 Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0006-fix-clutter_actor_get_margin-needs-a-special-wrapper.patch =46rom 00527196c6d204ac83a215582e2f1c5e993f50da Mon Sep 17 00:00:00 2001 From: David PIROTTE Date: Sat, 25 Oct 2014 15:16:37 -0200 Subject: [PATCH 6/6] fix clutter_actor_get_margin needs a special wrapper * clutter/gnome/gw/clutter-support.c: * clutter/gnome/gw/clutter-support.h: * clutter/gnome/overrides/clutter.defs: get-margin method overridden, now calling wrap_clutter_actor_get_margin. Removing eol white space and reorganizing clutter.defs a little, grouping methods, alphabetival order, per object class name, method name. --- clutter/gnome/gw/clutter-support.c | 10 +++- clutter/gnome/gw/clutter-support.h | 1 + clutter/gnome/overrides/clutter.defs | 105 +++++++++++++++++++------------= ---- 3 files changed, 67 insertions(+), 49 deletions(-) diff --git a/clutter/gnome/gw/clutter-support.c b/clutter/gnome/gw/clutter-= support.c index 3db6184..4de11c8 100644 --- a/clutter/gnome/gw/clutter-support.c +++ b/clutter/gnome/gw/clutter-support.c @@ -156,6 +156,14 @@ scm_scm_to_clutter_margin (SCM scm) } =20 SCM +wrap_clutter_actor_get_margin (ClutterActor* actor) +{ + ClutterMargin margin; + clutter_actor_get_margin (actor, &margin); + return scm_clutter_margin_to_scm (&margin); +} + +SCM scm_clutter_actor_box_to_scm (ClutterActorBox *a) { return scm_list_4 (scm_from_double (a->x1), @@ -252,7 +260,7 @@ _wrap_clutter_color_from_string (const char *name) } =20 SCM -wrap_clutter_actor_get_background_color (ClutterActor* actor)=20 +wrap_clutter_actor_get_background_color (ClutterActor* actor) { ClutterColor color; clutter_actor_get_background_color (actor, &color); diff --git a/clutter/gnome/gw/clutter-support.h b/clutter/gnome/gw/clutter-= support.h index 1728f48..31a9908 100644 --- a/clutter/gnome/gw/clutter-support.h +++ b/clutter/gnome/gw/clutter-support.h @@ -33,6 +33,7 @@ ClutterPathNode* scm_scm_to_clutter_path_node (SCM scm); =20 SCM scm_clutter_margin_to_scm (ClutterMargin *k); ClutterMargin* scm_scm_to_clutter_margin (SCM scm); +SCM wrap_clutter_actor_get_margin (ClutterActor* actor); =20 SCM scm_clutter_color_to_scm (ClutterColor *c); ClutterColor* scm_scm_to_clutter_color (SCM scm); diff --git a/clutter/gnome/overrides/clutter.defs b/clutter/gnome/overrides= /clutter.defs index 7206aae..dd23223 100644 --- a/clutter/gnome/overrides/clutter.defs +++ b/clutter/gnome/overrides/clutter.defs @@ -153,6 +153,20 @@ (return-type "GList*-of-ClutterAction*") ) =20 +(define-method get_background_color + (of-object "ClutterActor") + (c-name "wrap_clutter_actor_get_background_color") + (overrides "clutter_actor_get_background_color") + (return-type "SCM") + (leave-guile-mode #f)) + +(define-method get_children + (of-object "ClutterActor") + (c-name "clutter_actor_get_children") + (overrides "clutter_actor_get_children") + (return-type "GList*-of-ClutterActor*") +) + (define-method get_constraints (of-object "ClutterActor") (c-name "clutter_actor_get_constraints") @@ -167,20 +181,12 @@ (return-type "GList*-of-ClutterEffect*") ) =20 -(define-function clutter_binding_pool_get_for_class - (c-name "clutter_binding_pool_get_for_class") - (overrides "clutter_binding_pool_get_for_class") - (return-type "ClutterBindingPool*") - (parameters - '("GObjectClass*" "klass") - ) -) -(define-method get_children +(define-method get_margin (of-object "ClutterActor") - (c-name "clutter_actor_get_children") - (overrides "clutter_actor_get_children") - (return-type "GList*-of-ClutterActor*") -) + (c-name "wrap_clutter_actor_get_margin") + (overrides "clutter_actor_get_margin") + (return-type "SCM") + (leave-guile-mode #f)) =20 (define-method list_devices (of-object "ClutterDeviceManager") @@ -244,6 +250,44 @@ (return-type "GList*-of-GObject*") ) =20 +(define-method get_perspective + (of-object "ClutterStage") + (c-name "wrap_clutter_stage_get_perspective") + (overrides "clutter_stage_get_perspective") + (return-type "SCM") + (leave-guile-mode #f)) + +(define-method list_timelines + (of-object "ClutterStageManager") + (c-name "clutter_stage_manager_list_stages") + (overrides "clutter_stage_manager_list_stages") + (return-type "GSList*-of-ClutterStage*") +) + +(define-method peek_stages + (of-object "ClutterStageManager") + (c-name "clutter_stage_manager_peek_stages") + (overrides "clutter_stage_manager_peek_stages") + (return-type "const-GSList*-of-ClutterStage*") +) + +(define-function clutter_binding_pool_get_for_class + (c-name "clutter_binding_pool_get_for_class") + (overrides "clutter_binding_pool_get_for_class") + (return-type "ClutterBindingPool*") + (parameters + '("GObjectClass*" "klass") + ) +) + +(define-function clutter_color_from_string + (c-name "_wrap_clutter_color_from_string") + (overrides "clutter_color_from_string") + (return-type "SCM") + (leave-guile-mode #f) + (parameters + '("const-char*" "name"))) + (define-function clutter_units_from_pixels (return-type "ClutterUnits*") (c-name "wrap_clutter_units_from_pixels") @@ -305,41 +349,6 @@ ) ) =20 -(define-method get_perspective - (of-object "ClutterStage") - (c-name "wrap_clutter_stage_get_perspective") - (overrides "clutter_stage_get_perspective") - (return-type "SCM") - (leave-guile-mode #f)) - -(define-method list_timelines - (of-object "ClutterStageManager") - (c-name "clutter_stage_manager_list_stages") - (overrides "clutter_stage_manager_list_stages") - (return-type "GSList*-of-ClutterStage*") -) - -(define-method peek_stages - (of-object "ClutterStageManager") - (c-name "clutter_stage_manager_peek_stages") - (overrides "clutter_stage_manager_peek_stages") - (return-type "const-GSList*-of-ClutterStage*") -) - -(define-function clutter_color_from_string - (c-name "_wrap_clutter_color_from_string") - (overrides "clutter_color_from_string") - (return-type "SCM") - (leave-guile-mode #f) - (parameters - '("const-char*" "name"))) - -(define-method get_background_color - (of-object "ClutterActor") - (c-name "wrap_clutter_actor_get_background_color") - (overrides "clutter_actor_get_background_color") - (return-type "SCM") - (leave-guile-mode #f)) =20 (ignore-glob "*_get_type" "_*" --=20 2.1.1 --MP_/kCN8uwXc.as7k9ZvrlXZt57-- --Sig_/jOYkhY1ACEXn8STGScxU3wi Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iD8DBQFUS+JlRyh0zCtz6qsRAivOAKCHIjVcN60wPp8dEhyZ/qJlOIUJdQCgpc0X akpbprDE6qrGN/fCdY+FRBw= =rnNA -----END PGP SIGNATURE----- --Sig_/jOYkhY1ACEXn8STGScxU3wi--