solargraph-dragonruby 0.2.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 (50) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +56 -0
  3. data/CODE_OF_CONDUCT.md +10 -0
  4. data/LICENSE.txt +21 -0
  5. data/NOTICE +8 -0
  6. data/README.md +185 -0
  7. data/Rakefile +13 -0
  8. data/lib/solargraph/dragonruby/convention.rb +43 -0
  9. data/lib/solargraph/dragonruby/macro_node.rb +44 -0
  10. data/lib/solargraph/dragonruby/version.rb +7 -0
  11. data/lib/solargraph/dragonruby.rb +15 -0
  12. data/lib/solargraph-dragonruby.rb +5 -0
  13. data/sig/solargraph/dragonruby.rbs +19 -0
  14. data/stubs/extensions/README.md +20 -0
  15. data/stubs/extensions/args.rb +91 -0
  16. data/stubs/extensions/array.rb +25 -0
  17. data/stubs/extensions/attr.rb +249 -0
  18. data/stubs/extensions/easing.rb +90 -0
  19. data/stubs/extensions/entity.rb +63 -0
  20. data/stubs/extensions/geometry.rb +528 -0
  21. data/stubs/extensions/grid.rb +247 -0
  22. data/stubs/extensions/inputs.rb +678 -0
  23. data/stubs/extensions/layout.rb +175 -0
  24. data/stubs/extensions/log.rb +158 -0
  25. data/stubs/extensions/main.rb +63 -0
  26. data/stubs/extensions/numeric.rb +395 -0
  27. data/stubs/extensions/outputs.rb +132 -0
  28. data/stubs/extensions/runtime.rb +436 -0
  29. data/stubs/extensions/string.rb +85 -0
  30. data/stubs/extensions/typing.rb +193 -0
  31. data/stubs/extensions/zlib.rb +24 -0
  32. data/stubs/upstream/LICENSE.txt +21 -0
  33. data/stubs/upstream/UPSTREAM +2 -0
  34. data/stubs/upstream/args.rb +61 -0
  35. data/stubs/upstream/constants.rb +8 -0
  36. data/stubs/upstream/controller.rb +90 -0
  37. data/stubs/upstream/easing.rb +119 -0
  38. data/stubs/upstream/geometry.rb +430 -0
  39. data/stubs/upstream/globals.rb +17 -0
  40. data/stubs/upstream/gtk.rb +476 -0
  41. data/stubs/upstream/inputs.rb +286 -0
  42. data/stubs/upstream/kernel.rb +7 -0
  43. data/stubs/upstream/keyboard.rb +38 -0
  44. data/stubs/upstream/layout.rb +32 -0
  45. data/stubs/upstream/numeric.rb +82 -0
  46. data/stubs/upstream/outputs.rb +55 -0
  47. data/stubs/upstream/outputs_array.rb +4 -0
  48. data/stubs/upstream/phantom_types.rb +25 -0
  49. data/stubs/upstream/toplevel.rb +13 -0
  50. metadata +107 -0
