# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):
# 
# Path: pygaze/_misc/misc.py
# def rgb2psychorgb(rgbgun):
# 
#     """Returns a converted RGB gun
#     
#     arguments
#     rgbgun    -- a (R,G,B) or (R,G,B,A) tuple containing values between 0
#                and 255; other values (e.g. 'red' or hex values) may be
#                passed as well, but will be returned as they were
#     returns
#     psyrgb    -- a (R,G,B) tuple containing values between -1 and 1; or
#                rgbgun when passed rgbgun was not a tuple or a list
#     """
#     
#     if type(rgbgun) not in [tuple,list]:
#         return rgbgun
# 
#     psyrgb = []
# 
#     for val in rgbgun:
#         psyrgb.append((val/127.5)-1)
#     
#     # return (R,G,B), since PsychoPy does not like alpha channels anymore
#     
#     return tuple(psyrgb[0:3])
# 
# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/_display/basedisplay.py
# class BaseDisplay:
# 
#     """A class for Display objects, to present Screen objects on a monitor"""
# 
#     def __init__(self):
# 
#         """
#         Initializes a Display object.
#         
#         arguments
# 
#         None
# 
#         keyword arguments
# 
#         dispsize    --    size of the display in pixels: a (width, height)
#                     tuple (default = DISPSIZE)
#         fgc        --    the foreground colour: a RGB tuple, e.g. (255,0,0)
#                     for red or (0,0,0) for black (default = FGC)
#         bgc        --    the background colour: a RGB tuple, e.g. (0,0,255)
#                     for blue or (255,255,255) for white (default = BGC)
#         screen    --    a screen.Screen instance to be presented on the new
#                     Display (default=None)
#         """
#         
#         pass
# 
#     def show(self):
# 
#         """
#         Updates ('flips') the display.
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         None
#         
#         returns
#         time        --    the exact refresh time when disptype is PsychoPy,
#                     or an estimate when disptype is PyGame
#         """
#         
#         pass
# 
#     def show_part(self, rect, screen=None):
# 
#         """
#         Fills AND shows part(s) of the screen to given specified screen
#         (only works when disptype is PyGame; when this is set to PsychoPy
#         the entire display is filled and updated)
#         
#         arguments
#         
#         rect        --    a single or a list of rects; a rect is a (x,y,w,h)
#                     tuple or list
#         
#         keyword arguments
#         
#         screen    --    the screen of which the specified rects should be
#                     updated to the display (default = None)
#         
#         returns
#         
#         time        --    the exact refresh time when disptype is PsychoPy,
#                     or an estimate when disptype is PyGame
#         """
#         
#         pass
# 
#     def fill(self, screen=None):
# 
#         """
#         Fills the screen with the background colour of the Screen, NOT
#         updating it (call Display.show() to actually show the new contents)
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         screen    --    the screen that should be drawn to the display or
#                     None to fill the display with its background colour
#         
#         returns
#         
#         None
#         """
# 
#         pass
# 
#     def close(self):
# 
#         """
#         Closes the display
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         None
#         
#         returns
#         
#         None
#         """
# 
#         pass
# 
#     def make_screenshot(self, filename="screenshot.png"):
# 
#         """
#         Make a screenshot from the current display.
# 
#         arguments
# 
#         None
# 
#         keyword arguments
# 
#         filename    --    path and filename, under wich the screenshot will be
#                         saved. Defaults to screenshot.png
# 
#         returns
# 
#         None
#         """
# 
#         pass


from pygaze import settings
from pygaze._misc.misc import rgb2psychorgb
from pygaze.libtime import clock
from pygaze._display.basedisplay import BaseDisplay
from psychopy.visual import Window
    from pygaze._misc.misc import copy_docstr
import pygaze

#    or other software (as well as non-gaze contingent experiments/software)
#    Copyright (C) 2012-2013  Edwin S. Dalmaijer
#
#    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 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>



# we try importing the copy_docstr function, but as we do not really need it
# for a proper functioning of the code, we simply ignore it when it fails to
# be imported correctly
try:
except:
    pass


class PsychoPyDisplay(BaseDisplay):

    # See _display.basedisplay.BaseDisplay for documentation


