860 """
861 Need to create (in our database) a number of operations. This is a new IDL
862 syntax, the implied operations for a set now use setlike<T> where T is a known
863 type e.g., setlike<FontFace> setlike implies these operations are generated:
864
865 void forEach(any callback, optional any thisArg);
866 boolean has(FontFace fontFace);
867 boolean has(FontFace fontFace);
868
869 if setlike is not read-only these operations are generated:
870
871 FontFaceSet add(FontFace value);
872 boolean
delete(FontFace value);
873 void clear();
874 """
875 setlike_ops = []
876 """
877 Need to create a typedef for a function callback e.g.,
878 a setlike will need a callback that has the proper args in FontFaceSet that is
879 three arguments, etc.
880
881 typedef void FontFaceSetForEachCallback(
882 FontFace fontFace, FontFace fontFaceAgain, FontFaceSet set);
883
884 void forEach(FontFaceSetForEachCallback callback, [Object thisArg]);
885 """
886 callback_name = '%sForEachCallback' % interface.id
888 [[IDLType(None, callback_name), 'callback'],
889 [IDLType(None, 'any'), 'thisArg', True]])
890 setlike_ops.append(set_op)
891
893 interface.id, 'boolean', 'has',
894 [[IDLType(None, set_like.value_type.base_type), 'arg']])
895 setlike_ops.append(set_op)
896
897 if not set_like.is_read_only:
898
899
900 add_result_nullable = True
902 interface.id, interface.id, 'add',
903 [[IDLType(None, set_like.value_type.base_type), 'arg']],
904 add_result_nullable)
905 setlike_ops.append(set_op)
907 interface.id, 'boolean', 'delete',
908 [[IDLType(None, set_like.value_type.base_type), 'arg']])
909 setlike_ops.append(set_op)
911 setlike_ops.append(set_op)
912
913 return setlike_ops
914
915
def generate_operation(interface_name, result_type_name, oper_name, arguments, result_nullable=False)
def generate_setLike_operations_properties(interface, set_like)