[etoys-dev] Etoys Inbox: Etoys-kfr.160.mcz

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[etoys-dev] Etoys Inbox: Etoys-kfr.160.mcz

commits-2
A new version of Etoys was added to project Etoys Inbox:
http://source.squeak.org/etoysinbox/Etoys-kfr.160.mcz

==================== Summary ====================

Name: Etoys-kfr.160
Author: kfr
Time: 2 February 2014, 11:25:57 pm
UUID: 4c10efde-06d6-9048-aaa8-aaf79cc84d3e
Ancestors: Etoys-kfr.159

http://tracker.squeakland.org/browse/SQ-1146

=============== Diff against Etoys-kfr.158 ===============

Item was changed:
  ----- Method: CategoryViewer>>booleanPhraseFromPhrase: (in category 'support') -----
  booleanPhraseFromPhrase: phrase
  "Answer, if possible, a boolean-valued phrase derived from the phrase provided"
 
  |  retrieverOp retrieverTile |
  (phrase isKindOf: ParameterTile orOf: FunctionTile) ifTrue: [^ phrase booleanComparatorPhrase].
 
  phrase isBoolean ifTrue: [^ phrase].
+ "((scriptedPlayer respondsTo: #costume)
+ and:[scriptedPlayer costume isInWorld not]) ifTrue: [^ Array new]."
- ((scriptedPlayer respondsTo: #costume)
- and:[scriptedPlayer costume isInWorld not]) ifTrue: [^ Array new].
 
  ((phrase isMemberOf: PhraseTileMorph) and: [phrase submorphs size > 1] and: [#(bearingTo: distanceToPlayer:) includes: phrase submorphs second operatorOrExpression])
  ifTrue:
  [^ self booleanPhraseFromNumericGetterWithArgument: phrase].
 
  ((retrieverTile _ phrase submorphs last) isKindOf: TileMorph) ifFalse: [^ phrase].
  retrieverOp _ retrieverTile operatorOrExpression.
 
  (Vocabulary vocabularyForType: phrase resultType)
  affordsCoercionToBoolean ifTrue: [
  retrieverOp =  #getPatchValueIn: ifTrue: [
  ^ self booleanPhraseForGetPatchValueOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp =  #getRedComponentIn: ifTrue: [
  ^ self booleanPhraseForGetColorComponentOfType: phrase resultType componentName: #red  retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp =  #getGreenComponentIn: ifTrue: [
  ^ self booleanPhraseForGetColorComponentOfType: phrase resultType componentName: #green  retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp =  #getBlueComponentIn: ifTrue: [
  ^ self booleanPhraseForGetColorComponentOfType: phrase resultType componentName: #blue retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp = #getUphillIn: ifTrue: [
  ^ self booleanPhraseForGetUpHillOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp = #getDistanceTo: ifTrue: [
  ^ self booleanPhraseForGetDistanceToOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp = #getAngleTo: ifTrue: [
  ^ self booleanPhraseForGetAngleToOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
  retrieverOp = #bounceOn: ifTrue: [
  ^ self booleanPhraseForBounceOnOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
  " (retrieverOp = #bounceOn:color: or: [retrieverOp = #bounceOnColor:]) ifTrue: [
  ^ self booleanPhraseForBounceOnColorOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ]."
  "retrieverOp = #getTurtleAt: ifTrue: [
  ^ self booleanPhraseForGetTurtleAtOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ]."
  retrieverOp = #getTurtleOf: ifTrue: [
  ^ self booleanPhraseForGetTurtleOfOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
  ].
 
  ^ self booleanPhraseForRetrieverOfType: phrase resultType retrieverOp: retrieverOp player: phrase actualObject.
 
  ].
  ^ phrase!

