35 lines
783 B
Python
35 lines
783 B
Python
"""Framework-neutral notifications emitted by core services."""
|
|
|
|
|
|
class CoreEventSink:
|
|
"""Application boundary for status, refresh, and recovery requests.
|
|
|
|
Frontends must marshal these calls to their own UI thread.
|
|
"""
|
|
|
|
def status(self, message, priority, node=None):
|
|
pass
|
|
|
|
def state_changed(self, redraw_board=False):
|
|
pass
|
|
|
|
def engine_failure(self, message, code, engine_type):
|
|
pass
|
|
|
|
def insert_mode_changed(self, insert_node):
|
|
pass
|
|
|
|
def move_tree_changed(self):
|
|
pass
|
|
|
|
def contribution_game_changed(self, game):
|
|
pass
|
|
|
|
|
|
NULL_EVENTS = CoreEventSink()
|
|
|
|
|
|
def event_sink(host):
|
|
"""Return a host's event sink without making it a required UI object."""
|
|
return getattr(host, "events", NULL_EVENTS)
|