#!/usr/bin/python ''' SVPlayer pygtk default constants and modules (c) 2011-2012 Jan ONDREJ (SAL) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ''' #import pygtk #pygtk.require("2.0") #import gtk, gobject, pango import gi.pygtkcompat gi.pygtkcompat.enable() gi.pygtkcompat.enable_gtk(version='3.0') gi.require_version('GdkX11', '3.0') from gi.repository import GObject, Gtk, Gdk, Pango, GdkPixbuf from gi.repository import GdkX11 from gi.overrides import keysyms #import gobject, gtk, pango #Gdk = gtk.gdk; Pango = pango GObject.threads_init() Gdk.threads_init() COLOR_BLACK = Gdk.Color(0x0000, 0x0000, 0x0000) COLOR_WHITE = Gdk.Color(0xf000, 0xf000, 0xf000) COLOR_GRAY = Gdk.Color(0xe000, 0xe000, 0xe000) COLOR_RED = Gdk.Color(0xb000, 0x0600, 0x0600) COLOR_YELLOW = Gdk.color_parse('yellow') COLOR_GREEN = Gdk.color_parse('green') COLOR_DARK_YELLOW = Gdk.Color(0xdf00, 0xd000, 0x0000) FONT_SANS20 = Pango.FontDescription("sans 20") #FONT_SANS20B = Pango.FontDescription("sans bold 20") FONT_SANS24 = Pango.FontDescription("sans 24") FONT_SANS28 = Pango.FontDescription("sans 28") def totime(t): return "%d:%02d:%02d" % (t/60/60,(t/60)%60,t%60) class Screen(Gtk.DrawingArea): __gsignals__ = { #"expose-event": "override" #"draw": "override" } #def do_expose_event(self, event): def ____do_draw(self, event): # Create the cairo context cr = self.get_property('window').cairo_create() # Restrict Cairo to the exposed area; avoid extra work cr.rectangle(event.area.x, event.area.y, event.area.width, event.area.height) cr.clip() self.draw(cr, *self.get_property('window').get_size()) def draw(self, cr, width, height): # Fill the background with black cr.set_source_rgb(0, 0, 0) cr.rectangle(0, 0, width, height) cr.fill() def debug_shell(): import IPython return IPython.embed