[ease/gsoc2010: 37/39] Partially port to recent Clutter bindings



commit c9e2f3c0812525de94a86b9107e42a0e145f4fde
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Thu May 20 17:01:09 2010 +0200

    Partially port to recent Clutter bindings

 src/EditorEmbed.vala    |    6 +-
 src/Handle.vala         |    2 +-
 src/SlideActor.vala     |   98 +++++++++++++++++++++++-----------------------
 src/SlideButton.vala    |    2 +-
 src/TextActor.vala      |    2 +-
 src/TransitionPane.vala |    2 +-
 src/WelcomeActor.vala   |   14 +++---
 7 files changed, 63 insertions(+), 63 deletions(-)
---
diff --git a/src/EditorEmbed.vala b/src/EditorEmbed.vala
index 8dedac6..780b1d3 100644
--- a/src/EditorEmbed.vala
+++ b/src/EditorEmbed.vala
@@ -160,7 +160,7 @@ public class Ease.EditorEmbed : ScrollableEmbed
 			{
 				((Actor*)(itr->data))->button_press_event.disconnect(actor_clicked);
 				((Actor*)(itr->data))->button_release_event.disconnect(actor_released);
-				((Actor*)(itr->data))->set_reactive(false);
+				((Actor*)(itr->data))->reactive = false;
 			}
 		}
 		
@@ -196,7 +196,7 @@ public class Ease.EditorEmbed : ScrollableEmbed
 			
 			((Actor*)(itr->data))->button_press_event.connect(actor_clicked);
 			((Actor*)(itr->data))->button_release_event.connect(actor_released);
-			((Actor*)(itr->data))->set_reactive(true);
+			((Actor*)(itr->data))->reactive = true;
 		}
 		
 		contents.add_actor(slide_actor);
@@ -303,7 +303,7 @@ public class Ease.EditorEmbed : ScrollableEmbed
 		selection_rectangle = new Clutter.Rectangle();
 		selection_rectangle.border_color = {0, 0, 0, 255};
 		selection_rectangle.color = {0, 0, 0, 0};
-		selection_rectangle.set_border_width(2);
+		selection_rectangle.border_width = 2;
 		position_selection();
 		contents.add_actor(selection_rectangle);
 		
diff --git a/src/Handle.vala b/src/Handle.vala
index 04238d1..ffb5ff0 100644
--- a/src/Handle.vala
+++ b/src/Handle.vala
@@ -43,7 +43,7 @@ public class Ease.Handle : Clutter.Rectangle
 		height = SIZE;
 		set_anchor_point(SIZE / 2, SIZE / 2);
 		
-		set_reactive(true);
+		reactive = true;
 	}
 	
 	public void drag(float change_x, float change_y, Actor target, bool prop)
diff --git a/src/SlideActor.vala b/src/SlideActor.vala
index 05dc06d..a0df3d4 100644
--- a/src/SlideActor.vala
+++ b/src/SlideActor.vala
@@ -141,7 +141,7 @@ public class Ease.SlideActor : Clutter.Group
 		else // the background is a solid color
 		{
 			background = new Clutter.Rectangle();
-			((Clutter.Rectangle)background).set_color(slide.background_color);
+			((Clutter.Rectangle)background).color = slide.background_color;
 		}
 		background.width = slide.parent.width;
 		background.height = slide.parent.height;
@@ -270,7 +270,7 @@ public class Ease.SlideActor : Clutter.Group
 				                                         EASE_PIVOT);
 				animation_time.new_frame.connect((m) => {
 					new_slide.set_rotation(Clutter.RotateAxis.Z_AXIS,
-					                       angle * (1 - animation_alpha.get_alpha()),
+					                       angle * (1 - animation_alpha.alpha),
 					                       xpos, ypos, 0);
 				});
 				break;
@@ -312,11 +312,11 @@ public class Ease.SlideActor : Clutter.Group
 				
 				time1.new_frame.connect((m) => {
 					left.set_rotation(Clutter.RotateAxis.Y_AXIS,
-					                  180 * animation_alpha.get_alpha(),
+					                  180 * animation_alpha.alpha,
 					                  0, 0, 0);
 					                  
 					right.set_rotation(Clutter.RotateAxis.Y_AXIS,
-					                   -180 * animation_alpha.get_alpha(),
+					                   -180 * animation_alpha.alpha,
 					                   width * 2, 0, 0);
 				});
 				
