VM Maker: VMMaker.oscog-eem.2922.mcz

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

VM Maker: VMMaker.oscog-eem.2922.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2922.mcz

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

Name: VMMaker.oscog-eem.2922
Author: eem
Time: 5 January 2021, 12:16:35.656749 pm
UUID: 5a9437e9-a27e-47db-972f-b2864c01bca9
Ancestors: VMMaker.oscog-eem.2921

DropPlugin:
Add primitiveDropRequestURI to support launch apple events as drop events on MacOS.

=============== Diff against VMMaker.oscog-eem.2921 ===============

Item was changed:
  ----- Method: DropPlugin>>primitiveDropRequestFileHandle (in category 'primitives') -----
  primitiveDropRequestFileHandle
  "Note: File handle creation needs to be handled by specific support code explicitly bypassing the plugin file sand box."
- | dropIndex handleOop |
  <export: true>
+ | dropIndex handleOop |
+ interpreterProxy methodArgumentCount = 1 ifFalse:
+ [^interpreterProxy primitiveFail].
- <inline: false>
- interpreterProxy methodArgumentCount = 1
- ifFalse:[^interpreterProxy primitiveFail].
  dropIndex := interpreterProxy stackIntegerValue: 0.
+ interpreterProxy failed ifFalse:
+ [handleOop := self dropRequestFileHandle: dropIndex.
+ interpreterProxy failed ifFalse:
+ [interpreterProxy methodReturnValue: handleOop]]!
- handleOop := self dropRequestFileHandle: dropIndex.
- "dropRequestFileHandle needs to return the actual oop returned"
- interpreterProxy failed ifFalse:[
- interpreterProxy pop: 2.
- interpreterProxy push: handleOop.
- ].!

Item was changed:
  ----- Method: DropPlugin>>primitiveDropRequestFileName (in category 'primitives') -----
  primitiveDropRequestFileName
  "Note: File handle creation needs to be handled by specific support code explicitly bypassing the plugin file sand box."
- | dropIndex dropName nameLength nameOop namePtr |
  <export: true>
+ | dropIndex |
+ interpreterProxy methodArgumentCount = 1 ifFalse:
+ [^interpreterProxy primitiveFail].
- <inline: false>
- <var: #dropName type: 'char *'>
- <var: #namePtr type: 'char *'>
- interpreterProxy methodArgumentCount = 1
- ifFalse:[^interpreterProxy primitiveFail].
  dropIndex := interpreterProxy stackIntegerValue: 0.
+ "dropRequestFileName returns name or NULL on error; methodReturnString: fails for nil"
+ interpreterProxy failed ifFalse:
+ [interpreterProxy methodReturnString: (self dropRequestFileName: dropIndex)]!
- dropName := self dropRequestFileName: dropIndex.
- "dropRequestFileName returns name or NULL on error"
- dropName == nil
- ifTrue:[^interpreterProxy primitiveFail].
- nameLength := self strlen: dropName.
- nameOop := interpreterProxy instantiateClass: interpreterProxy classString indexableSize: nameLength.
- namePtr := interpreterProxy firstIndexableField: nameOop.
- 0 to: nameLength-1 do:[:i| namePtr at: i put: (dropName at: i)].
- interpreterProxy pop: 2.
- interpreterProxy push: nameOop.
- !

Item was added:
+ ----- Method: DropPlugin>>primitiveDropRequestURI (in category 'primitives') -----
+ primitiveDropRequestURI
+ "On platforms that don't support URIs (currently Windows) the idea is to use primitiveDropRequestURI,
+ which will fail, and then fall back on primitiveDropRequestFileName."
+ <export: true>
+ | dropIndex |
+ interpreterProxy methodArgumentCount = 1 ifFalse:
+ [^interpreterProxy primitiveFail].
+ dropIndex := interpreterProxy stackIntegerValue: 0.
+ "dropRequestURI returns name or NULL on error; methodReturnString: fails for nil"
+ interpreterProxy failed ifFalse:
+ [interpreterProxy methodReturnString: (self dropRequestURI: dropIndex)]!