Item was changed:
  ----- Method: GraphMorph class>>additionsToViewerCategories (in category '*eToys-scripting') -----
  additionsToViewerCategories
  "Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."
 
  ^ #(
 
  (basic (
  (slot cursor 'The current cursor location, wrapped back to the beginning if appropriate' Number readWrite Player getGraphCursor Player setCursorWrapped:)
 
  (slot sampleAtCursor 'The sample value at the current cursor location' Number readWrite Player getSampleAtCursor Player setSampleAtCursor:)))
 
  (sampling (
  (slot cursor 'The current cursor location, wrapped back to the beginning if appropriate' Number readWrite Player getCursor Player setCursorWrapped:)
  (slot sampleAtCursor 'The sample value at the current cursor location' Number readWrite Player getSampleAtCursor Player setSampleAtCursor:)
  (slot lastValue 'The last value obtained' Number readWrite Player getLastValue Player setLastValue:)
+ (slot samplingRate '11025, 22050, 44100' SamplingRate readWrite Player getSamplingRate Player setSamplingRate:)
  (command clear 'Clear the graph of current contents')
  (command loadSineWave 'Load a sine wave as the current graph')
  (command loadSound: 'Load the specified sound into the current graph' Sound)
  (command reverse 'Reverse the graph')
+ (command playFromCursorTo: 'Play the current graph as a sound' Number)
+ (slot count 'How many elements are within me' Number readOnly Player getCount unused unused)
  (command play 'Play the current graph as a sound'))))!

Item was changed:
  ----- Method: KedamaExamplerPlayer>>addInstanceVarNamed:withValue: (in category 'player protocol') -----
  addInstanceVarNamed: aName withValue: aValue
 
  self basicAddInstanceVarNamed: aName withValue: aValue.
  "turtles _ kedamaWorld turtlesOf: self."
+ turtles addInstanceVarNamed: aName withValue: aValue.
- turtles addInstanceVarVectorNamed: aName withValue: aValue.
  !

Item was changed:
  ----- Method: KedamaPatchType>>initialValueForASlotFor: (in category 'tile protocol') -----
  initialValueForASlotFor: aPlayer
  "Answer the value to give initially to a newly created slot of the given type in the given player"
 
+ ^ aPlayer kedamaWorld defaultPatch!
- ^ aPlayer costume renderedMorph defaultPatch.!

Item was changed:
  ----- Method: KedamaTurtleVectorPlayer2>>addInstanceVarNamed:withValue: (in category 'player protocol') -----
  addInstanceVarNamed: aName withValue: aValue
 
  | newArray |
+ newArray := self arrayForType: aValue.
+
+ arrays := arrays,(Array with: newArray).
+ newArray atAllPut: aValue.
- (aValue isKindOf: Number) ifTrue: [
- newArray _ KedamaFloatArray new: self size.
- ].
- (aValue isKindOf: Color) ifTrue: [
- newArray _ WordArray new: self size.
- ].
- (aValue isKindOf: Player) ifTrue: [
- newArray _ Array new: self size.
- ].
-
- arrays _ arrays, newArray.
  info at: aName asSymbol put: arrays size.
+ types at: arrays size put: aValue
+
+
+
  !

Item was changed:
  ----- Method: KeyPressMorph class>>descriptionForPartsBin (in category 'parts bin') -----
  descriptionForPartsBin
  ^ self
+ partName: 'Key press' translatedNoop
+ categories: {'Just for Fun' translatedNoop}
+ documentation: 'An object that tells you when a specific key has been pressed.' translatedNoop
- partName: 'Key press'
- categories: #('Just for Fun' )
- documentation: 'An object that tells you when a specific key has been pressed.'
  !

Item was changed:
  ----- Method: MethodMorph>>initialize (in category 'initialization') -----
  initialize
  "initialize the state of the receiver"
  super initialize.
+ !
- self useRoundedCorners!

