'Return a dict of info for a code browser row for this element.
- Should define "name" key.
- Can define "detail" key. This is the string displayed when
hovering over the image in the code browser.
- Can define "img" key. This is string used to identify the
image type. The following are common values:
argument, variable, class, function, import, interface, namespace
The symbol-types have -protected and -private versions, e.g.:
variable-private, variable-protected, class-private, ...
As well, many of the languages have associated icons:
Perl, Python, JavaScript, Ruby, ...
A few special ones for class instance vars:
instance-variable, instance-variable-protected,
instance-variable-private
Some special ones:
container, scanning, error'

def cb_data_from_elem_and_buf(self, elem, buf):

    if (elem.tag == 'import'):
        data = {'img': 'import'}
        data.update(self.cb_import_data_from_elem(elem))
        return data
    elif (elem.tag == 'variable'):
        return self.cb_variable_data_from_elem(elem)
    elif (elem.tag == 'scope'):
        ilk = elem.get('ilk')
        if (ilk == 'blob'):
            img = elem.get('lang')
            detail = self.cb_blob_detail_from_elem_and_buf(elem, buf)
        else:
            img = ilk
            attrs = elem.get('attributes', '').split()
            if ('private' in attrs):
                img += '-private'
            elif ('protected' in attrs):
                img += '-protected'
            if (ilk == 'function'):
                detail = self.cb_function_detail_from_elem(elem)
            elif (ilk == 'class'):
                detail = self.cb_class_detail_from_elem(elem)
            elif (ilk == 'interface'):
                detail = self.cb_interface_detail_from_elem(elem)
            elif (ilk == 'namespace'):
                detail = self.cb_namespace_detail_from_elem(elem)
            elif (ilk == 'trait'):
                detail = self.cb_trait_detail_from_elem(elem)
            else:
                log.warn("don't    know    how    to    get    cb    detail    for    '%s'    elem", ilk)
                detail = elem.get('name')
        return {'name': elem.get('name'), 'img': img, 'detail': detail}
    else:
        return {'name': repr(elem)}
