@illgrenoble/webx-client 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/WebXClient.d.ts +148 -16
  2. package/dist/WebXClient.js +148 -22
  3. package/dist/WebXClient.js.map +1 -1
  4. package/dist/display/WebXCursor.d.ts +65 -0
  5. package/dist/display/WebXCursor.js +65 -0
  6. package/dist/display/WebXCursor.js.map +1 -1
  7. package/dist/display/WebXCursorFactory.d.ts +18 -0
  8. package/dist/display/WebXCursorFactory.js +39 -16
  9. package/dist/display/WebXCursorFactory.js.map +1 -1
  10. package/dist/display/WebXDisplay.d.ts +139 -8
  11. package/dist/display/WebXDisplay.js +140 -8
  12. package/dist/display/WebXDisplay.js.map +1 -1
  13. package/dist/display/WebXSubImage.d.ts +42 -11
  14. package/dist/display/WebXSubImage.js +18 -12
  15. package/dist/display/WebXSubImage.js.map +1 -1
  16. package/dist/display/WebXTextureFactory.d.ts +30 -0
  17. package/dist/display/WebXTextureFactory.js +56 -19
  18. package/dist/display/WebXTextureFactory.js.map +1 -1
  19. package/dist/display/WebXWindow.d.ts +152 -0
  20. package/dist/display/WebXWindow.js +152 -0
  21. package/dist/display/WebXWindow.js.map +1 -1
  22. package/dist/display/WebXWindowProperties.d.ts +31 -6
  23. package/dist/display/WebXWindowProperties.js +16 -9
  24. package/dist/display/WebXWindowProperties.js.map +1 -1
  25. package/dist/input/WebXKeyboard.d.ts +40 -5
  26. package/dist/input/WebXKeyboard.js +52 -14
  27. package/dist/input/WebXKeyboard.js.map +1 -1
  28. package/dist/input/WebXMouse.d.ts +9 -0
  29. package/dist/input/WebXMouse.js +9 -4
  30. package/dist/input/WebXMouse.js.map +1 -1
  31. package/dist/input/keyboard/WebXKeyEvent.d.ts +35 -3
  32. package/dist/input/keyboard/WebXKeyEvent.js +115 -3
  33. package/dist/input/keyboard/WebXKeyEvent.js.map +1 -1
  34. package/dist/input/keyboard/WebXKeyPressEvent.d.ts +25 -8
  35. package/dist/input/keyboard/WebXKeyPressEvent.js +29 -11
  36. package/dist/input/keyboard/WebXKeyPressEvent.js.map +1 -1
  37. package/dist/input/keyboard/WebXKeyUpEvent.d.ts +30 -9
  38. package/dist/input/keyboard/WebXKeyUpEvent.js +19 -16
  39. package/dist/input/keyboard/WebXKeyUpEvent.js.map +1 -1
  40. package/dist/input/keyboard/WebXKeyboardModifierState.d.ts +69 -8
  41. package/dist/input/keyboard/WebXKeyboardModifierState.js +69 -8
  42. package/dist/input/keyboard/WebXKeyboardModifierState.js.map +1 -1
  43. package/dist/input/keyboard/WebXKeyboardUtils.d.ts +18 -2
  44. package/dist/input/keyboard/WebXKeyboardUtils.js +18 -2
  45. package/dist/input/keyboard/WebXKeyboardUtils.js.map +1 -1
  46. package/dist/input/keyboard/WebXKeydownEvent.d.ts +26 -9
  47. package/dist/input/keyboard/WebXKeydownEvent.js +17 -22
  48. package/dist/input/keyboard/WebXKeydownEvent.js.map +1 -1
  49. package/dist/input/mouse/WebXMouseState.d.ts +113 -2
  50. package/dist/input/mouse/WebXMouseState.js +104 -2
  51. package/dist/input/mouse/WebXMouseState.js.map +1 -1
  52. package/dist/instruction/WebXConnectInstruction.d.ts +16 -1
  53. package/dist/instruction/WebXConnectInstruction.js +13 -1
  54. package/dist/instruction/WebXConnectInstruction.js.map +1 -1
  55. package/dist/instruction/WebXCursorImageInstruction.d.ts +15 -3
  56. package/dist/instruction/WebXCursorImageInstruction.js +12 -5
  57. package/dist/instruction/WebXCursorImageInstruction.js.map +1 -1
  58. package/dist/instruction/WebXDataAckInstruction.d.ts +22 -5
  59. package/dist/instruction/WebXDataAckInstruction.js +15 -9
  60. package/dist/instruction/WebXDataAckInstruction.js.map +1 -1
  61. package/dist/instruction/WebXImageInstruction.d.ts +14 -3
  62. package/dist/instruction/WebXImageInstruction.js +11 -7
  63. package/dist/instruction/WebXImageInstruction.js.map +1 -1
  64. package/dist/instruction/WebXInstruction.d.ts +26 -10
  65. package/dist/instruction/WebXInstruction.js +19 -25
  66. package/dist/instruction/WebXInstruction.js.map +1 -1
  67. package/dist/instruction/WebXInstructionResponse.d.ts +55 -2
  68. package/dist/instruction/WebXInstructionResponse.js +40 -2
  69. package/dist/instruction/WebXInstructionResponse.js.map +1 -1
  70. package/dist/instruction/WebXInstructionType.d.ts +40 -0
  71. package/dist/instruction/WebXInstructionType.js +40 -0
  72. package/dist/instruction/WebXInstructionType.js.map +1 -1
  73. package/dist/instruction/WebXKeyboardInstruction.d.ts +19 -6
  74. package/dist/instruction/WebXKeyboardInstruction.js +13 -14
  75. package/dist/instruction/WebXKeyboardInstruction.js.map +1 -1
  76. package/dist/instruction/WebXMouseInstruction.d.ts +24 -9
  77. package/dist/instruction/WebXMouseInstruction.js +15 -21
  78. package/dist/instruction/WebXMouseInstruction.js.map +1 -1
  79. package/dist/instruction/WebXPongInstruction.d.ts +15 -3
  80. package/dist/instruction/WebXPongInstruction.js +12 -5
  81. package/dist/instruction/WebXPongInstruction.js.map +1 -1
  82. package/dist/instruction/WebXQualityInstruction.d.ts +16 -4
  83. package/dist/instruction/WebXQualityInstruction.js +13 -8
  84. package/dist/instruction/WebXQualityInstruction.js.map +1 -1
  85. package/dist/instruction/WebXScreenInstruction.d.ts +8 -0
  86. package/dist/instruction/WebXScreenInstruction.js +8 -0
  87. package/dist/instruction/WebXScreenInstruction.js.map +1 -1
  88. package/dist/instruction/WebXWindowsInstruction.d.ts +9 -0
  89. package/dist/instruction/WebXWindowsInstruction.js +9 -0
  90. package/dist/instruction/WebXWindowsInstruction.js.map +1 -1
  91. package/dist/message/WebXCursorImageMessage.d.ts +42 -13
  92. package/dist/message/WebXCursorImageMessage.js +24 -25
  93. package/dist/message/WebXCursorImageMessage.js.map +1 -1
  94. package/dist/message/WebXImageMessage.d.ts +37 -11
  95. package/dist/message/WebXImageMessage.js +22 -21
  96. package/dist/message/WebXImageMessage.js.map +1 -1
  97. package/dist/message/WebXMessage.d.ts +22 -6
  98. package/dist/message/WebXMessage.js +15 -9
  99. package/dist/message/WebXMessage.js.map +1 -1
  100. package/dist/message/WebXMessageType.d.ts +35 -0
  101. package/dist/message/WebXMessageType.js +35 -0
  102. package/dist/message/WebXMessageType.js.map +1 -1
  103. package/dist/message/WebXMouseMessage.d.ts +27 -7
  104. package/dist/message/WebXMouseMessage.js +18 -13
  105. package/dist/message/WebXMouseMessage.js.map +1 -1
  106. package/dist/message/WebXPingMessage.d.ts +9 -0
  107. package/dist/message/WebXPingMessage.js +9 -0
  108. package/dist/message/WebXPingMessage.js.map +1 -1
  109. package/dist/message/WebXQualityMessage.d.ts +36 -11
  110. package/dist/message/WebXQualityMessage.js +21 -21
  111. package/dist/message/WebXQualityMessage.js.map +1 -1
  112. package/dist/message/WebXScreenMessage.d.ts +17 -3
  113. package/dist/message/WebXScreenMessage.js +14 -5
  114. package/dist/message/WebXScreenMessage.js.map +1 -1
  115. package/dist/message/WebXSubImagesMessage.d.ts +27 -7
  116. package/dist/message/WebXSubImagesMessage.js +18 -13
  117. package/dist/message/WebXSubImagesMessage.js.map +1 -1
  118. package/dist/message/WebXWindowsMessage.d.ts +17 -3
  119. package/dist/message/WebXWindowsMessage.js +14 -5
  120. package/dist/message/WebXWindowsMessage.js.map +1 -1
  121. package/dist/tracer/WebXDebugImageMessageHandler.d.ts +30 -0
  122. package/dist/tracer/WebXDebugImageMessageHandler.js +30 -0
  123. package/dist/tracer/WebXDebugImageMessageHandler.js.map +1 -1
  124. package/dist/tracer/WebXHandler.d.ts +11 -0
  125. package/dist/tracer/WebXInstructionHandler.d.ts +17 -0
  126. package/dist/tracer/WebXInstructionHandler.js +6 -0
  127. package/dist/tracer/WebXInstructionHandler.js.map +1 -1
  128. package/dist/tracer/WebXMessageHandler.d.ts +17 -0
  129. package/dist/tracer/WebXMessageHandler.js +6 -0
  130. package/dist/tracer/WebXMessageHandler.js.map +1 -1
  131. package/dist/tracer/WebXStatsHandler.d.ts +16 -0
  132. package/dist/tracer/WebXStatsHandler.js +6 -0
  133. package/dist/tracer/WebXStatsHandler.js.map +1 -1
  134. package/dist/transport/WebXBinarySerializer.d.ts +20 -0
  135. package/dist/transport/WebXBinarySerializer.js +20 -0
  136. package/dist/transport/WebXBinarySerializer.js.map +1 -1
  137. package/dist/transport/WebXInstructionBuffer.d.ts +19 -0
  138. package/dist/transport/WebXInstructionBuffer.js +19 -0
  139. package/dist/transport/WebXInstructionBuffer.js.map +1 -1
  140. package/dist/transport/WebXInstructionEncoder.d.ts +138 -0
  141. package/dist/transport/WebXInstructionEncoder.js +138 -110
  142. package/dist/transport/WebXInstructionEncoder.js.map +1 -1
  143. package/dist/transport/WebXMessageBuffer.d.ts +63 -8
  144. package/dist/transport/WebXMessageBuffer.js +51 -16
  145. package/dist/transport/WebXMessageBuffer.js.map +1 -1
  146. package/dist/transport/WebXMessageDecoder.d.ts +69 -0
  147. package/dist/transport/WebXMessageDecoder.js +96 -18
  148. package/dist/transport/WebXMessageDecoder.js.map +1 -1
  149. package/dist/tunnel/WebXTunnel.d.ts +71 -0
  150. package/dist/tunnel/WebXTunnel.js +51 -4
  151. package/dist/tunnel/WebXTunnel.js.map +1 -1
  152. package/dist/tunnel/WebXWebSocketTunnel.d.ts +26 -0
  153. package/dist/tunnel/WebXWebSocketTunnel.js +26 -0
  154. package/dist/tunnel/WebXWebSocketTunnel.js.map +1 -1
  155. package/dist/utils/ColorGenerator.d.ts +19 -0
  156. package/dist/utils/ColorGenerator.js +19 -0
  157. package/dist/utils/ColorGenerator.js.map +1 -1
  158. package/package.json +1 -1
