components/exo/wayland/fuzzer/wayland_sequencer.py
def GetDependencyGraph(protocols):
  """Determine the dependencies between interfaces and their messages.

  Args:
    protocols: the list of wayland xml protocols you want the dependencies of.

  Returns:
    A bipartite graph where messages (i, m) depend on interfaces (i) and
    vice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to
    invoke m, whereas (i) to (i',m') indicates m' is a constructor for i
    instances.
  """
  dep_graph = {}
  constructed_interfaces = set()
  for _, i, m in wlu.AllMessages(protocols):
    dep_graph[ToNode(i, m)] = [('receiver', i.attrib['name'])] + [
        (a.attrib['name'], a.get('interface', '?'))
        for a in m.findall('arg')
        if a.attrib['type'] == 'object'
    ]
    constructed = wlu.GetConstructedInterface(m)
    if constructed:
      constructed_interfaces.add(constructed)
      dep_graph[constructed] = ToNode(i, m)
  for _, i in wlu.AllInterfaces(protocols):
    if i.attrib['name'] not in constructed_interfaces:
      dep_graph[i.attrib['name']] = ('wl_registry', 'bind')
  return dep_graph
Determine the dependencies between interfaces and their messages.

  Args:
    protocols: the list of wayland xml protocols you want the dependencies of.

  Returns:
    A bipartite graph where messages (i, m) depend on interfaces (i) and
    vice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to
    invoke m, whereas (i) to (i',m') indicates m' is a constructor for i
    instances.
  
Determine the dependencies between interfaces and their messages.
Determine the dependencies between interfaces and their messages .
def GetDependencyGraph(protocols):
  dep_graph = {}
  constructed_interfaces = set()
  for _, i, m in wlu.AllMessages(protocols):
    dep_graph[ToNode(i, m)] = [('receiver', i.attrib['name'])] + [
        (a.attrib['name'], a.get('interface', '?'))
        for a in m.findall('arg')
        if a.attrib['type'] == 'object'
    ]
    constructed = wlu.GetConstructedInterface(m)
    if constructed:
      constructed_interfaces.add(constructed)
      dep_graph[constructed] = ToNode(i, m)
  for _, i in wlu.AllInterfaces(protocols):
    if i.attrib['name'] not in constructed_interfaces:
      dep_graph[i.attrib['name']] = ('wl_registry', 'bind')
  return dep_graph
def GetDependencyGraph ( protocols ) : dep_graph = { } constructed_interfaces = set ( ) for _ , i , m in wlu . AllMessages ( protocols ) : dep_graph [ ToNode ( i , m ) ] = [ ( 'receiver' , i . attrib [ 'name' ] ) ] + [ ( a . attrib [ 'name' ] , a . get ( 'interface' , '?' ) ) for a in m . findall ( 'arg' ) if a . attrib [ 'type' ] == 'object' ] constructed = wlu . GetConstructedInterface ( m ) if constructed : constructed_interfaces . add ( constructed ) dep_graph [ constructed ] = ToNode ( i , m ) for _ , i in wlu . AllInterfaces ( protocols ) : if i . attrib [ 'name' ] not in constructed_interfaces : dep_graph [ i . attrib [ 'name' ] ] = ( 'wl_registry' , 'bind' ) return dep_graph
Determine the dependencies between interfaces and their messages.
Determine the dependencies between interfaces and their messages .
"""Determine the dependencies between interfaces and their messages.

  Args:
    protocols: the list of wayland xml protocols you want the dependencies of.

  Returns:
    A bipartite graph where messages (i, m) depend on interfaces (i) and
    vice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to
    invoke m, whereas (i) to (i',m') indicates m' is a constructor for i
    instances.
  """
A bipartite graph where messages (i, m) depend on interfaces (i) and
vice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to
invoke m, whereas (i) to (i',m') indicates m' is a constructor for i
instances.
A bipartite graph where messages ( i m ) depend on interfaces ( i ) and vice - versa . An edge from ( i m ) to ( i ' ) indicates an i ' instance is needed to invoke m whereas ( i ) to ( i ' m ' ) indicates m ' is a constructor for i instances .
protocols
the list of wayland xml protocols you want the dependencies of.
the list of wayland xml protocols you want the dependencies of .