Exemple #1
0
def __detectPlatform():
    try:
        if vim.screen != None: return "vim.screen"
    except Exception as e:
        print "Exception: %s" % e
    hasgui = int(vim.eval('has("gui_running")'))
    if hasgui != 0:
        try: # Deprecated: wx platform will be dropped!
            import wx
            return "wx"
        except Exception as e:
            print "Exception: %s" % e
    else:
        try:
            import curses
            import gcurses
            gcurses.vimPrepareScreen()
            return "curses"
        except Exception as e:
            print "Exception: %s" % e
    print "ioutil: Platform detection failed"
    return None
Exemple #2
0
#!/usr/bin/env python
# vim:set fileencoding=utf-8 sw=4 ts=8 et:vim
# Author:  Marko Mahnič
# Created: jun 2009
import vim
import curses
import gcurses
stdscr = gcurses.vimPrepareScreen()


class CWindow(object):
    def __init__(self, height, width, y, x):
        if y != None and x != None:
            self.__win = curses.newwin(height, width, y, x)
        else:
            self.__win = None
        self.linechars = [curses.ACS_HLINE, curses.ACS_VLINE]
        pass

    def __getattr__(self, name):
        fn = getattr(self.__win, name)
        return fn

    def derwin(self, height, width, y, x):
        win = CWindow(None, None, None, None)
        win.__win = self.__win.derwin(height, width, y, x)
        return win


class CScreen(object):
    def __init__(self):
Exemple #3
0
#!/usr/bin/env python
# vim:set fileencoding=utf-8 sw=4 ts=8 et:vim
# Author:  Marko Mahnič
# Created: jun 2009 
import vim
import curses
import gcurses
stdscr = gcurses.vimPrepareScreen()

class CWindow(object):
    def __init__(self, height, width, y, x):
        if y != None and x != None:
            self.__win = curses.newwin(height, width, y, x)
        else:
            self.__win = None
        self.linechars = [curses.ACS_HLINE, curses.ACS_VLINE]
        pass

    def __getattr__(self, name):
        fn = getattr(self.__win, name)
        return fn

    def derwin(self, height, width, y, x):
        win = CWindow(None, None, None, None)
        win.__win = self.__win.derwin(height, width, y, x)
        return win

class CScreen(object):
    def __init__(self):
        self.lastClick = (0, 0)
    def refresh(self):