[ease] Tries to connect a quit signal



commit 4246c70da0465b94941df2875f79e5a6ccb4a73e
Author: Stéphane Maniaci <stephane maniaci gmail com>
Date:   Fri Jul 9 11:06:06 2010 -0500

    Tries to connect a quit signal

 data/ui/editor-window.ui       |    2 +-
 src/ease-editor-window.vala    |    5 +++++
 src/ease-player.vala           |   33 ++++++++++++++++++++++++---------
 src/ease-scrollable-embed.vala |    1 -
 src/main.vala                  |    2 +-
 5 files changed, 31 insertions(+), 12 deletions(-)
---
diff --git a/data/ui/editor-window.ui b/data/ui/editor-window.ui
index d077301..58a26f8 100644
--- a/data/ui/editor-window.ui
+++ b/data/ui/editor-window.ui
@@ -108,7 +108,7 @@
                     <property name="visible">True</property>
                     <property name="use_underline">True</property>
                     <property name="use_stock">True</property>
-                    <signal name="activate" handler="gtk_main_quit"/>
+                    <signal name="activate" handler="ease_editor_window_on_quit"/>
                   </object>
                 </child>
               </object>
diff --git a/src/ease-editor-window.vala b/src/ease-editor-window.vala
index 6fa87e4..77cf82c 100644
--- a/src/ease-editor-window.vala
+++ b/src/ease-editor-window.vala
@@ -185,6 +185,11 @@ public class Ease.EditorWindow : Gtk.Window
 		update_undo();
 	}
 	
+	[CCode (instance_pos = -1)]
+	public void on_quit ()
+	{
+		Gtk.main_quit ();
+	}
 	/**
 	 * Load a slide into the main { link EditorEmbed}.
 	 *
diff --git a/src/ease-player.vala b/src/ease-player.vala
index b7b6bc8..a144095 100644
--- a/src/ease-player.vala
+++ b/src/ease-player.vala
@@ -44,11 +44,11 @@ public class Ease.Player : GLib.Object
 
 	// focus actors
 	private Clutter.Group shader;
-	private Clutter.Rectangle top_right;
-	private Clutter.Rectangle top_left;
-	private Clutter.Rectangle bottom_left;
-	private Clutter.Rectangle bottom_right;
-	private const uint FOCUS_SIZE = 50;
+	private Clutter.Rectangle shader_top;
+	private Clutter.Rectangle shader_bottom;
+	private Clutter.Rectangle shader_left;
+	private Clutter.Rectangle shader_right;
+	private const uint FOCUS_RADIUS = 25;
 	
 	public Player(Document doc)
 	{
@@ -61,8 +61,7 @@ public class Ease.Player : GLib.Object
 		stage.title = _("Ease Presentation");
 		stage.use_fog = false;
 		stage.set_fullscreen (true);
-		stage.show_all ();
-		stage.hide_all ();
+		
 		// scale the presentation if needed
 		if (stage.width < document.width || stage.height < document.height)
 		{
@@ -93,6 +92,21 @@ public class Ease.Player : GLib.Object
 		stage.color = {0, 0, 0, 255};
 		Clutter.grab_keyboard(stage);
 
+		// focusing
+		shader_top = new Clutter.Rectangle.with_color (Clutter.Color.from_string ("black"));
+		shader_right = new Clutter.Rectangle.with_color (Clutter.Color.from_string ("black"));
+		shader_bottom = new Clutter.Rectangle.with_color (Clutter.Color.from_string ("black"));
+		shader_left = new Clutter.Rectangle.with_color (Clutter.Color.from_string ("black"));
+
+
+		shader = new Clutter.Group ();
+		
+//		shader.add (shader_top, shader_bottom);
+		shader.add_actor (shader_right);
+		shader.add_actor (shader_left);
+
+		shader.show_all ();
+		
 		// make the stacking container
 		container = new Clutter.Group();
 		stage.add_actor(container);
@@ -108,8 +122,9 @@ public class Ease.Player : GLib.Object
 	
 	public void on_button_press (Clutter.ButtonEvent event)
 	{
-		debug ("Got a mouse click");
-		
+		debug ("Got a mouse click.");
+		shader_top.set_size (100, 200);
+		shader_top.set_position (event.x, event.y);
 	}
 
 	public void on_key_press (Clutter.KeyEvent event)
diff --git a/src/ease-scrollable-embed.vala b/src/ease-scrollable-embed.vala
index 3bbb289..5582879 100644
--- a/src/ease-scrollable-embed.vala
+++ b/src/ease-scrollable-embed.vala
@@ -66,7 +66,6 @@ public class Ease.ScrollableEmbed : Gtk.HBox
 	public ScrollableEmbed(bool horizontal, bool has_frame)
 	{
 		has_horizontal = horizontal;
-		
 		// create children
 		embed = new GtkClutter.Embed();
 		h_adjust = new Gtk.Adjustment(0, 0, 1, 0.1, 0.1, 0.1);
diff --git a/src/main.vala b/src/main.vala
index 0738b01..c8918f7 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -78,7 +78,7 @@ public static class Ease.Main : GLib.Object
 			stdout.printf(_("error parsing options: %s\n"), e.message);
 			return 1;
 		}
-	
+
 		ClutterGst.init(ref args);
 
 		// initalize static classes



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