seed r197 - in trunk: examples examples/clutter-shader libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r197 - in trunk: examples examples/clutter-shader libseed
- Date: Sat, 8 Nov 2008 05:44:22 +0000 (UTC)
Author: racarr
Date: Sat Nov 8 05:44:22 2008
New Revision: 197
URL: http://svn.gnome.org/viewvc/seed?rev=197&view=rev
Log:
Some final example cleanup. Add Seed.quit.
Added:
trunk/examples/clutter-shader/ (props changed)
- copied from r171, /trunk/examples/shader/
trunk/examples/clutter-shader/ShaderView.js
- copied unchanged from r172, /trunk/examples/shader/ShaderView.js
trunk/examples/clutter-shader/main.js
- copied unchanged from r172, /trunk/examples/shader/main.js
Modified:
trunk/examples/Makefile.am
trunk/examples/accelgroup.js
trunk/examples/actions.js
trunk/examples/clutter.js
trunk/examples/n-oscillator.js
trunk/libseed/seed-builtins.c
Modified: trunk/examples/Makefile.am
==============================================================================
--- trunk/examples/Makefile.am (original)
+++ trunk/examples/Makefile.am Sat Nov 8 05:44:22 2008
@@ -1,6 +1,6 @@
SUBDIRS = ide \
lightsoff \
- shader
+ clutter-shader
examplesdir=$(datadir)/doc/seed/examples
examples_DATA = \
Modified: trunk/examples/accelgroup.js
==============================================================================
--- trunk/examples/accelgroup.js (original)
+++ trunk/examples/accelgroup.js Sat Nov 8 05:44:22 2008
@@ -14,6 +14,7 @@
label = new Gtk.Label({label: "Press Q to quit"});
w.add(label);
+w.width_request = w.height_request = 300;
w.show_all();
Gtk.main();
Modified: trunk/examples/actions.js
==============================================================================
--- trunk/examples/actions.js (original)
+++ trunk/examples/actions.js Sat Nov 8 05:44:22 2008
@@ -17,7 +17,7 @@
tooltip:"New File", stock_id:Gtk.STOCK_NEW});
new_action.set_accel_group(accels);
actions.add_action_with_accel(new_action);
-//Could pass string, but this makes it use default accelerator for gtk-new
+//Could pass string, but this makes it use default accelerator for Gtk.STOCK_NEW
new_action.connect_accelerator();
new_action.signal.activate.connect(function(){Seed.print("New file")});
Modified: trunk/examples/clutter.js
==============================================================================
--- trunk/examples/clutter.js (original)
+++ trunk/examples/clutter.js Sat Nov 8 05:44:22 2008
@@ -107,19 +107,21 @@
text.anchor_y = text.height/2;
text.x = stage.width/2;
- //text.y = stage.height/2;
+
text.y = -text.height;
Clutter.effect_move(effect,
text,
text.x,
stage.height/2);
- // Clutter.effect_fade(effect,text,0);
for (i in rectangles)
{
+ Clutter.effect_fade(effect, rectangles[i],
+ 0);
Clutter.effect_move(effect, rectangles[i],
Math.random()*stage.width,
- Math.random()*stage.height);
+ Math.random()*stage.height/2 +
+ stage.height/2);
}
});
Modified: trunk/examples/n-oscillator.js
==============================================================================
--- trunk/examples/n-oscillator.js (original)
+++ trunk/examples/n-oscillator.js Sat Nov 8 05:44:22 2008
@@ -83,8 +83,9 @@
window.resize(600,300);
var hbox = new Gtk.HBox();
-var os1 = new oscillator(500);
-var os2 = new oscillator(700);
+var os1 = new oscillator(523.25);
+var os2 = new oscillator(659.26);
+var os3 = new oscillator(783.99);
function add_oscillator(button)
{
@@ -98,6 +99,7 @@
hbox.pack_start(button, true, true, 10);
hbox.pack_start(os1.vbox, true, true, 10);
hbox.pack_start(os2.vbox, true, true, 10);
+hbox.pack_start(os3.vbox, true, true, 10);
window.show_all();
Modified: trunk/libseed/seed-builtins.c
==============================================================================
--- trunk/libseed/seed-builtins.c (original)
+++ trunk/libseed/seed-builtins.c Sat Nov 8 05:44:22 2008
@@ -408,6 +408,24 @@
return JSObjectMake(eng->context, seed_native_callback_class, privates);
}
+JSValueRef
+seed_quit(JSContextRef ctx,
+ JSObjectRef function,
+ JSObjectRef this_object,
+ size_t argumentCount,
+ const JSValueRef arguments[], JSValueRef * exception)
+{
+ if (argumentCount != 0)
+ {
+ if (!seed_value_to_int(arguments[0], NULL))
+ exit(EXIT_SUCCESS);
+ else
+ exit(EXIT_FAILURE);
+ }
+
+ exit(EXIT_SUCCESS);
+}
+
void seed_init_builtins(gint * argc, gchar *** argv)
{
guint i;
@@ -426,6 +444,7 @@
seed_create_function("closure", &seed_closure, obj);
seed_create_function("setTimeout", &seed_set_timeout, obj);
seed_create_function("closure_native", &seed_closure_native, obj);
+ seed_create_function("quit", &seed_quit, obj);
arrayObj = JSObjectMake(eng->context, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]