@@ -412,7 +412,7 @@ public class Ease.SlideActor : Clutter.Group
 					for (int i = 0; i < SLAT_COUNT; i++)
 					{
 						groups[i].set_rotation(Clutter.RotateAxis.Y_AXIS,
-							              180 * animation_alpha.get_alpha(),
+							              180 * animation_alpha.alpha,
 							              (i + 0.5f) * width, 0, 0);
 					}
 				});
@@ -443,46 +443,46 @@ public class Ease.SlideActor : Clutter.Group
 				{
 					case "Bottom to Top":
 						time1.new_frame.connect((m) => {
-							set_rotation(Clutter.RotateAxis.X_AXIS, 90 * alpha1.get_alpha(), 0, slide.parent.height / 2, 0);
-							depth = (float)(FLIP_DEPTH * alpha1.get_alpha());
+							set_rotation(Clutter.RotateAxis.X_AXIS, 90 * alpha1.alpha, 0, slide.parent.height / 2, 0);
+							depth = (float)(FLIP_DEPTH * alpha1.alpha);
 						});
 						time2.new_frame.connect((m) => {
 							new_slide.opacity = 255;
-							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.get_alpha());
-							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, -90 * (1 - alpha2.get_alpha()), 0, slide.parent.height / 2, 0);
+							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.alpha);
+							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, -90 * (1 - alpha2.alpha), 0, slide.parent.height / 2, 0);
 						});
 						break;
 					case "Top to Bottom":
 						time1.new_frame.connect((m) => {
-							set_rotation(Clutter.RotateAxis.X_AXIS, -90 * alpha1.get_alpha(), 0, slide.parent.height / 2, 0);
-							depth = (float)(FLIP_DEPTH * alpha1.get_alpha());
+							set_rotation(Clutter.RotateAxis.X_AXIS, -90 * alpha1.alpha, 0, slide.parent.height / 2, 0);
+							depth = (float)(FLIP_DEPTH * alpha1.alpha);
 						});
 						time2.new_frame.connect((m) => {
 							new_slide.opacity = 255;
-							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.get_alpha());
-							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, 90 * (1 - alpha2.get_alpha()), 0, slide.parent.height / 2, 0);
+							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.alpha);
+							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, 90 * (1 - alpha2.alpha), 0, slide.parent.height / 2, 0);
 						});
 						break;
 					case "Left to Right":
 						time1.new_frame.connect((m) => {
-							set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * alpha1.get_alpha(), slide.parent.width / 2, 0, 0);
-							depth = (float)(FLIP_DEPTH * alpha1.get_alpha());
+							set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * alpha1.alpha, slide.parent.width / 2, 0, 0);
+							depth = (float)(FLIP_DEPTH * alpha1.alpha);
 						});
 						time2.new_frame.connect((m) => {
 							new_slide.opacity = 255;
-							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.get_alpha());
-							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * (1 - alpha2.get_alpha()), slide.parent.width / 2, 0, 0);
+							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.alpha);
+							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * (1 - alpha2.alpha), slide.parent.width / 2, 0, 0);
 						});
 						break;
 					case "Right to Left":
 						time1.new_frame.connect((m) => {
-							set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * alpha1.get_alpha(), slide.parent.width / 2, 0, 0);
-							depth = (float)(FLIP_DEPTH * alpha1.get_alpha());
+							set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * alpha1.alpha, slide.parent.width / 2, 0, 0);
+							depth = (float)(FLIP_DEPTH * alpha1.alpha);
 						});
 						time2.new_frame.connect((m) => {
 							new_slide.opacity = 255;
-							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.get_alpha());
-							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * (1 - alpha2.get_alpha()), slide.parent.width / 2, 0, 0);
+							new_slide.depth = FLIP_DEPTH * (float)(1 - alpha2.alpha);
+							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * (1 - alpha2.alpha), slide.parent.width / 2, 0, 0);
 						});
 						break;
 				}