@@ -1,6 +1,12 @@
1
1
  import * as THREE from 'three';
2
2
  import { WebXTextureFactory } from './WebXTextureFactory';
3
3
  import { Texture } from 'three';
4
+ /**
5
+ * Represents a window in the WebX display.
6
+ *
7
+ * This class manages the rendering of a single window, including its position,
8
+ * size, and texture updates.
9
+ */
4
10
  export declare class WebXWindow {
5
11
  static WINDOW_REFRESH_TIME_MS: number;
6
12
  private static _PLANE_GEOMETRY;
@@ -17,27 +23,138 @@ export declare class WebXWindow {
17
23
  private _width;
18
24
  private _height;
19
25
  private _windowRefreshTimeout;
26
+ /**
27
+ * Gets the THREE.js mesh representing the window.
28
+ *
29
+ * @returns The window mesh.
30
+ */
20
31
  get mesh(): THREE.Mesh;
32
+ /**
33
+ * Gets the color index of the window.
34
+ *
35
+ * @returns The color index as a number.
36
+ */
21
37
  get colorIndex(): number;
38
+ /**
39
+ * Gets the unique ID of the window.
40
+ *
41
+ * @returns The window ID as a number.
42
+ */
22
43
  get id(): number;
44
+ /**
45
+ * Gets the visibility status of the window.
46
+ *
47
+ * @returns True if the window is visible, false otherwise.
48
+ */
23
49
  get visible(): boolean;
50
+ /**
51
+ * Sets the visibility status of the window.
52
+ *
53
+ * @param visible True to make the window visible, false to hide it.
54
+ */
24
55
  private set visible(value);
56
+ /**
57
+ * Gets the color map texture of the window.
58
+ *
59
+ * @returns The color map as a Texture.
60
+ */
25
61
  get colorMap(): Texture;
62
+ /**
63
+ * Sets the color map texture of the window.
64
+ *
65
+ * @param colorMap The new color map as a Texture.
66
+ */
26
67
  private set colorMap(value);
68
+ /**
69
+ * Gets the alpha map texture of the window.
70
+ *
71
+ * @returns The alpha map as a Texture.
72
+ */
27
73
  get alphaMap(): Texture;
74
+ /**
75
+ * Sets the alpha map texture of the window.
76
+ *
77
+ * @param alphaMap The new alpha map as a Texture.
78
+ */
28
79
  private set alphaMap(value);
80
+ /**
81
+ * Checks if the color map is valid.
82
+ *
83
+ * @returns True if the color map is valid, false otherwise.
84
+ */
29
85
  get colorMapValid(): boolean;
86
+ /**
87
+ * Gets the depth of the window.
88
+ *
89
+ * @returns The depth as a number.
90
+ */
30
91
  get depth(): number;
92
+ /**
93
+ * Gets the x-coordinate of the window.
94
+ *
95
+ * @returns The x-coordinate as a number.
96
+ */
31
97
  get x(): number;
98
+ /**
99
+ * Sets the x-coordinate of the window.
100
+ *
101
+ * @param value The new x-coordinate as a number.
102
+ */
32
103
  set x(value: number);
104
+ /**
105
+ * Gets the y-coordinate of the window.
106
+ *
107
+ * @returns The y-coordinate as a number.
108
+ */
33
109
  get y(): number;
110
+ /**
111
+ * Sets the y-coordinate of the window.
112
+ *
113
+ * @param value The new y-coordinate as a number.
114
+ */
34
115
  set y(value: number);
116
+ /**
117
+ * Gets the z-index of the window.
118
+ *
119
+ * @returns The z-index as a number.
120
+ */
35
121
  get z(): number;
122
+ /**
123
+ * Sets the z-index of the window.
124
+ *
125
+ * @param value The new z-index as a number.
126
+ */
36
127
  set z(value: number);
128
+ /**
129
+ * Gets the width of the window.
130
+ *
131
+ * @returns The width as a number.
132
+ */
37
133
  get width(): number;
134
+ /**
135
+ * Sets the width of the window.
136
+ *
137
+ * @param value The new width as a number.
138
+ */
38
139
  set width(value: number);
140
+ /**
141
+ * Gets the height of the window.
142
+ *
143
+ * @returns The height as a number.
144
+ */
39
145
  get height(): number;
146
+ /**
147
+ * Sets the height of the window.
148
+ *
149
+ * @param value The new height as a number.
150
+ */
40
151
  set height(value: number);
152
+ /**
153
+ * Creates a new instance of WebXWindow.
154
+ *
155
+ * @param configuration The properties of the window, such as position and size.
156
+ * @param textureFactory The factory used to create textures for the window.
157
+ */
41
158
  constructor(configuration: {
42
159
  id: number;
43
160
  x: number;
@@ -46,12 +163,47 @@ export declare class WebXWindow {
46
163
  width: number;
47
164
  height: number;
48
165
  }, textureFactory: WebXTextureFactory);
166
+ /**
167
+ * Loads the window image from the texture factory.
168
+ */
49
169
  loadWindowImage(): Promise<void>;
170
+ /**
171
+ * Updates the position and size of the window.
172
+ *
173
+ * @param x The x-coordinate of the window.
174
+ * @param y The y-coordinate of the window.
175
+ * @param z The z-index of the window.
176
+ * @param width The width of the window.
177
+ * @param height The height of the window.
178
+ */
50
179
  setRectangle(x: number, y: number, z: number, width: number, height: number): void;
180
+ /**
181
+ * Updates the textures of the window with new image data.
182
+ *
183
+ * @param depth The depth of the image.
184
+ * @param colorMap The color texture.
185
+ * @param alphaMap The alpha texture.
186
+ * @param isFullWindow Whether to force an update of the textures.
187
+ */
51
188
  updateTexture(depth: number, colorMap: Texture, alphaMap: Texture, isFullWindow: boolean): void;
189
+ /**
190
+ * Updates the scale of the window mesh based on its width and height.
191
+ */
52
192
  private _updateScale;
193
+ /**
194
+ * Updates the position of the window mesh based on its x, y, and z coordinates.
195
+ */
53
196
  private _updatePosition;
197
+ /**
198
+ * Disposes of the resources used by the window.
199
+ */
54
200
  dispose(): void;
201
+ /**
202
+ * Disposes of the color map texture, releasing its resources.
203
+ */
55
204
  private _disposeColorMap;
205
+ /**
206
+ * Disposes of the alpha map texture, releasing its resources.
207
+ */
56
208
  private _disposeAlphaMap;
57
209
  }
@@ -12,79 +12,196 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.WebXWindow = void 0;
13
13
  const THREE = require("three");
14
14
  const three_1 = require("three");
15
+ /**
16
+ * Represents a window in the WebX display.
17
+ *
18
+ * This class manages the rendering of a single window, including its position,
19
+ * size, and texture updates.
20
+ */
15
21
  class WebXWindow {
22
+ /**
23
+ * Gets the THREE.js mesh representing the window.
24
+ *
25
+ * @returns The window mesh.
26
+ */
16
27
  get mesh() {
17
28
  return this._mesh;
18
29
  }
30
+ /**
31
+ * Gets the color index of the window.
32
+ *
33
+ * @returns The color index as a number.
34
+ */
19
35
  get colorIndex() {
20
36
  return this._colorIndex;
21
37
  }
38
+ /**
39
+ * Gets the unique ID of the window.
40
+ *
41
+ * @returns The window ID as a number.
42
+ */
22
43
  get id() {
23
44
  return this._id;
24
45
  }
46
+ /**
47
+ * Gets the visibility status of the window.
48
+ *
49
+ * @returns True if the window is visible, false otherwise.
50
+ */
25
51
  get visible() {
26
52
  return this._material.visible;
27
53
  }
54
+ /**
55
+ * Sets the visibility status of the window.
56
+ *
57
+ * @param visible True to make the window visible, false to hide it.
58
+ */
28
59
  set visible(visible) {
29
60
  if (this._material.visible !== visible) {
30
61
  this._material.visible = visible;
31
62
  }
32
63
  }
64
+ /**
65
+ * Gets the color map texture of the window.
66
+ *
67
+ * @returns The color map as a Texture.
68
+ */
33
69
  get colorMap() {
34
70
  return this._material.map;
35
71
  }
72
+ /**
73
+ * Sets the color map texture of the window.
74
+ *
75
+ * @param colorMap The new color map as a Texture.
76
+ */
36
77
  set colorMap(colorMap) {
37
78
  this._material.map = colorMap;
38
79
  }
80
+ /**
81
+ * Gets the alpha map texture of the window.
82
+ *
83
+ * @returns The alpha map as a Texture.
84
+ */
39
85
  get alphaMap() {
40
86
  return this._material.alphaMap;
41
87
  }
88
+ /**
89
+ * Sets the alpha map texture of the window.
90
+ *
91
+ * @param alphaMap The new alpha map as a Texture.
92
+ */
42
93
  set alphaMap(alphaMap) {
43
94
  this._material.alphaMap = alphaMap;
44
95
  }
96
+ /**
97
+ * Checks if the color map is valid.
98
+ *
99
+ * @returns True if the color map is valid, false otherwise.
100
+ */
45
101
  get colorMapValid() {
46
102
  return this.colorMap != null && this.colorMap.image.width === this._width && this.colorMap.image.height === this._height;
47
103
  }
104
+ /**
105
+ * Gets the depth of the window.
106
+ *
107
+ * @returns The depth as a number.
108
+ */
48
109
  get depth() {
49
110
  return this._depth;
50
111
  }
112
+ /**
113
+ * Gets the x-coordinate of the window.
114
+ *
115
+ * @returns The x-coordinate as a number.
116
+ */
51
117
  get x() {
52
118
  return this._x;
53
119
  }
120
+ /**
121
+ * Sets the x-coordinate of the window.
122
+ *
123
+ * @param value The new x-coordinate as a number.
124
+ */
54
125
  set x(value) {
55
126
  this._x = value;
56
127
  this._updatePosition();
57
128
  }
129
+ /**
130
+ * Gets the y-coordinate of the window.
131
+ *
132
+ * @returns The y-coordinate as a number.
133
+ */
58
134
  get y() {
59
135
  return this._y;
60
136
  }
137
+ /**
138
+ * Sets the y-coordinate of the window.
139
+ *
140
+ * @param value The new y-coordinate as a number.
141
+ */
61
142
  set y(value) {
62
143
  this._y = value;
63
144
  this._updatePosition();
64
145
  }
146
+ /**
147
+ * Gets the z-index of the window.
148
+ *
149
+ * @returns The z-index as a number.
150
+ */
65
151
  get z() {
66
152
  return this._z;
67
153
  }
154
+ /**
155
+ * Sets the z-index of the window.
156
+ *
157
+ * @param value The new z-index as a number.
158
+ */
68
159
  set z(value) {
69
160
  this._z = value;
70
161
  this._updatePosition();
71
162
  }
163
+ /**
164
+ * Gets the width of the window.
165
+ *
166
+ * @returns The width as a number.
167
+ */
72
168
  get width() {
73
169
  return this._width;
74
170
  }
171
+ /**
172
+ * Sets the width of the window.
173
+ *
174
+ * @param value The new width as a number.
175
+ */
75
176
  set width(value) {
76
177
  this._width = value;
77
178
  this._updateScale();
78
179
  this._updatePosition();
79
180
  }
181
+ /**
182
+ * Gets the height of the window.
183
+ *
184
+ * @returns The height as a number.
185
+ */
80
186
  get height() {
81
187
  return this._height;
82
188
  }
189
+ /**
190
+ * Sets the height of the window.
191
+ *
192
+ * @param value The new height as a number.
193
+ */
83
194
  set height(value) {
84
195
  this._height = value;
85
196
  this._updateScale();
86
197
  this._updatePosition();
87
198
  }
199
+ /**
200
+ * Creates a new instance of WebXWindow.
201
+ *
202
+ * @param configuration The properties of the window, such as position and size.
203
+ * @param textureFactory The factory used to create textures for the window.
204
+ */
88
205
  constructor(configuration, textureFactory) {
89
206
  this._width = 1;
90
207
  this._height = 1;
@@ -107,12 +224,24 @@ class WebXWindow {
107
224
  this._updateScale();
108
225
  this._updatePosition();
109
226
  }
227
+ /**
228
+ * Loads the window image from the texture factory.
229
+ */
110
230
  loadWindowImage() {
111
231
  return __awaiter(this, void 0, void 0, function* () {
112
232
  const response = yield this._textureFactory.getWindowTexture(this._id);
113
233
  this.updateTexture(response.depth, response.colorMap, response.alphaMap, true);
114
234
  });
115
235
  }
236
+ /**
237
+ * Updates the position and size of the window.
238
+ *
239
+ * @param x The x-coordinate of the window.
240
+ * @param y The y-coordinate of the window.
241
+ * @param z The z-index of the window.
242
+ * @param width The width of the window.
243
+ * @param height The height of the window.
244
+ */
116
245
  setRectangle(x, y, z, width, height) {
117
246
  this._x = x;
118
247
  this._y = y;
@@ -132,6 +261,14 @@ class WebXWindow {
132
261
  this._updateScale();
133
262
  this._updatePosition();
134
263
  }
264
+ /**
265
+ * Updates the textures of the window with new image data.
266
+ *
267
+ * @param depth The depth of the image.
268
+ * @param colorMap The color texture.
269
+ * @param alphaMap The alpha texture.
270
+ * @param isFullWindow Whether to force an update of the textures.
271
+ */
135
272
  updateTexture(depth, colorMap, alphaMap, isFullWindow) {
136
273
  this._depth = depth;
137
274
  // Dispose of previous texture
@@ -171,12 +308,21 @@ class WebXWindow {
171
308
  }, WebXWindow.WINDOW_REFRESH_TIME_MS);
172
309
  }
173
310
  }
311
+ /**
312
+ * Updates the scale of the window mesh based on its width and height.
313
+ */
174
314
  _updateScale() {
175
315
  this._mesh.scale.set(this._width, this._height, 1);
176
316
  }
317
+ /**
318
+ * Updates the position of the window mesh based on its x, y, and z coordinates.
319
+ */
177
320
  _updatePosition() {
178
321
  this._mesh.position.set(this._x + 0.5 * this._width, this._y + 0.5 * this._height, this._z);
179
322
  }
323
+ /**
324
+ * Disposes of the resources used by the window.
325
+ */
180
326
  dispose() {
181
327
  this._disposeColorMap();
182
328
  this._disposeAlphaMap();
@@ -186,12 +332,18 @@ class WebXWindow {
186
332
  this._windowRefreshTimeout = null;
187
333
  }
188
334
  }
335
+ /**
336
+ * Disposes of the color map texture, releasing its resources.
337
+ */
189
338
  _disposeColorMap() {
190
339
  if (this.colorMap) {
191
340
  this.colorMap.dispose();
192
341
  this.colorMap = null;
193
342
  }
194
343
  }
344
+ /**
345
+ * Disposes of the alpha map texture, releasing its resources.
346
+ */
195
347
  _disposeAlphaMap() {
196
348
  if (this.alphaMap) {
197
349
  this.alphaMap.dispose();
@@ -1 +1 @@
1
- {"version":3,"file":"WebXWindow.js","sourceRoot":"","sources":["../../src/display/WebXWindow.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAA+B;AAE/B,iCAA8C;AAE9C,MAAa,UAAU;IAoBrB,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,IAA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AE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC/B,YAAY,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACzC,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC;QACpC,CAAC;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC;IACH,CAAC;;AAnYH,gCAoYC;AAnYe,iCAAsB,GAAG,IAAI,AAAP,CAAQ;AAC7B,0BAAe,GAAwB,IAAI,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,AAA/D,CAAgE;AAC/E,uBAAY,GAAG,CAAC,AAAJ,CAAK"}
@@ -1,10 +1,35 @@
1
+ /**
2
+ * Represents the properties of a WebX window.
3
+ *
4
+ * These properties define the position, size, and ID of a window in the WebX display.
5
+ */
1
6
  export declare class WebXWindowProperties {
2
- id: number;
3
- x: number;
4
- y: number;
5
- width: number;
6
- height: number;
7
- constructor(configuration: {
7
+ /**
8
+ * The unique identifier of the window.
9
+ */
10
+ readonly id: number;
11
+ /**
12
+ * The x-coordinate of the window.
13
+ */
14
+ readonly x: number;
15
+ /**
16
+ * The y-coordinate of the window.
17
+ */
18
+ readonly y: number;
19
+ /**
20
+ * The width of the window.
21
+ */
22
+ readonly width: number;
23
+ /**
24
+ * The height of the window.
25
+ */
26
+ readonly height: number;
27
+ /**
28
+ * Creates a new instance of WebXWindowProperties.
29
+ *
30
+ * @param properties The properties of the window, including position, size, and ID.
31
+ */
32
+ constructor(properties: {
8
33
  id: number;
9
34
  x: number;
10
35
  y: number;
@@ -1,16 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebXWindowProperties = void 0;
4
+ /**
5
+ * Represents the properties of a WebX window.
6
+ *
7
+ * These properties define the position, size, and ID of a window in the WebX display.
8
+ */
4
9
  class WebXWindowProperties {
5
- constructor(configuration) {
6
- this.width = 1;
7
- this.height = 1;
8
- const { id, x, y, width, height } = configuration;
9
- this.id = id;
10
- this.x = x;
11
- this.y = y;
12
- this.width = width;
13
- this.height = height;
10
+ /**
11
+ * Creates a new instance of WebXWindowProperties.
12
+ *
13
+ * @param properties The properties of the window, including position, size, and ID.
14
+ */
15
+ constructor(properties) {
16
+ this.id = properties.id;
17
+ this.x = properties.x;
18
+ this.y = properties.y;
19
+ this.width = properties.width;
20
+ this.height = properties.height;
14
21
  }
15
22
  }
16
23
  exports.WebXWindowProperties = WebXWindowProperties;
@@ -1 +1 @@
1
- {"version":3,"file":"WebXWindowProperties.js","sourceRoot":"","sources":["../../src/display/WebXWindowProperties.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;IAO/B,YAAY,aAAkF;QAHvF,UAAK,GAAW,CAAC,CAAC;QAClB,WAAM,GAAW,CAAC,CAAC;QAGxB,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;QAClD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAfD,oDAeC"}
1
+ {"version":3,"file":"WebXWindowProperties.js","sourceRoot":"","sources":["../../src/display/WebXWindowProperties.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,oBAAoB;IA0B/B;;;;OAIG;IACH,YAAY,UAA+E;QACzF,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAClC,CAAC;CACF;AAtCD,oDAsCC"}
@@ -1,4 +1,10 @@
1
1
  import { WebXKeyboardModifierState } from './keyboard';
2
+ /**
3
+ * Represents the keyboard input device in the WebX client.
4
+ *
5
+ * This class handles keyboard events, such as key presses and releases,
6
+ * and provides methods to interact with the keyboard state.
7
+ */
2
8
  export declare class WebXKeyboard {
3
9
  private static _NEXT_ID;
4
10
  /**
@@ -76,23 +82,50 @@ export declare class WebXKeyboard {
76
82
  [index: number]: boolean;
77
83
  };
78
84
  /**
79
- * Create a new keyboard instance
80
- * @param element the element to bind the keyboard to
85
+ * Constructs a new WebXKeyboard instance.
86
+ *
87
+ * @param element The HTML element to attach the keyboard events to.
81
88
  */
82
89
  constructor(element: HTMLElement | Document);
90
+ /**
91
+ * Disposes of the keyboard instance and removes event listeners.
92
+ */
83
93
  dispose(): void;
84
94
  /**
85
95
  * Set quirk flags depending on platform/browser, if such information is available
86
96
  */
87
97
  private _handleQuirks;
98
+ /**
99
+ * Adds a keyboard event to the internal event queue.
100
+ *
101
+ * @param event The keyboard event to add.
102
+ */
88
103
  private _addEvent;
89
104
  /**
90
105
  * Bind the keyboard listeners to the given element
91
106
  */
92
107
  private _bindListeners;
108
+ /**
109
+ * Unbinds the keyboard listeners from the associated element.
110
+ */
93
111
  private _unbindListeners;
112
+ /**
113
+ * Handles the keydown event by interpreting and processing it.
114
+ *
115
+ * @param event The keyboard event to handle.
116
+ */
94
117
  private _bindKeyDownListener;
118
+ /**
119
+ * Handles the keypress event by interpreting and processing it.
120
+ *
121
+ * @param event The keyboard event to handle.
122
+ */
95
123
  private _bindKeyPressListener;
124
+ /**
125
+ * Handles the keyup event by interpreting and processing it.
126
+ *
127
+ * @param event The keyboard event to handle.
128
+ */
96
129
  private _bindKeyUpListener;
97
130
  /**
98
131
  * Returns the keyboard location of the key associated with the given
@@ -183,12 +216,14 @@ export declare class WebXKeyboard {
183
216
  */
184
217
  private _handleKeyDown;
185
218
  /**
186
- * Clear the key repeat timers
219
+ * Clears the timers used for key repeat functionality.
187
220
  */
188
221
  private _clearKeyRepeatTimers;
189
222
  /**
190
- * Checks to see if a key is pressed
191
- * @param keysym the key to check
223
+ * Checks if a key is currently pressed.
224
+ *
225
+ * @param keysym The keysym of the key to check.
226
+ * @returns true if the key is pressed, false otherwise.
192
227
  */
193
228
  private _isKeyPressed;
194
229
  /**