2
0
Просмотр исходного кода

Merge pull request #68 from hhzl/gh-58

Gh 58 processing js example
Hannes Hirzel 10 лет назад
Родитель
Сommit
d5beb2c70a

+ 69 - 23
processing/Gruntfile.js

@@ -1,23 +1,69 @@
-module.exports = function(grunt) {
-  grunt.loadNpmTasks('../../node_modules/amber-dev');
-
-  grunt.registerTask('default', ['amberc:processing']);
-
-  grunt.initConfig({
-    pkg: grunt.file.readJSON('../package.json'),
-
-    amberc: {  
-      options: {
-        amber_dir: '../bower_components/amber',
-        closure_jar: ''
-      },
-      processing: {
-        src: ['st/Processing-Examples.st'],
-        output_dir: 'js',
-        deploy: true,
-        amd_namespace: 'amber_examples_processing'
-      }
-    }
-  });
-
-}
+'use strict';
+
+module.exports = function (grunt) {
+    var path = require('path');
+
+    // These plugins provide necessary tasks.
+    grunt.loadNpmTasks('grunt-contrib-clean');
+    grunt.loadNpmTasks('grunt-contrib-requirejs');
+    grunt.loadNpmTasks('grunt-execute');
+    grunt.loadNpmTasks('amber-dev');
+
+    // Default task.
+    grunt.registerTask('default', ['amberc:all']);
+    grunt.registerTask('devel', ['amdconfig:app', 'requirejs:devel']);
+    grunt.registerTask('deploy', ['amdconfig:app', 'requirejs:deploy']);
+
+    // Project configuration.
+    grunt.initConfig({
+        // Metadata.
+        // pkg: grunt.file.readJSON(''),
+        banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+            '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+            '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
+            '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
+            ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
+        // task configuration
+        amberc: {
+            options: {
+                amber_dir: path.join(__dirname, "bower_components", "amber"),
+                library_dirs: ['src'],
+                closure_jar: ''
+            },
+            all: {
+                src: [
+                    'src/Processing-Examples.st' // list all sources in dependency order
+                ],
+                amd_namespace: 'amber-processingclock',
+                libraries: ['SUnit', 'Web']
+            }
+        },
+
+        amdconfig: {app: {dest: 'config.js'}},
+
+        requirejs: {
+            deploy: {options: {
+                mainConfigFile: "config.js",
+                onBuildWrite: function (moduleName, path, contents) {
+                    return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'deploy'}}});" : contents;
+                },
+                pragmas: {
+                    excludeIdeData: true,
+                    excludeDebugContexts: true
+                },
+                include: ['config', 'node_modules/requirejs/require', 'deploy'],
+                out: "the.js"
+            }},
+            devel: {options: {
+                mainConfigFile: "config.js",
+                onBuildWrite: function (moduleName, path, contents) {
+                    return moduleName === "config" ? contents + "\nrequire.config({map:{'*':{app:'devel'}}});" : contents;
+                },
+                include: ['config', 'node_modules/requirejs/require'],
+                out: "the.js"
+            }}
+        }
+
+    });
+
+};

+ 22 - 0
processing/LICENSE-MIT

@@ -0,0 +1,22 @@
+Copyright (c) 2014 hhzl
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

+ 17 - 0
processing/README.md

@@ -0,0 +1,17 @@
+# Amber Processing Example
+
+Amber using th
+
+## Getting Started
+
+Brought project alive (for example after `git clone`):
+
+```sh
+npm install
+bower install
+grunt devel
+```
+
+Developing the project (after brought alive):
+ 
+Start server with `amber serve` and go to `http://localhost:4000/` in your browser and follow the instructions

+ 36 - 0
processing/bower.json

@@ -0,0 +1,36 @@
+{
+  "name": "processingclock",
+  "description": "Amber using th",
+  "version": "0.1.0",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "/test_runner.js",
+    "test",
+    "tests"
+  ],
+  "authors": [
+    {
+      "name": "hhzl",
+      "email": "hannes.hirzel@gmail.com"
+    }
+  ],
+  "homepage": "https://github.com/amber-smalltalk/amber-examples",
+  "keywords": [
+    "Amber",
+    "Smalltalk"
+  ],
+  "license": [
+    "MIT"
+  ],
+  "private": false,
+  "dependencies": {
+    "amber": "^0.13.2",
+    "processing": "~1.4.8"
+  },
+  "devDependencies": {
+    "amber-ide-starter-dialog": "^0.1.0",
+    "helios": "^0.3.0"
+  }
+}

+ 8 - 0
processing/deploy.js

@@ -0,0 +1,8 @@
+define([
+    'amber/deploy',
+    // --- packages to be deployed begin here ---
+    'amber-processingclock/Processing-Examples'
+    // --- packages to be deployed end here ---
+], function (amber) {
+    return amber;
+});

+ 10 - 0
processing/devel.js

@@ -0,0 +1,10 @@
+define([
+    'amber/devel',
+    './deploy'
+    // --- packages used only during development begin here ---
+
+    // --- packages used only during development end here ---
+], function (amber) {
+    return amber;
+});
+

+ 28 - 46
processing/index.html