@@ -502,29 +502,29 @@ public class Ease.SlideActor : Clutter.Group
 					case "Left":
 						new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90, 0, 0, 0);
 						animation_time.new_frame.connect((m) => {
-							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * (1 - animation_alpha.get_alpha()), 0, 0, 0);
-							set_rotation(Clutter.RotateAxis.Y_AXIS, -110 * animation_alpha.get_alpha(), 0, 0, 0);
+							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90 * (1 - animation_alpha.alpha), 0, 0, 0);
+							set_rotation(Clutter.RotateAxis.Y_AXIS, -110 * animation_alpha.alpha, 0, 0, 0);
 						});
 						break;
 					case "Right":
 						new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, 90, slide.parent.width, 0, 0);
 						animation_time.new_frame.connect((m) => {
-							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * (1 - animation_alpha.get_alpha()), slide.parent.width, 0, 0);
-							set_rotation(Clutter.RotateAxis.Y_AXIS, 110 * animation_alpha.get_alpha(), slide.parent.width, 0, 0);
+							new_slide.set_rotation(Clutter.RotateAxis.Y_AXIS, -90 * (1 - animation_alpha.alpha), slide.parent.width, 0, 0);
+							set_rotation(Clutter.RotateAxis.Y_AXIS, 110 * animation_alpha.alpha, slide.parent.width, 0, 0);
 						});
 						break;
 					case "Top":
 						new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, -90, 0, 0, 0);
 						animation_time.new_frame.connect((m) => {
-							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, -90 * (1 - animation_alpha.get_alpha()), 0, 0, 0);
-							set_rotation(Clutter.RotateAxis.X_AXIS, 110 * animation_alpha.get_alpha(), 0, 0, 0);
+							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, -90 * (1 - animation_alpha.alpha), 0, 0, 0);
+							set_rotation(Clutter.RotateAxis.X_AXIS, 110 * animation_alpha.alpha, 0, 0, 0);
 						});
 						break;
 					case "Bottom":
 						new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, 90, 0, slide.parent.height, 0);
 						animation_time.new_frame.connect((m) => {
-							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, 90 * (1 - animation_alpha.get_alpha()), 0, slide.parent.height, 0);
-							set_rotation(Clutter.RotateAxis.X_AXIS, -110 * animation_alpha.get_alpha(), 0, slide.parent.height, 0);
+							new_slide.set_rotation(Clutter.RotateAxis.X_AXIS, 90 * (1 - animation_alpha.alpha), 0, slide.parent.height, 0);
+							set_rotation(Clutter.RotateAxis.X_AXIS, -110 * animation_alpha.alpha, 0, slide.parent.height, 0);
 						});
 						break;
 				}
@@ -534,7 +534,7 @@ public class Ease.SlideActor : Clutter.Group
 				depth = 1; //ugly, but works
 				animation_alpha = new Clutter.Alpha.full(animation_time, Clutter.AnimationMode.EASE_IN_QUART);
 				animation_time.new_frame.connect((m) => {
-					set_rotation(Clutter.RotateAxis.X_AXIS, -90 * animation_alpha.get_alpha(), 0, slide.parent.height, 0);
+					set_rotation(Clutter.RotateAxis.X_AXIS, -90 * animation_alpha.alpha, 0, slide.parent.height, 0);
 				});
 				break;
 			
@@ -553,11 +553,11 @@ public class Ease.SlideActor : Clutter.Group
 					time2.start();
 				});
 				time1.new_frame.connect((m) => {
-					contents.set_rotation(Clutter.RotateAxis.Y_AXIS, angle * alpha1.get_alpha(), slide.parent.width / 2, 0, 0);
+					contents.set_rotation(Clutter.RotateAxis.Y_AXIS, angle * alpha1.alpha, slide.parent.width / 2, 0, 0);
 				});
 				time2.new_frame.connect((m) => {
 					new_slide.contents.opacity = 255;
-					new_slide.contents.set_rotation(Clutter.RotateAxis.Y_AXIS, -angle * (1 - alpha2.get_alpha()), slide.parent.width / 2, 0, 0);
+					new_slide.contents.set_rotation(Clutter.RotateAxis.Y_AXIS, -angle * (1 - alpha2.alpha), slide.parent.width / 2, 0, 0);
 				});
 				time1.start();
 				break;
