2010-06-17 14:29:29 -06:00
|
|
|
from ctypes import *
|
|
|
|
from pydfhack import libdfhack, ViewScreen
|
2010-05-03 00:13:35 -06:00
|
|
|
|
2010-06-17 14:29:29 -06:00
|
|
|
libdfhack.Gui_ReadViewScreen.argtypes = [ c_void_p, c_void_p ]
|
|
|
|
|
|
|
|
class Gui(object):
|
|
|
|
def __init__(self, ptr):
|
|
|
|
self._gui_ptr = ptr
|
|
|
|
|
|
|
|
def start(self):
|
|
|
|
return libdfhack.Gui_Start(self._gui_ptr)
|
|
|
|
|
|
|
|
def finish(self):
|
|
|
|
return libdfhack.Gui_Finish(self._gui_ptr)
|
2010-05-03 00:13:35 -06:00
|
|
|
|
2010-06-17 14:29:29 -06:00
|
|
|
def read_pause_state(self):
|
|
|
|
return libdfhack.Gui_ReadPauseState(self._pos_ptr) > 0
|
|
|
|
|
|
|
|
def read_view_screen(self):
|
|
|
|
s = ViewScreen()
|
|
|
|
|
|
|
|
if libdfhack.Gui_ReadViewScreen(self._gui_ptr, byref(s)) > 0:
|
|
|
|
return s
|
|
|
|
else:
|
|
|
|
return None
|