@@ -1,48 +1,30 @@
-<!DOCTYPE html> 
-<html> 
-  <head> 
-    <title>using Processing.js with Amber Smalltalk</title> 
-    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
-    <meta name="author" content="Stefan Krecher" /> 
-    <link rel="stylesheet" type="text/css" href='css/style.css' />
-    <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/> 
-    <link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'> 
-	<script type="text/javascript" src="../bower_components/amber/support/requirejs/require.min.js"></script>
-    <script type='text/javascript' src='../bower_components/amber/support/amber.js'></script>
-    <script type='text/javascript' src='showdown/showdown.js'></script>
-	<script type="text/javascript" src="processing-1.4.1.js"></script>
-  </head> 
-  <body> 
-	A Clock made with <a href="http://processingjs.org">Processing.js</a> and <a href="http://amber-lang.net/">Amber</a>
-	<p>Examine the <button onClick="buttonClick()"> ProcessingClock class</button></p> 
-	<p><canvas id="canvas1" width="200" height="200"></canvas></p>
-	<script id="script1" type="text/javascript">
-		var buttonClick;
-		// Simple way to attach js code to the canvas is by using a function
-		function sketchProc(processing) {
-			// Override draw function, by default it will be called 60 times per second
-			processing.draw = function() {};
-		}
+<!DOCTYPE html>
+<html>
 
-		var canvas = document.getElementById("canvas1");
-		// attaching the sketchProc function to the canvas
-		var p = new Processing(canvas, sketchProc);
-		require.config({
-			paths: {
-				'amber_examples_processing': 'js',
-				'amber_examples_processing/_source': 'st'
-			}
-		});
-		require(['amber/devel','amber_examples_processing/Processing-Examples'],function(smalltalk){
+  <head>
+    <title>Amber Processing Example</title>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta name="author" content="hhzl" />
+    <script type='text/javascript' src='the.js'></script>
+  </head>
 
-			smalltalk.defaultAmdNamespace = 'amber_examples_processing';
-			smalltalk.initialize();
-			buttonClick = function() {
-				smalltalk.Browser._openOn_(smalltalk.ProcessingClock);
-			};
-			smalltalk.ProcessingClock._init();
-		});
-	</script>
-	   	
-  </body> 
-</html> 
+  <body>
+  <p>Hi, hhzl! Welcome to Amber project: "Amber Processing Example".</p>
+  <p>This is the place for your application's HTML. After getting familiar with Amber,
+      just remove this welcome contents from index.html and replace it with your own.</p>
+  <button id="amber-with">Hello from TagBrush >> with:</button>
+  <button id="jquery-append">Hello from jQuery append</button>
+  <ol id="output-list"></ol>
+  <script type='text/javascript'>
+      require(['app'], function (amber) {
+          amber.initialize({
+            //used for all new packages in IDE
+            'transport.defaultAmdNamespace': "amber-processingclock"
+          });
+          require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
+          amber.globals.ProcessingClock._start();
+      });
+  </script>
+  </body>
+
+</html>

+ 0 - 178
processing/js/Processing-Examples.js

