DummyCore.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. require('Polycode/Core')
  2. function DummyCore() {
  3. if(arguments[0] != "__skip_ptr__") {
  4. this.__ptr = Polycode.DummyCore()
  5. }
  6. }
  7. DummyCore.prototype = Object.create(Core.prototype);
  8. Duktape.fin(DummyCore.prototype, function (x) {
  9. if (x === DummyCore.prototype) {
  10. return;
  11. }
  12. Polycode.DummyCore__delete(x.__ptr)
  13. })
  14. DummyCore.prototype.Render = function() {
  15. Polycode.DummyCore_Render(this.__ptr)
  16. }
  17. DummyCore.prototype.systemUpdate = function() {
  18. return Polycode.DummyCore_systemUpdate(this.__ptr)
  19. }
  20. DummyCore.prototype.setCursor = function(cursorType) {
  21. Polycode.DummyCore_setCursor(this.__ptr, cursorType)
  22. }
  23. DummyCore.prototype.createThread = function(target) {
  24. Polycode.DummyCore_createThread(this.__ptr, target.__ptr)
  25. }
  26. DummyCore.prototype.createMutex = function() {
  27. var retVal = new CoreMutex()
  28. retVal.__ptr = Polycode.DummyCore_createMutex(this.__ptr)
  29. return retVal
  30. }
  31. DummyCore.prototype.copyStringToClipboard = function(str) {
  32. Polycode.DummyCore_copyStringToClipboard(this.__ptr, str)
  33. }
  34. DummyCore.prototype.getClipboardString = function() {
  35. return Polycode.DummyCore_getClipboardString(this.__ptr)
  36. }
  37. DummyCore.prototype.createFolder = function(folderPath) {
  38. Polycode.DummyCore_createFolder(this.__ptr, folderPath)
  39. }
  40. DummyCore.prototype.copyDiskItem = function(itemPath,destItemPath) {
  41. Polycode.DummyCore_copyDiskItem(this.__ptr, itemPath, destItemPath)
  42. }
  43. DummyCore.prototype.moveDiskItem = function(itemPath,destItemPath) {
  44. Polycode.DummyCore_moveDiskItem(this.__ptr, itemPath, destItemPath)
  45. }
  46. DummyCore.prototype.removeDiskItem = function(itemPath) {
  47. Polycode.DummyCore_removeDiskItem(this.__ptr, itemPath)
  48. }
  49. DummyCore.prototype.openFolderPicker = function() {
  50. return Polycode.DummyCore_openFolderPicker(this.__ptr)
  51. }
  52. DummyCore.prototype.openFilePicker = function(extensions,allowMultiple) {
  53. Polycode.DummyCore_openFilePicker(this.__ptr, extensions, allowMultiple)
  54. }
  55. DummyCore.prototype.saveFilePicker = function(extensions) {
  56. return Polycode.DummyCore_saveFilePicker(this.__ptr, extensions)
  57. }
  58. DummyCore.prototype.handleVideoModeChange = function(modeInfo) {
  59. Polycode.DummyCore_handleVideoModeChange(this.__ptr, modeInfo.__ptr)
  60. }
  61. DummyCore.prototype.flushRenderContext = function() {
  62. Polycode.DummyCore_flushRenderContext(this.__ptr)
  63. }
  64. DummyCore.prototype.openURL = function(url) {
  65. Polycode.DummyCore_openURL(this.__ptr, url)
  66. }
  67. DummyCore.prototype.getTicks = function() {
  68. return Polycode.DummyCore_getTicks(this.__ptr)
  69. }
  70. DummyCore.prototype.executeExternalCommand = function(command,args,inDirectory) {
  71. return Polycode.DummyCore_executeExternalCommand(this.__ptr, command, args, inDirectory)
  72. }
  73. DummyCore.prototype.systemParseFolder = function(pathString,showHidden,targetVector) {
  74. return Polycode.DummyCore_systemParseFolder(this.__ptr, pathString, showHidden, targetVector)
  75. }