本文整理汇总了Python中scc.osd.OSDWindow类的典型用法代码示例。如果您正苦于以下问题:Python OSDWindow类的具体用法?Python OSDWindow怎么用?Python OSDWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OSDWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _add_arguments
def _add_arguments(self):
OSDWindow._add_arguments(self)
self.argparser.add_argument('-t', type=float, metavar="seconds",
default=5, help="time before message is hidden (default: 5; 0 means forever)")
self.argparser.add_argument('-s', type=int, metavar="size",
default=3, help="font size, in range 1 to 3 (default: 3)")
self.argparser.add_argument('text', type=str, help="text to display")
开发者ID:kozec,项目名称:sc-controller,代码行数:7,代码来源:message.py
示例2: _add_arguments
def _add_arguments(self):
OSDWindow._add_arguments(self)
self.argparser.add_argument('image', type=str, nargs="?",
default = self.bdisplay, help="keyboard image to use")
self.argparser.add_argument('--cancel-with', type=str,
metavar="button", default='B',
help="button used to close display (default: B)")
开发者ID:kozec,项目名称:sc-controller,代码行数:7,代码来源:binding_display.py
示例3: __init__
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'
开发者ID:kozec,项目名称:sc-controller,代码行数:29,代码来源:menu.py
示例4: show
def show(self, *a):
OSDWindow.show(self, *a)
self.profile.load(find_profile(".scc-osd.keyboard")).compress()
self.mapper = SlaveMapper(self.profile, keyboard=b"SCC OSD Keyboard")
self.mapper.set_special_actions_handler(self)
self.set_cursor_position(0, 0, self.cursors[LEFT], self.limits[LEFT])
self.set_cursor_position(0, 0, self.cursors[RIGHT], self.limits[RIGHT])
开发者ID:wendeldr,项目名称:sc-controller,代码行数:7,代码来源:keyboard.py
示例5: _add_arguments
def _add_arguments(self):
OSDWindow._add_arguments(self)
self.argparser.add_argument('--control-with', '-c', type=str,
metavar="option", default=DEFAULT, choices=(DEFAULT, LEFT, RIGHT, STICK),
help="which pad or stick should be used to navigate menu")
self.argparser.add_argument('--confirm-with', type=str,
metavar="button", default=DEFAULT,
help="button used to confirm choice")
self.argparser.add_argument('--cancel-with', type=str,
metavar="button", default=DEFAULT,
help="button used to cancel menu")
self.argparser.add_argument('--confirm-with-release', action='store_true',
help="confirm choice with button release instead of button press")
self.argparser.add_argument('--cancel-with-release', action='store_true',
help="cancel menu with button release instead of button press")
self.argparser.add_argument('--use-cursor', '-u', action='store_true',
help="display and use cursor")
self.argparser.add_argument('--size', type=int,
help="sets prefered width or height")
self.argparser.add_argument('--feedback-amplitude', type=int,
help="enables and sets power of feedback effect generated when active menu option is changed")
self.argparser.add_argument('--from-profile', '-p', type=str,
metavar="profile_file menu_name",
help="load menu items from profile file")
self.argparser.add_argument('--from-file', '-f', type=str,
metavar="filename",
help="load menu items from json file")
self.argparser.add_argument('--print-items', action='store_true',
help="prints menu items to stdout")
self.argparser.add_argument('items', type=str, nargs='*', metavar='id title',
help="Menu items")
开发者ID:kozec,项目名称:sc-controller,代码行数:31,代码来源:menu.py
示例6: quit
def quit(self, code=-2):
if self.get_controller():
self.get_controller().unlock_all()
for source, eid in self._eh_ids:
source.disconnect(eid)
self._eh_ids = []
OSDWindow.quit(self, code)
开发者ID:kozec,项目名称:sc-controller,代码行数:7,代码来源:dialog.py
示例7: _add_arguments
def _add_arguments(self):
OSDWindow._add_arguments(self)
self.argparser.add_argument('--control-with', '-c', type=str,
metavar="option", default=STICK, choices=(LEFT, RIGHT, STICK),
help="which pad or stick should be used to navigate menu (default: %s)" % (STICK,))
self.argparser.add_argument('--confirm-with', type=str,
metavar="button", default='A',
help="button used to confirm choice (default: A)")
self.argparser.add_argument('--cancel-with', type=str,
metavar="button", default='B',
help="button used to cancel menu (default: B)")
self.argparser.add_argument('--confirm-with-release', action='store_true',
help="confirm choice with button release instead of button press")
self.argparser.add_argument('--cancel-with-release', action='store_true',
help="cancel menu with button release instead of button press")
self.argparser.add_argument('--use-cursor', '-u', action='store_true',
help="display and use cursor")
self.argparser.add_argument('--from-profile', '-p', type=str,
metavar="profile_file menu_name",
help="load menu items from profile file")
self.argparser.add_argument('--from-file', '-f', type=str,
metavar="filename",
help="load menu items from json file")
self.argparser.add_argument('--print-items', action='store_true',
help="prints menu items to stdout")
self.argparser.add_argument('items', type=str, nargs='*', metavar='id title',
help="Menu items")
开发者ID:mulark,项目名称:sc-controller,代码行数:27,代码来源:menu.py
示例8: __init__
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
开发者ID:kozec,项目名称:sc-controller,代码行数:7,代码来源:message.py
示例9: quit
def quit(self, code=-2):
if not self._is_submenu:
self.daemon.unlock_all()
for x in self._eh_ids:
self.daemon.disconnect(x)
self._eh_ids = []
OSDWindow.quit(self, code)
开发者ID:Micr0Bit,项目名称:sc-controller,代码行数:7,代码来源:menu.py
示例10: show
def show(self):
OSDWindow.show(self)
from ctypes import byref
pb = self.b.get_pixbuf()
win = X.XID(self.get_window().get_xid())
pixmap = X.create_pixmap(self.xdisplay, win,
pb.get_width(), pb.get_height(), 1)
width = pb.get_width()
height = pb.get_height()
self.f.move(self.cursor, int(width / 2), int(height / 2))
gc = X.create_gc(self.xdisplay, pixmap, 0, None)
X.set_foreground(self.xdisplay, gc, 0)
X.fill_rectangle(self.xdisplay, pixmap, gc, 0, 0, pb.get_width(), pb.get_height())
X.set_foreground(self.xdisplay, gc, 1)
X.set_background(self.xdisplay, gc, 1)
r = int(pb.get_width() * 0.985)
x = (pb.get_width() - r) / 2
X.fill_arc(self.xdisplay, pixmap, gc,
x, x, r, r, 0, 360*64)
X.flush_gc(self.xdisplay, gc)
X.flush(self.xdisplay)
X.shape_combine_mask(self.xdisplay, win, X.SHAPE_BOUNDING, 0, 0, pixmap, X.SHAPE_SET)
X.flush(self.xdisplay)
开发者ID:Micr0Bit,项目名称:sc-controller,代码行数:32,代码来源:radial_menu.py
示例11: quit
def quit(self, code=-1):
self.daemon.unlock_all()
for x in self._eh_ids:
self.daemon.disconnect(x)
self._eh_ids = []
del self.keyboard
OSDWindow.quit(self, code)
开发者ID:TotalCaesar659,项目名称:sc-controller,代码行数:7,代码来源:keyboard.py
示例12: __init__
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 = []
开发者ID:kozec,项目名称:sc-controller,代码行数:8,代码来源:inputdisplay.py
示例13: show
def show(self, *a):
if self.background is None:
self.realize()
self.background = SVGWidget(self.args.image, init_hilighted=True)
self.c.add(self.background)
self.add(self.c)
OSDWindow.show(self, *a)
self.move(*self.compute_position())
开发者ID:kozec,项目名称:sc-controller,代码行数:9,代码来源:binding_display.py
示例14: __init__
def __init__(self):
self.exit_code = -1
self.mainloop = GLib.MainLoop()
self.config = None
self._window = None
self._registered = False
self._last_profile_change = 0
self._recent_profiles_undo = None
OSDWindow._apply_css()
开发者ID:wendeldr,项目名称:sc-controller,代码行数:9,代码来源:scc-osd-daemon.py
示例15: show
def show(self):
self.l = Gtk.Label()
self.l.set_name("osd-label")
self.l.set_label(self.text)
self.add(self.l)
OSDWindow.show(self)
GLib.timeout_add_seconds(self.timeout, self.quit)
开发者ID:Micr0Bit,项目名称:sc-controller,代码行数:9,代码来源:message.py
示例16: _add_arguments
def _add_arguments(self):
OSDWindow._add_arguments(self)
self.argparser.add_argument('--confirm-with', type=str,
metavar="button", default=DEFAULT,
help="button used to confirm choice")
self.argparser.add_argument('--cancel-with', type=str,
metavar="button", default=DEFAULT,
help="button used to cancel dialog")
self.argparser.add_argument('--feedback-amplitude', type=int,
help="enables and sets power of feedback effect generated when active menu option is changed")
开发者ID:kozec,项目名称:sc-controller,代码行数:10,代码来源:launcher.py
示例17: __init__
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())
开发者ID:kozec,项目名称:sc-controller,代码行数:11,代码来源:gesture_display.py
示例18: show
def show(self, *a):
if self.background is None:
self._create_background()
OSDWindow.show(self, *a)
self.load_profile()
self.mapper = SlaveMapper(self.profile, None,
keyboard=b"SCC OSD Keyboard", mouse=b"SCC OSD Mouse")
self.mapper.set_special_actions_handler(self)
self.set_cursor_position(0, 0, self.cursors[LEFT], self.limits[LEFT])
self.set_cursor_position(0, 0, self.cursors[RIGHT], self.limits[RIGHT])
self.set_cursor_position(0, 0, self.cursors[CPAD], self.limits[CPAD])
self.timer('labels', 0.1, self.update_labels)
开发者ID:kozec,项目名称:sc-controller,代码行数:12,代码来源:keyboard.py
示例19: show
def show(self):
self.l = Gtk.Label()
self.l.set_name("osd-label-%s" % (self.size, ))
self.l.set_label(self.text)
self.add(self.l)
if self.size < 2:
self.set_name("osd-message-1")
OSDWindow.show(self)
if self.timeout > 0:
self._timeout_id = GLib.timeout_add_seconds(self.timeout, self.quit)
开发者ID:kozec,项目名称:sc-controller,代码行数:12,代码来源:message.py
示例20: _check_colorconfig_change
def _check_colorconfig_change(self):
"""
Checks if OSD color configuration is changed and re-applies CSS
if needed.
"""
h = sum([ hash(self.config['osd_colors'][x]) for x in self.config['osd_colors'] ])
h += sum([ hash(self.config['osk_colors'][x]) for x in self.config['osk_colors'] ])
if self._hash_of_colors != h:
self._hash_of_colors = h
OSDWindow._apply_css(self.config)
if self._window and isinstance(self._window, Keyboard):
self._window.recolor()
self._window.update_labels()
self._window.redraw_background()
开发者ID:mulark,项目名称:sc-controller,代码行数:14,代码来源:scc-osd-daemon.py
注:本文中的scc.osd.OSDWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论