Item was added:
+ ----- Method: ModifyVariableDialogMorph>>chooseType (in category 'accessing') -----
+ chooseType
+ (self targetPlayer okayToRemoveSlotNamed: slot) ifFalse:
+ [^ self inform: ('Sorry, {1} is in
+ use in a script.' translated format: {slot})].
+ super chooseType!

Item was changed:
  ----- Method: NewVariableDialogMorph>>rebuild (in category 'build') -----
  rebuild
+ | buttonColor itsName enableDecimalPlaces |
- | buttonColor itsName aBoolean |
  self removeAllMorphs.
  self addAColumn: {
  self lockedString: self title.
  }.
  self addSeparator.
 
  self addARow: {
  self inAColumn: {
  (self addARow: {
  self lockedString: 'Name:' translated.
  self spacer.
  varNameText := self newTextMorph
  contentsWrapped: self varName;
  selectAll;
  crAction: (MessageSend
  receiver: self
  selector: #doAccept);
  yourself
  }) cellPositioning: #center.
+ self inAColumn: {
+ (self addARow: {
+ self lockedString: 'Type:' translated.
+ self spacer.
+ varTypeButton := self buildVarTypeButton
+ }) cellPositioning: #center.
+ } named: #varType.
- (self addARow: {
- self lockedString: 'Type:' translated.
- self spacer.
- varTypeButton := self buildVarTypeButton
- }) cellPositioning: #center.
  }
  }.
  ActiveWorld activeHand newKeyboardFocus: varNameText.
  self addSeparator.
  self addDecimalPlaces.
+ enableDecimalPlaces := false.
- aBoolean := false.
  (#(#Number #Point) includes: self varType)
+ ifTrue: [ enableDecimalPlaces := true].
- ifTrue: [ aBoolean := true].
  self allMorphsDo: [ :each |
  itsName := each knownName.
  (#(decimalPlaces) includes: itsName) ifTrue:
+ [self enable: each when: enableDecimalPlaces]].
- [self enable: each when: aBoolean]].
 
+
 
+
  buttonColor := self color lighter.
  self addARow: {
  self inAColumn: {
  (self addARow: {
  self
  buttonNamed: 'Accept' translated action: #doAccept color: buttonColor
  help: 'keep changes made and close panel' translated.
  self
  buttonNamed: 'Cancel' translated action: #doCancel color: buttonColor
  help: 'cancel changes made and close panel' translated.
  }) listCentering: #center
  }
  }
  !

Item was added:
+ ----- Method: Object>>hasUserDefinedScripts (in category '*Etoys-viewer') -----
+ hasUserDefinedScripts
+ "Answer whether the receiver has any user-defined scripts, in the omniuser sense of the term.  This is needed to allow Viewers to look at any object, not just at Players."
+
+ ^ false!

Item was added:
+ ----- Method: Player>>getBlur (in category 'sketch filters') -----
+ getBlur
+ ^ self getFilterValue: #blur:form:!

Item was added:
+ ----- Method: Player>>getBrightnessShift (in category 'sketch filters') -----
+ getBrightnessShift
+ ^ self getFilterValue: #brightnessShift:form:!

Item was added:
+ ----- Method: Player>>getFilterValue: (in category 'sketch filters') -----
+ getFilterValue: aFilter
+ self costume renderedMorph isSketchMorph ifFalse:[^0].
+ self costume renderedMorph filters
+ do: [:i | (i includes: aFilter)
+ ifTrue: [^i second]].
+ ^0!

Item was added:
+ ----- Method: Player>>getFishEye (in category 'sketch filters') -----
+ getFishEye
+ ^ self getFilterValue: #fishEye:form:!

Item was added:
+ ----- Method: Player>>getHueShift (in category 'sketch filters') -----
+ getHueShift
+ ^ self getFilterValue: #hueShift:form:!

Item was added:
+ ----- Method: Player>>getSaturationShift (in category 'sketch filters') -----
+ getSaturationShift
+ ^ self getFilterValue: #saturationShift:form:!

Item was added:
+ ----- Method: Player>>getWhirl (in category 'sketch filters') -----
+ getWhirl
+ ^ self getFilterValue: #whirl:form:!

Item was changed:
  ----- Method: Player>>includeAtCursor: (in category 'scripts-standard') -----
  includeAtCursor: aPlayer
  "Add aPlayer to the list of objects logically 'within' me, at my current cursor position. ."
 
  | aCostume |
  (aPlayer isNil or: [aPlayer == self]) ifTrue: [^self].
  (aPlayer isText or: [aPlayer isString])
  ifTrue:
  [^ self costume class == TextFieldMorph
  ifTrue: [self costume append: aPlayer]
  ifFalse: [self]].
  aCostume := self costume topRendererOrSelf.
- aPlayer costume goHome. "assure it's in view"
  (aCostume isKindOf: PasteUpMorph)
  ifTrue:
  [aCostume addMorph: aPlayer costume asElementNumber: self getCursor.
  aCostume updateSubmorphThumbnails]  "also forces redraw"
  ifFalse:
  [aCostume addMorphBack: aPlayer.
+ self setCursor: aCostume submorphs size].
+ aPlayer costume goHome. "assure it's in view"
+ !
- self setCursor: aCostume submorphs size]!

Item was added:
+ ----- Method: Player>>kedamaWorld (in category 'slot-kedama') -----
+ kedamaWorld
+   ^ActiveWorld findDeeplyA: KedamaMorph
+ !

Item was added:
+ ----- Method: Player>>removeFilters (in category 'sketch filters') -----
+ removeFilters
+ self sendMessageToCostume: #removeFilters!

Item was added:
+ ----- Method: Player>>setBlur: (in category 'sketch filters') -----
+ setBlur: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:0.
+ self sendMessageToCostume: #filtersAdd: with: { #blur:form: . number}!

Item was added:
+ ----- Method: Player>>setBrightnessShift: (in category 'sketch filters') -----
+ setBrightnessShift: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:-100.
+ self sendMessageToCostume: #filtersAdd: with: { #brightnessShift:form: . number}!

Item was added:
+ ----- Method: Player>>setFishEye: (in category 'sketch filters') -----
+ setFishEye: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger  max:-10.
+ self sendMessageToCostume: #filtersAdd: with: { #fishEye:form: . number}!

Item was added:
+ ----- Method: Player>>setHueShift: (in category 'sketch filters') -----
+ setHueShift: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:360 max:-360.
+ self sendMessageToCostume: #filtersAdd: with: {#hueShift:form:. number}!

Item was added:
+ ----- Method: Player>>setSaturationShift: (in category 'sketch filters') -----
+ setSaturationShift: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber asInteger min:100 max:-100.
+ self sendMessageToCostume: #filtersAdd: with: { #saturationShift:form: . number}!

Item was added:
+ ----- Method: Player>>setWhirl: (in category 'sketch filters') -----
+ setWhirl: aNumber
+ | number |
+ self costume renderedMorph isSketchMorph ifFalse:[^nil].
+ number := aNumber truncated.
+ self sendMessageToCostume: #filtersAdd: with: { #whirl:form: . number}!

Item was added:
+ ----- Method: SketchMorph class>>additionsToViewerCategoryGraphicsFilters (in category '*eToys-scripting') -----
+ additionsToViewerCategoryGraphicsFilters
+ "Answer a list of (<categoryName> <list of category specs>) pairs that characterize the phrases this kind of morph wishes to add to various Viewer categories."
+
+ ^ #(
+ #'graphics filters'
+ (
+ (slot hueShift 'Shift the hue of the pictures colors. -360 to 360' Number readWrite Player getHueShift Player setHueShift:)
+ (slot brightnessShift 'Shift the brightness of the picture. -100 to 100' Number readWrite Player getBrightnessShift Player setBrightnessShift:)
+ (slot saturationShift 'Shift the saturation of the pictures colors. -100 to 100' Number readWrite Player getSaturationShift Player setSaturationShift:)
+ (slot blur 'Blur the picture. 1 to 10' Number readWrite Player getBlur Player setBlur:)
+ (slot fishEye 'Make a fish eye effect on the picture. -10 and up' Number readWrite Player getFishEye Player setFishEye:)
+ (slot whirl 'Make a whirl effect on the picture.' Number readWrite Player getWhirl Player setWhirl:)
+ (command removeFilters 'Remove the picture filters' )
+ ))
+
+
+ !

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev