From e668c15c70347d02070e5beba13028fc60f435aa Mon Sep 17 00:00:00 2001 From: "Theunis J. Botha" Date: Tue, 7 Sep 2021 07:58:29 +0200 Subject: [PATCH] namespace + component updates --- .r3_history | 5 +- dist/r3.js | 466 +++++++++++++----- graph.php | 29 ++ package.json | 2 +- r3.php | 37 +- src/r3/r3-component/index.js | 6 +- .../r3-input.js} | 64 ++- src/r3/r3-component/r3-touch.js | 196 ++++++++ src/r3/r3-event.js | 72 +-- src/r3/r3-r3.js | 35 +- version | 2 +- 11 files changed, 709 insertions(+), 205 deletions(-) rename src/r3/{r3-runtime.js => r3-component/r3-input.js} (74%) create mode 100644 src/r3/r3-component/r3-touch.js diff --git a/.r3_history b/.r3_history index 328234a..3060834 100644 --- a/.r3_history +++ b/.r3_history @@ -9,5 +9,6 @@ r3 create SystemLinking system r3 create SystemTest system r3 create Component extends R3Object ./r3-component/ r3 create Image extends Component ./r3-component/ -r3 create Runtime extends Event -r3 create SystemInput system +r3 create SystemInput system +r3 create Input extends Component ./r3-component/ +r3 create Touch extends Input ./r3-component/ diff --git a/dist/r3.js b/dist/r3.js index 6822da0..9b4eb89 100644 --- a/dist/r3.js +++ b/dist/r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.176'; - static compileDate = '2021 Sep 06 - 13:04:25 pm'; + static version = '2.0.185'; + static compileDate = '2021 Sep 07 - 07:56:14 am'; } /** @@ -272,24 +272,25 @@ Event.DISPOSE_INSTANCE = 0x3; Event.DISPOSE_OBJECT = 0x4; Event.GET_RUNTIME = 0x5; Event.GET_WINDOW_SIZE = 0x6; -Event.INSTANCE_CREATED = 0x7; -Event.INSTANCE_DISPOSED = 0x8; -Event.KEYBOARD_DOWN = 0x9; -Event.KEYBOARD_UP = 0xa; -Event.MOUSE_DOWN = 0xb; -Event.MOUSE_MOVE = 0xc; -Event.MOUSE_UP = 0xd; -Event.MOUSE_WHEEL = 0xe; -Event.OBJECT_CREATED = 0xf; -Event.OBJECT_INITIALIZED = 0x10; -Event.PAUSE = 0x11; -Event.RESTART = 0x12; -Event.START = 0x13; -Event.TOUCH_CANCEL = 0x14; -Event.TOUCH_END = 0x15; -Event.TOUCH_MOVE = 0x16; -Event.TOUCH_START = 0x17; -Event.MAX_EVENTS = 0x18; +Event.INPUT_COMPONENT_INITIALIZED = 0x7; +Event.INSTANCE_CREATED = 0x8; +Event.INSTANCE_DISPOSED = 0x9; +Event.KEYBOARD_DOWN = 0xa; +Event.KEYBOARD_UP = 0xb; +Event.MOUSE_DOWN = 0xc; +Event.MOUSE_MOVE = 0xd; +Event.MOUSE_UP = 0xe; +Event.MOUSE_WHEEL = 0xf; +Event.OBJECT_CREATED = 0x10; +Event.OBJECT_INITIALIZED = 0x11; +Event.PAUSE = 0x12; +Event.RESTART = 0x13; +Event.START = 0x14; +Event.TOUCH_CANCEL = 0x15; +Event.TOUCH_END = 0x16; +Event.TOUCH_MOVE = 0x17; +Event.TOUCH_START = 0x18; +Event.MAX_EVENTS = 0x19; Event.GetEventName = function(eventId) { @@ -300,23 +301,24 @@ Event.GetEventName = function(eventId) { case 0x4 : return 'dispose_object'; case 0x5 : return 'get_runtime'; case 0x6 : return 'get_window_size'; - case 0x7 : return 'instance_created'; - case 0x8 : return 'instance_disposed'; - case 0x9 : return 'keyboard_down'; - case 0xa : return 'keyboard_up'; - case 0xb : return 'mouse_down'; - case 0xc : return 'mouse_move'; - case 0xd : return 'mouse_up'; - case 0xe : return 'mouse_wheel'; - case 0xf : return 'object_created'; - case 0x10 : return 'object_initialized'; - case 0x11 : return 'pause'; - case 0x12 : return 'restart'; - case 0x13 : return 'start'; - case 0x14 : return 'touch_cancel'; - case 0x15 : return 'touch_end'; - case 0x16 : return 'touch_move'; - case 0x17 : return 'touch_start'; + case 0x7 : return 'input_component_initialized'; + case 0x8 : return 'instance_created'; + case 0x9 : return 'instance_disposed'; + case 0xa : return 'keyboard_down'; + case 0xb : return 'keyboard_up'; + case 0xc : return 'mouse_down'; + case 0xd : return 'mouse_move'; + case 0xe : return 'mouse_up'; + case 0xf : return 'mouse_wheel'; + case 0x10 : return 'object_created'; + case 0x11 : return 'object_initialized'; + case 0x12 : return 'pause'; + case 0x13 : return 'restart'; + case 0x14 : return 'start'; + case 0x15 : return 'touch_cancel'; + case 0x16 : return 'touch_end'; + case 0x17 : return 'touch_move'; + case 0x18 : return 'touch_start'; default : throw new Error('Event type not defined : ' + eventId); } @@ -2368,92 +2370,6 @@ class R3Object extends Event { } -/** - - Class R3.Event.Runtime - [Inherited from Event] - - Inherited Properties: - - - - Inherited Static Properties: - - - - Inherited Methods: - - - async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments - - - emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments - - - subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments - - Inherited Static Methods: - - - Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as - arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the - error as argument. - - - Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after - the event result is obtained, passing it the result. If an exception occurs during execution, the - clientErrorCallback is called with the error as argument. - - - Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - - [Belonging to Runtime] - - Properties: - - - - Static Properties: - - - - Methods: - - - - Static Methods: - - - - Of the form x= - - Of the form x= - - **/ - -class Runtime extends Event { - - constructor(options) { - - if (typeof options === 'undefined') { - options = {}; - } - - super(options); - - this.emit(Event.OBJECT_CREATED, this); - - Object.assign(this, options); - - this.emit(Event.OBJECT_INITIALIZED, this); - - } - -} - -Runtime.DEFAULT = 0x1; -Runtime.GRAPHICS = 0x2; - /** Class R3.Event.Object.Component @@ -2864,20 +2780,308 @@ class Image extends Component { } -R3.Object = R3Object; -R3.Component = Component; +/** + + Class R3.Event.Object.Component.Input + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + - runtime (Default value R3.Runtime.DEFAULT) + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance() + No comment + + - dispose() + No comment + + - disposeInstance() + No comment + + - getRuntime() + No comment + + Inherited Static Methods: + + + + [Belonging to Input] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + Of the form x= + + Of the form x= + + **/ + +class Input extends Component { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + super(options); + + this.emit(Event.OBJECT_CREATED, this); + + Object.assign(this, options); + + this.emit(Event.OBJECT_INITIALIZED, this); + + this.emit(Event.INPUT_COMPONENT_INITIALIZED); + } + +} + +/** + + Class R3.Event.Object.Component.Input.Touch + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + - runtime (Default value R3.Runtime.DEFAULT) + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance() + No comment + + - dispose() + No comment + + - disposeInstance() + No comment + + - getRuntime() + No comment + + Inherited Static Methods: + + + + [Inherited from Input] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to Touch] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + Of the form x= + + Of the form x= + + **/ + +class Touch extends Input { + + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + super(options); + + this.emit(Event.OBJECT_CREATED, this); + + Object.assign(this, options); + + this.emit(Event.OBJECT_INITIALIZED, this); + + } + +} + R3.System = System; -R3.Event = Event; -R3.Utils = Utils; R3.System.Input = SystemInput; R3.System.Linking = SystemLinking; R3.System.Socket = SystemSocket; R3.System.Test = SystemTest; +R3.Event = Event; R3.Event.Object = R3Object; -R3.Event.Runtime = Runtime; -R3.Event.Object.Component = Component; -R3.Event.Object.Project = Project; -R3.Event.Object.Component.Image = Image; +R3.Event.Component = Component; +R3.Event.Image = Image; +R3.Event.Input = Input; +R3.Event.Touch = Touch; +R3.Event.Project = Project; +R3.Utils = Utils; +R3.Object = R3Object; +R3.Object.Component = Component; +R3.Object.Image = Image; +R3.Object.Input = Input; +R3.Object.Touch = Touch; +R3.Object.Project = Project; +R3.Component = Component; +R3.Component.Image = Image; +R3.Component.Input = Input; +R3.Component.Touch = Touch; +R3.Input = Input; +R3.Input.Touch = Touch; R3.Runtime = Runtime; console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate); diff --git a/graph.php b/graph.php index f7c186c..444e7d8 100644 --- a/graph.php +++ b/graph.php @@ -256,6 +256,35 @@ class Graph return []; } } + + /** + * Returns all children of this node in a flat (1 dimensional) array + * @param $node + */ + public function flatten($node) + { + + if (sizeof($node->children) === 0) { + return []; + } + + $result = []; + + foreach ($node->children as $child) { + + array_push($result, $child); + + $children = $this->flatten($child); + + foreach ($children as $child2) { + array_push($result, $child2); + } + + } + + return $result; + + } } class Node diff --git a/package.json b/package.json index a662fe8..a93f483 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "r3", - "version" : "2.0.176", + "version" : "2.0.185", "description": "", "private": true, "dependencies": { diff --git a/r3.php b/r3.php index 0123d20..2bffdbe 100755 --- a/r3.php +++ b/r3.php @@ -1082,14 +1082,16 @@ function generateIndex($types) foreach ($types as $type) { - $nodes = $graph->search('name', $type); + $node = $graph->search('name', $type); $template = file_get_contents('src/templates/index.template'); $imports = []; $exports = []; - $nodes = array_merge([$nodes], $nodes->children); + $children = $graph->flatten($node); + + $nodes = array_merge([$node], $children); foreach ($nodes as $child) { @@ -1124,21 +1126,33 @@ function generateIndex($types) } } -function generateR3($nodes) +function generateR3($nodes, $graph) { $imports = []; $defines = []; - $convenientDefines = []; foreach ($nodes as $node) { - $file = str_replace('src/r3', '.', $node->file); - array_push($imports, "const " . $node->name . ' = require(\'' . $file . "');"); - array_push($defines, $node->nameSpace . $node->nameSpaceClassName . ' = ' . $node->name); - if (sizeof($node->children) > 0 && substr_count($node->nameSpace, ".") > 1) { - $convenientDefine = "R3." . $node->nameSpaceClassName . ' = ' . $node->name; - array_push($convenientDefines, $convenientDefine); + $file = str_replace('src/r3', '.', $node->file); + + array_push($imports, "const " . $node->name . ' = require(\'' . $file . "');"); + + if ((sizeof($node->children) > 0)) { + + $define = "R3." . $node->nameSpaceClassName . ' = ' . $node->name; + array_push($defines, $define); + + $children = $graph->flatten($node); + + foreach ($children as $child) { + $define = "R3." . $node->nameSpaceClassName . '.' . $child->nameSpaceClassName . ' = ' . $child->name; + array_push($defines, $define); + } + + } else if ($node->parent->parent === null) { + array_push($defines, $node->nameSpace . $node->nameSpaceClassName . ' = ' . $node->name); } + } @@ -1163,7 +1177,6 @@ function generateR3($nodes) updateSection($r3File, 'GENERATED_IMPORTS', implode("\n", $imports)); updateSection($r3File, 'GENERATED_DEFINES', implode(";\n", $defines) . ";"); - updateSection($r3File, 'GENERATED_CONVENIENT_DEFINES', implode(";\n", $convenientDefines) . ";"); if (in_array('CUSTOM_CONVENIENT_DEFINES', array_keys($tokens))) { updateSection($r3File, 'CUSTOM_CONVENIENT_DEFINES', $tokens['CUSTOM_CONVENIENT_DEFINES']); @@ -1648,7 +1661,7 @@ if ($argv[2] == 'build-dist') { updateParentSystems($nodes); - generateR3($nodes); + generateR3($nodes, $graph); generateR3Dist($nodes); foreach ($files as $file) { diff --git a/src/r3/r3-component/index.js b/src/r3/r3-component/index.js index 08e173f..c4a3a17 100644 --- a/src/r3/r3-component/index.js +++ b/src/r3/r3-component/index.js @@ -1,6 +1,8 @@ //GENERATED_IMPORTS_START const Component = require('./r3-component.js'); const Image = require('./r3-image.js'); +const Input = require('./r3-input.js'); +const Touch = require('./r3-touch.js'); //GENERATED_IMPORTS_END //GENERATED_INDEX_BODY_START @@ -9,6 +11,8 @@ const Image = require('./r3-image.js'); module.exports = { //GENERATED_EXPORTS_START Component, - Image + Image, + Input, + Touch //GENERATED_EXPORTS_END } diff --git a/src/r3/r3-runtime.js b/src/r3/r3-component/r3-input.js similarity index 74% rename from src/r3/r3-runtime.js rename to src/r3/r3-component/r3-input.js index bf16cb3..250bbe0 100644 --- a/src/r3/r3-runtime.js +++ b/src/r3/r3-component/r3-input.js @@ -1,11 +1,12 @@ -const Utils = require('./r3-utils'); -const Event = require('./r3-event.js'); +const Event = require('.././r3-event'); +const Utils = require('.././r3-utils'); +const Component = require('.././r3-component.js'); /** GENERATED_INHERITED_START - Class R3.Event.Runtime + Class R3.Event.Object.Component.Input [Inherited from Event] Inherited Properties: @@ -42,7 +43,53 @@ const Event = require('./r3-event.js'); - Subscribe(eventId, callback) Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised - [Belonging to Runtime] + [Inherited from R3Object] + + Inherited Properties: + + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + - runtime (Default value R3.Runtime.DEFAULT) + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance() + No comment + + - dispose() + No comment + + - disposeInstance() + No comment + + - getRuntime() + No comment + + Inherited Static Methods: + + + + [Belonging to Input] Properties: @@ -84,7 +131,7 @@ const Event = require('./r3-event.js'); **/ -class Runtime extends Event { +class Input extends Component { //GENERATED_CONSTRUCTOR_EXTENDS_START constructor(options) { @@ -111,6 +158,7 @@ class Runtime extends Event { this.emit(Event.OBJECT_INITIALIZED, this); //CUSTOM_AFTER_INIT_START + this.emit(Event.INPUT_COMPONENT_INITIALIZED); //CUSTOM_AFTER_INIT_END } //GENERATED_CONSTRUCTOR_EXTENDS_END @@ -126,10 +174,6 @@ class Runtime extends Event { } //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START - -Runtime.DEFAULT = 0x1; -Runtime.GRAPHICS = 0x2; - //CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END -module.exports = Runtime; +module.exports = Input; diff --git a/src/r3/r3-component/r3-touch.js b/src/r3/r3-component/r3-touch.js new file mode 100644 index 0000000..32802a9 --- /dev/null +++ b/src/r3/r3-component/r3-touch.js @@ -0,0 +1,196 @@ +const Event = require('.././r3-event'); +const Utils = require('.././r3-utils'); +const Input = require('.././r3-input.js'); + +/** + + GENERATED_INHERITED_START + + Class R3.Event.Object.Component.Input.Touch + [Inherited from Event] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + - async(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Async()' passing it the arguments + + - emit(eventId, data, clientCallback, clientErrorCallback) + Simply calls 'Emit()' passing it the arguments + + - subscribe(eventId, callback) + Simply calls 'Subscribe()' passing it the arguments + + Inherited Static Methods: + + - Async(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as + arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the + error as argument. + + - Emit(eventId, data, clientCallback, clientErrorCallback) + Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after + the event result is obtained, passing it the result. If an exception occurs during execution, the + clientErrorCallback is called with the error as argument. + + - Subscribe(eventId, callback) + Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised + + [Inherited from R3Object] + + Inherited Properties: + + - register (Default value true) + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Inherited from Component] + + Inherited Properties: + + - runtime (Default value R3.Runtime.DEFAULT) + + Inherited Static Properties: + + + + Inherited Methods: + + - createInstance() + No comment + + - dispose() + No comment + + - disposeInstance() + No comment + + - getRuntime() + No comment + + Inherited Static Methods: + + + + [Inherited from Input] + + Inherited Properties: + + + + Inherited Static Properties: + + + + Inherited Methods: + + + + Inherited Static Methods: + + + + [Belonging to Touch] + + Properties: + + + + Static Properties: + + + + Methods: + + + + Static Methods: + + + + GENERATED_INHERITED_END + + Of the form x= + CUSTOM_OPTIONS_START + CUSTOM_OPTIONS_END + + Of the form x= + CUSTOM_INSTANCE_OPTIONS_MAPPING_START + CUSTOM_INSTANCE_OPTIONS_MAPPING_END + + CUSTOM_LINKED_OBJECTS_START + CUSTOM_LINKED_OBJECTS_END + + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_START + CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS_END + + CUSTOM_METHODS_START + CUSTOM_METHODS_END + + CUSTOM_STATIC_METHODS_START + CUSTOM_STATIC_METHODS_END + + **/ + +class Touch extends Input { + + //GENERATED_CONSTRUCTOR_EXTENDS_START + constructor(options) { + + if (typeof options === 'undefined') { + options = {}; + } + + super(options); + + this.emit(Event.OBJECT_CREATED, this); + + //GENERATED_OPTIONS_INIT_START + //GENERATED_OPTIONS_INIT_END + + //CUSTOM_OPTIONS_INIT_START + //CUSTOM_OPTIONS_INIT_END + + Object.assign(this, options); + + //CUSTOM_BEFORE_INIT_START + //CUSTOM_BEFORE_INIT_END + + this.emit(Event.OBJECT_INITIALIZED, this); + + //CUSTOM_AFTER_INIT_START + //CUSTOM_AFTER_INIT_END + } + //GENERATED_CONSTRUCTOR_EXTENDS_END + + //GENERATED_METHODS_START + //GENERATED_METHODS_END + + //GENERATED_STATIC_METHODS_START + //GENERATED_STATIC_METHODS_END + + //CUSTOM_IMPLEMENTATION_START + //CUSTOM_IMPLEMENTATION_END +} + +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START +//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END + +module.exports = Touch; diff --git a/src/r3/r3-event.js b/src/r3/r3-event.js index d6a546d..ae44e53 100644 --- a/src/r3/r3-event.js +++ b/src/r3/r3-event.js @@ -313,24 +313,25 @@ Event.DISPOSE_INSTANCE = 0x3; Event.DISPOSE_OBJECT = 0x4; Event.GET_RUNTIME = 0x5; Event.GET_WINDOW_SIZE = 0x6; -Event.INSTANCE_CREATED = 0x7; -Event.INSTANCE_DISPOSED = 0x8; -Event.KEYBOARD_DOWN = 0x9; -Event.KEYBOARD_UP = 0xa; -Event.MOUSE_DOWN = 0xb; -Event.MOUSE_MOVE = 0xc; -Event.MOUSE_UP = 0xd; -Event.MOUSE_WHEEL = 0xe; -Event.OBJECT_CREATED = 0xf; -Event.OBJECT_INITIALIZED = 0x10; -Event.PAUSE = 0x11; -Event.RESTART = 0x12; -Event.START = 0x13; -Event.TOUCH_CANCEL = 0x14; -Event.TOUCH_END = 0x15; -Event.TOUCH_MOVE = 0x16; -Event.TOUCH_START = 0x17; -Event.MAX_EVENTS = 0x18; +Event.INPUT_COMPONENT_INITIALIZED = 0x7; +Event.INSTANCE_CREATED = 0x8; +Event.INSTANCE_DISPOSED = 0x9; +Event.KEYBOARD_DOWN = 0xa; +Event.KEYBOARD_UP = 0xb; +Event.MOUSE_DOWN = 0xc; +Event.MOUSE_MOVE = 0xd; +Event.MOUSE_UP = 0xe; +Event.MOUSE_WHEEL = 0xf; +Event.OBJECT_CREATED = 0x10; +Event.OBJECT_INITIALIZED = 0x11; +Event.PAUSE = 0x12; +Event.RESTART = 0x13; +Event.START = 0x14; +Event.TOUCH_CANCEL = 0x15; +Event.TOUCH_END = 0x16; +Event.TOUCH_MOVE = 0x17; +Event.TOUCH_START = 0x18; +Event.MAX_EVENTS = 0x19; Event.GetEventName = function(eventId) { @@ -341,23 +342,24 @@ Event.GetEventName = function(eventId) { case 0x4 : return 'dispose_object'; case 0x5 : return 'get_runtime'; case 0x6 : return 'get_window_size'; - case 0x7 : return 'instance_created'; - case 0x8 : return 'instance_disposed'; - case 0x9 : return 'keyboard_down'; - case 0xa : return 'keyboard_up'; - case 0xb : return 'mouse_down'; - case 0xc : return 'mouse_move'; - case 0xd : return 'mouse_up'; - case 0xe : return 'mouse_wheel'; - case 0xf : return 'object_created'; - case 0x10 : return 'object_initialized'; - case 0x11 : return 'pause'; - case 0x12 : return 'restart'; - case 0x13 : return 'start'; - case 0x14 : return 'touch_cancel'; - case 0x15 : return 'touch_end'; - case 0x16 : return 'touch_move'; - case 0x17 : return 'touch_start'; + case 0x7 : return 'input_component_initialized'; + case 0x8 : return 'instance_created'; + case 0x9 : return 'instance_disposed'; + case 0xa : return 'keyboard_down'; + case 0xb : return 'keyboard_up'; + case 0xc : return 'mouse_down'; + case 0xd : return 'mouse_move'; + case 0xe : return 'mouse_up'; + case 0xf : return 'mouse_wheel'; + case 0x10 : return 'object_created'; + case 0x11 : return 'object_initialized'; + case 0x12 : return 'pause'; + case 0x13 : return 'restart'; + case 0x14 : return 'start'; + case 0x15 : return 'touch_cancel'; + case 0x16 : return 'touch_end'; + case 0x17 : return 'touch_move'; + case 0x18 : return 'touch_start'; default : throw new Error('Event type not defined : ' + eventId); } diff --git a/src/r3/r3-r3.js b/src/r3/r3-r3.js index dec6749..9631e3e 100644 --- a/src/r3/r3-r3.js +++ b/src/r3/r3-r3.js @@ -1,6 +1,6 @@ class R3 { - static version = '2.0.176'; - static compileDate = '2021 Sep 06 - 13:04:25 pm'; + static version = '2.0.185'; + static compileDate = '2021 Sep 07 - 07:56:14 am'; } //GENERATED_IMPORTS_START @@ -12,34 +12,45 @@ const SystemLinking = require('./r3-system/r3-system-linking.js'); const SystemSocket = require('./r3-system/r3-system-socket.js'); const SystemTest = require('./r3-system/r3-system-test.js'); const R3Object = require('./r3-r3-object.js'); -const Runtime = require('./r3-runtime.js'); const Component = require('./r3-component/r3-component.js'); const Project = require('./r3-project.js'); const Image = require('./r3-component/r3-image.js'); +const Input = require('./r3-component/r3-input.js'); +const Touch = require('./r3-component/r3-touch.js'); //GENERATED_IMPORTS_END //GENERATED_DEFINES_START R3.System = System; -R3.Event = Event; -R3.Utils = Utils; R3.System.Input = SystemInput; R3.System.Linking = SystemLinking; R3.System.Socket = SystemSocket; R3.System.Test = SystemTest; +R3.Event = Event; R3.Event.Object = R3Object; -R3.Event.Runtime = Runtime; -R3.Event.Object.Component = Component; -R3.Event.Object.Project = Project; -R3.Event.Object.Component.Image = Image; +R3.Event.Component = Component; +R3.Event.Image = Image; +R3.Event.Input = Input; +R3.Event.Touch = Touch; +R3.Event.Project = Project; +R3.Utils = Utils; +R3.Object = R3Object; +R3.Object.Component = Component; +R3.Object.Image = Image; +R3.Object.Input = Input; +R3.Object.Touch = Touch; +R3.Object.Project = Project; +R3.Component = Component; +R3.Component.Image = Image; +R3.Component.Input = Input; +R3.Component.Touch = Touch; +R3.Input = Input; +R3.Input.Touch = Touch; //GENERATED_DEFINES_END //GENERATED_CONVENIENT_DEFINES_START -R3.Object = R3Object; -R3.Component = Component; //GENERATED_CONVENIENT_DEFINES_END //CUSTOM_CONVENIENT_DEFINES_START -R3.Runtime = Runtime; //CUSTOM_CONVENIENT_DEFINES_END module.exports = R3; diff --git a/version b/version index 4b37297..fb003ae 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0.176 \ No newline at end of file +2.0.185 \ No newline at end of file