mirror of
https://github.com/jtgans/g13gui.git
synced 2025-07-08 00:47:25 -04:00
The whole project at this point is entirely python, with no g13d present anywhere, so let's clean up the tree somewhat and make it flatter.
26 lines
595 B
Python
26 lines
595 B
Python
import PIL.ImageDraw
|
|
import PIL.PyAccess
|
|
from PIL import Image
|
|
|
|
from g13gui.observer.subject import Subject
|
|
|
|
|
|
class Display(Subject):
|
|
def __init__(self, displayDevice):
|
|
self._displayDevice = displayDevice
|
|
self.clear()
|
|
|
|
def clear(self):
|
|
size = self._displayDevice.dimensions
|
|
self._bitmap = Image.new(mode='1', size=size)
|
|
self._context = PIL.ImageDraw.Draw(self._bitmap)
|
|
|
|
def getContext(self):
|
|
return self._context
|
|
|
|
def commit(self):
|
|
self._displayDevice.update(self._bitmap)
|
|
|
|
def debug(self):
|
|
self._bitmap.show()
|