# Path: canvas/canvas.py
# class Canvas(object):
#     def __init__(self, slide, height, width):
#         """
#         Create a new Canvas interface to a provided python-pptx `Slide`.
# 
#         Parameters
#         ----------
#         slide : Slide
#             python-pptx Slide
#         height : int
#             Height of Slide in EMUs
#         width : int
#             Width of Slide in EMUs
#         """
#         self._slide = slide
#         self._slide_height = height
#         self._slide_width = width
# 
#     def getContext(self, contextType):
#         """
#         Create a new Context to work with.
# 
#         This will build a new PPTX Shape to work with.
# 
#         Parameters
#         ----------
#         contextType : str
#             The type of context to use. `2d` is the only available option.
#         """
#         if contextType is '2d':
#             return CanvasRenderingContext2D(self)
# 
#         return None
# 
#     def  probablySupportsContext(self, contextType):
#         """
#         Return boolean value if the Canvas supports the requested contextType.
# 
#         Parameters
#         ----------
#         contextType : str
#             The type of context to check.
#         """
#         if contextType is '2d':
#             return True
# 
#         return False
# 
# Path: canvas/context/context.py
# class CanvasRenderingContext2D(CanvasState, CanvasTransform, CanvasCompositing,
#         CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles,
#         CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText,
#         CanvasTextDrawingStyles, CanvasDrawImage, CanvasHitRegion,
#         CanvasImageData):
# 
#     ## OpenXML NameSpace map
#     nsmap = {
#         'p': 'http://schemas.openxmlformats.org/presentationml/2006/main',
#         'a': 'http://schemas.openxmlformats.org/drawingml/2006/main',
#         'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
#     }
# 
#     '''
#     Implements a HTML <canvas> interface to drawing on PresentationML/DrawingML
#     based PPTX slides.
#     '''
#     def __init__(self, canvas):
#         super(CanvasRenderingContext2D, self).__init__()
# 
#         self._canvas = canvas
# 
#         """Construct a Canvas instance."""
#         self._shadowColor = '000000'
#         self._shadowBlur = 0
#         self._shadowOffsetX = 0
#         self._shadowOffsetY = 0
# 
#         self._lineWidth = 12700
# 
#     @property
#     def canvas(self):
#         """
#         A read-only reference to the PPTXCanvas object this Context exists on.
#         """
#         return self._canvas
# 
#     @property
#     def lineWidth(self):
#         '''
#         Returns the current line width value.
#         Default value is 12700 EMU.
#         '''
#         return self._lineWidth
# 
#     @lineWidth.setter
#     def lineWidth(self, val):
#         '''
#         '''
#         self._lineWidth = val


import os
import shutil
import tempfile
import unittest
from pptx import Presentation
from canvas.canvas import Canvas
from canvas.context.context import CanvasRenderingContext2D


class CanvasTest(unittest.TestCase):
    """Tests for canvas."""

    def setUp(self):
        # Create a pptx presentation with a single blank slide
        prs = Presentation()
        blank_slide_layout = prs.slide_layouts[6]
        slide = prs.slides.add_slide(blank_slide_layout)

        self.slide_height = prs.slide_height
        self.slide_width = prs.slide_width

        self.canvas = Canvas(slide, self.slide_height, self.slide_width)

    def test_is_instance(self):

# Path: canvas/canvas.py
# class Canvas(object):
#     def __init__(self, slide, height, width):
#         """
#         Create a new Canvas interface to a provided python-pptx `Slide`.
# 
#         Parameters
#         ----------
#         slide : Slide
#             python-pptx Slide
#         height : int
#             Height of Slide in EMUs
#         width : int
#             Width of Slide in EMUs
#         """
#         self._slide = slide
#         self._slide_height = height
#         self._slide_width = width
# 
#     def getContext(self, contextType):
#         """
#         Create a new Context to work with.
# 
#         This will build a new PPTX Shape to work with.
# 
#         Parameters
#         ----------
#         contextType : str
#             The type of context to use. `2d` is the only available option.
#         """
#         if contextType is '2d':
#             return CanvasRenderingContext2D(self)
# 
#         return None
# 
#     def  probablySupportsContext(self, contextType):
#         """
#         Return boolean value if the Canvas supports the requested contextType.
# 
#         Parameters
#         ----------
#         contextType : str
#             The type of context to check.
#         """
#         if contextType is '2d':
#             return True
# 
#         return False
# 
# Path: canvas/context/context.py
# class CanvasRenderingContext2D(CanvasState, CanvasTransform, CanvasCompositing,
#         CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles,
#         CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText,
#         CanvasTextDrawingStyles, CanvasDrawImage, CanvasHitRegion,
#         CanvasImageData):
# 
#     ## OpenXML NameSpace map
#     nsmap = {
#         'p': 'http://schemas.openxmlformats.org/presentationml/2006/main',
#         'a': 'http://schemas.openxmlformats.org/drawingml/2006/main',
#         'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
#     }
# 
#     '''
#     Implements a HTML <canvas> interface to drawing on PresentationML/DrawingML
#     based PPTX slides.
#     '''
#     def __init__(self, canvas):
#         super(CanvasRenderingContext2D, self).__init__()
# 
#         self._canvas = canvas
# 
#         """Construct a Canvas instance."""
#         self._shadowColor = '000000'
#         self._shadowBlur = 0
#         self._shadowOffsetX = 0
#         self._shadowOffsetY = 0
# 
#         self._lineWidth = 12700
# 
#     @property
#     def canvas(self):
#         """
#         A read-only reference to the PPTXCanvas object this Context exists on.
#         """
#         return self._canvas
# 
#     @property
#     def lineWidth(self):
#         '''
#         Returns the current line width value.
#         Default value is 12700 EMU.
#         '''
#         return self._lineWidth
# 
#     @lineWidth.setter
#     def lineWidth(self, val):
#         '''
#         '''
#         self._lineWidth = val


# Path: tests/canvas_test.py
import os
import shutil
import tempfile
import unittest
from pptx import Presentation
from canvas.canvas import Canvas
from canvas.context.context import CanvasRenderingContext2D



class CanvasTest(unittest.TestCase):
    """Tests for canvas."""

    def setUp(self):
        # Create a pptx presentation with a single blank slide
        prs = Presentation()
        blank_slide_layout = prs.slide_layouts[6]
        slide = prs.slides.add_slide(blank_slide_layout)

        self.slide_height = prs.slide_height
        self.slide_width = prs.slide_width

        self.canvas = Canvas(slide, self.slide_height, self.slide_width)

    def test_is_instance(self):

        self.assertIsInstance(self.canvas, Canvas)