@@ -1,178 +0,0 @@
-define("amber_examples_processing/Processing-Examples", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
-var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
-smalltalk.addPackage('Processing-Examples');
-smalltalk.packages["Processing-Examples"].transport = {"type":"amd","amdNamespace":"amber_examples_processing"};
-
-smalltalk.addClass('ProcessingClock', globals.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
-smalltalk.addMethod(
-smalltalk.method({
-selector: "draw",
-protocol: 'not yet classified',
-fn: function (){
-var self=this;
-var drawBlock;
-function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$3,$1,$6,$8,$7,$5,$9;
-drawBlock=(function(){
-var now,hoursPosition,minutesPosition,secondsPosition;
-return smalltalk.withContext(function($ctx2) {
-_st(self["@processing"])._background_((224));
-now=_st($Date())._new();
-now;
-$2=_st(_st(now)._hours()).__backslash_backslash((12));
-$4=_st(now)._minutes();
-$ctx2.sendIdx["minutes"]=1;
-$3=_st($4).__slash((60));
-$ctx2.sendIdx["/"]=2;
-$1=_st($2).__plus($3);
-$ctx2.sendIdx["+"]=1;
-hoursPosition=_st($1).__slash((12));
-$ctx2.sendIdx["/"]=1;
-hoursPosition;
-self._drawArm_lengthScale_weight_(hoursPosition,(0.5),(5));
-$ctx2.sendIdx["drawArm:lengthScale:weight:"]=1;
-$6=_st(now)._minutes();
-$8=_st(now)._seconds();
-$ctx2.sendIdx["seconds"]=1;
-$7=_st($8).__slash((60));
-$ctx2.sendIdx["/"]=4;
-$5=_st($6).__plus($7);
-minutesPosition=_st($5).__slash((60));
-$ctx2.sendIdx["/"]=3;
-minutesPosition;
-self._drawArm_lengthScale_weight_(minutesPosition,(0.8),(3));
-$ctx2.sendIdx["drawArm:lengthScale:weight:"]=2;
-secondsPosition=_st(_st(now)._seconds()).__slash((60));
-secondsPosition;
-return self._drawArm_lengthScale_weight_(secondsPosition,(0.9),(1));
-}, function($ctx2) {$ctx2.fillBlock({now:now,hoursPosition:hoursPosition,minutesPosition:minutesPosition,secondsPosition:secondsPosition},$ctx1,1)})});
-$9=drawBlock;
-return $9;
-}, function($ctx1) {$ctx1.fill(self,"draw",{drawBlock:drawBlock},globals.ProcessingClock)})},
-args: [],
-source: "draw\x0a| drawBlock |\x0a\x0adrawBlock := [\x0a  | now hoursPosition minutesPosition secondsPosition |  \x0a  processing background: 224.\x0a  \x0a  now := Date new.\x0a  \x0a  \x22Moving hours arm by small increments\x22\x0a   hoursPosition := ((now hours \x5c\x5c 12) + (now minutes / 60 )) /12 .\x0a   self drawArm: hoursPosition lengthScale: 0.5 weight: 5.\x0a   \x0a   \x22Moving minutes arm by small increments\x22\x0a    minutesPosition := (now minutes + (now seconds / 60))/60.\x0a    self drawArm: minutesPosition lengthScale: 0.80 weight: 3.\x0a\x0a    \x22Moving hour arm by second increments\x22\x0a    secondsPosition := now seconds / 60.\x0a    self drawArm: secondsPosition lengthScale: 0.90 weight: 1.\x0a  ].\x0a\x0a^drawBlock",
-messageSends: ["background:", "new", "/", "+", "\x5c\x5c", "hours", "minutes", "drawArm:lengthScale:weight:", "seconds"],
-referencedClasses: ["Date"]
-}),
-globals.ProcessingClock);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "drawArm:lengthScale:weight:",
-protocol: 'not yet classified',
-fn: function (aPosition,aLengthScale,aWeight){
-var self=this;
-var myDX,myDY;
-function $Math(){return globals.Math||(typeof Math=="undefined"?nil:Math)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$6,$7,$5,$4,$3,$2,$8,$12,$11,$10,$9;
-_st(self["@processing"])._strokeWeight_(aWeight);
-$1=self["@centerX"];
-$6=_st(aPosition).__star((2));
-$ctx1.sendIdx["*"]=4;
-$7=_st($Math())._PI();
-$ctx1.sendIdx["PI"]=1;
-$5=_st($6).__star($7);
-$ctx1.sendIdx["*"]=3;
-$4=_st($Math())._sin_($5);
-$3=_st($4).__star(aLengthScale);
-$ctx1.sendIdx["*"]=2;
-$2=_st($3).__star(self["@maxArmLength"]);
-$ctx1.sendIdx["*"]=1;
-myDX=_st($1).__plus($2);
-$8=self["@centerY"];
-$12=_st(_st(aPosition).__star((2))).__star(_st($Math())._PI());
-$ctx1.sendIdx["*"]=7;
-$11=_st($Math())._cos_($12);
-$10=_st($11).__star(aLengthScale);
-$ctx1.sendIdx["*"]=6;
-$9=_st($10).__star(self["@maxArmLength"]);
-$ctx1.sendIdx["*"]=5;
-myDY=_st($8).__minus($9);
-_st(self["@processing"])._line_y_dX_dy_(self["@centerX"],self["@centerY"],myDX,myDY);
-return self}, function($ctx1) {$ctx1.fill(self,"drawArm:lengthScale:weight:",{aPosition:aPosition,aLengthScale:aLengthScale,aWeight:aWeight,myDX:myDX,myDY:myDY},globals.ProcessingClock)})},
-args: ["aPosition", "aLengthScale", "aWeight"],
-source: "drawArm: aPosition lengthScale: aLengthScale weight: aWeight\x0a| myDX myDY |\x0aprocessing strokeWeight: aWeight.\x0amyDX := centerX \x0a\x09\x09\x09+ ((Math sin: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0amyDY := centerY \x0a\x09\x09\x09- ((Math cos: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0a\x0aprocessing line: centerX y: centerY dX: myDX dy: myDY.",
-messageSends: ["strokeWeight:", "+", "*", "sin:", "PI", "-", "cos:", "line:y:dX:dy:"],
-referencedClasses: ["Math"]
-}),
-globals.ProcessingClock);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "firstProcessingInstance",
-protocol: 'not yet classified',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return Processing.instances[0];
-return self}, function($ctx1) {$ctx1.fill(self,"firstProcessingInstance",{},globals.ProcessingClock)})},
-args: [],
-source: "firstProcessingInstance\x0a\x0a\x09<return Processing.instances[0]>",
-messageSends: [],
-referencedClasses: []
-}),
-globals.ProcessingClock);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-protocol: 'not yet classified',
-fn: function (){
-var self=this;
-function $Math(){return globals.Math||(typeof Math=="undefined"?nil:Math)}
-return smalltalk.withContext(function($ctx1) { 
-self["@processing"]=self._firstProcessingInstance();
-self["@centerX"]=_st(_st(self["@processing"])._width()).__slash((2));
-$ctx1.sendIdx["/"]=1;
-self["@centerY"]=_st(_st(self["@processing"])._height()).__slash((2));
-self["@maxArmLength"]=_st($Math())._min_or_(self["@centerX"],self["@centerY"]);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ProcessingClock)})},
-args: [],
-source: "initialize\x0aprocessing := self firstProcessingInstance.\x0acenterX := processing width / 2.\x0acenterY := processing height / 2.\x0amaxArmLength := Math min: centerX or: centerY.",
-messageSends: ["firstProcessingInstance", "/", "width", "height", "min:or:"],
-referencedClasses: ["Math"]
-}),
-globals.ProcessingClock);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "processing",
-protocol: 'not yet classified',
-fn: function (){
-var self=this;
-var $1;
-$1=self["@processing"];
-return $1;
-},
-args: [],
-source: "processing\x0a^processing",
-messageSends: [],
-referencedClasses: []
-}),
-globals.ProcessingClock);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "init",
-protocol: 'not yet classified',
-fn: function (){
-var self=this;
-var clock,processing,block;
-function $ProcessingClock(){return globals.ProcessingClock||(typeof ProcessingClock=="undefined"?nil:ProcessingClock)}
-return smalltalk.withContext(function($ctx1) { 
-clock=_st($ProcessingClock())._new();
-processing=_st(clock)._processing();
-block=_st(clock)._draw();
-_st(processing)._at_put_("draw",block);
-return self}, function($ctx1) {$ctx1.fill(self,"init",{clock:clock,processing:processing,block:block},globals.ProcessingClock.klass)})},
-args: [],
-source: "init\x0a| clock processing block |\x0aclock := ProcessingClock new .\x0aprocessing := clock processing.\x0ablock := clock draw.\x0aprocessing at: 'draw' put: block",
-messageSends: ["new", "processing", "draw", "at:put:"],
-referencedClasses: ["ProcessingClock"]
-}),
-globals.ProcessingClock.klass);
-
-});