@@ -0,0 +1,678 @@
1
+ module GTK
2
+ # State of the keyboard keys for one event type (`key_down`, `key_held`,
3
+ # `key_up`, `key_repeat`), e.g. `args.inputs.keyboard.key_down.space`.
4
+ # Each key returns the tick it entered that state, or a falsey value.
5
+ class KeyboardKeys
6
+ # @return [Integer, false, nil]
7
+ attr_reader :alt, :option, :alt_left, :option_left, :alt_right, :option_right, :meta, :command,
8
+ :meta_left, :command_left, :meta_right, :command_right, :control, :ctrl, :control_left, :ctrl_left,
9
+ :control_right, :ctrl_right, :shift, :shift_left, :shift_right, :backspace, :delete, :escape,
10
+ :enter, :tab, :space, :exclamation_point, :open_round_brace, :close_round_brace, :open_curly_brace, :close_curly_brace,
11
+ :open_square_brace, :close_square_brace, :colon, :semicolon, :equal, :hyphen, :dollar, :percent,
12
+ :double_quotation_mark, :single_quotation_mark, :backtick, :tilde, :period, :comma, :pipe, :underscore,
13
+ :left_arrow, :right_arrow, :up_arrow, :down_arrow, :left, :right, :up, :down,
14
+ :pageup, :pagedown, :w_scancode, :a_scancode, :s_scancode, :d_scancode, :up_wasd, :down_wasd,
15
+ :left_wasd, :right_wasd, :ac_back, :ac_home, :ac_forward, :ac_stop, :ac_refresh, :ac_bookmarks,
16
+ :zero, :one, :two, :three, :four, :five, :six, :seven,
17
+ :eight, :nine, :a, :b, :c, :d, :e, :f,
18
+ :g, :h, :i, :j, :k, :l, :m, :n,
19
+ :o, :p, :q, :r, :s, :t, :u, :v,
20
+ :w, :x, :y, :z,
21
+ :caps_lock, :home, :end, :page_up, :page_down, :insert, :print_screen, :scroll_lock, :pause,
22
+ :f1, :f2, :f3, :f4, :f5, :f6, :f7, :f8, :f9, :f10, :f11, :f12,
23
+ :at, :hash, :caret, :ampersand, :asterisk, :plus, :forward_slash, :back_slash,
24
+ :less_than, :greater_than, :question_mark, :section, :ordinal_indicator, :superscript_two,
25
+ :num_lock, :kp_zero, :kp_one, :kp_two, :kp_three, :kp_four, :kp_five, :kp_six, :kp_seven,
26
+ :kp_eight, :kp_nine, :kp_period, :kp_plus, :kp_minus, :kp_multiply, :kp_divide, :kp_enter, :kp_equals
27
+
28
+ # @return [Integer, nil] numeric SDL identifier of the last key in this state
29
+ attr_reader :raw_key
30
+
31
+ # @return [Integer, nil] ascii value of the last key in this state (follows OS key repeat for `key_down`)
32
+ attr_reader :char
33
+
34
+ # @return [Hash{Integer => Integer}] raw SDL keycode states, for keys without a named property
35
+ attr_reader :keycodes
36
+
37
+ # @return [Array<Symbol>] all keys in this state (relatively expensive; avoid calling every frame)
38
+ def truthy_keys; end
39
+
40
+ # True if any of `keys` is in this state. A key ending in `!`
41
+ # (e.g. `:enter!`) is cleared when this returns true, so later checks
42
+ # on the same frame don't see it.
43
+ #
44
+ # @param keys [Array<Symbol>]
45
+ # @return [Boolean]
46
+ def any? keys; end
47
+
48
+ # True if all of `keys` are in this state. Keys ending in `!` are
49
+ # cleared when this returns true (see #any?).
50
+ #
51
+ # @param keys [Array<Symbol>]
52
+ # @return [Boolean]
53
+ def all? keys; end
54
+
55
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from WASD and arrow keys; `nil` if none are in this state
56
+ def directional_vector; end
57
+
58
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from WASD keys only
59
+ def directional_vector_wasd; end
60
+
61
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from arrow keys only
62
+ def directional_vector_arrow; end
63
+
64
+ # @return [Float, nil] angle in degrees of #directional_vector
65
+ def directional_angle; end
66
+
67
+ # @return [Integer] `-1` (left), `0`, or `+1` (right)
68
+ def left_right; end
69
+
70
+ # @return [Integer] `-1` (down), `0`, or `+1` (up)
71
+ def up_down; end
72
+ end
73
+
74
+ class Keyboard
75
+ # @return [GTK::KeyboardKeys] keys pressed on this frame
76
+ attr_reader :key_down
77
+
78
+ # @return [GTK::KeyboardKeys] keys held (all frames after `key_down` until released)
79
+ attr_reader :key_held
80
+
81
+ # @return [GTK::KeyboardKeys] keys released on this frame
82
+ attr_reader :key_up
83
+
84
+ # @return [GTK::KeyboardKeys] keys pressed or repeated, based on OS key repeat speed
85
+ attr_reader :key_repeat
86
+
87
+ # Keys pressed or held, e.g. `args.inputs.keyboard.space`. `hash` is only
88
+ # available on the key states (`keyboard.key_down.hash`), since
89
+ # `keyboard.hash` is Object#hash.
90
+ # @return [Integer, false, nil]
91
+ attr_reader :alt, :option, :alt_left, :option_left, :alt_right, :option_right, :meta, :command,
92
+ :meta_left, :command_left, :meta_right, :command_right, :control, :ctrl, :control_left, :ctrl_left,
93
+ :control_right, :ctrl_right, :shift, :shift_left, :shift_right, :backspace, :delete, :escape,
94
+ :enter, :tab, :space, :exclamation_point, :open_round_brace, :close_round_brace, :open_curly_brace, :close_curly_brace,
95
+ :open_square_brace, :close_square_brace, :colon, :semicolon, :equal, :hyphen, :dollar, :percent,
96
+ :double_quotation_mark, :single_quotation_mark, :backtick, :tilde, :period, :comma, :pipe, :underscore,
97
+ :left_arrow, :right_arrow, :up_arrow, :down_arrow, :pageup, :pagedown, :w_scancode, :a_scancode,
98
+ :s_scancode, :d_scancode, :up_wasd, :down_wasd, :left_wasd, :right_wasd, :ac_back, :ac_home,
99
+ :ac_forward, :ac_stop, :ac_refresh, :ac_bookmarks, :zero, :one, :two, :three,
100
+ :four, :five, :six, :seven, :eight, :nine, :a, :b,
101
+ :c, :d, :e, :f, :g, :h, :i, :j,
102
+ :k, :l, :m, :n, :o, :p, :q, :r,
103
+ :s, :t, :u, :v, :w, :x, :y, :z,
104
+ :caps_lock, :home, :end, :page_up, :page_down, :insert, :print_screen, :scroll_lock, :pause,
105
+ :f1, :f2, :f3, :f4, :f5, :f6, :f7, :f8, :f9, :f10, :f11, :f12,
106
+ :at, :caret, :ampersand, :asterisk, :plus, :forward_slash, :back_slash,
107
+ :less_than, :greater_than, :question_mark, :section, :ordinal_indicator, :superscript_two,
108
+ :num_lock, :kp_zero, :kp_one, :kp_two, :kp_three, :kp_four, :kp_five, :kp_six, :kp_seven,
109
+ :kp_eight, :kp_nine, :kp_period, :kp_plus, :kp_minus, :kp_multiply, :kp_divide, :kp_enter, :kp_equals
110
+
111
+ # @param key [Symbol]
112
+ # @return [Boolean] true if `key` was pressed on this frame
113
+ def key_down? key; end
114
+
115
+ # @param key [Symbol]
116
+ # @return [Boolean] true if `key` was released on this frame
117
+ def key_up? key; end
118
+
119
+ # @param key [Symbol]
120
+ # @return [Boolean] true if `key` is held
121
+ def key_held? key; end
122
+
123
+ # @param key [Symbol]
124
+ # @return [Boolean] true if `key` was pressed on this frame or is held
125
+ def key_down_or_held? key; end
126
+
127
+ # @param key [Symbol]
128
+ # @return [Boolean] true if `key` was pressed or repeated on this frame
129
+ def key_repeat? key; end
130
+
131
+ # @return [Integer] `-1` (left), `0`, or `+1` (right) from WASD keys only
132
+ def left_right_wasd; end
133
+
134
+ # @return [Integer] `-1` (left), `0`, or `+1` (right) from arrow keys only
135
+ def left_right_arrow; end
136
+
137
+ # @return [Integer] `-1` (down), `0`, or `+1` (up) from WASD keys only
138
+ def up_down_wasd; end
139
+
140
+ # @return [Integer] `-1` (down), `0`, or `+1` (up) from arrow keys only
141
+ def up_down_arrow; end
142
+
143
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from WASD keys only; `nil` if none are down or held
144
+ def directional_vector_wasd; end
145
+
146
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from arrow keys only; `nil` if none are down or held
147
+ def directional_vector_arrow; end
148
+
149
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from WASD and arrow keys; `nil` if none are down or held
150
+ def directional_vector; end
151
+
152
+ # @return [Float, nil] angle in degrees of #directional_vector; `nil` if no direction is down or held
153
+ def directional_angle; end
154
+
155
+ # @return [Typing::KeyStatesHash] keys in each state (`down`, `held`, `down_or_held`, `up`, `repeat`)
156
+ def keys; end
157
+ end
158
+
159
+ # Button states for one event type (`key_down`, `key_held`, `key_up`),
160
+ # e.g. `args.inputs.controller_one.key_down.a`.
161
+ class ControllerKeys
162
+ # @return [Integer, false, nil] tick the button entered this state, or a falsey value
163
+ attr_reader :a, :b, :x, :y, :l1, :r1, :l2, :r2, :l3, :r3, :start, :select,
164
+ :up, :down, :left, :right,
165
+ :directional_up, :directional_down, :directional_left, :directional_right,
166
+ :n, :north, :s, :south, :e, :east, :w, :west,
167
+ :cross, :circle, :square, :triangle
168
+
169
+ # @return [Array<Symbol>] all buttons in this state
170
+ def truthy_keys; end
171
+
172
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from the directions in this state; `nil` if none
173
+ def directional_vector; end
174
+
175
+ # @return [Float, nil] angle in degrees of #directional_vector
176
+ def directional_angle; end
177
+
178
+ # @return [Integer] `-1` (left), `0`, or `+1` (right)
179
+ def left_right; end
180
+
181
+ # @return [Integer] `-1` (down), `0`, or `+1` (up)
182
+ def up_down; end
183
+ end
184
+
185
+ class Controller
186
+ # @return [GTK::ControllerKeys] buttons pressed on this frame
187
+ attr_reader :key_down
188
+
189
+ # @return [GTK::ControllerKeys] buttons held (all frames after `key_down` until released)
190
+ attr_reader :key_held
191
+
192
+ # @return [GTK::ControllerKeys] buttons released on this frame
193
+ attr_reader :key_up
194
+
195
+ # Face button aliases. Cardinal names (`n`/`north`, ...) are recommended
196
+ # over `a`/`b`/`x`/`y`, whose positions vary between controllers.
197
+ #
198
+ # @return [Boolean]
199
+ attr_reader :n, :north, :s, :south, :e, :east, :w, :west,
200
+ :cross, :circle, :square, :triangle
201
+
202
+ # @return [Boolean] the south face button (east on a Nintendo Switch Pro Controller); use for confirm
203
+ def accept; end
204
+
205
+ # @return [Boolean] the east face button (south on a Nintendo Switch Pro Controller); use for back
206
+ def cancel; end
207
+
208
+ # @return [Boolean] true if up is pressed or held on the dpad only (analog is not consulted)
209
+ def up_dpad; end
210
+
211
+ # @return [Boolean] true if down is pressed or held on the dpad only
212
+ def down_dpad; end
213
+
214
+ # @return [Boolean] true if left is pressed or held on the dpad only
215
+ def left_dpad; end
216
+
217
+ # @return [Boolean] true if right is pressed or held on the dpad only
218
+ def right_dpad; end
219
+
220
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from the dpad only; `nil` if nothing is pressed
221
+ def directional_vector_dpad; end
222
+
223
+ # @return [Typing::PointHash] normalized `x`, `y` from the left analog stick
224
+ def directional_vector_left_analog; end
225
+
226
+ # @return [Typing::PointHash, nil] cardinal-snapped `x`, `y` from the left analog stick; `nil` at rest
227
+ def directional_vector_left_analog_cardinal; end
228
+
229
+ # @return [Typing::PointHash] normalized `x`, `y` from the right analog stick
230
+ def directional_vector_right_analog; end
231
+
232
+ # @return [Typing::PointHash, nil] cardinal-snapped `x`, `y` from the right analog stick; `nil` at rest
233
+ def directional_vector_right_analog_cardinal; end
234
+
235
+ # @return [Typing::PointHash] normalized `x`, `y` from the dpad and left analog stick
236
+ def directional_vector_left; end
237
+
238
+ # @return [Typing::PointHash] normalized `x`, `y` from the right analog stick, falling back to the face buttons
239
+ def directional_vector_right; end
240
+
241
+ # @return [Typing::PointHash] normalized `x`, `y` using the face buttons as directions (twin-stick style)
242
+ def directional_vector_buttons; end
243
+
244
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from the dpad and left analog stick; `nil` at rest
245
+ def directional_vector; end
246
+
247
+ # @return [Float, nil] angle in degrees of #directional_vector; `nil` at rest
248
+ def directional_angle; end
249
+
250
+ # @return [Float] angle of the left analog stick in degrees
251
+ def left_analog_angle; end
252
+
253
+ # @return [Float] angle of the right analog stick in degrees
254
+ def right_analog_angle; end
255
+
256
+ # Raw analog value below which the stick is considered at rest (default `3600`).
257
+ # @return [Integer]
258
+ attr_accessor :analog_dead_zone
259
+
260
+ # @param key [Symbol]
261
+ # @return [Boolean]
262
+ def key_down? key; end
263
+
264
+ # @param key [Symbol]
265
+ # @return [Boolean]
266
+ def key_up? key; end
267
+
268
+ # @param key [Symbol]
269
+ # @return [Boolean]
270
+ def key_held? key; end
271
+
272
+ # @param key [Symbol]
273
+ # @return [Boolean]
274
+ def key_down_or_held? key; end
275
+ end
276
+
277
+ # One mouse button, via `args.inputs.mouse.buttons.(left|middle|right|x1|x2)`.
278
+ class MouseButton
279
+ # @return [Symbol] `:left`, `:middle`, `:right`, `:x1`, or `:x2`
280
+ attr_reader :id
281
+
282
+ # @return [Integer] `0` to `4`
283
+ attr_reader :index
284
+
285
+ # @return [GTK::MousePoint, nil] where and when the button was clicked/down, or `nil`
286
+ attr_reader :click
287
+
288
+ # @return [Integer, nil] `Kernel.tick_count` of the click
289
+ attr_reader :click_at
290
+
291
+ # @return [Integer, nil] `Kernel.global_tick_count` of the click
292
+ attr_reader :global_click_at
293
+
294
+ # @return [GTK::MousePoint, nil] where and when the button was released, or `nil`
295
+ attr_reader :up
296
+
297
+ # @return [Integer, nil] `Kernel.tick_count` of the release
298
+ attr_reader :up_at
299
+
300
+ # @return [Integer, nil] `Kernel.global_tick_count` of the release
301
+ attr_reader :global_up_at
302
+
303
+ # @return [GTK::MousePoint, nil] current position and when the hold started, or `nil`
304
+ attr_reader :held
305
+
306
+ # @return [Integer, nil] `Kernel.tick_count` the hold started
307
+ attr_reader :held_at
308
+
309
+ # @return [Integer, nil] `Kernel.global_tick_count` the hold started
310
+ attr_reader :global_held_at
311
+
312
+ # @return [GTK::MousePoint, nil] same as #click
313
+ attr_reader :down
314
+
315
+ # @return [Integer, nil] same as #click_at
316
+ attr_reader :down_at
317
+
318
+ # @return [Integer, nil] same as #global_click_at
319
+ attr_reader :global_down_at
320
+
321
+ # @return [GTK::MousePoint, nil] the previous click of this button
322
+ attr_reader :previous_click
323
+
324
+ # @return [Numeric] mouse position
325
+ attr_reader :x, :y
326
+
327
+ # @return [Integer] ticks the button has been held (`0` if it isn't)
328
+ def held_duration; end
329
+
330
+ # The click, if the button was exclusively determined to be a click
331
+ # (released quickly without moving far) and won't be considered held.
332
+ #
333
+ # @return [GTK::MousePoint, nil] where and when the click happened, or `nil`
334
+ def buffered_click; end
335
+
336
+ # The hold, if the button was exclusively determined to be held (pressed
337
+ # long enough or dragged) and won't be considered a click.
338
+ #
339
+ # @return [GTK::MousePoint, nil] current position and when the hold started, or `nil`
340
+ def buffered_held; end
341
+ end
342
+
343
+ class MouseButtons
344
+ # @return [GTK::MouseButton]
345
+ attr_reader :left, :middle, :right, :x1, :x2
346
+ end
347
+
348
+ class Mouse
349
+ # Per-button state, for telling a held drag apart from a click.
350
+ #
351
+ # @return [GTK::MouseButtons]
352
+ attr_reader :buttons
353
+
354
+ # MouseButton#buffered_click of the first button that has one.
355
+ #
356
+ # @return [GTK::MousePoint, nil]
357
+ def buffered_click; end
358
+
359
+ # MouseButton#buffered_held of the first button that has one.
360
+ #
361
+ # @return [GTK::MousePoint, nil]
362
+ def buffered_held; end
363
+
364
+ # Buttons pressed on this frame, e.g. `args.inputs.mouse.key_down.left`.
365
+ #
366
+ # @return [GTK::MouseKeys]
367
+ attr_reader :key_down
368
+
369
+ # Buttons held (all frames after `key_down` until released).
370
+ #
371
+ # @return [GTK::MouseKeys]
372
+ attr_reader :key_held
373
+
374
+ # Buttons released on this frame.
375
+ #
376
+ # @return [GTK::MouseKeys]
377
+ attr_reader :key_up
378
+
379
+ # The mouse as a zero-size rect. `offset` (`{ x:, y: }`) is added to the
380
+ # position, e.g. to get the mouse relative to a render target's origin.
381
+ #
382
+ # @param offset [Typing::Point, Object, nil]
383
+ # @return [Typing::RectHash] `{ x:, y:, w: 0, h: 0 }`
384
+ def rect offset: nil; end
385
+
386
+ # @param center_point [Typing::Point, Object] responds to `x`, `y`
387
+ # @param radius [Float]
388
+ # @return [Boolean] true if the mouse is inside the circle
389
+ def inside_circle? center_point, radius; end
390
+
391
+ # @return [Typing::PointHash, nil] wheel movement on each axis this frame, or `nil`
392
+ attr_reader :wheel
393
+
394
+ # The mouse position. `offset` (`{ x:, y: }`) is added to it.
395
+ #
396
+ # @param offset [Typing::Point, Object, nil]
397
+ # @return [Typing::RectHash] `{ x:, y:, w: 0, h: 0 }`
398
+ def point offset: nil; end
399
+
400
+ # Same as #point.
401
+ #
402
+ # @param offset [Typing::Point, Object, nil]
403
+ # @return [Typing::RectHash] `{ x:, y:, w: 0, h: 0 }`
404
+ def position offset: nil; end
405
+
406
+ # @param rect [Typing::Rect, Object] responds to `x`, `y`, `w`, `h`
407
+ # @param offset [Typing::Point, Object, nil] added to the mouse position first
408
+ # @return [Boolean] true if the mouse is inside `rect`
409
+ def inside_rect? rect, offset: nil; end
410
+
411
+ # @param other_rect [Typing::Rect, Object] responds to `x`, `y`, `w`, `h`
412
+ # @param offset [Typing::Point, Object, nil] ignored by the runtime
413
+ # @return [Boolean] true if the mouse intersects `other_rect`
414
+ def intersect_rect? other_rect, offset: nil; end
415
+
416
+ # @return [Typing::RectHash] #point offset by `Grid.allscreen_offset`
417
+ def point_allscreen_offset; end
418
+
419
+ # @return [Typing::RectHash] #rect offset by `Grid.allscreen_offset`
420
+ def rect_allscreen_offset; end
421
+
422
+ # @return [Integer] always `0`
423
+ def w; end
424
+
425
+ # @return [Integer] always `0`
426
+ def h; end
427
+
428
+ # @return [GTK::MousePoint, nil] the left button's click or hold, if either
429
+ def left; end
430
+
431
+ # @return [GTK::MousePoint, nil] the middle button's click or hold, if either
432
+ def middle; end
433
+
434
+ # @return [GTK::MousePoint, nil] the right button's click or hold, if either
435
+ def right; end
436
+
437
+ # @return [GTK::MousePoint, nil] the x1 button's click or hold, if either
438
+ def x1; end
439
+
440
+ # @return [GTK::MousePoint, nil] the x2 button's click or hold, if either
441
+ def x2; end
442
+
443
+ # @return [Boolean] true if the x1 (back) button is down
444
+ attr_reader :button_x1
445
+
446
+ # @return [Boolean] true if the x2 (forward) button is down
447
+ attr_reader :button_x2
448
+
449
+ # @return [GTK::MousePoint, nil] the left button's hold
450
+ def held; end
451
+
452
+ # @return [Integer, nil] `Kernel.tick_count` the left button was clicked
453
+ def click_at; end
454
+
455
+ # @return [Integer, nil] `Kernel.global_tick_count` the left button was clicked
456
+ def global_click_at; end
457
+
458
+ # @return [Integer, nil] `Kernel.tick_count` the left button's hold started
459
+ def held_at; end
460
+
461
+ # @return [Integer, nil] `Kernel.global_tick_count` the left button's hold started
462
+ def global_held_at; end
463
+
464
+ # @return [Integer, nil] `Kernel.tick_count` the left button was released
465
+ def up_at; end
466
+
467
+ # @return [Integer, nil] `Kernel.global_tick_count` the left button was released
468
+ def global_up_at; end
469
+
470
+ # @return [Integer, nil] `Kernel.tick_count` the mouse last moved
471
+ attr_reader :moved_at
472
+
473
+ # @return [Integer, nil] `Kernel.global_tick_count` the mouse last moved
474
+ attr_reader :global_moved_at
475
+
476
+ # @return [Integer, nil] `Kernel.tick_count` if the mouse was used on this frame
477
+ attr_reader :active
478
+
479
+ # @param key [Symbol] `:left`, `:middle`, `:right`, `:x1`, or `:x2`
480
+ # @return [GTK::MousePoint, nil]
481
+ def key_down? key; end
482
+
483
+ # @param key [Symbol]
484
+ # @return [GTK::MousePoint, nil]
485
+ def key_up? key; end
486
+
487
+ # @param key [Symbol]
488
+ # @return [GTK::MousePoint, nil]
489
+ def key_held? key; end
490
+
491
+ # @param key [Symbol]
492
+ # @return [GTK::MousePoint, nil]
493
+ def key_down_or_held? key; end
494
+ end
495
+
496
+ # Mouse button states for one event type, via
497
+ # `args.inputs.mouse.(key_down|key_held|key_up)`.
498
+ class MouseKeys
499
+ # @return [GTK::MousePoint, nil] where and when the button entered this state, or `nil`
500
+ attr_reader :left, :middle, :right, :x1, :x2
501
+ end
502
+
503
+ # One touch point, from the values of `args.inputs.touch` (touch devices only).
504
+ class FingerTouch
505
+ # @return [Numeric]
506
+ attr_reader :x, :y
507
+
508
+ # @return [Numeric] position on the previous frame
509
+ attr_reader :previous_x, :previous_y
510
+
511
+ # @return [Boolean] true if the finger moved on this frame
512
+ attr_reader :moved
513
+
514
+ # @return [Integer] `Kernel.tick_count` the finger last moved
515
+ attr_reader :moved_at
516
+
517
+ # @return [Integer] `Kernel.global_tick_count` the finger last moved
518
+ attr_reader :global_moved_at
519
+
520
+ # @return [Integer] `Kernel.tick_count` the finger touched down
521
+ attr_reader :down_at
522
+
523
+ # @return [Integer] `Kernel.global_tick_count` the finger touched down
524
+ attr_reader :global_down_at
525
+
526
+ # @return [Integer] `0` for the first finger down, `1` for the second, ...
527
+ attr_reader :touch_order
528
+
529
+ # @return [Typing::PointHash] `{ x:, y: }`
530
+ def point; end
531
+
532
+ # @return [Typing::PointHash] `{ x:, y: }` (same as #point)
533
+ def position; end
534
+
535
+ # @param rect [Typing::Rect, Object] responds to `x`, `y`, `w`, `h`
536
+ # @return [Boolean]
537
+ def inside_rect? rect; end
538
+
539
+ # @param center [Typing::Point, Object] responds to `x`, `y`
540
+ # @param radius [Numeric]
541
+ # @return [Boolean]
542
+ def inside_circle? center, radius; end
543
+ end
544
+
545
+ # Directional state shared by the keyboard (arrows and WASD) and
546
+ # `controller_one` for one event type, via
547
+ # `args.inputs.(key_down|key_held|key_up)`, e.g. `args.inputs.key_down.left`.
548
+ class KeyboardOrControllerKeys
549
+ # @return [Integer, Boolean, nil] truthy if the direction entered this state
550
+ attr_reader :up, :down, :left, :right
551
+
552
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from the directions in this state; `nil` if none
553
+ def directional_vector; end
554
+
555
+ # @return [Float, nil] angle in degrees of #directional_vector
556
+ def directional_angle; end
557
+
558
+ # @return [Integer] `-1` (left), `0`, or `+1` (right)
559
+ def left_right; end
560
+
561
+ # @return [Integer] `-1` (down), `0`, or `+1` (up)
562
+ def up_down; end
563
+ end
564
+
565
+ class MousePoint
566
+ # @return [Typing::RectHash] `x`, `y` of the click, with `w`, `h` always `0`
567
+ attr_reader :point
568
+
569
+ # @param rect [Typing::Rect, Object] responds to `x`, `y`, `w`, `h`
570
+ # @return [Boolean] true if the click is inside `rect`
571
+ def inside_rect? rect; end
572
+
573
+ # @param center_point [Typing::Point, Object] responds to `x`, `y`
574
+ # @param radius [Float]
575
+ # @return [Boolean] true if the click is inside the circle
576
+ def inside_circle? center_point, radius; end
577
+
578
+ # @return [Numeric]
579
+ attr_accessor :x, :y
580
+ end
581
+
582
+ class Inputs
583
+ # Text typed since the last frame, including IME/international input.
584
+ # Only populated after `DR.start_text_input` (on touch devices that also
585
+ # shows the on-screen keyboard; `DR.stop_text_input` dismisses it). For
586
+ # simple key handling prefer `args.inputs.keyboard.key_down.char`.
587
+ #
588
+ # @return [Array<String>]
589
+ def text; end
590
+
591
+ # Pending requests to the in-game web server started with
592
+ # `DR.start_server!`. Respond to each with `request.respond 200, "ok"`.
593
+ #
594
+ # Pro license.
595
+ #
596
+ # @return [Array<GTK::Runtime::HTTPRequest>]
597
+ attr_reader :http_requests
598
+
599
+ # All current touch points keyed by touch id (touch devices only).
600
+ #
601
+ # @return [Hash{Integer => GTK::FingerTouch}]
602
+ attr_reader :touch
603
+
604
+ # A touch point on the left half of the screen, as a 1x1 rect.
605
+ #
606
+ # @return [Typing::RectHash, nil]
607
+ attr_reader :finger_left
608
+
609
+ # A touch point on the right half of the screen, as a 1x1 rect.
610
+ #
611
+ # @return [Typing::RectHash, nil]
612
+ attr_reader :finger_right
613
+
614
+ # Directions pressed on this frame on the keyboard or `controller_one`,
615
+ # e.g. `args.inputs.key_down.left`.
616
+ #
617
+ # @return [GTK::KeyboardOrControllerKeys]
618
+ def key_down; end
619
+
620
+ # Directions held on the keyboard or `controller_one`.
621
+ #
622
+ # @return [GTK::KeyboardOrControllerKeys]
623
+ def key_held; end
624
+
625
+ # Directions released on this frame on the keyboard or `controller_one`.
626
+ #
627
+ # @return [GTK::KeyboardOrControllerKeys]
628
+ def key_up; end
629
+
630
+ # Same as #left_right.
631
+ # @return [Integer] `-1` (left), `0`, or `+1` (right)
632
+ def left_right_with_wasd; end
633
+
634
+ # Same as #left_right_perc.
635
+ # @return [Float] `-1.0` to `1.0`
636
+ def left_right_perc_with_wasd; end
637
+
638
+ # @return [Integer] `-1` (left), `0`, or `+1` (right) from the arrow keys and dpad only (no WASD or analog)
639
+ def left_right_arrow; end
640
+
641
+ # Same as #left_right_arrow.
642
+ # @return [Integer] `-1` (left), `0`, or `+1` (right)
643
+ def left_right_dpad; end
644
+
645
+ # Same as #left_right_directional_perc: the left analog stick, falling
646
+ # back to the dpad and arrow keys (no WASD).
647
+ # @return [Float] `-1.0` to `1.0`
648
+ def left_right_perc_dpad; end
649
+
650
+ # Same as #up_down.
651
+ # @return [Integer] `-1` (down), `0`, or `+1` (up)
652
+ def up_down_with_wasd; end
653
+
654
+ # @return [Integer] `-1` (down), `0`, or `+1` (up) from the arrow keys and dpad only (no WASD or analog)
655
+ def up_down_arrow; end
656
+
657
+ # @return [Typing::PointHash, nil] normalized `x`, `y` from the keyboard, falling back to `controller_one`; `nil` at rest
658
+ def directional_vector; end
659
+
660
+ # @return [Float, nil] angle in degrees of #directional_vector; `nil` at rest
661
+ def directional_angle; end
662
+
663
+ # @return [GTK::FingerTouch, nil] the first finger touching the screen
664
+ attr_reader :finger_one
665
+
666
+ # @return [GTK::FingerTouch, nil] the second finger touching the screen
667
+ attr_reader :finger_two
668
+
669
+ # Change in distance between two fingers on this frame (positive when
670
+ # pinching in). The mouse wheel also sets it. `0` when not pinching.
671
+ #
672
+ # @return [Numeric]
673
+ attr_reader :pinch_zoom
674
+
675
+ # @return [Boolean] true if the device supports touch
676
+ def touch_enabled?; end
677
+ end
678
+ end