# Path: pygaze/settings.py
# class Settings(object):
#     def __init__(self):
#     def read_module(self, mod):
#     def __getattr__(self, setting):
#     def __setattr__(self, setting, value):
# 
# Path: pygaze/_misc/misc.py
# def rgb2psychorgb(rgbgun):
# 
#     """Returns a converted RGB gun
#     
#     arguments
#     rgbgun    -- a (R,G,B) or (R,G,B,A) tuple containing values between 0
#                and 255; other values (e.g. 'red' or hex values) may be
#                passed as well, but will be returned as they were
#     returns
#     psyrgb    -- a (R,G,B) tuple containing values between -1 and 1; or
#                rgbgun when passed rgbgun was not a tuple or a list
#     """
#     
#     if type(rgbgun) not in [tuple,list]:
#         return rgbgun
# 
#     psyrgb = []
# 
#     for val in rgbgun:
#         psyrgb.append((val/127.5)-1)
#     
#     # return (R,G,B), since PsychoPy does not like alpha channels anymore
#     
#     return tuple(psyrgb[0:3])
# 
# Path: pygaze/libtime.py
# def expstart():
# def get_time():
# def pause(pausetime):
# def expend():
# 
# Path: pygaze/_display/basedisplay.py
# class BaseDisplay:
# 
#     """A class for Display objects, to present Screen objects on a monitor"""
# 
#     def __init__(self):
# 
#         """
#         Initializes a Display object.
#         
#         arguments
# 
#         None
# 
#         keyword arguments
# 
#         dispsize    --    size of the display in pixels: a (width, height)
#                     tuple (default = DISPSIZE)
#         fgc        --    the foreground colour: a RGB tuple, e.g. (255,0,0)
#                     for red or (0,0,0) for black (default = FGC)
#         bgc        --    the background colour: a RGB tuple, e.g. (0,0,255)
#                     for blue or (255,255,255) for white (default = BGC)
#         screen    --    a screen.Screen instance to be presented on the new
#                     Display (default=None)
#         """
#         
#         pass
# 
#     def show(self):
# 
#         """
#         Updates ('flips') the display.
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         None
#         
#         returns
#         time        --    the exact refresh time when disptype is PsychoPy,
#                     or an estimate when disptype is PyGame
#         """
#         
#         pass
# 
#     def show_part(self, rect, screen=None):
# 
#         """
#         Fills AND shows part(s) of the screen to given specified screen
#         (only works when disptype is PyGame; when this is set to PsychoPy
#         the entire display is filled and updated)
#         
#         arguments
#         
#         rect        --    a single or a list of rects; a rect is a (x,y,w,h)
#                     tuple or list
#         
#         keyword arguments
#         
#         screen    --    the screen of which the specified rects should be
#                     updated to the display (default = None)
#         
#         returns
#         
#         time        --    the exact refresh time when disptype is PsychoPy,
#                     or an estimate when disptype is PyGame
#         """
#         
#         pass
# 
#     def fill(self, screen=None):
# 
#         """
#         Fills the screen with the background colour of the Screen, NOT
#         updating it (call Display.show() to actually show the new contents)
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         screen    --    the screen that should be drawn to the display or
#                     None to fill the display with its background colour
#         
#         returns
#         
#         None
#         """
# 
#         pass
# 
#     def close(self):
# 
#         """
#         Closes the display
#         
#         arguments
#         
#         None
#         
#         keyword arguments
#         
#         None
#         
#         returns
#         
#         None
#         """
# 
#         pass
# 
#     def make_screenshot(self, filename="screenshot.png"):
# 
#         """
#         Make a screenshot from the current display.
# 
#         arguments
# 
#         None
# 
#         keyword arguments
# 
#         filename    --    path and filename, under wich the screenshot will be
#                         saved. Defaults to screenshot.png
# 
#         returns
# 
#         None
#         """
# 
#         pass


# Path: pygaze/_display/psychopydisplay.py
from pygaze import settings
from pygaze._misc.misc import rgb2psychorgb
from pygaze.libtime import clock
from pygaze._display.basedisplay import BaseDisplay
from psychopy.visual import Window
    from pygaze._misc.misc import copy_docstr
import pygaze

#    or other software (as well as non-gaze contingent experiments/software)
#    Copyright (C) 2012-2013  Edwin S. Dalmaijer
#
#    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 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>



# we try importing the copy_docstr function, but as we do not really need it
# for a proper functioning of the code, we simply ignore it when it fails to
# be imported correctly
try:
except:
    pass


class PsychoPyDisplay(BaseDisplay):

    # See _display.basedisplay.BaseDisplay for documentation


    def __init__(self, dispsize=settings.DISPSIZE, fgc=settings.FGC,