+ 5 - 0
processing/local.amd.json

@@ -0,0 +1,5 @@
+{
+    "paths": {
+        "amber-processingclock": "src"
+    }
+}

+ 42 - 0
processing/package.json

@@ -0,0 +1,42 @@
+{
+  "name": "processingclock",
+  "title": "Amber Processing Example",
+  "description": "Amber using th",
+  "version": "0.1.0",
+  "homepage": "https://github.com/amber-smalltalk/amber-examples",
+  "author": {
+    "name": "",
+    "email": ""
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/amber-smalltalk/amber-examples.git"
+  },
+  "bugs": {
+    "url": "https://github.com/amber-smalltalk/amber-examples/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/amber-smalltalk/amber-examples/blob/master/LICENSE-MIT"
+    }
+  ],
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "amber-dev": "^0.2.3",
+    "grunt": "^0.4.5",
+    "grunt-contrib-clean": "^0.6.0",
+    "grunt-contrib-requirejs": "^0.4.4",
+    "grunt-execute": "^0.2.2",
+    "requirejs": "^2.1.15"
+  },
+  "keywords": [
+    "Amber",
+    "Smalltalk"
+  ]
+}

Разница между файлами не показана из-за своего большого размера
+ 0 - 1494
processing/processing-1.4.1.js


+ 5 - 0
processing/processing.amd.json

@@ -0,0 +1,5 @@
+{
+  "paths": {
+                "processing" : "processing/processing"   
+           }
+}

+ 0 - 419
processing/showdown/showdown.js

