| Index: lib/html/scripts/systembase.py
|
| diff --git a/lib/html/scripts/systembase.py b/lib/html/scripts/systembase.py
|
| index 1e1f9491cdb82fc02080feebce7f32a706ee118b..700d412430fb4bf75fdeba6787c7b5f376de32d4 100644
|
| --- a/lib/html/scripts/systembase.py
|
| +++ b/lib/html/scripts/systembase.py
|
| @@ -15,7 +15,7 @@ class System(object):
|
| This is a base class for all the specific systems.
|
| The life-cycle of a System is:
|
| - construction (__init__)
|
| - - (InterfaceGenerator | ProcessCallback)* # for each IDL interface
|
| + - (ProcessInterface)* # for each IDL interface
|
| """
|
|
|
| def __init__(self, options):
|
| @@ -28,11 +28,6 @@ class System(object):
|
| """Processes an interface that is not a callback function."""
|
| pass
|
|
|
| - def ProcessCallback(self, interface, info):
|
| - """Processes an interface that is a callback function."""
|
| - pass
|
| -
|
| -
|
| # Helper methods used by several systems.
|
|
|
| def _BaseDefines(self, interface):
|
| @@ -58,16 +53,27 @@ class System(object):
|
| return result
|
|
|
| class BaseGenerator(object):
|
| - def __init__(self, database, interface):
|
| + def __init__(self, database, type_registry, interface):
|
| self._database = database
|
| + self._type_registry = type_registry
|
| self._interface = interface
|
|
|
| def Generate(self):
|
| + if 'Callback' in self._interface.ext_attrs:
|
| + handlers = [operation for operation in self._interface.operations
|
| + if operation.id == 'handleEvent']
|
| + info = AnalyzeOperation(self._interface, handlers)
|
| + self.GenerateCallback(info)
|
| + return
|
| +
|
| self.StartInterface()
|
| self.AddMembers(self._interface)
|
| self.AddSecondaryMembers(self._interface)
|
| self.FinishInterface()
|
|
|
| + def GenerateCallback(self, info):
|
| + pass
|
| +
|
| def AddMembers(self, interface):
|
| for const in sorted(interface.constants, ConstantOutputOrder):
|
| self.AddConstant(const)
|
| @@ -171,8 +177,11 @@ class BaseGenerator(object):
|
| walk(interface.parents[1:])
|
| return result
|
|
|
| + def _TypeInfo(self, type_name):
|
| + return self._type_registry.TypeInfo(type_name)
|
| +
|
| def _DartType(self, type_name):
|
| - return self._system._type_registry.DartType(type_name)
|
| + return self._type_registry.DartType(type_name)
|
|
|
|
|
| class GeneratorOptions(object):
|
|
|