code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
#!/usr/bin/python
# $Id:$
from pyglet.gl import *
from pyglet import window
class MoveWindow(object):
def __init__(self, window, x, y):
self.offset = x, y
self.window = window
def on_mouse_drag(self, x, y, dx, dy, buttons, modifiers):
sx, sy = self.window.get_location()
ox, oy... | Python |
'''Wrapper for avformat
Generated with:
../tools/wraptypes/wrap.py /usr/include/ffmpeg/avformat.h -o lib_avformat.py
.. Then hacked. DON'T REGENERATE.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
from avcodec import get_library
_lib = get_library('avformat')
_in... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import pyglet
from pyglet.window.xlib import xlib
from pyglet.gl import *
from pyglet.gl.glx import *
def reshape(width, height):
h = height / float(width)
glViewport(0, 0, width, height)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glFrustum(-1.0, 1.0, -h, h, 5... | Python |
# Number MacBook
# 500 59.1715965271
# 1000 29.5857982635
# 2000 19.8412704468
import os
import sys
import random
import pygame
import pygame.time
from pygame.locals import *
pygame.init()
win = pygame.display.set_mode((600, 600))
ww, wh = win.get_size()
img = pygame.image.load('examples/nois... | Python |
import sys
import time
from ctypes import *
from exceptions import *
import random
# disable error checking (python -O) to make this code work :)
from pyglet import options
import pyglet.window
from pyglet import clock
from pyglet.shader import *
from pyglet.ext.model.geometric import *
from pyglet.gl import *
from ... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import Queue
import pyglet
from pyglet.window.win32 import _kernel32, _user32, constants, types
class MTWin32EventLoop(pyglet.app.win32.Win32EventLoop):
def __init__(self, *args, **kwargs):
super(MTWin32EventLoop, self).__init__(*args, **kwargs)
... | Python |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import setup_path
import sys
import pyglet
import mt_media
import mt_procedural as procedural
player = mt_media.Player()
player.queue(procedural.Sine(0.5, 300))
player.queue(procedural.Sine(0.5, 330))
player.queue(procedural.S... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import setup_path
import pyglet
import mt_media
import sys
source = mt_media.load(sys.argv[1])
player = mt_media.Player()
player.queue(source)
player.play()
player.on_eos = lambda: pyglet.app.exit()
pyglet.app.run()
| Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import threading
import time
import mt_media
import pyglet
_debug = pyglet.options['debug_media']
class SilentAudioPlayer(mt_media.AbstractAudioPlayer):
# When playing video, length of audio (in secs) to buffer ahead.
... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import math
import sys
import threading
import time
import pyglet
_debug = pyglet.options['debug_media']
import mt_media
import lib_dsound as lib
from pyglet.window.win32 import _user32, _kernel32
class DirectSoundException(mt_media.MediaException):
pas... | Python |
'''Wrapper for pulse
Generated with:
tools/genwrappers.py pulseaudio
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('pulse')
_int_types = (c_... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
import lib_pulseaudio as pa
import pyglet
_debug = pyglet.options['debug_media']
import mt_media
def check(result):
if result < 0:
error = pa.pa_context_errno(context._context)
raise MediaExcept... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
#!/usr/bin/python
# $Id: setup_path.py 1580 2008-01-15 15:08:39Z Alex.Holkner $
import os.path
import sys
script_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(script_dir, '..', '..'))
sys.path.insert(0, script_dir)
| Python |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | Python |
#!/usr/bin/env python
'''
Hack synchronisation into pyglet event loop.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import select
import threading
import pyglet
class XlibEventDispatcher(object):
def fileno(self):
raise NotImplementedError('abstract')
def dispatch_events(self):
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
from pyglet.ext.layout import *
from pyglet.window import *
window = Window(visible=False)
def print_time(start, msg):
dt = time.time() - start
print '%f\t%s' % (dt, msg)
def profile(xhtml, widths=[800,600,4... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
import lib_pulseaudio as pa
import pyglet
_debug = pyglet.options['debug_media']
from pyglet.media import AudioPlayer, Listener, MediaException
def check(result):
if result < 0:
error = pa.pa_context_er... | Python |
'''Wrapper for pulse
Generated with:
tools/genwrappers.py pulseaudio
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: wrap.py 1694 2008-01-30 23:12:00Z Alex.Holkner $'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('pulse')
_int_types = (c_... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import sys
from pyglet import clock
from pyglet import image
from pyglet import window
w = window.Window()
class AnimationPlayer(object):
expected_delay = 0
def __init__(self, animation):
self.animation = animat... | Python |
#!/usr/bin/env python
'''Press R,G,B,S keys to alter target color and saturation.
'''
print __doc__
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
from ctypes import *
from pyglet.gl import *
from pyglet import clock
from pyglet.image import *
from pyglet.window import *
from pyglet.window.event import ... | Python |
#!/usr/bin/env python
import sys
from pyglet.gl import *
from pyglet import window, image
import shader
w = window.Window(512, 512)
kitten = image.load('../examples/programming_guide/kitten.jpg')
pinch_f = '''
uniform sampler2D tex;
uniform vec2 size;
uniform vec2 mouse;
uniform float strength;
void main() {
v... | Python |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import math
import random
import re
import os.path
import pyglet
from pyglet.gl import *
import xml.dom
import xml.dom.minidom
class SmoothLineGroup(pyglet.graphics.Group):
def set_state(self):
... | Python |
#!/usr/bin/python
# $Id:$
# wxPython + pyglet integration, by subclassing wx.Window.
# Win32 works fine, though flickery resize.
# GDK sort of works, but keeps getting overdrawn by the window background
# (resize to see).
import wx
import pyglet
from pyglet.gl import *
import sys
if sys.platform == ... | Python |
# Copyright 2009 Joe Wreschnig and others.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following di... | Python |
'''Wrapper for Xxf86vm
Generated with:
tools/genwrappers.py
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xxf86vm')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
# Som... | Python |
'''Wrapper for Xrandr
Generated with:
tools/genwrappers.py xrandr
Do not modify this file.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
from ctypes import *
import pyglet.lib
_lib = pyglet.lib.load_library('Xrandr')
_int_types = (c_int16, c_int32)
if hasattr(ctypes, 'c_int64'):
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
import pyglet
from pyglet.window.xlib import xlib
import lib_xrandr as xrandr
def _check_extension(display):
major_opcode = ctypes.c_int()
first_event = ctypes.c_int()
first_error = ctypes.c_int()
x... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import ctypes
import os
import fcntl
import mutex
import time
import select
import struct
import signal
import sys
import threading
from pyglet.window.xlib import xlib
import lib_xf86vmode as xf86vmode
class ModeList(object):
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
# Patch for window/carbon/__init__.py::
# (in _create)
#
# fs_width = c_short(width)
# fs_height = c_short(width)
#
# ... that's it :-)
| Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import pyglet
from pyglet.gl import *
window = pyglet.window.Window(fullscreen=True)
@window.event
def on_draw():
glClearColor(.5, .5, .5, 1)
glClear(GL_COLOR_BUFFER_BIT)
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
... | Python |
#!/usr/bin/python
# $Id:$
import ctypes
import pyglet
from pyglet.window.win32 import _user32
from pyglet.window.win32.constants import *
from pyglet.window.win32.types import *
WCHAR = ctypes.c_wchar
BCHAR = ctypes.c_wchar
class MONITORINFOEX(ctypes.Structure):
_fields_ = (
('cbSize', DW... | Python |
#!/usr/bin/python
# $Id:$
import os.path
import sys
script_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(script_dir, '..', '..'))
sys.path.insert(0, script_dir)
| Python |
#!/usr/bin/python
# $Id:$
import os
import sys
import unittest
from pyglet.gl import *
from pyglet import image
from pyglet import resource
from pyglet import window
__noninteractive = True
# Test image is laid out
# M R
# B G
# In this test the image is sampled at four points from top-right cloc... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
__noninteractive = True
'''
Layout:
. (script home)
file.txt F1
dir1/
file.txt F2
dir1/
file.txt F3
res.zip/... | Python |
#!/usr/bin/env python
'''Test that rendering of bullet glyphs works.
You should see 5 bullet glyphs rendered in the bottom-left of the window.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import font
import base_text
class TEST_HALIGN(base_text.TextTestBase):
font... | Python |
#!/usr/bin/env python
'''Test that a font likely to be installed on the computer can be
loaded and displayed correctly.
One window will open, it should show "Quickly brown fox" at 24pt using:
* "Helvetica" on Mac OS X
* "Arial" on Windows
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import un... | Python |
#!/usr/bin/env python
'''Base class for text tests.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import sys
from pyglet.gl import *
from pyglet import font
from pyglet.window import *
from pyglet.window.event import *
from tests.regression import ImageRegressionTestCase
class Text... | Python |
#!/usr/bin/env python
'''Test that font.Text alignment works with multiple lines.
Three labels will be rendered at the top-left, center and bottom-right of the
window. Resize the window to ensure the alignment is as specified.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pygl... | Python |
#!/usr/bin/env python
'''Test that text will not wrap when its width is set to its calculated
width.
You should be able to clearly see "TEST TEST" on a single line (not two)
and "SPAM SPAM SPAM" over two lines, not three.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_text... | Python |
#!/usr/bin/env python
'''Test that the horizontal font metrics are calculated correctly.
Some text in various fonts will be displayed. Green vertical lines mark
the left edge of the text. Blue vertical lines mark the right edge of the
text.
Press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__versi... | Python |
#!/usr/bin/env python
'''Test that font colour is applied correctly. Default font should
appear blue.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_text
from pyglet import font
class TEST_COLOR(base_text.TextTestBase):
def render(self):
fnt = font.load(self.f... | Python |
#!/usr/bin/env python
'''Test that a font with no name given still renders using some sort
of default system font.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_text
class TEST_DEFAULT(base_text.TextTestBase):
font_name = ''
if __name__ == '__main__':
unittest.ma... | Python |
#!/usr/bin/env python
'''Test that font.Text vertical alignment works.
Four labels will be aligned top, center, baseline and bottom.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import gl
from pyglet import font
import base_text
class TEST_VALIGN(base_text.TextTestBas... | Python |
#!/usr/bin/env python
'''Test that a specific DPI can be set to render the text with.
Some text in Action Man font will be displayed. A green box should exactly
bound the top and bottom of the text.
Press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import os
import unittest
... | Python |
#!/usr/bin/env python
'''Test that font colour is applied correctly. Default font should
appear at 0.1 opacity (faint white)
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
import base_text
from pyglet import font
class TEST_COLOR_BLEND(base_text.TextTestBase):
def render(self):
... | Python |
#!/usr/bin/env python
'''Test that font.Text horizontal alignment works.
Three labels will be rendered aligned left, center and right.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import font
import base_text
class TEST_HALIGN(base_text.TextTestBase):
font_name = ... | Python |
#!/usr/bin/env python
'''Test that a font distributed with the application can be displayed.
Four lines of text should be displayed, each in a different variant
(bold/italic/regular) of Action Man at 24pt. The Action Man fonts are
included in the test directory (tests/font) as action_man*.ttf.
Press ESC to end the ... | Python |
#!/usr/bin/python
'''Test that the event loop can do timing.
The test will display a series of intervals, iterations and sleep times.
It should then display an incrementing number up to 2x the number of
iterations, at a rate determined by the interval.
'''
import sys
import unittest
import pyglet
__non... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pyglet.image import get_buffer_manager
class ImageRegressionTestCase(unittest.TestCase):
_enable_regression_image = False
_enable_interactive = True
_captured_image = None
def capture_regress... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear a tone at 440Hz (A above middle C) for 1.0 seconds. The test
will exit immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.5 seconds. The test will exit
immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
class TEST_... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.5 seconds. The test will exit
immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
class TEST_... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.5 seconds. The test will exit
immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
class TEST_... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.5 seconds. The test will exit
immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
class TEST_... | Python |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.25 seconds, then a 0.5 second pause
then another 0.25 seconds of noise. The test will exit immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
import time
... | Python |
#!/usr/bin/env python
'''Test that window size can be set.
Expected behaviour:
One window will be opened. The window's dimensions will be printed
to the terminal.
- press "x" to increase the width
- press "X" to decrease the width
- press "y" to increase the height
- press "Y" to decre... | Python |
#!/usr/bin/env python
'''Test that exclusive mouse mode can be set.
Expected behaviour:
One window will be opened. Press 'e' to enable exclusive mode and 'E'
to disable exclusive mode.
In exclusive mode:
- the mouse cursor should be invisible
- moving the mouse should generate events with bogu... | Python |
#!/usr/bin/env python
'''Test that window style can be dialog.
Expected behaviour:
One dialog-styled window will be opened.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import un... | Python |
#!/usr/bin/python
# $Id:$
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
'''Test that screens can be selected for fullscreen.
Expected behaviour:
One window will be created fullscreen on the primary screen. When you
close this window, another will open on the next screen, and so
on until all screens have been tested.
Each screen will be filled ... | Python |
#!/usr/bin/env python
'''Test that minimum and maximum window size can be set.
Expected behaviour:
One window will be opened. The window's dimensions will be printed
to the terminal. Initially the window has no minimum or maximum
size (besides any OS-enforced limit).
- press "n" to set the minimum... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 2
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_expose(self):
... | Python |
#!/usr/bin/env python
'''Test that window icon can be set for multiple sizes.
Expected behaviour:
One window will be opened. The window's icon depends on the icon
size:
16x16 icon is a yellow "1"
32x32 icon is a purple "2"
48x48 icon is a cyan "3"
72x72 icon is a red "4"
128x12... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
'''Test that mouse drag event works correctly.
Expected behaviour:
One window will be opened. Click and drag with the mouse and ensure
that buttons, coordinates and modifiers are reported correctly. Events
should be generated even when the drag leaves the window.
Close the win... | Python |
#!/usr/bin/env python
'''Test that the window can be hidden and shown.
Expected behaviour:
One window will be opened. Every 5 seconds it will toggle between
hidden and shown.
Press escape or close the window to finish the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import time
... | Python |
#!/usr/bin/env python
'''Test that a window can be opened.
Expected behaviour:
One small window will be opened coloured purple.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pyglet import window
from pyglet.gl import *
clas... | Python |
#!/usr/bin/env python
'''Test that close event works correctly.
Expected behaviour:
One window will be opened. Click the close button and ensure the
event is printed to the terminal. The window should not close
when you do this.
Press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__v... | Python |
#!/usr/bin/env python
'''Test that window expose event works correctly.
Expected behaviour:
One window will be opened. Uncovering the window from other windows
or the edge of the screen should produce the expose event.
Note that on OS X and other compositing window managers this event
is equivalent ... | Python |
#!/usr/bin/env python
'''Test that window location can be set.
Expected behaviour:
One window will be opened. The window's location will be printed
to the terminal.
- Use the arrow keys to move the window.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__v... | Python |
#!/usr/bin/env python
'''Test that window style can be borderless.
Expected behaviour:
One borderless window will be opened.
Mouse click in the window to close it and end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
... | Python |
#!/usr/bin/env python
'''Test that mouse scroll event works correctly.
Expected behaviour:
One window will be opened. Move the scroll wheel and check that events
are printed to console. Positive values are associated with scrolling
up.
Scrolling can also be side-to-side, for example with an Apple M... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 3
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_show(self):
... | Python |
#!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from pyglet import window
from pyglet.window.event import WindowEventLogger
from pyglet.window import key
from pyglet.gl import *
import window_util
class WINDOW_SET_FULLSCREEN(unittest.TestCase):
def on_te... | Python |
#!/usr/bin/env python
'''Test that mouse button events work correctly.
Expected behaviour:
One window will be opened. Click within this window and check the console
output for mouse events.
- Buttons 1, 2, 4 correspond to left, middle, right, respectively.
- No events for scroll wheel
- Modi... | Python |
#!/usr/bin/env python
'''Test that mouse cursor can be made visible and hidden.
Expected behaviour:
One window will be opened. Press 'v' to hide mouse cursor and 'V' to
show mouse cursor. It should only affect the mouse when within the
client area of the window.
Close the window or press ESC to end... | Python |
#!/usr/bin/env python
'''Test that window icon can be set.
Expected behaviour:
One window will be opened. It will have an icon depicting a yellow
"A".
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:... | Python |
#!/usr/bin/env python
'''Test that show and hide events work correctly.
Expected behaviour:
One window will be opened. There should be one shown event printed
initially. Minimizing and restoring the window should produce hidden
and shown events, respectively.
On OS X the events should also be fired... | Python |
#!/usr/bin/env python
'''Test that activate and deactivate events work correctly.
Expected behaviour:
One window will be opened. Clicking on the window should activate it,
clicking on another window should deactivate it. Messages will be
printed to the console for both events.
On OS X you can also ... | Python |
#!/usr/bin/env python
'''Test that window style can be tool.
Expected behaviour:
One tool-styled window will be opened.
Close the window to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: WINDOW_SET_MOUSE_CURSOR.py 717 2007-03-03 07:04:10Z Alex.Holkner $'
import unittest
from pygl... | Python |
#!/usr/bin/env python
'''Test that key press and release events work correctly.
Expected behaviour:
One window will be opened. Type into this window and check the console
output for key press and release events. Check that the correct
key symbol and modifiers are reported.
Close the window or press... | Python |
#!/usr/bin/env python
'''Test that image mouse cursor can be set.
Expected behaviour:
One window will be opened. The mouse cursor in the window will be
a custom cursor.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
from pygl... | Python |
#!/usr/bin/env python
'''Test that exclusive keyboard mode can be set.
Expected behaviour:
One window will be opened. Press 'e' to enable exclusive mode and 'E'
to disable exclusive mode.
In exclusive mode:
- Pressing system keys, the Expose keys, etc., should have no effect
besides displayi... | Python |
#!/usr/bin/env python
'''Test that a window can have multisample.
A window will be opened containing two rotating squares. Initially,
there will be no multisampling (the edges will look "jaggy"). Press:
* M to toggle multisampling on/off
* S to increase samples (2, 4, 6, 8, 10, ...)
* Shift+S to... | Python |
#!/usr/bin/env python
'''Test that vsync can be set.
Expected behaviour:
A window will alternate between red and green fill.
- Press "v" to toggle vsync on/off. "Tearing" should only be visible
when vsync is off (as indicated at the terminal).
Not all video drivers support vsync. On Linux,... | Python |
#!/usr/bin/env python
'''Test that window can be set to and from various fullscreen sizes.
Expected behaviour:
One window will be opened. Press a number to switch to the corresponding
fullscreen size; hold control and press a number to switch back
to the corresponding window size:
0 - Default si... | Python |
#!/usr/bin/env python
'''Test that window move event works correctly.
Expected behaviour:
One window will be opened. Move the window and ensure that the
location printed to the terminal is correct.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id:... | Python |
#!/usr/bin/env python
'''Test that window can be minimized and maximized.
Expected behaviour:
One window will be opened.
- press "x" to maximize the window.
- press "n" to minimize the window.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id... | Python |
#!/usr/bin/env python
'''Test that mouse motion event works correctly.
Expected behaviour:
One window will be opened. Move the mouse in and out of this window
and ensure the absolute and relative coordinates are correct.
- Absolute coordinates should have (0,0) at bottom-left of client area
of wi... | Python |
#!/usr/bin/env python
'''Test that multiple windows share objects by default.
This test is non-interactive.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
from ctypes import *
from pyglet import window
from pyglet.gl import *
__noninteractive = True
class CONTEXT_SHARE(unittest.Tes... | Python |
#!/usr/bin/env python
# $Id: $
import unittest
from pyglet import window
import base_event_sequence
__noninteractive = True
class TEST_CLASS(base_event_sequence.BaseEventSequence):
last_sequence = 2
def on_resize(self, width, height):
self.check_sequence(1, 'on_resize')
def on_expose(self):
... | Python |
#!/usr/bin/env python
'''Test that the window can be activated (focus set).
Expected behaviour:
One window will be opened. Every 5 seconds it will be activated;
it should be come to the front and accept keyboard input (this will
be shown on the terminal).
On Windows XP, the taskbar icon may flash (i... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.