本文整理汇总了Python中scc.osd.OSDWindow.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python OSDWindow.__init__方法的具体用法?Python OSDWindow.__init__怎么用?Python OSDWindow.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scc.osd.OSDWindow
的用法示例。
在下文中一共展示了OSDWindow.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, cls="osd-menu"):
OSDWindow.__init__(self, cls)
self.daemon = None
self.config = None
self.feedback = None
self.controller = None
self.xdisplay = X.Display(hash(GdkX11.x11_get_default_xdisplay())) # Magic
cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
self.cursor = Gtk.Image.new_from_file(cursor)
self.cursor.set_name("osd-menu-cursor")
self.parent = self.create_parent()
self.f = Gtk.Fixed()
self.f.add(self.parent)
self.add(self.f)
self._submenu = None
self._scon = StickController()
self._scon.connect("direction", self.on_stick_direction)
self._is_submenu = False
self._selected = None
self._menuid = None
self._use_cursor = False
self._eh_ids = []
self._control_with = STICK
self._control_with_dpad = False
self._confirm_with = 'A'
self._cancel_with = 'B'
示例2: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self):
OSDWindow.__init__(self, "osd-message")
self.timeout = OSDAction.DEFAULT_TIMEOUT
self.size = OSDAction.DEFAULT_SIZE
self.text = "text"
self._timeout_id = None
示例3: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, imagepath="/usr/share/scc/images"):
OSDWindow.__init__(self, "osd-menu")
self.daemon = None
self.config = None
self.hilights = { self.HILIGHT_COLOR : set(), self.OBSERVE_COLOR : set() }
self.imagepath = imagepath
self._eh_ids = []
示例4: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, config=None):
OSDWindow.__init__(self, "osd-gesture")
self.daemon = None
self._left_detector = GestureDetector(0, self._on_gesture_finished)
# self._right_detector = GestureDetector(0, self._on_gesture_finished)
self._control_with = LEFT
self._eh_ids = []
self._gesture = None
self.setup_widgets()
self.use_config(config or Config())
示例5: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, config=None):
self.bdisplay = os.path.join(get_config_path(), 'binding-display.svg')
if not os.path.exists(self.bdisplay):
# Prefer image in ~/.config/scc, but load default one as fallback
self.bdisplay = os.path.join(get_share_path(), "images", 'binding-display.svg')
OSDWindow.__init__(self, "osd-keyboard")
self.daemon = None
self.config = config or Config()
self.group = None
self.limits = {}
self.background = None
self._eh_ids = []
self._stick = 0, 0
self.c = Gtk.Box()
self.c.set_name("osd-keyboard-container")
示例6: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self):
OSDWindow.__init__(self, "osd-keyboard")
TimerManager.__init__(self)
self.daemon = None
self.keyboard = None
self.keymap = Gdk.Keymap.get_default()
self.keymap.connect('state-changed', self.on_state_changed)
kbimage = os.path.join(get_config_path(), 'keyboard.svg')
if not os.path.exists(kbimage):
# Prefer image in ~/.config/scc, but load default one as fallback
kbimage = os.path.join(get_share_path(), "images", 'keyboard.svg')
self.background = SVGWidget(self, kbimage)
self.limit_left = self.background.get_rect_area(self.background.get_element("LIMIT_LEFT"))
self.limit_right = self.background.get_rect_area(self.background.get_element("LIMIT_RIGHT"))
cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
self.cursor_left = Gtk.Image.new_from_file(cursor)
self.cursor_left.set_name("osd-keyboard-cursor")
self.cursor_right = Gtk.Image.new_from_file(cursor)
self.cursor_right.set_name("osd-keyboard-cursor")
self._eh_ids = []
self._stick = 0, 0
self._hovers = { self.cursor_left : None, self.cursor_right : None }
self._pressed = { self.cursor_left : None, self.cursor_right : None }
self.c = Gtk.Box()
self.c.set_name("osd-keyboard-container")
self.f = Gtk.Fixed()
self.f.add(self.background)
self.f.add(self.cursor_left)
self.f.add(self.cursor_right)
self.c.add(self.f)
self.add(self.c)
self.set_cursor_position(0, 0, self.cursor_left, self.limit_left)
self.set_cursor_position(0, 0, self.cursor_right, self.limit_right)
self.timer('labels', 0.1, self.update_labels)
示例7: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, cls="osd-menu"):
self._buttons = None
self._string = ""
OSDWindow.__init__(self, cls)
self.daemon = None
self.config = None
self.feedback = None
self.controller = None
self.xdisplay = X.Display(hash(GdkX11.x11_get_default_xdisplay())) # Magic
self.create_parent()
self.create_app_list()
self.create_buttons()
cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
self.cursors = [ Gtk.Image.new_from_file(cursor), Gtk.Image.new_from_file(cursor) ]
for c in self.cursors:
c.set_name("osd-menu-cursor")
c.selected = None
self.f.add(c)
self.f.show_all()
self._scon = StickController()
self._scon.connect("direction", self.on_stick_direction)
self._selected = None
self._menuid = None
self._eh_ids = []
self._confirm_with = 'A'
self._cancel_with = 'B'
if Launcher._app_db is None:
Launcher._app_db = []
for x in Launcher.BUTTONS:
for c in x:
Launcher.CHAR_TO_NUMBER[c] = x[0]
for x in Gio.AppInfo.get_all():
try:
Launcher._app_db.append(( Launcher.name_to_keys(x), x ))
except UnicodeDecodeError:
# Just fuck them...
pass
示例8: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, cls="osd-menu"):
self._buttons = None
self._text = None
OSDWindow.__init__(self, cls)
self.daemon = None
self.config = None
self.feedback = None
self.controller = None
self.xdisplay = X.Display(hash(GdkX11.x11_get_default_xdisplay())) # Magic
self.parent = self.create_parent()
self.f = Gtk.Fixed()
self.f.add(self.parent)
self.add(self.f)
self._scon = StickController()
self._scon.connect("direction", self.on_stick_direction)
self._selected = None
self._eh_ids = []
示例9: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self, config=None):
self.kbimage = os.path.join(get_config_path(), 'keyboard.svg')
if not os.path.exists(self.kbimage):
# Prefer image in ~/.config/scc, but load default one as fallback
self.kbimage = os.path.join(get_share_path(), "images", 'keyboard.svg')
TimerManager.__init__(self)
OSDWindow.__init__(self, "osd-keyboard")
self.daemon = None
self.mapper = None
self.keymap = Gdk.Keymap.get_default()
self.keymap.connect('state-changed', self.on_keymap_state_changed)
Action.register_all(sys.modules['scc.osd.osk_actions'], prefix="OSK")
self.profile = Profile(TalkingActionParser())
self.config = config or Config()
self.dpy = X.Display(hash(GdkX11.x11_get_default_xdisplay()))
self.group = None
self.limits = {}
self.background = None
cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
self.cursors = {}
self.cursors[LEFT] = Gtk.Image.new_from_file(cursor)
self.cursors[LEFT].set_name("osd-keyboard-cursor")
self.cursors[RIGHT] = Gtk.Image.new_from_file(cursor)
self.cursors[RIGHT].set_name("osd-keyboard-cursor")
self.cursors[CPAD] = Gtk.Image.new_from_file(cursor)
self.cursors[CPAD].set_name("osd-keyboard-cursor")
self._eh_ids = []
self._controller = None
self._stick = 0, 0
self._hovers = { self.cursors[LEFT]: None, self.cursors[RIGHT]: None }
self._pressed = { self.cursors[LEFT]: None, self.cursors[RIGHT]: None }
self._pressed_areas = {}
self.c = Gtk.Box()
self.c.set_name("osd-keyboard-container")
self.f = Gtk.Fixed()
示例10: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self):
OSDWindow.__init__(self, "osd-menu")
TimerManager.__init__(self)
self.daemon = None
cursor = os.path.join(get_share_path(), "images", 'menu-cursor.svg')
self.cursor = Gtk.Image.new_from_file(cursor)
self.cursor.set_name("osd-menu-cursor")
self.parent = self.create_parent()
self.f = Gtk.Fixed()
self.f.add(self.parent)
self.add(self.f)
self._direction = 0 # Movement direction
self._selected = None
self._menuid = None
self._use_cursor = False
self._eh_ids = []
self._control_with = STICK
self._confirm_with = 'A'
self._cancel_with = 'B'
示例11: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self):
OSDWindow.__init__(self, "osd-message")
self.timeout = 5
self.text = "text"
示例12: __init__
# 需要导入模块: from scc.osd import OSDWindow [as 别名]
# 或者: from scc.osd.OSDWindow import __init__ [as 别名]
def __init__(self):
OSDWindow.__init__(self, "osd-area")
TimerManager.__init__(self)
self.size = (100, 100)
self.add(Gtk.Fixed())