unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guile-clutter, clutter-devel: 2 more patches
@ 2014-10-25 17:48 David Pirotte
  0 siblings, 0 replies; only message in thread
From: David Pirotte @ 2014-10-25 17:48 UTC (permalink / raw)
  To: guile-devel


[-- Attachment #1.1: Type: text/plain, Size: 190 bytes --]

Hello,

	guile-clutter
	  clutter-devel:
		-] removing example based upon deprecated functionality;
		-] fix clutter_actor_get_margin needs a special wrapper.

Happy hacking.
David

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0005-removing-example-based-upon-deprecated-functionality.patch --]
[-- Type: text/x-patch, Size: 4483 bytes --]

From ee05442e14c770a70c4ad941de2de00f5a211ee7 Mon Sep 17 00:00:00 2001
From: David PIROTTE <david@altosw.be>
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 <clutter-behaviour-opacity>, but <clutter-behaviour>, 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    
-;; modify it under the terms of the GNU General Public License as   
-;; published by the Free Software Foundation; either version 2 of   
-;; the License, or (at your option) any later version.              
-;;                                                                  
-;; This program is distributed in the hope that it will be useful,  
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of   
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    
-;; GNU General Public License for more details.                     
-;;                                                                  
-;; 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 <clutter-text>
-               #: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 <clutter-rectangle>
-                #:color *color* #:width 20 #:height (pk (- (get-height *stage*) sh))
-                #:x (- sw 50) #:y sh))
-           (t (make <clutter-timeline>
-                #:duration 800 ; milliseconds
-                #:loop #t))
-           (b (make <clutter-behaviour-opacity>
-                #: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-Clutter!")))
-    (prep-stage)
-    (show-message message)
-    (show-all *stage*)
-    (g-main-loop-run *loop*)
-    (exit 0)))
-- 
2.1.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0006-fix-clutter_actor_get_margin-needs-a-special-wrapper.patch --]
[-- Type: text/x-patch, Size: 6412 bytes --]

From 00527196c6d204ac83a215582e2f1c5e993f50da Mon Sep 17 00:00:00 2001
From: David PIROTTE <david@altosw.be>
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)
 }
 
 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)
 }
 
 SCM
-wrap_clutter_actor_get_background_color (ClutterActor* actor) 
+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);
 
 SCM scm_clutter_margin_to_scm (ClutterMargin *k);
 ClutterMargin* scm_scm_to_clutter_margin (SCM scm);
+SCM wrap_clutter_actor_get_margin (ClutterActor* actor);
 
 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*")
   )
 
+(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*")
 )
 
-(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))
 
 (define-method list_devices
   (of-object "ClutterDeviceManager")
@@ -244,6 +250,44 @@
   (return-type "GList*-of-GObject*")
 )
 
+(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 @@
   )
 )
 
-(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))
 
 (ignore-glob  "*_get_type"
               "_*"
-- 
2.1.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 173 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-10-25 17:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-25 17:48 guile-clutter, clutter-devel: 2 more patches David Pirotte

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).