Exemple #1
0
        static void LoadMethods()
        {
            var libs = UnmanagedLib.IsMacOsPlat
                ? new string[] { "libncurses.dylib" }
                : new string[] { "libncurses.6.so", "libncurses.5.so" };

            curse_lib = new UnmanagedLib(libs);
            methods   = new NativeMethods(curse_lib);
        }
Exemple #2
0
        public NativeMethods(UnmanagedLib lib)
        {
            UnmanagedLibrary = lib;

            initscr            = lib.GetNativeMethodDelegate <Delegates.initscr>("initscr");
            endwin             = lib.GetNativeMethodDelegate <Delegates.endwin>("endwin");
            isendwin           = lib.GetNativeMethodDelegate <Delegates.isendwin>("isendwin");
            cbreak             = lib.GetNativeMethodDelegate <Delegates.cbreak>("cbreak");
            nocbreak           = lib.GetNativeMethodDelegate <Delegates.nocbreak>("nocbreak");
            echo               = lib.GetNativeMethodDelegate <Delegates.echo>("echo");
            noecho             = lib.GetNativeMethodDelegate <Delegates.noecho>("noecho");
            halfdelay          = lib.GetNativeMethodDelegate <Delegates.halfdelay>("halfdelay");
            raw                = lib.GetNativeMethodDelegate <Delegates.raw>("raw");
            noraw              = lib.GetNativeMethodDelegate <Delegates.noraw>("noraw");
            noqiflush          = lib.GetNativeMethodDelegate <Delegates.noqiflush>("noqiflush");
            qiflush            = lib.GetNativeMethodDelegate <Delegates.qiflush>("qiflush");
            typeahead          = lib.GetNativeMethodDelegate <Delegates.typeahead>("typeahead");
            timeout            = lib.GetNativeMethodDelegate <Delegates.timeout>("timeout");
            wtimeout           = lib.GetNativeMethodDelegate <Delegates.wtimeout>("wtimeout");
            notimeout          = lib.GetNativeMethodDelegate <Delegates.notimeout>("notimeout");
            keypad             = lib.GetNativeMethodDelegate <Delegates.keypad>("keypad");
            meta               = lib.GetNativeMethodDelegate <Delegates.meta>("meta");
            intrflush          = lib.GetNativeMethodDelegate <Delegates.intrflush>("intrflush");
            clearok            = lib.GetNativeMethodDelegate <Delegates.clearok>("clearok");
            idlok              = lib.GetNativeMethodDelegate <Delegates.idlok>("idlok");
            idcok              = lib.GetNativeMethodDelegate <Delegates.idcok>("idcok");
            immedok            = lib.GetNativeMethodDelegate <Delegates.immedok>("immedok");
            leaveok            = lib.GetNativeMethodDelegate <Delegates.leaveok>("leaveok");
            wsetscrreg         = lib.GetNativeMethodDelegate <Delegates.wsetscrreg>("wsetscrreg");
            scrollok           = lib.GetNativeMethodDelegate <Delegates.scrollok>("scrollok");
            nl                 = lib.GetNativeMethodDelegate <Delegates.nl>("nl");
            nonl               = lib.GetNativeMethodDelegate <Delegates.nonl>("nonl");
            setscrreg          = lib.GetNativeMethodDelegate <Delegates.setscrreg>("setscrreg");
            refresh            = lib.GetNativeMethodDelegate <Delegates.refresh>("refresh");
            doupdate           = lib.GetNativeMethodDelegate <Delegates.doupdate>("doupdate");
            wrefresh           = lib.GetNativeMethodDelegate <Delegates.wrefresh>("wrefresh");
            redrawwin          = lib.GetNativeMethodDelegate <Delegates.redrawwin>("redrawwin");
            wredrawln          = lib.GetNativeMethodDelegate <Delegates.wredrawln> ("wredrawln");
            wnoutrefresh       = lib.GetNativeMethodDelegate <Delegates.wnoutrefresh>("wnoutrefresh");
            move               = lib.GetNativeMethodDelegate <Delegates.move>("move");
            addch              = lib.GetNativeMethodDelegate <Delegates.addch>("addch");
            addstr             = lib.GetNativeMethodDelegate <Delegates.addstr>("addstr");
            wmove              = lib.GetNativeMethodDelegate <Delegates.wmove>("wmove");
            waddch             = lib.GetNativeMethodDelegate <Delegates.waddch>("waddch");
            attron             = lib.GetNativeMethodDelegate <Delegates.attron>("attron");
            attroff            = lib.GetNativeMethodDelegate <Delegates.attroff>("attroff");
            attrset            = lib.GetNativeMethodDelegate <Delegates.attrset>("attrset");
            getch              = lib.GetNativeMethodDelegate <Delegates.getch>("getch");
            get_wch            = lib.GetNativeMethodDelegate <Delegates.get_wch>("get_wch");
            ungetch            = lib.GetNativeMethodDelegate <Delegates.ungetch>("ungetch");
            mvgetch            = lib.GetNativeMethodDelegate <Delegates.mvgetch>("mvgetch");
            has_colors         = lib.GetNativeMethodDelegate <Delegates.has_colors>("has_colors");
            start_color        = lib.GetNativeMethodDelegate <Delegates.start_color>("start_color");
            init_pair          = lib.GetNativeMethodDelegate <Delegates.init_pair>("init_pair");
            use_default_colors = lib.GetNativeMethodDelegate <Delegates.use_default_colors>("use_default_colors");
            COLOR_PAIRS        = lib.GetNativeMethodDelegate <Delegates.COLOR_PAIRS>("COLOR_PAIRS");
            //getmouse = lib.GetNativeMethodDelegate<Delegates.getmouse>("getmouse");
            //ungetmouse = lib.GetNativeMethodDelegate<Delegates.ungetmouse>("ungetmouse");
            mouseinterval = lib.GetNativeMethodDelegate <Delegates.mouseinterval>("mouseinterval");
            mousemask     = lib.GetNativeMethodDelegate <Delegates.mousemask>("mousemask");

            subwin     = lib.GetNativeMethodDelegate <Delegates.subwin>("subwin");
            box        = lib.GetNativeMethodDelegate <Delegates.box>("box");
            mvwprintw  = lib.GetNativeMethodDelegate <Delegates.mvwprintw>("mvwprintw");
            wprintw    = lib.GetNativeMethodDelegate <Delegates.wprintw>("wprintw");
            wborder    = lib.GetNativeMethodDelegate <Delegates.wborder>("wborder");
            init_color = lib.GetNativeMethodDelegate <Delegates.init_color>("init_color");
            wattron    = lib.GetNativeMethodDelegate <Delegates.wattron>("wattron");
            wattroff   = lib.GetNativeMethodDelegate <Delegates.wattroff>("wattroff");
            wbkgd      = lib.GetNativeMethodDelegate <Delegates.wbkgd>("wbkgd");
            waddstr    = lib.GetNativeMethodDelegate <Delegates.waddstr>("waddstr");
            curs_set   = lib.GetNativeMethodDelegate <Delegates.curs_set>("curs_set");
            derwin     = lib.GetNativeMethodDelegate <Delegates.derwin>("derwin");
            newwin     = lib.GetNativeMethodDelegate <Delegates.newwin>("newwin");
            wclrtoeol  = lib.GetNativeMethodDelegate <Delegates.wclrtoeol>("wclrtoeol");
            wclear     = lib.GetNativeMethodDelegate <Delegates.wclear>("wclear");
            werase     = lib.GetNativeMethodDelegate <Delegates.werase>("werase");
        }