sfml3-rb 0.2.2 → 0.3.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.
- checksums.yaml +4 -4
- data/.yardopts +9 -0
- data/CHANGELOG.md +43 -17
- data/README.md +97 -29
- data/ext/audio/audio_enums.c +58 -20
- data/ext/audio/listener.c +89 -6
- data/ext/audio/music.c +206 -5
- data/ext/audio/sound.c +175 -5
- data/ext/audio/sound_buffer.c +189 -47
- data/ext/audio/sound_buffer_recorder.c +83 -16
- data/ext/audio/sound_recorder.c +172 -52
- data/ext/audio/sound_source_cone.c +108 -29
- data/ext/audio/sound_stream.c +178 -5
- data/ext/core/exceptions.c +10 -8
- data/ext/core/unicode.c +12 -2
- data/ext/ext.c +4 -0
- data/ext/graphics/blend_mode.c +203 -53
- data/ext/graphics/circle.c +271 -4
- data/ext/graphics/color.c +240 -90
- data/ext/graphics/drawable.c +15 -4
- data/ext/graphics/font.c +138 -25
- data/ext/graphics/glyph.c +31 -8
- data/ext/graphics/image.c +180 -37
- data/ext/graphics/polygon.c +293 -26
- data/ext/graphics/rect.c +211 -54
- data/ext/graphics/rectangle.c +279 -26
- data/ext/graphics/render_state.c +116 -2
- data/ext/graphics/render_texture.c +163 -2
- data/ext/graphics/shader.c +283 -17
- data/ext/graphics/shape.c +252 -26
- data/ext/graphics/sprite.c +216 -25
- data/ext/graphics/stencil_mode.c +148 -39
- data/ext/graphics/target.c +67 -22
- data/ext/graphics/target.h +15 -15
- data/ext/graphics/text.c +306 -6
- data/ext/graphics/texture.c +257 -3
- data/ext/graphics/transform.c +178 -5
- data/ext/graphics/transformable.c +126 -2
- data/ext/graphics/vertex.c +79 -2
- data/ext/graphics/vertex_array.c +128 -16
- data/ext/graphics/vertex_buffer.c +124 -2
- data/ext/graphics/view.c +130 -2
- data/ext/network/ftp.c +249 -10
- data/ext/network/http.c +156 -38
- data/ext/network/ip_address.c +107 -26
- data/ext/network/network_enums.c +248 -141
- data/ext/network/packet.c +273 -39
- data/ext/network/socket_selector.c +91 -19
- data/ext/network/tcp_listener.c +75 -16
- data/ext/network/tcp_socket.c +128 -25
- data/ext/network/udp_socket.c +122 -26
- data/ext/ports.rb +7 -0
- data/ext/system/buffer.c +41 -12
- data/ext/system/clock.c +68 -9
- data/ext/system/input_stream.c +94 -42
- data/ext/system/sleep.c +10 -2
- data/ext/system/time.c +172 -34
- data/ext/system/vec2.c +156 -35
- data/ext/system/vec3.c +166 -35
- data/ext/window/clipboard.c +47 -17
- data/ext/window/context.c +59 -9
- data/ext/window/context_settings.c +116 -38
- data/ext/window/cursor.c +39 -9
- data/ext/window/event.c +163 -42
- data/ext/window/joystick.c +69 -3
- data/ext/window/keyboard.c +168 -116
- data/ext/window/mouse.c +36 -2
- data/ext/window/sensor.c +28 -2
- data/ext/window/touch.c +20 -2
- data/ext/window/video_mode.c +90 -19
- data/ext/window/vulkan.c +34 -6
- data/ext/window/window.c +340 -16
- data/lib/sfml/version.rb +1 -1
- data/sig/audio/audio_enums.rbs +30 -0
- data/sig/audio/listener.rbs +16 -0
- data/sig/audio/music.rbs +56 -0
- data/sig/audio/sound.rbs +51 -0
- data/sig/audio/sound_buffer.rbs +17 -0
- data/sig/audio/sound_buffer_recorder.rbs +14 -0
- data/sig/audio/sound_recorder.rbs +17 -0
- data/sig/audio/sound_source_cone.rbs +14 -0
- data/sig/audio/sound_stream.rbs +51 -0
- data/sig/graphics/blend_mode.rbs +29 -0
- data/sig/graphics/circle.rbs +44 -0
- data/sig/graphics/color.rbs +39 -0
- data/sig/graphics/drawable.rbs +5 -0
- data/sig/graphics/font.rbs +20 -0
- data/sig/graphics/glyph.rbs +7 -0
- data/sig/graphics/image.rbs +22 -0
- data/sig/graphics/polygon.rbs +42 -0
- data/sig/graphics/rect.rbs +33 -0
- data/sig/graphics/rectangle.rbs +42 -0
- data/sig/graphics/render_state.rbs +21 -0
- data/sig/graphics/render_texture.rbs +37 -0
- data/sig/graphics/shader.rbs +39 -0
- data/sig/graphics/shape.rbs +38 -0
- data/sig/graphics/sprite.rbs +34 -0
- data/sig/graphics/stencil_mode.rbs +18 -0
- data/sig/graphics/target.rbs +10 -0
- data/sig/graphics/text.rbs +48 -0
- data/sig/graphics/texture.rbs +34 -0
- data/sig/graphics/transform.rbs +37 -0
- data/sig/graphics/transformable.rbs +25 -0
- data/sig/graphics/vertex.rbs +17 -0
- data/sig/graphics/vertex_array.rbs +17 -0
- data/sig/graphics/vertex_buffer.rbs +22 -0
- data/sig/graphics/view.rbs +24 -0
- data/sig/network/ftp.rbs +46 -0
- data/sig/network/http.rbs +27 -0
- data/sig/network/ip_address.rbs +22 -0
- data/sig/network/network_enums.rbs +95 -0
- data/sig/network/packet.rbs +40 -0
- data/sig/network/socket_selector.rbs +14 -0
- data/sig/network/tcp_listener.rbs +13 -0
- data/sig/network/tcp_socket.rbs +18 -0
- data/sig/network/udp_socket.rbs +17 -0
- data/sig/system/buffer.rbs +11 -0
- data/sig/system/clock.rbs +13 -0
- data/sig/system/input_stream.rbs +7 -0
- data/sig/system/sleep.rbs +3 -0
- data/sig/system/time.rbs +28 -0
- data/sig/system/vec2.rbs +26 -0
- data/sig/system/vec3.rbs +27 -0
- data/sig/window/clipboard.rbs +8 -0
- data/sig/window/context.rbs +11 -0
- data/sig/window/context_settings.rbs +20 -0
- data/sig/window/cursor.rbs +6 -0
- data/sig/window/event.rbs +20 -0
- data/sig/window/joystick.rbs +15 -0
- data/sig/window/keyboard.rbs +10 -0
- data/sig/window/mouse.rbs +9 -0
- data/sig/window/sensor.rbs +8 -0
- data/sig/window/touch.rbs +6 -0
- data/sig/window/video_mode.rbs +16 -0
- data/sig/window/vulkan.rbs +7 -0
- data/sig/window/window.rbs +57 -0
- metadata +66 -2
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Text
|
|
3
|
+
def self.new: () -> Text
|
|
4
|
+
| (untyped font) -> Text
|
|
5
|
+
| (untyped font, String string) -> Text
|
|
6
|
+
| (untyped font, String string, Integer character_size) -> Text
|
|
7
|
+
|
|
8
|
+
def copy: () -> Text
|
|
9
|
+
def font: () -> untyped
|
|
10
|
+
def string: () -> String
|
|
11
|
+
def character_size: () -> Integer
|
|
12
|
+
def style: () -> Integer
|
|
13
|
+
def fill_color: () -> untyped
|
|
14
|
+
def outline_color: () -> untyped
|
|
15
|
+
def outline_thickness: () -> Float
|
|
16
|
+
def letter_spacing: () -> Float
|
|
17
|
+
def line_spacing: () -> Float
|
|
18
|
+
def position: () -> Vector2
|
|
19
|
+
def rotation: () -> Float
|
|
20
|
+
def scale: () -> Vector2
|
|
21
|
+
def origin: () -> Vector2
|
|
22
|
+
def transform: () -> Array[Float]
|
|
23
|
+
def inverse_transform: () -> Array[Float]
|
|
24
|
+
def matrix: () -> Array[Float]
|
|
25
|
+
def find_character_pos: (Integer index) -> Vector2
|
|
26
|
+
def local_bounds: () -> untyped
|
|
27
|
+
def global_bounds: () -> untyped
|
|
28
|
+
|
|
29
|
+
def font=: (untyped value) -> untyped
|
|
30
|
+
def string=: (String value) -> String
|
|
31
|
+
def character_size=: (Integer value) -> Integer
|
|
32
|
+
def style=: (Integer | Symbol value) -> (Integer | Symbol)
|
|
33
|
+
def fill_color=: (untyped value) -> untyped
|
|
34
|
+
def outline_color=: (untyped value) -> untyped
|
|
35
|
+
def outline_thickness=: (Float value) -> Float
|
|
36
|
+
def letter_spacing=: (Float value) -> Float
|
|
37
|
+
def line_spacing=: (Float value) -> Float
|
|
38
|
+
def position=: (Vector2 value) -> Vector2
|
|
39
|
+
def rotation=: (Float value) -> Float
|
|
40
|
+
def scale=: (Vector2 value) -> Vector2
|
|
41
|
+
def origin=: (Vector2 value) -> Vector2
|
|
42
|
+
|
|
43
|
+
def move: (Vector2 offset) -> self
|
|
44
|
+
def rotate: (Float angle) -> self
|
|
45
|
+
def scale!: (Vector2 factors) -> self
|
|
46
|
+
def draw: (untyped target, untyped state) -> nil
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Texture
|
|
3
|
+
def self.new: (Vector2 size) -> Texture
|
|
4
|
+
def self.srgb: (Vector2 size) -> Texture
|
|
5
|
+
def self.from_file: (String path, ?untyped area) -> Texture
|
|
6
|
+
def self.srgb_from_file: (String path, ?untyped area) -> Texture
|
|
7
|
+
def self.from_memory: (String data, ?untyped area) -> Texture
|
|
8
|
+
def self.srgb_from_memory: (String data, ?untyped area) -> Texture
|
|
9
|
+
def self.from_stream: (untyped stream, ?untyped area) -> Texture
|
|
10
|
+
def self.srgb_from_stream: (untyped stream, ?untyped area) -> Texture
|
|
11
|
+
def self.from_image: (untyped image, ?untyped area) -> Texture
|
|
12
|
+
def self.srgb_from_image: (untyped image, ?untyped area) -> Texture
|
|
13
|
+
def self.maximum_size: () -> Integer
|
|
14
|
+
|
|
15
|
+
def copy: () -> Texture
|
|
16
|
+
def size: () -> Vector2
|
|
17
|
+
def resize: (Vector2 size) -> bool
|
|
18
|
+
def resize_srgb: (Vector2 size) -> bool
|
|
19
|
+
def swap: (Texture other) -> self
|
|
20
|
+
def copy_to_image: () -> untyped
|
|
21
|
+
def update_from_pixels: (String pixels, Vector2 size, Vector2 offset) -> self
|
|
22
|
+
def update_from_image: (untyped image, Vector2 offset) -> self
|
|
23
|
+
def update_from_texture: (Texture source, Vector2 offset) -> self
|
|
24
|
+
def update_from_window: (untyped window, Vector2 offset) -> self
|
|
25
|
+
def smooth=: (bool value) -> bool
|
|
26
|
+
def smooth?: () -> bool
|
|
27
|
+
def srgb?: () -> bool
|
|
28
|
+
def repeated=: (bool value) -> bool
|
|
29
|
+
def repeated?: () -> bool
|
|
30
|
+
def generate_mipmap: () -> bool
|
|
31
|
+
def native_handle: () -> Integer
|
|
32
|
+
def bind: (?untyped coordinate_type) -> self
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Transform
|
|
3
|
+
def initialize: () -> void
|
|
4
|
+
| (Array[Float] array_of_9) -> void
|
|
5
|
+
| (Float, Float, Float, Float, Float, Float, Float, Float, Float) -> void
|
|
6
|
+
|
|
7
|
+
def self.identity: () -> Transform
|
|
8
|
+
def self.from_a: (Array[Float] array_of_9) -> Transform
|
|
9
|
+
def self.combine: (Array[Float] array_a, Array[Float] array_b) -> Array[Float]
|
|
10
|
+
def self.inverse: (Array[Float] array) -> Array[Float]
|
|
11
|
+
|
|
12
|
+
def to_a: () -> Array[Float]
|
|
13
|
+
def to_ary: () -> Array[Float]
|
|
14
|
+
def matrix: () -> Array[Float]
|
|
15
|
+
def gl_matrix: () -> Array[Float]
|
|
16
|
+
def ==: (untyped other) -> bool
|
|
17
|
+
def to_s: () -> String
|
|
18
|
+
def inspect: () -> String
|
|
19
|
+
|
|
20
|
+
def copy: () -> Transform
|
|
21
|
+
def inverse: () -> Transform
|
|
22
|
+
def transform_point: (untyped point) -> untyped
|
|
23
|
+
def transform_rect: (untyped rect) -> untyped
|
|
24
|
+
|
|
25
|
+
def *: (Transform | Array[Float] other) -> Transform
|
|
26
|
+
def combine: (Transform | Array[Float] other) -> Transform
|
|
27
|
+
def combine!: (Transform | Array[Float] other) -> self
|
|
28
|
+
def translate: (untyped offset) -> Transform
|
|
29
|
+
def translate!: (untyped offset) -> self
|
|
30
|
+
def rotate: (Float angle, ?untyped center) -> Transform
|
|
31
|
+
def rotate!: (Float angle, ?untyped center) -> self
|
|
32
|
+
def scale: (untyped factors, ?untyped center) -> Transform
|
|
33
|
+
def scale!: (untyped factors, ?untyped center) -> self
|
|
34
|
+
|
|
35
|
+
IDENTITY: Transform
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Transformable
|
|
3
|
+
def self.new: () -> Transformable
|
|
4
|
+
|
|
5
|
+
def position=: (Vector2 value) -> self
|
|
6
|
+
def rotation=: (Float value) -> self
|
|
7
|
+
def scale=: (Vector2 value) -> self
|
|
8
|
+
def origin=: (Vector2 value) -> self
|
|
9
|
+
|
|
10
|
+
def position: () -> Vector2
|
|
11
|
+
def rotation: () -> Float
|
|
12
|
+
def scale: () -> Vector2
|
|
13
|
+
def origin: () -> Vector2
|
|
14
|
+
|
|
15
|
+
def move: (Vector2 offset) -> self
|
|
16
|
+
def rotate: (Float angle) -> self
|
|
17
|
+
def scale!: (Vector2 factors) -> self
|
|
18
|
+
|
|
19
|
+
def transform: () -> Array[Float]
|
|
20
|
+
def matrix: () -> Array[Float]
|
|
21
|
+
def inverse_transform: () -> Array[Float]
|
|
22
|
+
|
|
23
|
+
def copy: () -> Transformable
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Vertex
|
|
3
|
+
def self.new: () -> Vertex
|
|
4
|
+
| (Vector2 position) -> Vertex
|
|
5
|
+
| (Vector2 position, untyped color) -> Vertex
|
|
6
|
+
| (Vector2 position, untyped color, Vector2 tex_coords) -> Vertex
|
|
7
|
+
|
|
8
|
+
def position: () -> Vector2
|
|
9
|
+
def position=: (Vector2 value) -> Vector2
|
|
10
|
+
def color: () -> untyped
|
|
11
|
+
def color=: (untyped value) -> untyped
|
|
12
|
+
def tex_coords: () -> Vector2
|
|
13
|
+
def tex_coords=: (Vector2 value) -> Vector2
|
|
14
|
+
def to_a: () -> [Vector2, untyped]
|
|
15
|
+
def ==: (untyped other) -> bool
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class VertexArray
|
|
3
|
+
def self.new: () -> VertexArray
|
|
4
|
+
|
|
5
|
+
def copy: () -> VertexArray
|
|
6
|
+
def vertex_count: () -> Integer
|
|
7
|
+
def vertex: (Integer index) -> Vertex
|
|
8
|
+
def set_vertex: (Integer index, Vertex vertex) -> Vertex
|
|
9
|
+
def append: (Vertex vertex) -> self
|
|
10
|
+
def clear!: () -> self
|
|
11
|
+
def resize: (Integer count) -> self
|
|
12
|
+
def primitive: () -> Symbol
|
|
13
|
+
def primitive=: (Symbol value) -> Symbol
|
|
14
|
+
def bounds: () -> untyped
|
|
15
|
+
def draw: (untyped target, untyped state) -> nil
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class VertexBuffer
|
|
3
|
+
def self.new: () -> VertexBuffer
|
|
4
|
+
| (Integer count) -> VertexBuffer
|
|
5
|
+
| (Integer count, Symbol primitive) -> VertexBuffer
|
|
6
|
+
| (Integer count, Symbol primitive, Symbol usage) -> VertexBuffer
|
|
7
|
+
def self.available?: () -> bool
|
|
8
|
+
|
|
9
|
+
def copy: () -> VertexBuffer
|
|
10
|
+
def vertex_count: () -> Integer
|
|
11
|
+
def update: (Array[untyped] vertices, ?Integer offset) -> bool
|
|
12
|
+
def update_from: (VertexBuffer other) -> bool
|
|
13
|
+
def swap: (VertexBuffer other) -> self
|
|
14
|
+
def primitive: () -> Symbol
|
|
15
|
+
def primitive=: (Symbol value) -> Symbol
|
|
16
|
+
def usage: () -> Symbol
|
|
17
|
+
def usage=: (Symbol value) -> Symbol
|
|
18
|
+
def native_handle: () -> Integer
|
|
19
|
+
def bind: () -> self
|
|
20
|
+
def draw: (untyped target, untyped state) -> nil
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class View
|
|
3
|
+
def self.new: () -> View
|
|
4
|
+
def self.from_rect: (untyped rect) -> View
|
|
5
|
+
|
|
6
|
+
def initialize: () -> void
|
|
7
|
+
def move: (Vector2 offset) -> self
|
|
8
|
+
def rotate: (Float angle) -> self
|
|
9
|
+
def zoom: (Float factor) -> self
|
|
10
|
+
def copy: () -> View
|
|
11
|
+
|
|
12
|
+
def rotation=: (Float value) -> self
|
|
13
|
+
def size=: (Vector2 value) -> self
|
|
14
|
+
def center=: (Vector2 value) -> self
|
|
15
|
+
def viewport=: (untyped value) -> self
|
|
16
|
+
def scissor=: (untyped value) -> self
|
|
17
|
+
|
|
18
|
+
def rotation: () -> Float
|
|
19
|
+
def size: () -> Vector2
|
|
20
|
+
def center: () -> Vector2
|
|
21
|
+
def viewport: () -> untyped
|
|
22
|
+
def scissor: () -> untyped
|
|
23
|
+
end
|
|
24
|
+
end
|
data/sig/network/ftp.rbs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Ftp
|
|
3
|
+
def self.new: () -> Ftp
|
|
4
|
+
|
|
5
|
+
def connect: (IpAddress | String | Integer address, ?Integer port, ?Time timeout) -> FtpResponse
|
|
6
|
+
def login_anonymous: () -> FtpResponse
|
|
7
|
+
def login: (String name, String password) -> FtpResponse
|
|
8
|
+
def disconnect: () -> FtpResponse
|
|
9
|
+
def keep_alive: () -> FtpResponse
|
|
10
|
+
def working_directory: () -> FtpDirectoryResponse
|
|
11
|
+
def directory_listing: (?String? directory) -> FtpListingResponse
|
|
12
|
+
def change_directory: (String directory) -> FtpResponse
|
|
13
|
+
def parent_directory: () -> FtpResponse
|
|
14
|
+
def create_directory: (String name) -> FtpResponse
|
|
15
|
+
def delete_directory: (String name) -> FtpResponse
|
|
16
|
+
def rename_file: (String file, String new_name) -> FtpResponse
|
|
17
|
+
def delete_file: (String name) -> FtpResponse
|
|
18
|
+
def download: (String remote_file, String local_path, ?Symbol | Integer mode) -> FtpResponse
|
|
19
|
+
def upload: (String local_file, String remote_path, ?Symbol | Integer mode, ?bool append) -> FtpResponse
|
|
20
|
+
def send_command: (String command, ?String? parameter) -> FtpResponse
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class FtpResponse
|
|
24
|
+
def ok?: () -> bool
|
|
25
|
+
def status: () -> Integer
|
|
26
|
+
def status_name: () -> Symbol
|
|
27
|
+
def message: () -> String
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class FtpDirectoryResponse
|
|
31
|
+
def ok?: () -> bool
|
|
32
|
+
def status: () -> Integer
|
|
33
|
+
def status_name: () -> Symbol
|
|
34
|
+
def message: () -> String
|
|
35
|
+
def directory: () -> String
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class FtpListingResponse
|
|
39
|
+
def ok?: () -> bool
|
|
40
|
+
def status: () -> Integer
|
|
41
|
+
def status_name: () -> Symbol
|
|
42
|
+
def message: () -> String
|
|
43
|
+
def count: () -> Integer
|
|
44
|
+
def name: (Integer index) -> String
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Http
|
|
3
|
+
def self.new: () -> Http
|
|
4
|
+
|
|
5
|
+
def set_host: (String host, ?Integer port) -> self
|
|
6
|
+
def send_request: (HttpRequest request, ?Time timeout) -> HttpResponse
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class HttpRequest
|
|
10
|
+
def self.new: () -> HttpRequest
|
|
11
|
+
|
|
12
|
+
def set_field: (String field, String value) -> String
|
|
13
|
+
def method=: (Symbol | Integer value) -> (Symbol | Integer)
|
|
14
|
+
def uri=: (String value) -> String
|
|
15
|
+
def set_http_version: (Integer major, Integer minor) -> [Integer, Integer]
|
|
16
|
+
def body=: (String value) -> String
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class HttpResponse
|
|
20
|
+
def field: (String name) -> String?
|
|
21
|
+
def status: () -> Integer
|
|
22
|
+
def status_name: () -> Symbol
|
|
23
|
+
def major_version: () -> Integer
|
|
24
|
+
def minor_version: () -> Integer
|
|
25
|
+
def body: () -> String
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class IpAddress
|
|
3
|
+
def self.new: (Integer | String | IpAddress address) -> IpAddress
|
|
4
|
+
def self.from_string: (String address) -> IpAddress
|
|
5
|
+
def self.from_bytes: (Integer byte0, Integer byte1, Integer byte2, Integer byte3) -> IpAddress
|
|
6
|
+
def self.from_integer: (Integer value) -> IpAddress
|
|
7
|
+
def self.local_address: () -> IpAddress
|
|
8
|
+
def self.public_address: (?Time timeout) -> IpAddress
|
|
9
|
+
|
|
10
|
+
def to_s: () -> String
|
|
11
|
+
def to_str: () -> String
|
|
12
|
+
def to_integer: () -> Integer
|
|
13
|
+
def hash: () -> Integer
|
|
14
|
+
def ==: (untyped other) -> bool
|
|
15
|
+
def eql?: (untyped other) -> bool
|
|
16
|
+
|
|
17
|
+
NONE: IpAddress
|
|
18
|
+
ANY: IpAddress
|
|
19
|
+
LOCAL_HOST: IpAddress
|
|
20
|
+
BROADCAST: IpAddress
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
module SocketStatus
|
|
3
|
+
DONE: Integer
|
|
4
|
+
NOT_READY: Integer
|
|
5
|
+
PARTIAL: Integer
|
|
6
|
+
DISCONNECTED: Integer
|
|
7
|
+
ERROR: Integer
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
module HttpMethod
|
|
11
|
+
GET: Integer
|
|
12
|
+
POST: Integer
|
|
13
|
+
HEAD: Integer
|
|
14
|
+
PUT: Integer
|
|
15
|
+
DELETE: Integer
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
module HttpStatus
|
|
19
|
+
OK: Integer
|
|
20
|
+
CREATED: Integer
|
|
21
|
+
ACCEPTED: Integer
|
|
22
|
+
NO_CONTENT: Integer
|
|
23
|
+
RESET_CONTENT: Integer
|
|
24
|
+
PARTIAL_CONTENT: Integer
|
|
25
|
+
MULTIPLE_CHOICES: Integer
|
|
26
|
+
MOVED_PERMANENTLY: Integer
|
|
27
|
+
MOVED_TEMPORARILY: Integer
|
|
28
|
+
NOT_MODIFIED: Integer
|
|
29
|
+
BAD_REQUEST: Integer
|
|
30
|
+
UNAUTHORIZED: Integer
|
|
31
|
+
FORBIDDEN: Integer
|
|
32
|
+
NOT_FOUND: Integer
|
|
33
|
+
RANGE_NOT_SATISFIABLE: Integer
|
|
34
|
+
INTERNAL_SERVER_ERROR: Integer
|
|
35
|
+
NOT_IMPLEMENTED: Integer
|
|
36
|
+
BAD_GATEWAY: Integer
|
|
37
|
+
SERVICE_NOT_AVAILABLE: Integer
|
|
38
|
+
GATEWAY_TIMEOUT: Integer
|
|
39
|
+
VERSION_NOT_SUPPORTED: Integer
|
|
40
|
+
INVALID_RESPONSE: Integer
|
|
41
|
+
CONNECTION_FAILED: Integer
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
module FtpTransferMode
|
|
45
|
+
BINARY: Integer
|
|
46
|
+
ASCII: Integer
|
|
47
|
+
EBCDIC: Integer
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
module FtpStatus
|
|
51
|
+
RESTART_MARKER_REPLY: Integer
|
|
52
|
+
SERVICE_READY_SOON: Integer
|
|
53
|
+
DATA_CONNECTION_ALREADY_OPENED: Integer
|
|
54
|
+
OPENING_DATA_CONNECTION: Integer
|
|
55
|
+
OK: Integer
|
|
56
|
+
POINTLESS_COMMAND: Integer
|
|
57
|
+
SYSTEM_STATUS: Integer
|
|
58
|
+
DIRECTORY_STATUS: Integer
|
|
59
|
+
FILE_STATUS: Integer
|
|
60
|
+
HELP_MESSAGE: Integer
|
|
61
|
+
SYSTEM_TYPE: Integer
|
|
62
|
+
SERVICE_READY: Integer
|
|
63
|
+
CLOSING_CONNECTION: Integer
|
|
64
|
+
DATA_CONNECTION_OPENED: Integer
|
|
65
|
+
CLOSING_DATA_CONNECTION: Integer
|
|
66
|
+
ENTERING_PASSIVE_MODE: Integer
|
|
67
|
+
LOGGED_IN: Integer
|
|
68
|
+
FILE_ACTION_OK: Integer
|
|
69
|
+
DIRECTORY_OK: Integer
|
|
70
|
+
NEED_PASSWORD: Integer
|
|
71
|
+
NEED_ACCOUNT_TO_LOG_IN: Integer
|
|
72
|
+
NEED_INFORMATION: Integer
|
|
73
|
+
SERVICE_UNAVAILABLE: Integer
|
|
74
|
+
DATA_CONNECTION_UNAVAILABLE: Integer
|
|
75
|
+
TRANSFER_ABORTED: Integer
|
|
76
|
+
FILE_ACTION_ABORTED: Integer
|
|
77
|
+
LOCAL_ERROR: Integer
|
|
78
|
+
INSUFFICIENT_STORAGE_SPACE: Integer
|
|
79
|
+
COMMAND_UNKNOWN: Integer
|
|
80
|
+
PARAMETERS_UNKNOWN: Integer
|
|
81
|
+
COMMAND_NOT_IMPLEMENTED: Integer
|
|
82
|
+
BAD_COMMAND_SEQUENCE: Integer
|
|
83
|
+
PARAMETER_NOT_IMPLEMENTED: Integer
|
|
84
|
+
NOT_LOGGED_IN: Integer
|
|
85
|
+
NEED_ACCOUNT_TO_STORE: Integer
|
|
86
|
+
FILE_UNAVAILABLE: Integer
|
|
87
|
+
PAGE_TYPE_UNKNOWN: Integer
|
|
88
|
+
NOT_ENOUGH_MEMORY: Integer
|
|
89
|
+
FILENAME_NOT_ALLOWED: Integer
|
|
90
|
+
INVALID_RESPONSE: Integer
|
|
91
|
+
CONNECTION_FAILED: Integer
|
|
92
|
+
CONNECTION_CLOSED: Integer
|
|
93
|
+
INVALID_FILE: Integer
|
|
94
|
+
end
|
|
95
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Packet
|
|
3
|
+
def self.new: () -> Packet
|
|
4
|
+
|
|
5
|
+
def copy: () -> Packet
|
|
6
|
+
def append: (String data) -> self
|
|
7
|
+
def clear: () -> self
|
|
8
|
+
def data: () -> String
|
|
9
|
+
def data_size: () -> Integer
|
|
10
|
+
def read_position: () -> Integer
|
|
11
|
+
def end_of_packet?: () -> bool
|
|
12
|
+
def can_read?: () -> bool
|
|
13
|
+
|
|
14
|
+
def read_bool: () -> bool
|
|
15
|
+
def read_int8: () -> Integer
|
|
16
|
+
def read_uint8: () -> Integer
|
|
17
|
+
def read_int16: () -> Integer
|
|
18
|
+
def read_uint16: () -> Integer
|
|
19
|
+
def read_int32: () -> Integer
|
|
20
|
+
def read_uint32: () -> Integer
|
|
21
|
+
def read_int64: () -> Integer
|
|
22
|
+
def read_uint64: () -> Integer
|
|
23
|
+
def read_float: () -> Float
|
|
24
|
+
def read_double: () -> Float
|
|
25
|
+
def read_string: () -> String
|
|
26
|
+
|
|
27
|
+
def write_bool: (bool value) -> bool
|
|
28
|
+
def write_int8: (Integer value) -> Integer
|
|
29
|
+
def write_uint8: (Integer value) -> Integer
|
|
30
|
+
def write_int16: (Integer value) -> Integer
|
|
31
|
+
def write_uint16: (Integer value) -> Integer
|
|
32
|
+
def write_int32: (Integer value) -> Integer
|
|
33
|
+
def write_uint32: (Integer value) -> Integer
|
|
34
|
+
def write_int64: (Integer value) -> Integer
|
|
35
|
+
def write_uint64: (Integer value) -> Integer
|
|
36
|
+
def write_float: (Float value) -> Float
|
|
37
|
+
def write_double: (Float value) -> Float
|
|
38
|
+
def write_string: (String value) -> String
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class SocketSelector
|
|
3
|
+
def self.new: () -> SocketSelector
|
|
4
|
+
|
|
5
|
+
def copy: () -> SocketSelector
|
|
6
|
+
def add: (TcpListener | TcpSocket | UdpSocket socket) -> self
|
|
7
|
+
def remove: (TcpListener | TcpSocket | UdpSocket socket) -> self
|
|
8
|
+
def clear: () -> self
|
|
9
|
+
def wait: (?Time timeout) -> bool
|
|
10
|
+
def tcp_listener_ready?: (TcpListener listener) -> bool
|
|
11
|
+
def tcp_socket_ready?: (TcpSocket socket) -> bool
|
|
12
|
+
def udp_socket_ready?: (UdpSocket socket) -> bool
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class TcpListener
|
|
3
|
+
def self.new: () -> TcpListener
|
|
4
|
+
def self.any_port: () -> Integer
|
|
5
|
+
|
|
6
|
+
def blocking?: () -> bool
|
|
7
|
+
def blocking=: (bool value) -> bool
|
|
8
|
+
def local_port: () -> Integer
|
|
9
|
+
def listen: (Integer port, ?IpAddress address) -> Symbol
|
|
10
|
+
def close: () -> self
|
|
11
|
+
def accept: () -> [TcpSocket?, Symbol]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class TcpSocket
|
|
3
|
+
def self.new: () -> TcpSocket
|
|
4
|
+
|
|
5
|
+
def blocking?: () -> bool
|
|
6
|
+
def blocking=: (bool value) -> bool
|
|
7
|
+
def local_port: () -> Integer
|
|
8
|
+
def remote_address: () -> IpAddress
|
|
9
|
+
def remote_port: () -> Integer
|
|
10
|
+
def connect: (IpAddress | String | Integer address, Integer port, ?Time timeout) -> Symbol
|
|
11
|
+
def disconnect: () -> self
|
|
12
|
+
def send: (String data) -> Symbol
|
|
13
|
+
def send_partial: (String data) -> [Integer, Symbol]
|
|
14
|
+
def receive: (?Integer max_length) -> [String, Symbol]
|
|
15
|
+
def send_packet: (Packet packet) -> Symbol
|
|
16
|
+
def receive_packet: (Packet packet) -> Symbol
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class UdpSocket
|
|
3
|
+
def self.new: () -> UdpSocket
|
|
4
|
+
def self.any_port: () -> Integer
|
|
5
|
+
def self.max_datagram_size: () -> Integer
|
|
6
|
+
|
|
7
|
+
def blocking?: () -> bool
|
|
8
|
+
def blocking=: (bool value) -> bool
|
|
9
|
+
def local_port: () -> Integer
|
|
10
|
+
def bind: (Integer port, ?IpAddress address) -> Symbol
|
|
11
|
+
def unbind: () -> self
|
|
12
|
+
def send: (String data, IpAddress | String | Integer address, Integer port) -> Symbol
|
|
13
|
+
def receive: (?Integer max_length) -> [String, IpAddress, Integer, Symbol]
|
|
14
|
+
def send_packet: (Packet packet, IpAddress | String | Integer address, Integer port) -> Symbol
|
|
15
|
+
def receive_packet: (Packet packet) -> [IpAddress, Integer, Symbol]
|
|
16
|
+
end
|
|
17
|
+
end
|
data/sig/system/time.rbs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Time
|
|
3
|
+
include Comparable
|
|
4
|
+
|
|
5
|
+
def self.new: () -> Time
|
|
6
|
+
| (Float seconds) -> Time
|
|
7
|
+
| (Integer microseconds) -> Time
|
|
8
|
+
| (Time other) -> Time
|
|
9
|
+
def self.seconds: (Float value) -> Time
|
|
10
|
+
def self.milliseconds: (Integer value) -> Time
|
|
11
|
+
def self.microseconds: (Integer value) -> Time
|
|
12
|
+
def self.zero: () -> Time
|
|
13
|
+
|
|
14
|
+
def as_seconds: () -> Float
|
|
15
|
+
def as_milliseconds: () -> Integer
|
|
16
|
+
def as_microseconds: () -> Integer
|
|
17
|
+
def to_f: () -> Float
|
|
18
|
+
def to_i: () -> Integer
|
|
19
|
+
def +: (Time other) -> Time
|
|
20
|
+
def -: (Time other) -> Time
|
|
21
|
+
def *: (Float scalar) -> Time
|
|
22
|
+
def /: (Time other) -> Float
|
|
23
|
+
| (Float other) -> Time
|
|
24
|
+
def <=>: (Time other) -> Integer
|
|
25
|
+
def ==: (untyped other) -> bool
|
|
26
|
+
def to_s: () -> String
|
|
27
|
+
end
|
|
28
|
+
end
|
data/sig/system/vec2.rbs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Vector2
|
|
3
|
+
include Enumerable[Float]
|
|
4
|
+
|
|
5
|
+
def self.new: () -> Vector2
|
|
6
|
+
| (Float x, Float y) -> Vector2
|
|
7
|
+
| (Array[Float] xy) -> Vector2
|
|
8
|
+
| (Vector2 other) -> Vector2
|
|
9
|
+
|
|
10
|
+
def x: () -> Float
|
|
11
|
+
def x=: (Float value) -> Float
|
|
12
|
+
def y: () -> Float
|
|
13
|
+
def y=: (Float value) -> Float
|
|
14
|
+
def to_a: () -> [Float, Float]
|
|
15
|
+
def to_ary: () -> [Float, Float]
|
|
16
|
+
def each: () { (Float) -> void } -> self
|
|
17
|
+
def []: (Integer index) -> Float
|
|
18
|
+
def size: () -> Integer
|
|
19
|
+
def length: () -> Integer
|
|
20
|
+
def ==: (untyped other) -> bool
|
|
21
|
+
def +: (Vector2 | Array[Float] other) -> Vector2
|
|
22
|
+
def -: (Vector2 | Array[Float] other) -> Vector2
|
|
23
|
+
def *: (Float scalar) -> Vector2
|
|
24
|
+
def to_s: () -> String
|
|
25
|
+
end
|
|
26
|
+
end
|
data/sig/system/vec3.rbs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module SFML
|
|
2
|
+
class Vector3
|
|
3
|
+
include Enumerable[Float]
|
|
4
|
+
|
|
5
|
+
def self.new: () -> Vector3
|
|
6
|
+
| (Float x, Float y, Float z) -> Vector3
|
|
7
|
+
| (Array[Float] xyz) -> Vector3
|
|
8
|
+
| (Vector3 other) -> Vector3
|
|
9
|
+
|
|
10
|
+
def x: () -> Float
|
|
11
|
+
def x=: (Float value) -> Float
|
|
12
|
+
def y: () -> Float
|
|
13
|
+
def y=: (Float value) -> Float
|
|
14
|
+
def z: () -> Float
|
|
15
|
+
def z=: (Float value) -> Float
|
|
16
|
+
def to_a: () -> [Float, Float, Float]
|
|
17
|
+
def to_ary: () -> [Float, Float, Float]
|
|
18
|
+
def each: () { (Float) -> void } -> self
|
|
19
|
+
def size: () -> Integer
|
|
20
|
+
def length: () -> Integer
|
|
21
|
+
def ==: (untyped other) -> bool
|
|
22
|
+
def +: (Vector3 | Array[Float] other) -> Vector3
|
|
23
|
+
def -: (Vector3 | Array[Float] other) -> Vector3
|
|
24
|
+
def *: (Float scalar) -> Vector3
|
|
25
|
+
def to_s: () -> String
|
|
26
|
+
end
|
|
27
|
+
end
|