@@ -572,15 +572,15 @@ public class Ease.SlideActor : Clutter.Group
 				animation_alpha = new Clutter.Alpha.full(animation_time, Clutter.AnimationMode.LINEAR);
 				animation_time.new_frame.connect((m) => {
 					unowned GLib.List<Clutter.Actor>* itr;
-					contents.opacity = clamp_opacity(455 - 555 * alpha1.get_alpha());
-					new_slide.contents.opacity = clamp_opacity(-100 + 400 * alpha2.get_alpha());
+					contents.opacity = clamp_opacity(455 - 555 * alpha1.alpha);
+					new_slide.contents.opacity = clamp_opacity(-100 + 400 * alpha2.alpha);
 					for (itr = contents.get_children(); itr != null; itr = itr->next)
 					{
-						((Clutter.Actor*)itr->data)->set_rotation(Clutter.RotateAxis.X_AXIS, 540 * alpha1.get_alpha(), 0, 0, 0);
+						((Clutter.Actor*)itr->data)->set_rotation(Clutter.RotateAxis.X_AXIS, 540 * alpha1.alpha, 0, 0, 0);
 					}
 					for (itr = new_slide.contents.get_children(); itr != null; itr = itr->next)
 					{
-						((Clutter.Actor*)itr->data)->set_rotation(Clutter.RotateAxis.X_AXIS, -540 * (1 - alpha2.get_alpha()), 0, 0, 0);
+						((Clutter.Actor*)itr->data)->set_rotation(Clutter.RotateAxis.X_AXIS, -540 * (1 - alpha2.alpha), 0, 0, 0);
 					}
 				});
 				break;
@@ -606,7 +606,7 @@ public class Ease.SlideActor : Clutter.Group
 				}
 				animation_alpha = new Clutter.Alpha.full(animation_time, Clutter.AnimationMode.EASE_OUT_SINE);
 				animation_time.new_frame.connect((m) => {
-					new_slide.set_scale(animation_alpha.get_alpha(), animation_alpha.get_alpha());
+					new_slide.set_scale(animation_alpha.alpha, animation_alpha.alpha);
 				});
 				//new_slide.animate(Clutter.AnimationMode.EASE_OUT_SINE, length, "scale_x", 1);
 				//new_slide.animate(Clutter.AnimationMode.EASE_OUT_SINE, length, "scale_y", 1);
@@ -673,10 +673,10 @@ public class Ease.SlideActor : Clutter.Group
 						contents.set_scale_full(1, 1, slide.parent.width / 2, slide.parent.height / 2);
 						contents.animate(Clutter.AnimationMode.LINEAR, length / 2, "opacity", 0);
 						animation_time.new_frame.connect((m) => {
-							new_slide.contents.set_scale(animation_alpha.get_alpha(),
-								                            animation_alpha.get_alpha());
-							contents.set_scale(1.0 + 2 * animation_alpha.get_alpha(),
-							   	                        1.0 + 2 * animation_alpha.get_alpha());
+							new_slide.contents.set_scale(animation_alpha.alpha,
+								                            animation_alpha.alpha);
+							contents.set_scale(1.0 + 2 * animation_alpha.alpha,
+							   	                        1.0 + 2 * animation_alpha.alpha);
 						});
 						break;
 					case "Out":
@@ -685,10 +685,10 @@ public class Ease.SlideActor : Clutter.Group
 						new_slide.contents.opacity = 0;
 						new_slide.contents.animate(Clutter.AnimationMode.EASE_IN_SINE, length / 2, "opacity", 255);
 						animation_time.new_frame.connect((m) => {
-							new_slide.contents.set_scale(1.0 + 2 * (1 - animation_alpha.get_alpha()),
-								                            1.0 + 2 * (1 - animation_alpha.get_alpha()));
-							contents.set_scale(1 - animation_alpha.get_alpha(),
-							   	                         1 - animation_alpha.get_alpha());
+							new_slide.contents.set_scale(1.0 + 2 * (1 - animation_alpha.alpha),
+								                            1.0 + 2 * (1 - animation_alpha.alpha));
+							contents.set_scale(1 - animation_alpha.alpha,
+							   	                         1 - animation_alpha.alpha);
 						});
 						break;
 				}
