Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
scripts.idlnode.IDLInterface Class Reference
Inheritance diagram for scripts.idlnode.IDLInterface:
scripts.idlnode.IDLNode

Public Member Functions

def __init__ (self, ast, id=None)
 
def reset_id (self, new_id)
 
def has_attribute (self, candidate)
 
- Public Member Functions inherited from scripts.idlnode.IDLNode
def __init__ (self, ast, id=None)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 
def reset_id (self, newId)
 
def all (self, type_filter=None)
 
def to_dict (self)
 
def to_hash (self)
 

Public Attributes

 id
 
 parents
 
 javascript_binding_name
 
 doc_js_name
 
 is_supplemental
 
 isMaplike
 
 isMaplike_ro
 
 maplike_key_value
 
 operations
 
 attributes
 
 constants
 
 is_no_interface_object
 
 is_fc_suppressed
 
- Public Attributes inherited from scripts.idlnode.IDLNode
 id
 
 ext_attrs
 
 annotations
 
 members
 

Detailed Description

IDLInterface node contains operations, attributes, constants,
as well as parent references.

Definition at line 916 of file idlnode.py.

Constructor & Destructor Documentation

◆ __init__()

def scripts.idlnode.IDLInterface.__init__ (   self,
  ast,
  id = None 
)
Initializes an IDLNode from a PegParser AST output.

Reimplemented from scripts.idlnode.IDLNode.

Definition at line 920 of file idlnode.py.

920 def __init__(self, ast, id=None):
921 IDLNode.__init__(self, ast)
922
923 if id:
924 self.id = id
925
926 self._convert_ext_attrs(ast)
927 self._convert_annotations(ast)
928
929 self.parents = self._convert_all(ast, 'ParentInterface',
930 IDLParentInterface)
931
932 javascript_interface_name = self.ext_attrs.get('InterfaceName', self.id)
933 self.javascript_binding_name = javascript_interface_name
934 self.doc_js_name = javascript_interface_name
935
936 if not (self._find_first(ast, 'Callback') is None):
937 self.ext_attrs['Callback'] = None
938 if not (self._find_first(ast, 'Partial') is None):
939 self.is_supplemental = True
940 self.ext_attrs['DartSupplemental'] = None
941 self.isMaplike = False
942 self.isMaplike_ro = False
943 self.maplike_key_value = [None, None]
944 if ast is not None and ast.maplike is not None:
945 self.isMaplike = True
946 self.isMaplike_ro = ast.maplike.is_read_only
947 self.maplike_key_value = [
948 IDLType(ast.maplike.key_type),
949 IDLType(ast.maplike.value_type)
950 ]
951
952 self.operations = self._convert_all(
953 ast, 'Operation', lambda ast: IDLOperation(ast, self.doc_js_name))
954
955 if not (id) and ast.setlike:
957 self, ast.setlike)
958 for op in setlike_ops:
959 self.operations.append(op)
960
961 self.attributes = self._convert_all(
962 ast, 'Attribute', lambda ast: IDLAttribute(ast, self.doc_js_name))
963 self.constants = self._convert_all(
964 ast, 'Const', lambda ast: IDLConstant(ast, self.doc_js_name))
965 self.is_supplemental = 'DartSupplemental' in self.ext_attrs
966 self.is_no_interface_object = 'NoInterfaceObject' in self.ext_attrs
967 # TODO(terry): Can eliminate Suppressed when we're only using blink parser.
968 self.is_fc_suppressed = 'Suppressed' in self.ext_attrs or \
969 'DartSuppress' in self.ext_attrs
970
static void append(char **dst, size_t *count, const char *src, size_t n)
Definition: editor.cpp:211
const myers::Point & get(const myers::Segment &)
def generate_setLike_operations_properties(interface, set_like)
Definition: idlnode.py:859

Member Function Documentation

◆ has_attribute()

def scripts.idlnode.IDLInterface.has_attribute (   self,
  candidate 
)

Definition at line 984 of file idlnode.py.

984 def has_attribute(self, candidate):
985 for attribute in self.attributes:
986 if (attribute.id == candidate.id and
987 attribute.is_read_only == candidate.is_read_only):
988 return True
989 return False
990
991

◆ reset_id()

def scripts.idlnode.IDLInterface.reset_id (   self,
  new_id 
)
Reset the id of the Interface and corresponding the JS names.

Reimplemented from scripts.idlnode.IDLNode.

Definition at line 971 of file idlnode.py.

971 def reset_id(self, new_id):
972 """Reset the id of the Interface and corresponding the JS names."""
973 if self.id != new_id:
974 self.id = new_id
975 self.doc_js_name = new_id
976 self.javascript_binding_name = new_id
977 for member in self.operations:
978 member.doc_js_interface_name = new_id
979 for member in self.attributes:
980 member.doc_js_interface_name = new_id
981 for member in self.constants:
982 member.doc_js_interface_name = new_id
983

Member Data Documentation

◆ attributes

scripts.idlnode.IDLInterface.attributes

Definition at line 961 of file idlnode.py.

◆ constants

scripts.idlnode.IDLInterface.constants

Definition at line 963 of file idlnode.py.

◆ doc_js_name

scripts.idlnode.IDLInterface.doc_js_name

Definition at line 934 of file idlnode.py.

◆ id

scripts.idlnode.IDLInterface.id

Definition at line 924 of file idlnode.py.

◆ is_fc_suppressed

scripts.idlnode.IDLInterface.is_fc_suppressed

Definition at line 968 of file idlnode.py.

◆ is_no_interface_object

scripts.idlnode.IDLInterface.is_no_interface_object

Definition at line 966 of file idlnode.py.

◆ is_supplemental

scripts.idlnode.IDLInterface.is_supplemental

Definition at line 939 of file idlnode.py.

◆ isMaplike

scripts.idlnode.IDLInterface.isMaplike

Definition at line 941 of file idlnode.py.

◆ isMaplike_ro

scripts.idlnode.IDLInterface.isMaplike_ro

Definition at line 942 of file idlnode.py.

◆ javascript_binding_name

scripts.idlnode.IDLInterface.javascript_binding_name

Definition at line 933 of file idlnode.py.

◆ maplike_key_value

scripts.idlnode.IDLInterface.maplike_key_value

Definition at line 943 of file idlnode.py.

◆ operations

scripts.idlnode.IDLInterface.operations

Definition at line 952 of file idlnode.py.

◆ parents

scripts.idlnode.IDLInterface.parents

Definition at line 929 of file idlnode.py.


The documentation for this class was generated from the following file: