[vala/wip/sdl2: 34/42] sdl2: Fix instance methods




commit 3f78c7bd68cf305d49d6f4ed25798a9bde091744
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jan 25 16:47:23 2021 +0100

    sdl2: Fix instance methods

 vapi/sdl2.vapi | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)
---
diff --git a/vapi/sdl2.vapi b/vapi/sdl2.vapi
index d15cfc612..0d89af276 100644
--- a/vapi/sdl2.vapi
+++ b/vapi/sdl2.vapi
@@ -2066,10 +2066,10 @@ namespace SDL {
                        UYVY, YVYU;
 
                        [CCode (cname = "SDL_DEFINE_PIXELFOURCC")]
-                       public PixelRAWFormat define_from_four_cc (char a, char b, char c, char d);
+                       public static PixelRAWFormat define_from_four_cc (char a, char b, char c, char d);
 
                        [CCode (cname = "SDL_DEFINE_PIXELFORMAT")]
-                       public PixelRAWFormat define (Video.PixelType type, Video.BitmapOrder order, 
Video.PackedLayout layout, uchar bits, uchar bytes);
+                       public static PixelRAWFormat define (Video.PixelType type, Video.BitmapOrder order, 
Video.PackedLayout layout, uchar bits, uchar bytes);
 
                        [CCode (cname = "SDL_PIXELFLAG")]
                        public uchar get_pixel_flag ();
@@ -2139,8 +2139,8 @@ namespace SDL {
                        public bool is_equal (Video.Rect other_rect);
 
                        [Version (since = "2.0.4")]
-                       [CCode (cname = "SDL_PointInRect", instance_pos = 1)]
-                       public bool contains_point (Video.Point p);
+                       [CCode (cname = "SDL_PointInRect", instance_pos = -1)]
+                       public bool contains_point (Video.Point? p);
                        [CCode (cname = "SDL_HasIntersection")]
                        public bool is_intersecting (Video.Rect other_rect);
 
@@ -2159,7 +2159,7 @@ namespace SDL {
 
 
 
-               [CCode (cname = "SDL_Palette", cheader_filename = "SDL2/SDL_pixels.h", cprefix = "SDL_", 
free_function = "SDL_FreePalette", ref_function = "SDL_Palette_up", unref_function = "SDL_FreePalette")]
+               [CCode (cname = "SDL_Palette", cheader_filename = "SDL2/SDL_pixels.h", free_function = 
"SDL_FreePalette", ref_function = "SDL_Palette_up", unref_function = "SDL_FreePalette")]
                public class Palette {
                        [CCode (array_length_cexpr = "ncolors", array_length_type = "int")]
                        public Video.Color[] colors;
@@ -2177,7 +2177,7 @@ namespace SDL {
                        public int set_colors (Video.Color[] colors, int first_color);
                }
 
-               [CCode (cname = "SDL_PixelFormat", cheader_filename = "SDL2/SDL_pixels.h", cprefix = "SDL_", 
free_function = "SDL_FreeFormat", ref_function = "SDL_PixelFormat_up", unref_function = "SDL_FreeFormat")]
+               [CCode (cname = "SDL_PixelFormat", cheader_filename = "SDL2/SDL_pixels.h", free_function = 
"SDL_FreeFormat", ref_function = "SDL_PixelFormat_up", unref_function = "SDL_FreeFormat")]
                public class PixelFormat {
                        public Video.PixelRAWFormat format;
                        public Video.Palette palette;
@@ -2529,14 +2529,14 @@ namespace SDL {
                        [CCode (cname = "SDL_RenderDrawRect")]
                        public int draw_rect (Video.Rect? rect);
 
-                       [CCode (cname = "SDL_RenderDrawLines")]
-                       public int draw_rects (Video.Rect[] points, int count);
+                       [CCode (cname = "SDL_RenderDrawRect")]
+                       public int draw_rects (Video.Rect? rect);
 
                        [CCode (cname = "SDL_RenderFillRect")]
                        public int fill_rect (Video.Rect? rect);
 
                        [CCode (cname = "SDL_RenderFillRects")]
-                       public int fill_rects (Video.Rect[] points, int count);
+                       public int fill_rects (Video.Rect[] rects);
 
                        [CCode (cname = "SDL_RenderCopy")]
                        public int copy (Video.Texture texture, Video.Rect? srcrect, Video.Rect? dstrect);
@@ -2576,7 +2576,7 @@ namespace SDL {
                        [CCode (cname = "SDL_SetTextureAlphaMod")]
                        public int set_alpha_mod (uint8 alpha);
 
-                       [CCode (cname = "SDL_GetTextureColorMod")]
+                       [CCode (cname = "SDL_GetTextureAlphaMod")]
                        public int get_alpha_mod (out uint8 alpha);
 
                        [CCode (cname = "SDL_SetTextureBlendMode")]
@@ -2590,7 +2590,7 @@ namespace SDL {
 
                        [Version (since = "2.0.1")]
                        [CCode (cname = "SDL_UpdateYUVTexture")]
-                       public int update_yuv (Video.Rect? rect, uint8[] yplane, int ypitch, uint8[] uplane, 
int upitch, uint8[] vplane, int vpitch);
+                       public int update_yuv (Video.Rect? rect, [CCode (array_length = false)] uint8[] 
yplane, int ypitch, [CCode (array_length = false)] uint8[] uplane, int upitch, [CCode (array_length = false)] 
uint8[] vplane, int vpitch);
 
                        [CCode (cname = "SDL_LockTexture")]
                        public int do_lock (Video.Rect? rect, out void* pixels, out int pitch);
@@ -3045,10 +3045,10 @@ namespace SDL {
                        public float get_brightness ();
 
                        [CCode (cname = "SDL_SetWindowGammaRamp")]
-                       public int set_gammaramp (uint16[]? red, uint16[]? green, uint16[]? blue);
+                       public int set_gammaramp (uint16 red[256], uint16 green[256], uint16 blue[256]);
 
                        [CCode (cname = "SDL_GetWindowGammaRamp")]
-                       public int get_gammaramp (out uint16[]? red, out uint16[]? green, out uint16[]? blue);
+                       public int get_gammaramp (out uint16 red[256], out uint16 green[256], out uint16 
blue[256]);
 
                        [Version (since = "2.0.0")]
                        [CCode (cname = "SDL_GetWindowWMInfo", cheader_filename = "SDL2/SDL_syswm.h")]
@@ -4013,6 +4013,7 @@ namespace SDL {
                        }
 
                        [CCode (cname = "SDL_GameControllerButtonBind")]
+                       [SimpleType]
                        public struct ButtonBind {
                                [CCode (cname = "bindType")]
                                public BindType bind_type;
@@ -4193,9 +4194,9 @@ namespace SDL {
                [CCode (cname = "SDL_HapticName")]
                public static unowned string device_name (int device_index);
                [CCode (cname = "SDL_HapticNewEffect")]
-               public int upload_effect (HapticEffect effect);
+               public int upload_effect (HapticEffect? effect);
                [CCode (cname = "SDL_HapticRunEffect")]
-               public int run_effect (int effect_id);
+               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_HapticDestroyEffect")]
@@ -4204,7 +4205,7 @@ namespace SDL {
                public int get_effect_status (int effect_id);
                //Returns negative on error, that's why it's not a bool
                [CCode (cname = "SDL_HapticEffectSupported")]
-               public int supports_effect (HapticEffect effect);
+               public int supports_effect (HapticEffect? effect);
                [Version (since = "2.0.0")]
                [CCode (cname = "SDL_HapticNumEffects")]
                public int effects_capacity ();
@@ -4222,7 +4223,7 @@ namespace SDL {
                [CCode (cname = "SDL_HapticRumbleInit")]
                public int rumble_init ();
                [CCode (cname = "SDL_HapticRumblePlay")]
-               public int rumble_play ();
+               public int rumble_play (float strength, uint32 length);
                [CCode (cname = "SDL_HapticRumbleStop")]
                public int rumble_stop ();
                [CCode (cname = "SDL_HapticRumbleSupported")]
@@ -4341,7 +4342,7 @@ namespace SDL {
                        public void unlock ();
 
                        [CCode (cname = "SDL_GetAudioDeviceName")]
-                       public unowned string get_name ();
+                       public unowned string get_name (int iscapture = 0);
 
                        [Version (since = "2.0.4")]
                        [CCode (cname = "SDL_QueueAudio")]


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