@@ -722,8 +722,8 @@ public class Ease.SlideActor : Clutter.Group
 				alpha1 = new Clutter.Alpha.full(time1, Clutter.AnimationMode.EASE_IN_OUT_SINE);
 			
 				time1.new_frame.connect((m) => {
-					set_scale_full(ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * (1 - alpha1.get_alpha()),
-						                     ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * (1 - alpha1.get_alpha()),
+					set_scale_full(ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * (1 - alpha1.alpha),
+						                     ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * (1 - alpha1.alpha),
 						                     slide.parent.width / 2,
 						                     slide.parent.height / 2);
 				});
@@ -733,8 +733,8 @@ public class Ease.SlideActor : Clutter.Group
 				});
 				time2.completed.connect(() => {
 					time1.new_frame.connect((m) => {
-						new_slide.set_scale_full(ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * alpha1.get_alpha(),
-							                         ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * alpha1.get_alpha(),
+						new_slide.set_scale_full(ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * alpha1.alpha,
+							                         ZOOM_OUT_SCALE + (1 - ZOOM_OUT_SCALE) * alpha1.alpha,
 							                         slide.parent.width / 2,
 							                         slide.parent.height / 2);
 					});
diff --git a/src/SlideButton.vala b/src/SlideButton.vala
index e0adfbd..2f8598f 100644
--- a/src/SlideButton.vala
+++ b/src/SlideButton.vala
@@ -69,7 +69,7 @@ public class Ease.SlideButton : Gtk.Button
 		slide_image = new GtkClutter.Embed();
 		var color = Clutter.Color();
 		color.from_string("Black");
-		((Clutter.Stage)(slide_image.get_stage())).set_color(color);
+		((Clutter.Stage)(slide_image.get_stage())).color = color;
 
 		// make the slide actor
 		actor = new SlideActor.from_slide(s.parent, s, true, ActorContext.SIDEBAR);
diff --git a/src/TextActor.vala b/src/TextActor.vala
index f9666a9..0eca0c0 100644
--- a/src/TextActor.vala
+++ b/src/TextActor.vala
@@ -50,7 +50,7 @@ public class Ease.TextActor : Actor
 		desc.set_variant(e.font_variant);
 		desc.set_size(e.font_size * Pango.SCALE);
 		((Clutter.Text)contents).font_name = desc.to_string();
-		((Clutter.Text)contents).set_line_alignment(e.text_align);
+		((Clutter.Text)contents).line_alignment = e.text_align;
 		
 		add_actor(contents);
 		contents.width = e.width;
diff --git a/src/TransitionPane.vala b/src/TransitionPane.vala
index be9fa0b..36451ed 100644
--- a/src/TransitionPane.vala
+++ b/src/TransitionPane.vala
@@ -42,7 +42,7 @@ public class Ease.TransitionPane : Gtk.VBox
 		preview.set_size_request(0, 100);
 		var color = Clutter.Color();
 		color.from_string("Black");
-		((Clutter.Stage)(preview.get_stage())).set_color(color);
+		((Clutter.Stage)(preview.get_stage())).color = color;
 		var frame = new Gtk.Frame(null);
 		frame.add(preview);
 		var hbox = new Gtk.HBox(false, 0);
diff --git a/src/WelcomeActor.vala b/src/WelcomeActor.vala
index 7e44aa7..051ad82 100644
--- a/src/WelcomeActor.vala
+++ b/src/WelcomeActor.vala
@@ -41,14 +41,14 @@ public class Ease.WelcomeActor : Clutter.Rectangle
 		height = w * 3 / 4; // 4:3
 	
 		// TODO: make this an actual preview
-		var color = Clutter.Color();
-		color.from_hls((float)Random.next_double() * 360, 0.5f, 0.5f);
-		color.from_string("Pink");
-		set_color(color);
+		var col = Clutter.Color();
+		col.from_hls((float)Random.next_double() * 360, 0.5f, 0.5f);
+		col.from_string("Pink");
+		color = col;
 		
-		set_border_color({255, 255, 255, 255});
-		set_border_width(2);
-		set_reactive(true);
+		border_color = ({255, 255, 255, 255});
+		border_width = 2;
+		reactive = true;
 		
 		opacity = 0;
 		animate(FADE_EASE, FADE_INIT_TIME, "opacity", 255);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]