[vala/wip/sdl2: 38/42] sdl2: More fixes




commit 7d7b6f037ca32b39d823f73e2bbf20df7aecc0d2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Jan 29 17:23:15 2021 +0100

    sdl2: More fixes

 vapi/sdl2.vapi | 46 ++++++++++++++++++++--------------------------
 1 file changed, 20 insertions(+), 26 deletions(-)
---
diff --git a/vapi/sdl2.vapi b/vapi/sdl2.vapi
index 60b2971ad..987c81f32 100644
--- a/vapi/sdl2.vapi
+++ b/vapi/sdl2.vapi
@@ -2129,7 +2129,7 @@ namespace SDL {
                        public void union_rect (Video.Rect other_rect, out Video.Rect result);
 
                        [CCode (cname = "SDL_EnclosePoints")]
-                       public bool enclose_points (int count, Video.Rect clip, out Video.Rect result);
+                       public static bool enclose_points (Video.Point[] points, Video.Rect clip, out 
Video.Rect result);
 
                        [CCode (cname = "SDL_IntersectRectAndLine")]
                        public bool intersects_withline (out int x1, out int y1, out int x2, out int y2);
@@ -2377,8 +2377,7 @@ namespace SDL {
                }// RendererFlags
 
                [CCode (cprefix = "SDL_", cname = "SDL_RendererInfo", cheader_filename = "SDL2/SDL_render.h")]
-               [Compact]
-               public class RendererInfo {
+               public struct RendererInfo {
 
                        public unowned string name;
                        public uint32 flags;
@@ -2673,7 +2672,7 @@ namespace SDL {
 
                        [Version (since = "2.0.5")]
                        [CCode (cname = "SDL_GetDisplayUsableBounds")]
-                       public int get_usable_bounds (out Video.Rect? rect);
+                       public int get_usable_bounds (out Video.Rect rect);
                }// Display
 
                [CCode (cname = " SDL_SYSWM_TYPE", cprefix = "SDL_SYSWM_", cheader_filename = 
"SDL2/SDL_syswm.h")]
@@ -2859,10 +2858,10 @@ namespace SDL {
                [Compact]
                public class Window {
                        [CCode (cname = "SDL_WINDOWPOS_UNDEFINED_MASK")]
-                       public const uint8 POS_UNDEFINED;
+                       public const uint POS_UNDEFINED;
 
                        [CCode (cname = "SDL_WINDOWPOS_CENTERED_MASK")]
-                       public const uint8 POS_CENTERED;
+                       public const uint POS_CENTERED;
 
                        [CCode (cname = "SDL_NONSHAPEABLE_WINDOW", cheader_filename = "SDL2/SDL_shape.h")]
                        public const int8 SDL_NONSHAPEABLE_WINDOW;
@@ -3025,7 +3024,7 @@ namespace SDL {
                        public int set_gammaramp (uint16 red[256], uint16 green[256], uint16 blue[256]);
 
                        [CCode (cname = "SDL_GetWindowGammaRamp")]
-                       public int get_gammaramp (out uint16 red[256], out uint16 green[256], out uint16 
blue[256]);
+                       public int get_gammaramp ([CCode (array_length = false)] uint16[] red, [CCode 
(array_length = false)] uint16[] green, [CCode (array_length = false)] uint16[] blue);
 
                        [Version (since = "2.0.0")]
                        [CCode (cname = "SDL_GetWindowWMInfo", cheader_filename = "SDL2/SDL_syswm.h")]
@@ -3033,11 +3032,11 @@ namespace SDL {
 
                        [Version (since = "2.0.1")]
                        [CCode (cname = "SDL_GL_GetDrawableSize")]
-                       public void get_gl_drawable_size (out int? w, out int? h);
+                       public void get_gl_drawable_size (out int w, out int h);
 
                        [Version (since = "2.0.5")]
-                       [CCode (cname = "SDL_GetWindowBorderSize")]
-                       public int get_border_size (out int? top, out int? left, out int? bottom, out int? 
right);
+                       [CCode (cname = "SDL_GetWindowBordersSize")]
+                       public int get_borders_size (out int top, out int left, out int bottom, out int 
right);
 
                        [Version (since = "2.0.5")]
                        [CCode (cname = "SDL_SetWindowOpacity")]
@@ -3045,7 +3044,7 @@ namespace SDL {
 
                        [Version (since = "2.0.5")]
                        [CCode (cname = "SDL_GetWindowOpacity")]
-                       public int get_opacity (out float? opacity);
+                       public int get_opacity (out float opacity);
 
                        [Version (since = "2.0.5")]
                        [CCode (cname = "SDL_SetWindowInputFocus")]
@@ -3571,7 +3570,7 @@ namespace SDL {
                        public static Video.Window get_focus ();
 
                        [CCode (cname = "SDL_GetKeyboardState")]
-                       public static unowned uint8* get_raw_state (out size_t length = null);
+                       public static unowned uint8* get_raw_state (out int numkeys = null);
 
                        [CCode (cname = "vala_get_keyboard_state")]
                        public static unowned bool[] get_state () {
@@ -3648,7 +3647,7 @@ namespace SDL {
 
                        [Version (since = "2.0.4")]
                        [CCode (cname = "SDL_GetGlobalMouseState")]
-                       public static uint32 get_global_state (ref int? x, ref int? y);
+                       public static uint32 get_global_state (ref int x, ref int y);
 
                        [CCode (cname = "SDL_GetRelativeMouseState")]
                        public static uint32 get_relative_state (ref int x, ref int y);
@@ -4168,10 +4167,10 @@ namespace SDL {
                [CCode (cname = "SDL_HapticOpen")]
                public Haptic (int device_index);
                [Version (since = "2.0.0")]
-               [CCode (cname = "SDL_HapticOpenfromJoystick")]
+               [CCode (cname = "SDL_HapticOpenFromJoystick")]
                public Haptic.from_joystick (Input.Joystick joystick);
                [Version (since = "2.0.0")]
-               [CCode (cname = "SDL_HapticOpenfromMouse")]
+               [CCode (cname = "SDL_HapticOpenFromMouse")]
                public Haptic.from_mouse ();
                [CCode (cname = "SDL_NumHaptics")]
                public static int num_devices ();
@@ -4181,8 +4180,8 @@ namespace SDL {
                public int upload_effect (HapticEffect? effect);
                [CCode (cname = "SDL_HapticRunEffect")]
                public int run_effect (int effect_id, uint32 iterations);
-               [CCode (cname = "SDl_HapticUpdateEffect")]
-               public int update_effect (int effect_id, HapticEffect new_effect);
+               [CCode (cname = "SDL_HapticUpdateEffect")]
+               public int update_effect (int effect_id, out HapticEffect new_effect);
                [CCode (cname = "SDL_HapticDestroyEffect")]
                public int destroy_effect (int effect_id);
                [CCode (cname = "SDL_HapticGetEffectStatus")]
@@ -4202,7 +4201,7 @@ namespace SDL {
                public int get_index ();
                [CCode (cname = "SDL_HapticSetGain")]
                public int set_gain (int gain);
-               [CCode (cname = "SDL_HapticsetAutocenter")]
+               [CCode (cname = "SDL_HapticSetAutocenter")]
                public int set_autocenter (int percentage);
                [CCode (cname = "SDL_HapticRumbleInit")]
                public int rumble_init ();
@@ -4214,7 +4213,7 @@ namespace SDL {
                public int rumble_supported ();
                [Version (since = "2.0.0")]
                [CCode (cname = "SDL_HapticOpened")]
-               public bool is_open ();
+               public static bool is_open (int device_index);
                [CCode (cname = "SDL_HapticQuery")]
                public uint query ();
                [CCode (cname = "SDL_HapticPause")]
@@ -4356,11 +4355,6 @@ namespace SDL {
                        [CCode (cname = "SDL_CloseAudioDevice")]
                        public void close_device ();
 
-                       [Version (since = "2.0.4")]
-                       [CCode (cname = "SDL_AudioDeviceConnected")]
-                       public bool is_device_connected ();
-
-
                }// AudioDeviceID
 
 
@@ -4409,10 +4403,10 @@ namespace SDL {
                public static void free (ref uint8 audio_buf);
 
                [CCode (cname = "SDL_MixAudio")]
-               public static void mix ([CCode (array_length = false)] ref uint8[] dst, [CCode (array_length 
= false)] uint8[] src, uint32 len, int volume);
+               public static void mix ([CCode (array_length = false)] uint8[] dst, [CCode (array_length = 
false)] uint8[] src, uint32 len, int volume);
 
                [CCode (cname = "SDL_MixAudioFormat")]
-               public static void mix_device ([CCode (array_length = false)] ref uint8[] dst, [CCode 
(array_length = false)] uint8[] src, AudioFormat format, uint32 len, int volume);
+               public static void mix_device ([CCode (array_length = false)] uint8[] dst, [CCode 
(array_length = false)] uint8[] src, AudioFormat format, uint32 len, int volume);
 
                [Version (deprecated = true, replacement = "AudioDevice.do_lock")]
                [CCode (cname = "SDL_LockAudio")]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]