'Return the current state of the ViewBox.
Linked views are always converted to view names in the returned state.'

def getState(self, copy=True):

    state = self.state.copy()
    views = []
    for v in state['linkedViews']:
        if isinstance(v, weakref.ref):
            v = v()
        if ((v is None) or isinstance(v, basestring)):
            views.append(v)
        else:
            views.append(v.name)
    state['linkedViews'] = views
    if copy:
        return deepcopy(state)
    else:
        return state
