# 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 pos2psychopos(pos, dispsize=None):
# 
#     """Returns a converted position tuple (x,y) (internal use)
#     
#     arguments
#     pos        -- a (x,y) position tuple, assuming (0,0) is top left
#     
#     keyword arguments
#     dispsize    -- a (width, height) tuple for the display resolution or None
#                for autodetecting the size of current active window
#                (default = None)
#     
#     returns
#     pos        -- a (x,y) tuple that makes sense to PsychoPy (i.e. (0,0) is
#                display center; bottom left is (-,-) and top right is
#                (+,+))
#     """
# 
#     if dispsize is None:
#         dispsize = settings.DISPSIZE[:]
# 
#     x = pos[0] - dispsize[0]/2
#     y = (pos[1] - dispsize[1]/2) * -1
# 
#     return (x,y)
# 
# def psychopos2pos(pos, dispsize=None):
# 
#     """Returns a converted position tuple (x,y) (internal use)
#     
#     arguments
#     pos        -- a (x,y) tuple that makes sense to PsychoPy (i.e. (0,0) is
#                display center; bottom left is (-,-) and top right is
#                (+,+))
#     
#     keyword arguments
#     dispsize    -- a (width, height) tuple for the display resolution or None
#                for autodetecting the size of current active window
#                (default = None)
#     
#     returns
#     pos        -- a (x,y) position tuple, assuming (0,0) is top left
#     """
# 
#     if dispsize is None:
#         dispsize = settings.DISPSIZE[:]
# 
#     x = pos[0] + dispsize[0]/2
#     y = (pos[1] * -1) + dispsize[1]/2
# 
#     return (x,y)


from pygaze import settings
        from psychopy.visual import Aperture
from pygaze._misc.misc import pos2psychopos, psychopos2pos
        import pygame
import pygaze

        elif pos == "top":
            self.frlcor = (0, -self.dist)
        elif pos == "topright":
            self.frlcor = (-self.frlxdis, self.frlydis)
        elif pos == "right":
            self.frlcor = (self.dist, 0)
        elif pos == "bottomright":
            self.frlcor = (-self.frlxdis, -self.frlydis)
        elif pos == "bottom":
            self.frlcor = (0, self.dist)
        elif pos == "bottomleft":
            self.frlcor = (self.frlxdis, -self.frlydis)
        elif pos == "left":
            self.frlcor = (-self.dist, 0)
        elif pos == "topleft":
            self.frlcor = (self.frlxdis, self.frlydis)
        else:
            print("WARNING! plugins.frl.__init__: FRL position argument '{}' not recognized; FRL position set to 'centre'.".format(pos))
            self.frlcor = (0, 0)

        if disptype in ["pygame","psychopy"]:
            self.disptype = disptype
        else:
            raise Exception("Error in plugins.frl.__init__: disptype '{}' not recognized".format(disptype))

        if self.disptype == "pygame":
            self.__class__ = PyGameFRL
        elif self.disptype == "psychopy":
            self.__class__ = PsychoPyFRL
            self.frl = Aperture(pygaze.expdisplay, self.size, \

# 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 pos2psychopos(pos, dispsize=None):
# 
#     """Returns a converted position tuple (x,y) (internal use)
#     
#     arguments
#     pos        -- a (x,y) position tuple, assuming (0,0) is top left
#     
#     keyword arguments
#     dispsize    -- a (width, height) tuple for the display resolution or None
#                for autodetecting the size of current active window
#                (default = None)
#     
#     returns
#     pos        -- a (x,y) tuple that makes sense to PsychoPy (i.e. (0,0) is
#                display center; bottom left is (-,-) and top right is
#                (+,+))
#     """
# 
#     if dispsize is None:
#         dispsize = settings.DISPSIZE[:]
# 
#     x = pos[0] - dispsize[0]/2
#     y = (pos[1] - dispsize[1]/2) * -1
# 
#     return (x,y)
# 
# def psychopos2pos(pos, dispsize=None):
# 
#     """Returns a converted position tuple (x,y) (internal use)
#     
#     arguments
#     pos        -- a (x,y) tuple that makes sense to PsychoPy (i.e. (0,0) is
#                display center; bottom left is (-,-) and top right is
#                (+,+))
#     
#     keyword arguments
#     dispsize    -- a (width, height) tuple for the display resolution or None
#                for autodetecting the size of current active window
#                (default = None)
#     
#     returns
#     pos        -- a (x,y) position tuple, assuming (0,0) is top left
#     """
# 
#     if dispsize is None:
#         dispsize = settings.DISPSIZE[:]
# 
#     x = pos[0] + dispsize[0]/2
#     y = (pos[1] * -1) + dispsize[1]/2
# 
#     return (x,y)


# Path: pygaze/plugins/frl.py
from pygaze import settings
        from psychopy.visual import Aperture
from pygaze._misc.misc import pos2psychopos, psychopos2pos
        import pygame
import pygaze

        elif pos == "top":
            self.frlcor = (0, -self.dist)
        elif pos == "topright":
            self.frlcor = (-self.frlxdis, self.frlydis)
        elif pos == "right":
            self.frlcor = (self.dist, 0)
        elif pos == "bottomright":
            self.frlcor = (-self.frlxdis, -self.frlydis)
        elif pos == "bottom":
            self.frlcor = (0, self.dist)
        elif pos == "bottomleft":
            self.frlcor = (self.frlxdis, -self.frlydis)
        elif pos == "left":
            self.frlcor = (-self.dist, 0)
        elif pos == "topleft":
            self.frlcor = (self.frlxdis, self.frlydis)
        else:
            print("WARNING! plugins.frl.__init__: FRL position argument '{}' not recognized; FRL position set to 'centre'.".format(pos))
            self.frlcor = (0, 0)

        if disptype in ["pygame","psychopy"]:
            self.disptype = disptype
        else:
            raise Exception("Error in plugins.frl.__init__: disptype '{}' not recognized".format(disptype))

        if self.disptype == "pygame":
            self.__class__ = PyGameFRL
        elif self.disptype == "psychopy":
            self.__class__ = PsychoPyFRL
            self.frl = Aperture(pygaze.expdisplay, self.size, \

                pos=pos2psychopos(self.frlcor), shape="circle", units="pix")
