示例#1
0
        //[DllImport ("libc")]
        //public extern static int ioctl (int fd, int cmd, out winsize argp);

        static void LoadMethods()
        {
            var libs = UnmanagedLibrary.IsMacOSPlatform ? new string [] { "libncurses.dylib" } : new string [] { "libncursesw.so.6", "libncursesw.so.5" };

            curses_library = new UnmanagedLibrary(libs, false);
            methods        = new NativeMethods(curses_library);
        }
示例#2
0
 public NativeMethods(UnmanagedLibrary lib)
 {
     this.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");
     //wredrawwin = lib.GetNativeMethodDelegate<Delegates.wredrawwin> ("wredrawwin");
     wnoutrefresh       = lib.GetNativeMethodDelegate <Delegates.wnoutrefresh> ("wnoutrefresh");
     move               = lib.GetNativeMethodDelegate <Delegates.move> ("move");
     addch              = lib.GetNativeMethodDelegate <Delegates.addch>("addch");
     addwstr            = lib.GetNativeMethodDelegate <Delegates.addwstr> ("addwstr");
     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");
 }