Changeset 46
- Timestamp:
- 06/11/08 12:01:26 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lily/lily/chrome/content/externals/processing.js
r44 r46 84 84 this.inlet1["run"]=function() { 85 85 var obj = LilyUtils.readFileFromPath(currScriptPath); 86 proc = Processing(thisPtr.displayElement,obj.data );86 proc = Processing(thisPtr.displayElement,obj.data,thisPtr); 87 87 } 88 88 … … 137 137 thisPtr.controller.patchController.attachPatchObserver(thisPtr.objID,"patchLoaded",loadFunc,"all"); 138 138 139 LilyUtils.loadScript("chrome://lily/content/lib/processing.js", this); 140 Processing.lily = thisPtr; 139 LilyUtils.loadScript("chrome://lily/content/lib/processing.js", this); 141 140 } 142 141 trunk/lily/lily/chrome/content/lib/processing.js
r45 r46 7 7 (function(){ 8 8 9 this.Processing = function Processing( aElement, aCode )9 this.Processing = function Processing( aElement, aCode, context) 10 10 { 11 11 var p = buildProcessing( aElement ); 12 p.lily = context; 12 13 p.init( aCode ); 13 14 return p; … … 526 527 p.createGraphics = function createGraphics( w, h ) 527 528 { 528 var canvas = Processing.lily.document.createElement("canvas"); //FIX ME *****529 var canvas = p.lily.document.createElement("canvas"); //FIX ME ***** 529 530 var ret = buildProcessing( canvas ); 530 531 ret.size( w, h ); … … 551 552 if ( typeof img == "string" ) 552 553 { 553 if( Processing.lily.document.getElementById(img)) {554 return Processing.lily.document.getElementById(img); //FIX ME ****554 if(p.lily.document.getElementById(img)) { 555 return p.lily.document.getElementById(img); //FIX ME **** 555 556 } else { 556 557 p.loadImage(img); 557 return Processing.lily.document.getElementById(img); //FIX ME ****558 return p.lily.document.getElementById(img); //FIX ME **** 558 559 } 559 560 } … … 572 573 } 573 574 574 var canvas = Processing.lily.document.createElement("canvas"); //FIX ME ***575 var canvas = p.lily.document.createElement("canvas"); //FIX ME *** 575 576 canvas.width = img.width; 576 577 canvas.height = img.height; … … 643 644 function processData(data){ 644 645 645 //remove any dupes 646 if( Processing.lily.document.getElementById(file)) {647 Processing.lily.document.getElementById(file).648 parentNode.removeChild( Processing.lily.document.getElementById(file));646 //remove any dupes FIXME **** 647 if(p.lily.document.getElementById(file)) { 648 p.lily.document.getElementById(file). 649 parentNode.removeChild(p.lily.document.getElementById(file)); 649 650 } 650 651 651 var div = Processing.lily.document.createElement("div");652 var div = p.lily.document.createElement("div"); 652 653 div.style.display="none"; 653 Processing.lily.document.body.appendChild(div);654 img = Processing.lily.document.createElement("img");654 p.lily.document.body.appendChild(div); 655 img = p.lily.document.createElement("img"); 655 656 img.src = "data:image/jpeg;base64,"+btoa(data); 656 657 img.id = orgName; … … 668 669 var h = img.height, w = img.width; 669 670 670 var canvas = Processing.lily.document.createElement("canvas"); //FIX ME ****671 var canvas = p.lily.document.createElement("canvas"); //FIX ME **** 671 672 canvas.width = w; 672 673 canvas.height = h; … … 1328 1329 curContext.strokeStyle = strokeStyle; 1329 1330 1330 Processing.lily.set_obj_size(aWidth,aHeight); //**** FIX ME ****1331 p.lily.set_obj_size(aWidth,aHeight); //**** FIX ME **** 1331 1332 1332 1333 p.background(); //**** FIX ME **** had to add this for some reason... … … 1654 1655 p.pmouseY = p.mouseY; 1655 1656 //**** FIX ME ***** 1656 p.mouseX = (e.clientX+ Processing.lily.parent.patchView.oWin.scrollX) - Processing.lily.left;1657 p.mouseY = (e.clientY+ Processing.lily.parent.patchView.oWin.scrollY) - Processing.lily.top;1657 p.mouseX = (e.clientX+p.lily.parent.patchView.oWin.scrollX) - p.lily.left; 1658 p.mouseY = (e.clientY+p.lily.parent.patchView.oWin.scrollY) - p.lily.top; 1658 1659 1659 1660 if ( p.mouseMoved ) … … 1697 1698 }); 1698 1699 1699 attach( Processing.lily.document, "keydown", function(e) //FIX ME ****1700 attach( p.lily.document, "keydown", function(e) //FIX ME **** 1700 1701 { 1701 1702 keyPressed = true; … … 1718 1719 }); 1719 1720 1720 attach( Processing.lily.document, "keyup", function(e) //FIX ME *****1721 attach( p.lily.document, "keyup", function(e) //FIX ME ***** 1721 1722 { 1722 1723 keyPressed = false;