@@ -1,419 +0,0 @@
-/*
-   A A L        Source code at:
-   T C A   <http://www.attacklab.net/>
-   T K B
-*/
-
-var Showdown={};
-Showdown.converter=function(){
-var _1;
-var _2;
-var _3;
-var _4=0;
-this.makeHtml=function(_5){
-_1=new Array();
-_2=new Array();
-_3=new Array();
-_5=_5.replace(/~/g,"~T");
-_5=_5.replace(/\$/g,"~D");
-_5=_5.replace(/\r\n/g,"\n");
-_5=_5.replace(/\r/g,"\n");
-_5="\n\n"+_5+"\n\n";
-_5=_6(_5);
-_5=_5.replace(/^[ \t]+$/mg,"");
-_5=_7(_5);
-_5=_8(_5);
-_5=_9(_5);
-_5=_a(_5);
-_5=_5.replace(/~D/g,"$$");
-_5=_5.replace(/~T/g,"~");
-return _5;
-};
-var _8=function(_b){
-var _b=_b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(_c,m1,m2,m3,m4){
-m1=m1.toLowerCase();
-_1[m1]=_11(m2);
-if(m3){
-return m3+m4;
-}else{
-if(m4){
-_2[m1]=m4.replace(/"/g,"&quot;");
-}
-}
-return "";
-});
-return _b;
-};
-var _7=function(_12){
-_12=_12.replace(/\n/g,"\n\n");
-var _13="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";
-var _14="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,_15);
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,_15);
-_12=_12.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/\n\n/g,"\n");
-return _12;
-};
-var _15=function(_16,m1){
-var _18=m1;
-_18=_18.replace(/\n\n/g,"\n");
-_18=_18.replace(/^\n/,"");
-_18=_18.replace(/\n+$/g,"");
-_18="\n\n~K"+(_3.push(_18)-1)+"K\n\n";
-return _18;
-};
-var _9=function(_19){
-_19=_1a(_19);
-var key=_1c("<hr />");
-_19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
-_19=_1d(_19);
-_19=_1e(_19);
-_19=_1f(_19);
-_19=_7(_19);
-_19=_20(_19);
-return _19;
-};
-var _21=function(_22){
-_22=_23(_22);
-_22=_24(_22);
-_22=_25(_22);
-_22=_26(_22);
-_22=_27(_22);
-_22=_28(_22);
-_22=_11(_22);
-_22=_29(_22);
-_22=_22.replace(/  +\n/g," <br />\n");
-return _22;
-};
-var _24=function(_2a){
-var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;
-_2a=_2a.replace(_2b,function(_2c){
-var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
-tag=_2e(tag,"\\`*_");
-return tag;
-});
-return _2a;
-};
-var _27=function(_2f){
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
-_2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
-return _2f;
-};
-var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
-if(m7==undefined){
-m7="";
-}
-var _39=m1;
-var _3a=m2;
-var _3b=m3.toLowerCase();
-var url=m4;
-var _3d=m7;
-if(url==""){
-if(_3b==""){
-_3b=_3a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_3b;
-if(_1[_3b]!=undefined){
-url=_1[_3b];
-if(_2[_3b]!=undefined){
-_3d=_2[_3b];
-}
-}else{
-if(_39.search(/\(\s*\)$/m)>-1){
-url="";
-}else{
-return _39;
-}
-}
-}
-url=_2e(url,"*_");
-var _3e="<a href=\""+url+"\"";
-if(_3d!=""){
-_3d=_3d.replace(/"/g,"&quot;");
-_3d=_2e(_3d,"*_");
-_3e+=" title=\""+_3d+"\"";
-}
-_3e+=">"+_3a+"</a>";
-return _3e;
-};
-var _26=function(_3f){
-_3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
-_3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
-return _3f;
-};
-var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
-var _49=m1;
-var _4a=m2;
-var _4b=m3.toLowerCase();
-var url=m4;
-var _4d=m7;
-if(!_4d){
-_4d="";
-}
-if(url==""){
-if(_4b==""){
-_4b=_4a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_4b;
-if(_1[_4b]!=undefined){
-url=_1[_4b];
-if(_2[_4b]!=undefined){
-_4d=_2[_4b];
-}
-}else{
-return _49;
-}
-}
-_4a=_4a.replace(/"/g,"&quot;");
-url=_2e(url,"*_");
-var _4e="<img src=\""+url+"\" alt=\""+_4a+"\"";
-_4d=_4d.replace(/"/g,"&quot;");
-_4d=_2e(_4d,"*_");
-_4e+=" title=\""+_4d+"\"";
-_4e+=" />";
-return _4e;
-};
-var _1a=function(_4f){
-_4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
-return _1c("<h1>"+_21(m1)+"</h1>");
-});
-_4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
-return _1c("<h2>"+_21(m1)+"</h2>");
-});
-_4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
-var _57=m1.length;
-return _1c("<h"+_57+">"+_21(m2)+"</h"+_57+">");
-});
-return _4f;
-};
-var _58;
-var _1d=function(_59){
-_59+="~0";
-var _5a=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
-if(_4){
-_59=_59.replace(_5a,function(_5b,m1,m2){
-var _5e=m1;
-var _5f=(m2.search(/[*+-]/g)>-1)?"ul":"ol";
-_5e=_5e.replace(/\n{2,}/g,"\n\n\n");
-var _60=_58(_5e);
-_60=_60.replace(/\s+$/,"");
-_60="<"+_5f+">"+_60+"</"+_5f+">\n";
-return _60;
-});
-}else{
-_5a=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
-_59=_59.replace(_5a,function(_61,m1,m2,m3){
-var _65=m1;
-var _66=m2;
-var _67=(m3.search(/[*+-]/g)>-1)?"ul":"ol";
-var _66=_66.replace(/\n{2,}/g,"\n\n\n");
-var _68=_58(_66);
-_68=_65+"<"+_67+">\n"+_68+"</"+_67+">\n";
-return _68;
-});
-}
-_59=_59.replace(/~0/,"");
-return _59;
-};
-_58=function(_69){
-_4++;
-_69=_69.replace(/\n{2,}$/,"\n");
-_69+="~0";
-_69=_69.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(_6a,m1,m2,m3,m4){
-var _6f=m4;
-var _70=m1;
-var _71=m2;
-if(_70||(_6f.search(/\n{2,}/)>-1)){
-_6f=_9(_72(_6f));
-}else{
-_6f=_1d(_72(_6f));
-_6f=_6f.replace(/\n$/,"");
-_6f=_21(_6f);
-}
-return "<li>"+_6f+"</li>\n";
-});
-_69=_69.replace(/~0/g,"");
-_4--;
-return _69;
-};
-var _1e=function(_73){
-_73+="~0";
-_73=_73.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(_74,m1,m2){
-var _77=m1;
-var _78=m2;
-_77=_79(_72(_77));
-_77=_6(_77);
-_77=_77.replace(/^\n+/g,"");
-_77=_77.replace(/\n+$/g,"");
-_77="<pre><code>"+_77+"\n</code></pre>";
-return _1c(_77)+_78;
-});
-_73=_73.replace(/~0/,"");
-return _73;
-};
-var _1c=function(_7a){
-_7a=_7a.replace(/(^\n+|\n+$)/g,"");
-return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
-};
-var _23=function(_7b){
-_7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
-var c=m3;
-c=c.replace(/^([ \t]*)/g,"");
-c=c.replace(/[ \t]*$/g,"");
-c=_79(c);
-return m1+"<code>"+c+"</code>";
-});
-return _7b;
-};
-var _79=function(_82){
-_82=_82.replace(/&/g,"&amp;");
-_82=_82.replace(/</g,"&lt;");
-_82=_82.replace(/>/g,"&gt;");
-_82=_2e(_82,"*_{}[]\\",false);
-return _82;
-};
-var _29=function(_83){
-_83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");
-_83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");
-return _83;
-};
-var _1f=function(_84){
-_84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
-var bq=m1;
-bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
-bq=bq.replace(/~0/g,"");
-bq=bq.replace(/^[ \t]+$/gm,"");
-bq=_9(bq);
-bq=bq.replace(/(^|\n)/g,"$1  ");
-bq=bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(_88,m1){
-var pre=m1;
-pre=pre.replace(/^  /mg,"~0");
-pre=pre.replace(/~0/g,"");
-return pre;
-});
-return _1c("<blockquote>\n"+bq+"\n</blockquote>");
-});
-return _84;
-};
-var _20=function(_8b){
-_8b=_8b.replace(/^\n+/g,"");
-_8b=_8b.replace(/\n+$/g,"");
-var _8c=_8b.split(/\n{2,}/g);
-var _8d=new Array();
-var end=_8c.length;
-for(var i=0;i<end;i++){
-var str=_8c[i];
-if(str.search(/~K(\d+)K/g)>=0){
-_8d.push(str);
-}else{
-if(str.search(/\S/)>=0){
-str=_21(str);
-str=str.replace(/^([ \t]*)/g,"<p>");
-str+="</p>";
-_8d.push(str);
-}
-}
-}
-end=_8d.length;
-for(var i=0;i<end;i++){
-while(_8d[i].search(/~K(\d+)K/)>=0){
-var _91=_3[RegExp.$1];
-_91=_91.replace(/\$/g,"$$$$");
-_8d[i]=_8d[i].replace(/~K\d+K/,_91);
-}
-}
-return _8d.join("\n\n");
-};
-var _11=function(_92){
-_92=_92.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");
-_92=_92.replace(/<(?![a-z\/?\$!])/gi,"&lt;");
-return _92;
-};
-var _25=function(_93){
-_93=_93.replace(/\\(\\)/g,_94);
-_93=_93.replace(/\\([`*_{}\[\]()>#+-.!])/g,_94);
-return _93;
-};
-var _28=function(_95){
-_95=_95.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"<a href=\"$1\">$1</a>");
-_95=_95.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(_96,m1){
-return _98(_a(m1));
-});
-return _95;
-};
-var _98=function(_99){
-function char2hex(ch){
-var _9b="0123456789ABCDEF";
-var dec=ch.charCodeAt(0);
-return (_9b.charAt(dec>>4)+_9b.charAt(dec&15));
-}
-var _9d=[function(ch){
-return "&#"+ch.charCodeAt(0)+";";
-},function(ch){
-return "&#x"+char2hex(ch)+";";
-},function(ch){
-return ch;
-}];
-_99="mailto:"+_99;
-_99=_99.replace(/./g,function(ch){
-if(ch=="@"){
-ch=_9d[Math.floor(Math.random()*2)](ch);
-}else{
-if(ch!=":"){
-var r=Math.random();
-ch=(r>0.9?_9d[2](ch):r>0.45?_9d[1](ch):_9d[0](ch));
-}
-}
-return ch;
-});
-_99="<a href=\""+_99+"\">"+_99+"</a>";
-_99=_99.replace(/">.+:/g,"\">");
-return _99;
-};
-var _a=function(_a3){
-_a3=_a3.replace(/~E(\d+)E/g,function(_a4,m1){
-var _a6=parseInt(m1);
-return String.fromCharCode(_a6);
-});
-return _a3;
-};
-var _72=function(_a7){
-_a7=_a7.replace(/^(\t|[ ]{1,4})/gm,"~0");
-_a7=_a7.replace(/~0/g,"");
-return _a7;
-};
-var _6=function(_a8){
-_a8=_a8.replace(/\t(?=\t)/g,"    ");
-_a8=_a8.replace(/\t/g,"~A~B");
-_a8=_a8.replace(/~B(.+?)~A/g,function(_a9,m1,m2){
-var _ac=m1;
-var _ad=4-_ac.length%4;
-for(var i=0;i<_ad;i++){
-_ac+=" ";
-}
-return _ac;
-});
-_a8=_a8.replace(/~A/g,"    ");
-_a8=_a8.replace(/~B/g,"");
-return _a8;
-};
-var _2e=function(_af,_b0,_b1){
-var _b2="(["+_b0.replace(/([\[\]\\])/g,"\\$1")+"])";
-if(_b1){
-_b2="\\\\"+_b2;
-}
-var _b3=new RegExp(_b2,"g");
-_af=_af.replace(_b3,_94);
-return _af;
-};
-var _94=function(_b4,m1){
-var _b6=m1.charCodeAt(0);
-return "~E"+_b6+"E";
-};
-};
-if(typeof exports!='undefined')exports.Showdown=Showdown;

+ 286 - 0
processing/src/Processing-Examples.js

@@ -0,0 +1,286 @@
+define("amber-processingclock/Processing-Examples", ["amber/boot", "amber_core/Kernel-Objects"], function($boot){
+var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
+var smalltalk=$core,_st=$recv,globals=$globals;
+$core.addPackage('Processing-Examples');
+$core.packages["Processing-Examples"].transport = {"type":"amd","amdNamespace":"amber-processingclock"};
+
+$core.addClass('ProcessingClock', $globals.Object, ['processing', 'centerX', 'centerY', 'maxArmLength'], 'Processing-Examples');
+$core.addMethod(
+$core.method({
+selector: "draw",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+var drawBlock;
+function $Date(){return $globals.Date||(typeof Date=="undefined"?nil:Date)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+var $2,$4,$3,$1,$6,$8,$7,$5,$9;
+drawBlock=(function(){
+var now,hoursPosition,minutesPosition,secondsPosition;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx2) {
+//>>excludeEnd("ctx");
+$recv(self["@processing"])._background_((224));
+now=$recv($Date())._new();
+now;
+$2=$recv($recv(now)._hours()).__backslash_backslash((12));
+$4=$recv(now)._minutes();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["minutes"]=1;
+//>>excludeEnd("ctx");
+$3=$recv($4).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["/"]=2;
+//>>excludeEnd("ctx");
+$1=$recv($2).__plus($3);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["+"]=1;
+//>>excludeEnd("ctx");
+hoursPosition=$recv($1).__slash((12));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["/"]=1;
+//>>excludeEnd("ctx");
+hoursPosition;
+self._drawArm_lengthScale_weight_(hoursPosition,(0.5),(5));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["drawArm:lengthScale:weight:"]=1;
+//>>excludeEnd("ctx");
+$6=$recv(now)._minutes();
+$8=$recv(now)._seconds();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["seconds"]=1;
+//>>excludeEnd("ctx");
+$7=$recv($8).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["/"]=4;
+//>>excludeEnd("ctx");
+$5=$recv($6).__plus($7);
+minutesPosition=$recv($5).__slash((60));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["/"]=3;
+//>>excludeEnd("ctx");
+minutesPosition;
+self._drawArm_lengthScale_weight_(minutesPosition,(0.8),(3));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx2.sendIdx["drawArm:lengthScale:weight:"]=2;
+//>>excludeEnd("ctx");
+secondsPosition=$recv($recv(now)._seconds()).__slash((60));
+secondsPosition;
+return self._drawArm_lengthScale_weight_(secondsPosition,(0.9),(1));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx2) {$ctx2.fillBlock({now:now,hoursPosition:hoursPosition,minutesPosition:minutesPosition,secondsPosition:secondsPosition},$ctx1,1)});
+//>>excludeEnd("ctx");
+});
+$9=drawBlock;
+return $9;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"draw",{drawBlock:drawBlock},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "draw\x0a| drawBlock |\x0a\x0adrawBlock := [\x0a  | now hoursPosition minutesPosition secondsPosition |  \x0a  processing background: 224.\x0a  \x0a  now := Date new.\x0a  \x0a  \x22Moving hours arm by small increments\x22\x0a   hoursPosition := ((now hours \x5c\x5c 12) + (now minutes / 60 )) /12 .\x0a   self drawArm: hoursPosition lengthScale: 0.5 weight: 5.\x0a   \x0a   \x22Moving minutes arm by small increments\x22\x0a    minutesPosition := (now minutes + (now seconds / 60))/60.\x0a    self drawArm: minutesPosition lengthScale: 0.80 weight: 3.\x0a\x0a    \x22Moving hour arm by second increments\x22\x0a    secondsPosition := now seconds / 60.\x0a    self drawArm: secondsPosition lengthScale: 0.90 weight: 1.\x0a  ].\x0a\x0a^drawBlock",
+referencedClasses: ["Date"],
+//>>excludeEnd("ide");
+messageSends: ["background:", "new", "/", "+", "\x5c\x5c", "hours", "minutes", "drawArm:lengthScale:weight:", "seconds"]
+}),
+$globals.ProcessingClock);
+
+$core.addMethod(
+$core.method({
+selector: "drawArm:lengthScale:weight:",
+protocol: 'not yet classified',
+fn: function (aPosition,aLengthScale,aWeight){
+var self=this;
+var myDX,myDY;
+function $Math(){return $globals.Math||(typeof Math=="undefined"?nil:Math)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+var $1,$6,$7,$5,$4,$3,$2,$8,$12,$11,$10,$9;
+$recv(self["@processing"])._strokeWeight_(aWeight);
+$1=self["@centerX"];
+$6=$recv(aPosition).__star((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=4;
+//>>excludeEnd("ctx");
+$7=$recv($Math())._PI();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["PI"]=1;
+//>>excludeEnd("ctx");
+$5=$recv($6).__star($7);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=3;
+//>>excludeEnd("ctx");
+$4=$recv($Math())._sin_($5);
+$3=$recv($4).__star(aLengthScale);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=2;
+//>>excludeEnd("ctx");
+$2=$recv($3).__star(self["@maxArmLength"]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=1;
+//>>excludeEnd("ctx");
+myDX=$recv($1).__plus($2);
+$8=self["@centerY"];
+$12=$recv($recv(aPosition).__star((2))).__star($recv($Math())._PI());
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=7;
+//>>excludeEnd("ctx");
+$11=$recv($Math())._cos_($12);
+$10=$recv($11).__star(aLengthScale);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=6;
+//>>excludeEnd("ctx");
+$9=$recv($10).__star(self["@maxArmLength"]);
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["*"]=5;
+//>>excludeEnd("ctx");
+myDY=$recv($8).__minus($9);
+$recv(self["@processing"])._line_y_dX_dy_(self["@centerX"],self["@centerY"],myDX,myDY);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"drawArm:lengthScale:weight:",{aPosition:aPosition,aLengthScale:aLengthScale,aWeight:aWeight,myDX:myDX,myDY:myDY},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: ["aPosition", "aLengthScale", "aWeight"],
+source: "drawArm: aPosition lengthScale: aLengthScale weight: aWeight\x0a| myDX myDY |\x0aprocessing strokeWeight: aWeight.\x0amyDX := centerX \x0a\x09\x09\x09+ ((Math sin: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0amyDY := centerY \x0a\x09\x09\x09- ((Math cos: (aPosition * 2 * Math PI))\x0a\x09\x09\x09* aLengthScale * maxArmLength).\x0a\x0aprocessing line: centerX y: centerY dX: myDX dy: myDY.",
+referencedClasses: ["Math"],
+//>>excludeEnd("ide");
+messageSends: ["strokeWeight:", "+", "*", "sin:", "PI", "-", "cos:", "line:y:dX:dy:"]
+}),
+$globals.ProcessingClock);
+
+$core.addMethod(
+$core.method({
+selector: "firstProcessingInstance",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+return Processing.instances[0];
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"firstProcessingInstance",{},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "firstProcessingInstance\x0a\x0a\x09<return Processing.instances[0]>",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.ProcessingClock);
+
+$core.addMethod(
+$core.method({
+selector: "initialize",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+function $Math(){return $globals.Math||(typeof Math=="undefined"?nil:Math)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+self["@processing"]=self._firstProcessingInstance();
+self["@centerX"]=$recv($recv(self["@processing"])._width()).__slash((2));
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["/"]=1;
+//>>excludeEnd("ctx");
+self["@centerY"]=$recv($recv(self["@processing"])._height()).__slash((2));
+self["@maxArmLength"]=$recv($Math())._min_or_(self["@centerX"],self["@centerY"]);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.ProcessingClock)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "initialize\x0aprocessing := self firstProcessingInstance.\x0acenterX := processing width / 2.\x0acenterY := processing height / 2.\x0amaxArmLength := Math min: centerX or: centerY.",
+referencedClasses: ["Math"],
+//>>excludeEnd("ide");
+messageSends: ["firstProcessingInstance", "/", "width", "height", "min:or:"]
+}),
+$globals.ProcessingClock);
+
+$core.addMethod(
+$core.method({
+selector: "processing",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@processing"];
+return $1;
+
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "processing\x0a^processing",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: []
+}),
+$globals.ProcessingClock);
+
+
+$core.addMethod(
+$core.method({
+selector: "init",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+var clock,processing,block;
+function $ProcessingClock(){return $globals.ProcessingClock||(typeof ProcessingClock=="undefined"?nil:ProcessingClock)}
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+clock=$recv($ProcessingClock())._new();
+processing=$recv(clock)._processing();
+block=$recv(clock)._draw();
+$recv(processing)._at_put_("draw",block);
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"init",{clock:clock,processing:processing,block:block},$globals.ProcessingClock.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "init\x0a| clock processing block |\x0aclock := ProcessingClock new .\x0aprocessing := clock processing.\x0ablock := clock draw.\x0aprocessing at: 'draw' put: block",
+referencedClasses: ["ProcessingClock"],
+//>>excludeEnd("ide");
+messageSends: ["new", "processing", "draw", "at:put:"]
+}),
+$globals.ProcessingClock.klass);
+
+$core.addMethod(
+$core.method({
+selector: "start",
+protocol: 'not yet classified',
+fn: function (){
+var self=this;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+return $core.withContext(function($ctx1) { 
+//>>excludeEnd("ctx");
+self._init();
+return self;
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+}, function($ctx1) {$ctx1.fill(self,"start",{},$globals.ProcessingClock.klass)});
+//>>excludeEnd("ctx");
+},
+//>>excludeStart("ide", pragmas.excludeIdeData);
+args: [],
+source: "start\x0a\x0a     self init",
+referencedClasses: [],
+//>>excludeEnd("ide");
+messageSends: ["init"]
+}),
+$globals.ProcessingClock.klass);
+
+});

+ 5 - 0
processing/st/Processing-Examples.st → processing/src/Processing-Examples.st

@@ -67,5 +67,10 @@ clock := ProcessingClock new .
 processing := clock processing.
 block := clock draw.
 processing at: 'draw' put: block
+!
+
+start
+
+     self init
 ! !
 

Некоторые файлы не были показаны из-за большого количества измененных файлов