seed r743 - in trunk: doc/tutorial-standalone examples/browser libseed tests/javascript



Author: racarr
Date: Wed Jan 14 21:15:56 2009
New Revision: 743
URL: http://svn.gnome.org/viewvc/seed?rev=743&view=rev

Log:
Rename instance_init to init

Modified:
   trunk/doc/tutorial-standalone/1.js
   trunk/doc/tutorial-standalone/2.js
   trunk/doc/tutorial-standalone/3.js
   trunk/doc/tutorial-standalone/tutorial.html.in
   trunk/examples/browser/browser.js
   trunk/libseed/seed-gtype.c
   trunk/tests/javascript/gtype-class-init-exception.js
   trunk/tests/javascript/gtype-property.js
   trunk/tests/javascript/gtype-signal-exception.js
   trunk/tests/javascript/gtype-signal.js
   trunk/tests/javascript/gtype.js

Modified: trunk/doc/tutorial-standalone/1.js
==============================================================================
--- trunk/doc/tutorial-standalone/1.js	(original)
+++ trunk/doc/tutorial-standalone/1.js	Wed Jan 14 21:15:56 2009
@@ -6,7 +6,7 @@
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();

Modified: trunk/doc/tutorial-standalone/2.js
==============================================================================
--- trunk/doc/tutorial-standalone/2.js	(original)
+++ trunk/doc/tutorial-standalone/2.js	Wed Jan 14 21:15:56 2009
@@ -9,7 +9,7 @@
 Browser = new GType({
     parent: Gtk.VBox.type,
     name: "Browser",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var toolbar = new BrowserToolbar();
@@ -42,7 +42,7 @@
 BrowserView = new GType({
     parent: WebKit.WebView.type,
     name: "BrowserView",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var update_url = function (web_view, web_frame)
@@ -72,7 +72,7 @@
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();

Modified: trunk/doc/tutorial-standalone/3.js
==============================================================================
--- trunk/doc/tutorial-standalone/3.js	(original)
+++ trunk/doc/tutorial-standalone/3.js	Wed Jan 14 21:15:56 2009
@@ -9,7 +9,7 @@
 TabbedBrowser = new GType({
     parent: Gtk.Notebook.type,
     name: "TabbedBrowser",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Public
         this.close_tab = function (tab)
@@ -57,7 +57,7 @@
 BrowserTab = new GType({
     parent: Gtk.VBox.type,
     name: "BrowserTab",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var toolbar = new BrowserToolbar();
@@ -103,7 +103,7 @@
 BrowserView = new GType({
     parent: WebKit.WebView.type,
     name: "BrowserView",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var tab;
@@ -154,7 +154,7 @@
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();

Modified: trunk/doc/tutorial-standalone/tutorial.html.in
==============================================================================
--- trunk/doc/tutorial-standalone/tutorial.html.in	(original)
+++ trunk/doc/tutorial-standalone/tutorial.html.in	Wed Jan 14 21:15:56 2009
@@ -152,14 +152,14 @@
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
 
     }
 });
 </pre>
 <p>
-You'll notice that the GType takes a JavaScript object. The three most important properties which we'll be using are <i>parent</i>, the type of the 'parent' class, from which our subclass should inherit its default behavior; <i>name</i>, the UpperCamelCase name of our new class; and <i>instance_init</i>, a JavaScript function which is called each time a new instance of the class is made.
+You'll notice that the GType takes a JavaScript object. The three most important properties which we'll be using are <i>parent</i>, the type of the 'parent' class, from which our subclass should inherit its default behavior; <i>name</i>, the UpperCamelCase name of our new class; and <i>init</i>, a JavaScript function which is called each time a new instance of the class is made.
 </p>
 <div class="section">Working with Widgets</div>
 <p>We'll start by making the BrowserToolbar's buttons. GTK provides a ToolButton widget, which is generally used for making such toolbars, as well as various different stock icons (to ensure consistency within all GTK applications). Browsing through <a href="http://library.gnome.org/devel/gtk/stable/gtk-Stock-Items.html";>the GTK Stock Item documentation</a>, we find that we're looking for "<code>gtk-go-back</code>", "<code>gtk-go-forward</code>", and "<code>gtk-refresh</code>". A glance at the <a href="http://library.gnome.org/devel/gtk/stable/GtkToolButton.html";>GtkToolButton documentation</a> shows us that we can choose a stock icon by setting the <code>stock-id</code> property - we'll use JSON constructors to keep things tidy. Do note that we use underscores instead of dashes, because the property name isn't quoted (thus, a dash would indicate subtraction, which isn't what we're looking for!):</p>
@@ -167,7 +167,7 @@
 <span class="unchanged">BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {</span>
         // Private
         var url_bar = new Gtk.Entry();
@@ -193,7 +193,7 @@
 <span class="unchanged">BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();
@@ -252,7 +252,7 @@
 BrowserView = new GType({
     parent: WebKit.WebView.type,
     name: "BrowserView",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var update_url = function (web_view, web_frame)
@@ -290,7 +290,7 @@
 <span class="unchanged">BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();
@@ -353,7 +353,7 @@
 Browser = new GType({
     parent: Gtk.VBox.type,
     name: "Browser",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var toolbar = new BrowserToolbar();

Modified: trunk/examples/browser/browser.js
==============================================================================
--- trunk/examples/browser/browser.js	(original)
+++ trunk/examples/browser/browser.js	Wed Jan 14 21:15:56 2009
@@ -9,7 +9,7 @@
 TabbedBrowser = new GType({
     parent: Gtk.Notebook.type,
     name: "TabbedBrowser",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Public
         this.close_tab = function (tab)
@@ -57,7 +57,7 @@
 BrowserTab = new GType({
     parent: Gtk.VBox.type,
     name: "BrowserTab",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var toolbar = new BrowserToolbar();
@@ -103,7 +103,7 @@
 BrowserView = new GType({
     parent: WebKit.WebView.type,
     name: "BrowserView",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var tab;
@@ -154,7 +154,7 @@
 BrowserToolbar = new GType({
     parent: Gtk.HBox.type,
     name: "BrowserToolbar",
-    instance_init: function (klass)
+    init: function (klass)
     {
         // Private
         var url_bar = new Gtk.Entry();

Modified: trunk/libseed/seed-gtype.c
==============================================================================
--- trunk/libseed/seed-gtype.c	(original)
+++ trunk/libseed/seed-gtype.c	Wed Jan 14 21:15:56 2009
@@ -585,7 +585,7 @@
 										  (JSObjectRef) arguments[0],
 										  "class_init");
 	instance_init = seed_object_get_property(ctx, (JSObjectRef) arguments[0],
-											 "instance_init");
+											 "init");
 	name = seed_object_get_property(ctx, (JSObjectRef) arguments[0], "name");
 
 	new_name = seed_value_to_string(ctx, name, exception);

Modified: trunk/tests/javascript/gtype-class-init-exception.js
==============================================================================
--- trunk/tests/javascript/gtype-class-init-exception.js	(original)
+++ trunk/tests/javascript/gtype-class-init-exception.js	Wed Jan 14 21:15:56 2009
@@ -13,7 +13,7 @@
     {
 		prototype = notAVariable.notAProperty;
     },
-    instance_init: function(klass)
+    init: function(klass)
     {
     }};
 

Modified: trunk/tests/javascript/gtype-property.js
==============================================================================
--- trunk/tests/javascript/gtype-property.js	(original)
+++ trunk/tests/javascript/gtype-property.js	Wed Jan 14 21:15:56 2009
@@ -23,7 +23,7 @@
 													  false,
 													  GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE));
 },
-instance_init: function(klass)
+init: function(klass)
 {
 	
 }};

Modified: trunk/tests/javascript/gtype-signal-exception.js
==============================================================================
--- trunk/tests/javascript/gtype-signal-exception.js	(original)
+++ trunk/tests/javascript/gtype-signal-exception.js	Wed Jan 14 21:15:56 2009
@@ -36,7 +36,7 @@
 	}
 
     },
-    instance_init: function(klass)
+    init: function(klass)
     {
     }};
 

Modified: trunk/tests/javascript/gtype-signal.js
==============================================================================
--- trunk/tests/javascript/gtype-signal.js	(original)
+++ trunk/tests/javascript/gtype-signal.js	Wed Jan 14 21:15:56 2009
@@ -19,7 +19,7 @@
 	hello_signal_id = klass.install_signal(HelloSignalDefinition);
 	goodbye_signal_id = klass.install_signal(GoodbyeSignalDefinition);
     },
-    instance_init: function(instance)
+    init: function(instance)
     {
     }};
 

Modified: trunk/tests/javascript/gtype.js
==============================================================================
--- trunk/tests/javascript/gtype.js	(original)
+++ trunk/tests/javascript/gtype.js	Wed Jan 14 21:15:56 2009
@@ -15,7 +15,7 @@
 	prototype.message = "Prototypes!";
 	Seed.print("In klass init");
     },
-    instance_init: function(klass)
+    init: function(klass)
     {
 	this.title = "Hello!";
 	Seed.print("In constructor for " + this);



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