[vala/0.48] curses: Fix a few binding errors



commit 87565669ce615033d2ab152d469e7a9df854ef74
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jan 27 15:34:53 2021 +0100

    curses: Fix a few binding errors

 vapi/curses.vapi | 71 +++++++++++++++++++++++++++++++++-----------------------
 1 file changed, 42 insertions(+), 29 deletions(-)
---
diff --git a/vapi/curses.vapi b/vapi/curses.vapi
index 2f17659e3..821c9a5f1 100644
--- a/vapi/curses.vapi
+++ b/vapi/curses.vapi
@@ -44,7 +44,7 @@ namespace Curses {
                public const Curses.Color WHITE;
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "unsigned char", has_type_id = false)]
        public enum Acs {
                ULCORNER, LLCORNER, URCORNER, LRCORNER, LTEE, RTEE,
                BTEE, TTEE, HLINE, VLINE, PLUS, S1, S9, DIAMOND,
@@ -74,7 +74,11 @@ namespace Curses {
                [CCode (cname = "dupwin")]
                public Window copy();
                public ulong getbkgd();
+#if POSIX
+               public static Window getwin(Posix.FILE filep);
+#else
                public static Window getwin(GLib.FileStream filep);
+#endif
                public void idcok(bool bf);
                public int idlok(bool bf);
                public void immedok(bool bf);
@@ -96,7 +100,7 @@ namespace Curses {
                [CCode (cname = "mvwaddstr")]
                public int mvaddstr(int y, int x, string str);
                [CCode (cname = "mvwchgat")]
-               public int mvchgat(int y, int x, int n, ulong attr, short color);
+               public int mvchgat(int y, int x, int n, ulong attr, short color, void* data);
                [CCode (cname = "mvwdelch")]
                public int mvdelch(int y, int x);
                [CCode (cname = "mvwgetch")]
@@ -138,7 +142,11 @@ namespace Curses {
                public int notimeout(bool bf);
                public int overlay(Window win);
                public int overwrite(Window win);
+#if POSIX
+               public int putwin(Posix.FILE filep);
+#else
                public int putwin(GLib.FileStream filep);
+#endif
                public int redrawwin();
                public int scroll();
                public int scrollok(bool bf);
@@ -162,13 +170,13 @@ namespace Curses {
                [CCode (cname = "wattrset")]
                public int attrset(ulong attrs);
                [CCode (cname = "wattr_get")]
-               public int attr_get(ref ulong attrs, ref ulong pair);
+               public int attr_get(ref ulong attrs, ref ulong pair, void* data);
                [CCode (cname = "wattr_on")]
-               public int attr_on(ulong attrs);
+               public int attr_on(ulong attrs, void* data);
                [CCode (cname = "wattr_off")]
-               public int attr_off(ulong attrs);
+               public int attr_off(ulong attrs, void* data);
                [CCode (cname = "wattr_set")]
-               public int attr_set(ulong attrs, short pair);
+               public int attr_set(ulong attrs, short pair, void* data);
                [CCode (cname = "wbkgd")]
                public int bkgd(ulong ch);
                [CCode (cname = "wbkgdset")]
@@ -176,7 +184,7 @@ namespace Curses {
                [CCode (cname = "wborder")]
                public int border(ulong ls, ulong rs, ulong ts, ulong bs, ulong tl, ulong tr, ulong bl, ulong 
br);
                [CCode (cname = "wchgat")]
-               public int chgat(int n, ulong attr, short color);
+               public int chgat(int n, ulong attr, short color, void* data);
                [CCode (cname = "wclear")]
                public int clear();
                [CCode (cname = "wclrtobot")]
@@ -184,7 +192,7 @@ namespace Curses {
                [CCode (cname = "wclrtoeol")]
                public int clrtoeol();
                [CCode (cname = "wcolor_set")]
-               public int color_set(short color_pair_number);
+               public int color_set(short color_pair_number, void* data);
                [CCode (cname = "wcursyncup")]
                public void cursyncup();
                [CCode (cname = "wdelch")]
@@ -280,7 +288,11 @@ namespace Curses {
        [CCode (free_function = "delscreen", cname = "SCREEN", cprefix = "")]
        public class Screen {
                [CCode (cname = "newterm")]
+#if POSIX
+               public Screen(string str, Posix.FILE outfd, Posix.FILE infd);
+#else
                public Screen(string str, GLib.FileStream outfd, GLib.FileStream infd);
+#endif
                public unowned Screen set_term();
        }
 
@@ -292,10 +304,10 @@ namespace Curses {
        public int attroff(ulong attr);
        public int attron(ulong attr);
        public int attrset(ulong attr);
-       public int attr_get(ref ulong attrs, ref short pair);
-       public int attr_off(ulong attrs);
-       public int attr_on(ulong attrs);
-       public int attr_set(ulong attrs, short pair);
+       public int attr_get(ref ulong attrs, ref short pair, void* data);
+       public int attr_off(ulong attrs, void* data);
+       public int attr_on(ulong attrs, void* data);
+       public int attr_set(ulong attrs, short pair, void* data);
        public int baudrate();
        public int beep();
        public int bkgd(ulong ch);
@@ -303,12 +315,12 @@ namespace Curses {
        public int border(ulong ls, ulong rs, ulong ts, ulong bs, ulong tl, ulong tr, ulong bl, ulong br);
        public bool can_change_color();
        public int cbreak();
-       public int chgat(int n, ulong attr, short color);
+       public int chgat(int n, ulong attr, short color, void* data);
        public int clear();
        public int clrtobot();
        public int clrtoeol();
        public int color_content(short color, ref short r, ref short g, ref short b);
-       public int color_set(short color_pair_number);
+       public int color_set(short color_pair_number, void* data);
        public int COLOR_PAIR(int n);
        public int curs_set(int visibility);
        public int def_prog_mode();
@@ -349,14 +361,14 @@ namespace Curses {
        public bool isendwin();
        public string keyname(int c);
        public char killchar();
-       public string ulongname();
+       public string longname();
        public int move(int y, int x);
        public int mvaddch(int y, int x, ulong ch);
        public int mvaddchnstr(int y, int x, [CCode (array_length = false)] ulong[] chstr, int n);
        public int mvaddchstr(int y, int x, [CCode (array_length = false)] ulong[] chstr);
        public int mvaddnstr(int y, int x, string str, int n);
        public int mvaddstr(int y, int x, string str);
-       public int mvchgat(int y, int x, int n, ulong attr, short color);
+       public int mvchgat(int y, int x, int n, ulong attr, short color, void* data);
        public int mvdelch(int y, int x);
        public int mvgetch(int y, int x);
        public int mvgetnstr(int y, int x, string str, int n);
@@ -392,6 +404,7 @@ namespace Curses {
        public int resetty();
        public int reset_prog_mode();
        public int reset_shell_mode();
+       [CCode (has_target = false, has_typedef = false)]
        public delegate int RipofflineInitFunc(Window win, int n);
        public int ripoffline(int line, RipofflineInitFunc init);
        public int savetty();
@@ -404,12 +417,12 @@ namespace Curses {
        public int scr_set(string str);
        public int setscrreg(int top, int bot);
        public int slk_attroff(ulong attrs);
-       public int slk_attr_off(ulong attrs);
+       public int slk_attr_off(ulong attrs, void* data);
        public int slk_attron(ulong attrs);
-       public int slk_attr_on(ulong attrs);
+       public int slk_attr_on(ulong attrs, void* data);
        public int slk_attrset(ulong attrs);
        public ulong slk_attr();
-       public int slk_attr_set(ulong attrs, short pair);
+       public int slk_attr_set(ulong attrs, short pair, void* data);
        public int slk_clear();
        public int slk_color(short color_pair_number);
        public int slk_init(int fmt);
@@ -472,7 +485,7 @@ namespace Curses {
 
        public int mvcur(int oldrow, int oldcol, int newrow, int newcol);
 
-       [CCode (cprefix = "A_", has_type_id = false)]
+       [CCode (cname = "chtype", cprefix = "A_", has_type_id = false)]
        public enum Attribute {
                NORMAL, ATTRIBUTES, CHARTEXT, COLOR, STANDOUT,
                UNDERLINE, REVERSE, BLINK, DIM, BOLD, ALTCHARSET, INVIS,
@@ -480,7 +493,7 @@ namespace Curses {
                ITALIC // ITALIC is an ncurses extension
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Key {
                CODE_YES, MIN, BREAK, SRESET, RESET, DOWN, UP, LEFT,
                RIGHT, HOME, BACKSPACE, F0, DL, IL, DC, IC, EIC,
@@ -494,7 +507,7 @@ namespace Curses {
                SHOME, SIC, SLEFT, SMESSAGE, SMOVE, SNEXT, SOPTIONS,
                SPREVIOUS, SPRINT, SREDO, SREPLACE, SRIGHT, SRSUME,
                SSAVE, SSUSPEND, SUNDO, SUSPEND, UNDO, MOUSE, RESIZE,
-               EVENT, MAX;
+               MAX;
 
                public static int F (int n) {
                        return F0 + n;
@@ -511,20 +524,20 @@ namespace Curses {
                long bstate;
        }
 
-       [CCode (cprefix="", has_type_id = false)]
+       [CCode (cname = "int", cprefix = "", has_type_id = false)]
        public enum MouseMask {
                ALL_MOUSE_EVENTS,
                REPORT_MOUSE_POSITION
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button {
                SHIFT,
                CTRL,
                ALT,
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button1 {
                PRESSED,
                RELEASED,
@@ -533,7 +546,7 @@ namespace Curses {
                TRIPLE_CLICKED
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button2 {
                PRESSED,
                RELEASED,
@@ -542,7 +555,7 @@ namespace Curses {
                TRIPLE_CLICKED
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button3 {
                PRESSED,
                RELEASED,
@@ -551,7 +564,7 @@ namespace Curses {
                TRIPLE_CLICKED
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button4 {
                PRESSED,
                RELEASED,
@@ -560,7 +573,7 @@ namespace Curses {
                TRIPLE_CLICKED
        }
 
-       [CCode (has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false)]
        public enum Button5 {
                PRESSED,
                RELEASED,


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